@prolibu-suite/cobalt-core 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (536) hide show
  1. package/custom-elements.json +6407 -3168
  2. package/dist/cjs/co-accordion.cjs.entry.js +3 -3
  3. package/dist/cjs/co-app-shell.cjs.entry.js +3 -3
  4. package/dist/cjs/co-autocomplete.cjs.entry.js +2 -2
  5. package/dist/cjs/co-avatar-group.cjs.entry.js +1 -1
  6. package/dist/cjs/co-avatar.cjs.entry.js +9 -4
  7. package/dist/cjs/co-badge.cjs.entry.js +2 -2
  8. package/dist/cjs/co-bottom-sheet.cjs.entry.js +4 -4
  9. package/dist/cjs/co-breadcrumb-item.cjs.entry.js +37 -0
  10. package/dist/cjs/co-breadcrumb.cjs.entry.js +55 -0
  11. package/dist/cjs/co-button-group.cjs.entry.js +3 -3
  12. package/dist/cjs/co-button.cjs.entry.js +10 -4
  13. package/dist/cjs/co-calendar-month.cjs.entry.js +2 -2
  14. package/dist/cjs/co-calendar_3.cjs.entry.js +40 -10
  15. package/dist/cjs/co-card.cjs.entry.js +3 -3
  16. package/dist/cjs/co-checkbox-group.cjs.entry.js +1 -1
  17. package/dist/cjs/co-checkbox.cjs.entry.js +18 -6
  18. package/dist/cjs/co-chip.cjs.entry.js +12 -7
  19. package/dist/cjs/co-color-picker.cjs.entry.js +4 -4
  20. package/dist/cjs/co-column-picker.cjs.entry.js +3 -3
  21. package/dist/cjs/co-combobox.cjs.entry.js +2 -2
  22. package/dist/cjs/co-command-search.cjs.entry.js +5 -5
  23. package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
  24. package/dist/cjs/co-data-table.cjs.entry.js +23 -16
  25. package/dist/cjs/co-date-picker.cjs.entry.js +2 -2
  26. package/dist/cjs/co-date-range-picker.cjs.entry.js +2 -2
  27. package/dist/cjs/co-date-range.cjs.entry.js +2 -2
  28. package/dist/cjs/co-drive-card.cjs.entry.js +81 -0
  29. package/dist/cjs/co-drop-zone.cjs.entry.js +63 -0
  30. package/dist/cjs/co-empty-state.cjs.entry.js +13 -3
  31. package/dist/cjs/co-event-calendar.cjs.entry.js +3 -3
  32. package/dist/cjs/co-fab.cjs.entry.js +3 -3
  33. package/dist/cjs/co-file-field.cjs.entry.js +7 -7
  34. package/dist/cjs/co-file-type-tile.cjs.entry.js +78 -0
  35. package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
  36. package/dist/cjs/co-icon-button.cjs.entry.js +23 -7
  37. package/dist/cjs/co-icon.cjs.entry.js +3 -3
  38. package/dist/cjs/co-input.cjs.entry.js +36 -7
  39. package/dist/cjs/co-json-field.cjs.entry.js +5 -5
  40. package/dist/cjs/co-lightbox.cjs.entry.js +5 -5
  41. package/dist/cjs/co-list-footer.cjs.entry.js +2 -2
  42. package/dist/cjs/co-list-item.cjs.entry.js +5 -5
  43. package/dist/cjs/co-loader.cjs.entry.js +34 -0
  44. package/dist/cjs/co-media-thumb.cjs.entry.js +36 -0
  45. package/dist/cjs/co-menu-divider.cjs.entry.js +2 -2
  46. package/dist/cjs/co-menu-item.cjs.entry.js +11 -3
  47. package/dist/cjs/co-menu.cjs.entry.js +3 -3
  48. package/dist/cjs/co-modal.cjs.entry.js +29 -5
  49. package/dist/cjs/co-navbar.cjs.entry.js +3 -3
  50. package/dist/cjs/co-number-field.cjs.entry.js +4 -4
  51. package/dist/cjs/co-option-list.cjs.entry.js +379 -0
  52. package/dist/cjs/{co-loader_2.cjs.entry.js → co-overlay.cjs.entry.js} +2 -32
  53. package/dist/cjs/co-page-header.cjs.entry.js +2 -2
  54. package/dist/cjs/co-phone-field.cjs.entry.js +3 -3
  55. package/dist/cjs/co-popover.cjs.entry.js +3 -3
  56. package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
  57. package/dist/cjs/co-progress-circle.cjs.entry.js +3 -3
  58. package/dist/cjs/co-radio-group.cjs.entry.js +4 -4
  59. package/dist/cjs/co-radio.cjs.entry.js +4 -4
  60. package/dist/cjs/co-rating.cjs.entry.js +4 -4
  61. package/dist/cjs/co-ref-field.cjs.entry.js +4 -4
  62. package/dist/cjs/co-rich-text-editor.cjs.entry.js +4 -4
  63. package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +1 -1
  64. package/dist/cjs/co-rich-text-viewer.cjs.entry.js +2 -2
  65. package/dist/cjs/co-row.cjs.entry.js +3 -3
  66. package/dist/cjs/co-segmented-bar.cjs.entry.js +58 -0
  67. package/dist/cjs/co-select.cjs.entry.js +6 -6
  68. package/dist/cjs/co-separator.cjs.entry.js +2 -2
  69. package/dist/cjs/co-sidebar-nav.cjs.entry.js +3 -3
  70. package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
  71. package/dist/cjs/co-skeleton.cjs.entry.js +2 -2
  72. package/dist/cjs/co-slider.cjs.entry.js +3 -3
  73. package/dist/cjs/co-switch.cjs.entry.js +5 -5
  74. package/dist/cjs/co-tab-group.cjs.entry.js +15 -3
  75. package/dist/cjs/co-tab.cjs.entry.js +8 -5
  76. package/dist/cjs/co-tags-field.cjs.entry.js +8 -8
  77. package/dist/cjs/co-textarea.cjs.entry.js +6 -6
  78. package/dist/cjs/co-toast.cjs.entry.js +10 -4
  79. package/dist/cjs/co-toggle-button-group.cjs.entry.js +16 -4
  80. package/dist/cjs/co-toggle-button.cjs.entry.js +9 -5
  81. package/dist/cjs/co-tooltip.cjs.entry.js +3 -3
  82. package/dist/cjs/co-transfer-list.cjs.entry.js +3 -3
  83. package/dist/cjs/co-video.cjs.entry.js +3 -3
  84. package/dist/cjs/cobalt.cjs.js +2 -2
  85. package/dist/cjs/{fieldChip-CDIMz_Y6.js → fieldChip-DtYUP0VZ.js} +1 -1
  86. package/dist/cjs/{index-5NdsiFjZ.js → index-4y1Dm145.js} +64 -11
  87. package/dist/cjs/{index-BumlM92r.js → index-NNvye1ul.js} +68 -8
  88. package/dist/cjs/loader.cjs.js +2 -2
  89. package/dist/cjs/{requiredMark-CqMGt1H1.js → requiredMark-DyjZzUCd.js} +1 -1
  90. package/dist/cobalt/cobalt.esm.js +1 -1
  91. package/dist/cobalt/{p-635b03d5.entry.js → p-06c27cc5.entry.js} +1 -1
  92. package/dist/cobalt/p-075f6ca4.entry.js +1 -0
  93. package/dist/cobalt/{p-0a506c9d.entry.js → p-0810ee1e.entry.js} +1 -1
  94. package/dist/cobalt/p-08519a7c.entry.js +1 -0
  95. package/dist/cobalt/p-0b41e76e.entry.js +1 -0
  96. package/dist/cobalt/{p-d809bd44.entry.js → p-0be124d5.entry.js} +1 -1
  97. package/dist/cobalt/{p-8d59f5ad.entry.js → p-0e1afdea.entry.js} +1 -1
  98. package/dist/cobalt/{p-e53861e4.entry.js → p-1388eac6.entry.js} +1 -1
  99. package/dist/cobalt/{p-8dc1dab8.entry.js → p-19f7ee64.entry.js} +1 -1
  100. package/dist/cobalt/{p-29be61a9.entry.js → p-1af6ef83.entry.js} +1 -1
  101. package/dist/cobalt/{p-58a53421.entry.js → p-1cecb9e1.entry.js} +1 -1
  102. package/dist/cobalt/{p-ef7d4ae3.entry.js → p-20c68308.entry.js} +1 -1
  103. package/dist/cobalt/p-21916f82.entry.js +1 -0
  104. package/dist/cobalt/{p-3e187456.entry.js → p-23c9208a.entry.js} +1 -1
  105. package/dist/cobalt/{p-c10697e1.entry.js → p-2d4e1ca8.entry.js} +1 -1
  106. package/dist/cobalt/{p-377c2ccc.entry.js → p-304c3be1.entry.js} +1 -1
  107. package/dist/cobalt/{p-9abbd436.entry.js → p-311118cb.entry.js} +1 -1
  108. package/dist/cobalt/p-328f0470.entry.js +1 -0
  109. package/dist/cobalt/p-35c63fdc.entry.js +1 -0
  110. package/dist/cobalt/{p-70b14b05.entry.js → p-363a5262.entry.js} +1 -1
  111. package/dist/cobalt/p-376c43b8.entry.js +1 -0
  112. package/dist/cobalt/{p-afb7e19e.entry.js → p-39a29bbb.entry.js} +1 -1
  113. package/dist/cobalt/{p-1a07c23c.entry.js → p-3d07e4a9.entry.js} +1 -1
  114. package/dist/cobalt/{p-cb235aa7.entry.js → p-3dd6b57b.entry.js} +1 -1
  115. package/dist/cobalt/{p-9a088515.entry.js → p-48c5f311.entry.js} +1 -1
  116. package/dist/cobalt/{p-37595103.entry.js → p-4aeefe3f.entry.js} +1 -1
  117. package/dist/cobalt/p-523cfd98.entry.js +1 -0
  118. package/dist/cobalt/{p-9a04ca90.entry.js → p-58aed8d6.entry.js} +1 -1
  119. package/dist/cobalt/{p-93046365.entry.js → p-593fd213.entry.js} +1 -1
  120. package/dist/cobalt/{p-64ddee92.entry.js → p-5eecea26.entry.js} +1 -1
  121. package/dist/cobalt/p-64a0b656.entry.js +1 -0
  122. package/dist/cobalt/p-69289e82.entry.js +1 -0
  123. package/dist/cobalt/p-6a3ed174.entry.js +1 -0
  124. package/dist/cobalt/{p-1531d3c9.entry.js → p-6f12e721.entry.js} +1 -1
  125. package/dist/cobalt/{p-4871690e.entry.js → p-7040e4c5.entry.js} +1 -1
  126. package/dist/cobalt/p-755ecee1.entry.js +1 -0
  127. package/dist/cobalt/p-76b46336.entry.js +1 -0
  128. package/dist/cobalt/{p-65af5017.entry.js → p-79e49749.entry.js} +1 -1
  129. package/dist/cobalt/p-7b5dec05.entry.js +1 -0
  130. package/dist/cobalt/p-7d9f2021.entry.js +1 -0
  131. package/dist/cobalt/{p-51a53177.entry.js → p-804d025f.entry.js} +1 -1
  132. package/dist/cobalt/{p-0bb55163.entry.js → p-860a685f.entry.js} +1 -1
  133. package/dist/cobalt/p-87289d32.entry.js +1 -0
  134. package/dist/cobalt/{p-b6f20268.entry.js → p-8ae5da0c.entry.js} +1 -1
  135. package/dist/cobalt/p-8fdf2163.entry.js +1 -0
  136. package/dist/cobalt/p-9310739f.entry.js +1 -0
  137. package/dist/cobalt/{p-31ab9a46.entry.js → p-96baec0e.entry.js} +1 -1
  138. package/dist/cobalt/p-BUgUTjOB.js +1 -0
  139. package/dist/cobalt/{p-CegCk7FL.js → p-Bgxofdfb.js} +1 -1
  140. package/dist/cobalt/{p-BZJ7NCm5.js → p-BxzuCRMr.js} +1 -1
  141. package/dist/cobalt/p-Es9IUmmt.js +2 -0
  142. package/dist/cobalt/{p-8d7fdb9d.entry.js → p-a0749d7b.entry.js} +1 -1
  143. package/dist/cobalt/{p-1dc9c49e.entry.js → p-a71fd4f1.entry.js} +1 -1
  144. package/dist/cobalt/{p-52de17da.entry.js → p-aa1ad9fa.entry.js} +1 -1
  145. package/dist/cobalt/p-af0495d8.entry.js +1 -0
  146. package/dist/cobalt/{p-260101ab.entry.js → p-b045d680.entry.js} +1 -1
  147. package/dist/cobalt/{p-5890e4d1.entry.js → p-b3c8fc9a.entry.js} +1 -1
  148. package/dist/cobalt/p-b4dcc260.entry.js +1 -0
  149. package/dist/cobalt/p-b8200f7f.entry.js +1 -0
  150. package/dist/cobalt/p-b8f36f12.entry.js +1 -0
  151. package/dist/cobalt/{p-62274eba.entry.js → p-ba6f0f90.entry.js} +1 -1
  152. package/dist/cobalt/{p-279bf91c.entry.js → p-bae82095.entry.js} +1 -1
  153. package/dist/cobalt/{p-cfb36943.entry.js → p-be3e61f4.entry.js} +1 -1
  154. package/dist/cobalt/p-c1abc74b.entry.js +1 -0
  155. package/dist/cobalt/{p-ba90e871.entry.js → p-c23a2ff6.entry.js} +1 -1
  156. package/dist/cobalt/{p-f4063c41.entry.js → p-c682453a.entry.js} +1 -1
  157. package/dist/cobalt/{p-790d384e.entry.js → p-c857b9ff.entry.js} +1 -1
  158. package/dist/cobalt/{p-4504f7b0.entry.js → p-c85a6a9e.entry.js} +1 -1
  159. package/dist/cobalt/p-ca108c6d.entry.js +1 -0
  160. package/dist/cobalt/p-cf239452.entry.js +1 -0
  161. package/dist/cobalt/p-d2507f04.entry.js +1 -0
  162. package/dist/cobalt/p-d403d9c4.entry.js +1 -0
  163. package/dist/cobalt/{p-2f86e1e0.entry.js → p-d4086c34.entry.js} +1 -1
  164. package/dist/cobalt/p-d55652f2.entry.js +1 -0
  165. package/dist/cobalt/{p-12e2c2c4.entry.js → p-d7c9cf93.entry.js} +1 -1
  166. package/dist/cobalt/{p-1f747e45.entry.js → p-d7cbb4c7.entry.js} +1 -1
  167. package/dist/cobalt/p-da211abf.entry.js +1 -0
  168. package/dist/cobalt/p-dcc7fc95.entry.js +1 -0
  169. package/dist/cobalt/p-dd03c00b.entry.js +1 -0
  170. package/dist/cobalt/p-e55fb916.entry.js +1 -0
  171. package/dist/cobalt/p-e8e752f9.entry.js +1 -0
  172. package/dist/cobalt/{p-3863ea91.entry.js → p-e93644cb.entry.js} +1 -1
  173. package/dist/cobalt/{p-6e808b3a.entry.js → p-f6b93f17.entry.js} +1 -1
  174. package/dist/cobalt/{p-6d1217c3.entry.js → p-f72f0e38.entry.js} +1 -1
  175. package/dist/cobalt/{p-8e1dc062.entry.js → p-fb86cdb9.entry.js} +1 -1
  176. package/dist/cobalt/p-ff6be242.entry.js +1 -0
  177. package/dist/collection/collection-manifest.json +8 -0
  178. package/dist/collection/components/co-accordion/co-accordion.js +2 -2
  179. package/dist/collection/components/co-app-shell/co-app-shell.js +2 -2
  180. package/dist/collection/components/co-avatar/co-avatar.js +27 -3
  181. package/dist/collection/components/co-badge/co-badge.js +1 -1
  182. package/dist/collection/components/co-bottom-sheet/co-bottom-sheet.js +3 -3
  183. package/dist/collection/components/co-breadcrumb/co-breadcrumb.css +6 -0
  184. package/dist/collection/components/co-breadcrumb/co-breadcrumb.js +111 -0
  185. package/dist/collection/components/co-breadcrumb-item/co-breadcrumb-item.css +66 -0
  186. package/dist/collection/components/co-breadcrumb-item/co-breadcrumb-item.js +169 -0
  187. package/dist/collection/components/co-button/co-button.css +23 -0
  188. package/dist/collection/components/co-button/co-button.js +48 -2
  189. package/dist/collection/components/co-button-group/co-button-group.js +2 -2
  190. package/dist/collection/components/co-calendar/co-calendar.js +1 -1
  191. package/dist/collection/components/co-calendar-month/co-calendar-month.js +1 -1
  192. package/dist/collection/components/co-card/co-card.js +2 -2
  193. package/dist/collection/components/co-checkbox/co-checkbox.css +63 -0
  194. package/dist/collection/components/co-checkbox/co-checkbox.js +58 -7
  195. package/dist/collection/components/co-chip/co-chip.css +56 -1
  196. package/dist/collection/components/co-chip/co-chip.js +52 -9
  197. package/dist/collection/components/co-color-picker/co-color-picker.js +2 -2
  198. package/dist/collection/components/co-column-picker/co-column-picker.js +2 -2
  199. package/dist/collection/components/co-command-search/co-command-search.js +4 -4
  200. package/dist/collection/components/co-data-table/co-data-table.css +5 -1
  201. package/dist/collection/components/co-data-table/co-data-table.js +93 -14
  202. package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +4 -4
  203. package/dist/collection/components/co-date-field/co-date-field.js +4 -4
  204. package/dist/collection/components/co-date-range/co-date-range.js +1 -1
  205. package/dist/collection/components/co-drawer/co-drawer.css +20 -3
  206. package/dist/collection/components/co-drawer/co-drawer.js +52 -2
  207. package/dist/collection/components/co-drive-card/co-drive-card.css +285 -0
  208. package/dist/collection/components/co-drive-card/co-drive-card.js +329 -0
  209. package/dist/collection/components/co-drop-zone/co-drop-zone.css +49 -0
  210. package/dist/collection/components/co-drop-zone/co-drop-zone.js +197 -0
  211. package/dist/collection/components/co-empty-state/co-empty-state.css +38 -0
  212. package/dist/collection/components/co-empty-state/co-empty-state.js +72 -1
  213. package/dist/collection/components/co-event-calendar/co-event-calendar.js +2 -2
  214. package/dist/collection/components/co-fab/co-fab.js +2 -2
  215. package/dist/collection/components/co-file-field/co-file-field.js +5 -5
  216. package/dist/collection/components/co-file-type-tile/co-file-type-tile.css +14 -0
  217. package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +164 -0
  218. package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
  219. package/dist/collection/components/co-icon/co-icon.js +2 -2
  220. package/dist/collection/components/co-icon-button/co-icon-button.css +11 -4
  221. package/dist/collection/components/co-icon-button/co-icon-button.js +80 -25
  222. package/dist/collection/components/co-input/co-input.css +58 -0
  223. package/dist/collection/components/co-input/co-input.js +54 -5
  224. package/dist/collection/components/co-json-field/co-json-field.js +3 -3
  225. package/dist/collection/components/co-lightbox/co-lightbox.js +4 -4
  226. package/dist/collection/components/co-list-footer/co-list-footer.js +1 -1
  227. package/dist/collection/components/co-list-item/co-list-item.js +4 -4
  228. package/dist/collection/components/co-media-thumb/co-media-thumb.css +43 -0
  229. package/dist/collection/components/co-media-thumb/co-media-thumb.js +148 -0
  230. package/dist/collection/components/co-menu/co-menu.css +6 -4
  231. package/dist/collection/components/co-menu/co-menu.js +20 -1
  232. package/dist/collection/components/co-menu-divider/co-menu-divider.js +1 -1
  233. package/dist/collection/components/co-menu-item/co-menu-item.css +26 -8
  234. package/dist/collection/components/co-menu-item/co-menu-item.js +69 -2
  235. package/dist/collection/components/co-modal/co-modal.css +17 -0
  236. package/dist/collection/components/co-modal/co-modal.js +59 -6
  237. package/dist/collection/components/co-navbar/co-navbar.js +2 -2
  238. package/dist/collection/components/co-number-field/co-number-field.js +2 -2
  239. package/dist/collection/components/co-option-list/co-option-list.css +228 -0
  240. package/dist/collection/components/co-option-list/co-option-list.js +860 -0
  241. package/dist/collection/components/co-option-list/optionListLogic.js +100 -0
  242. package/dist/collection/components/co-overlay/co-overlay.js +1 -1
  243. package/dist/collection/components/co-page-header/co-page-header.js +1 -1
  244. package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
  245. package/dist/collection/components/co-popover/co-popover.js +2 -2
  246. package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
  247. package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
  248. package/dist/collection/components/co-radio/co-radio.js +3 -3
  249. package/dist/collection/components/co-radio-group/co-radio-group.js +3 -3
  250. package/dist/collection/components/co-rating/co-rating.js +3 -3
  251. package/dist/collection/components/co-ref-field/co-ref-field.js +0 -0
  252. package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +2 -2
  253. package/dist/collection/components/co-row/co-row.js +2 -2
  254. package/dist/collection/components/co-segmented-bar/co-segmented-bar.css +36 -0
  255. package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +176 -0
  256. package/dist/collection/components/co-select/co-select.js +4 -4
  257. package/dist/collection/components/co-separator/co-separator.js +1 -1
  258. package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
  259. package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +2 -2
  260. package/dist/collection/components/co-skeleton/co-skeleton.js +1 -1
  261. package/dist/collection/components/co-slider/co-slider.js +2 -2
  262. package/dist/collection/components/co-switch/co-switch.js +3 -3
  263. package/dist/collection/components/co-tab/co-tab.css +54 -3
  264. package/dist/collection/components/co-tab/co-tab.js +45 -3
  265. package/dist/collection/components/co-tab-group/co-tab-group.css +8 -0
  266. package/dist/collection/components/co-tab-group/co-tab-group.js +35 -1
  267. package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
  268. package/dist/collection/components/co-textarea/co-textarea.js +4 -4
  269. package/dist/collection/components/co-toast/co-toast.css +56 -2
  270. package/dist/collection/components/co-toast/co-toast.js +27 -2
  271. package/dist/collection/components/co-toggle-button/co-toggle-button.css +38 -0
  272. package/dist/collection/components/co-toggle-button/co-toggle-button.js +46 -3
  273. package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +16 -0
  274. package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +34 -2
  275. package/dist/collection/components/co-tooltip/co-tooltip.js +2 -2
  276. package/dist/collection/components/co-transfer-list/co-transfer-list.js +2 -2
  277. package/dist/collection/components/co-video/co-video.js +2 -2
  278. package/dist/components/co-accordion.js +1 -1
  279. package/dist/components/co-app-shell.js +1 -1
  280. package/dist/components/co-autocomplete.js +1 -1
  281. package/dist/components/co-avatar-group.js +1 -1
  282. package/dist/components/co-avatar.js +1 -1
  283. package/dist/components/co-badge.js +1 -1
  284. package/dist/components/co-bottom-sheet.js +1 -1
  285. package/dist/components/co-breadcrumb-item.d.ts +11 -0
  286. package/dist/components/co-breadcrumb-item.js +1 -0
  287. package/dist/components/co-breadcrumb.d.ts +11 -0
  288. package/dist/components/co-breadcrumb.js +1 -0
  289. package/dist/components/co-button-group.js +1 -1
  290. package/dist/components/co-button.js +1 -1
  291. package/dist/components/co-calendar-month.js +1 -1
  292. package/dist/components/co-calendar.js +1 -1
  293. package/dist/components/co-card.js +1 -1
  294. package/dist/components/co-checkbox-group.js +1 -1
  295. package/dist/components/co-checkbox.js +1 -1
  296. package/dist/components/co-chip.js +1 -1
  297. package/dist/components/co-color-picker.js +1 -1
  298. package/dist/components/co-column-picker.js +1 -1
  299. package/dist/components/co-combobox.js +1 -1
  300. package/dist/components/co-command-search.js +1 -1
  301. package/dist/components/co-data-table-pagination.js +1 -1
  302. package/dist/components/co-data-table.js +1 -1
  303. package/dist/components/co-date-field.js +1 -1
  304. package/dist/components/co-date-picker.js +1 -1
  305. package/dist/components/co-date-range-picker.js +1 -1
  306. package/dist/components/co-date-range.js +1 -1
  307. package/dist/components/co-drawer.js +1 -1
  308. package/dist/components/co-drive-card.d.ts +11 -0
  309. package/dist/components/co-drive-card.js +1 -0
  310. package/dist/components/co-drop-zone.d.ts +11 -0
  311. package/dist/components/co-drop-zone.js +1 -0
  312. package/dist/components/co-empty-state.js +1 -1
  313. package/dist/components/co-event-calendar.js +1 -1
  314. package/dist/components/co-fab.js +1 -1
  315. package/dist/components/co-file-field.js +1 -1
  316. package/dist/components/co-file-type-tile.d.ts +11 -0
  317. package/dist/components/co-file-type-tile.js +1 -0
  318. package/dist/components/co-helper-text.js +1 -1
  319. package/dist/components/co-icon-button.js +1 -1
  320. package/dist/components/co-icon.js +1 -1
  321. package/dist/components/co-input.js +1 -1
  322. package/dist/components/co-json-field.js +1 -1
  323. package/dist/components/co-lightbox.js +1 -1
  324. package/dist/components/co-list-footer.js +1 -1
  325. package/dist/components/co-list-item.js +1 -1
  326. package/dist/components/co-media-thumb.d.ts +11 -0
  327. package/dist/components/co-media-thumb.js +1 -0
  328. package/dist/components/co-menu-divider.js +1 -1
  329. package/dist/components/co-menu-item.js +1 -1
  330. package/dist/components/co-menu.js +1 -1
  331. package/dist/components/co-modal.js +1 -1
  332. package/dist/components/co-navbar.js +1 -1
  333. package/dist/components/co-number-field.js +1 -1
  334. package/dist/components/co-option-list.d.ts +11 -0
  335. package/dist/components/co-option-list.js +1 -0
  336. package/dist/components/co-overlay.js +1 -1
  337. package/dist/components/co-page-header.js +1 -1
  338. package/dist/components/co-phone-field.js +1 -1
  339. package/dist/components/co-popover.js +1 -1
  340. package/dist/components/co-progress-bar.js +1 -1
  341. package/dist/components/co-progress-circle.js +1 -1
  342. package/dist/components/co-radio-group.js +1 -1
  343. package/dist/components/co-radio.js +1 -1
  344. package/dist/components/co-rating.js +1 -1
  345. package/dist/components/co-ref-field.js +1 -1
  346. package/dist/components/co-rich-text-editor.js +1 -1
  347. package/dist/components/co-rich-text-toolbar.js +1 -1
  348. package/dist/components/co-rich-text-viewer.js +1 -1
  349. package/dist/components/co-row.js +1 -1
  350. package/dist/components/co-segmented-bar.d.ts +11 -0
  351. package/dist/components/co-segmented-bar.js +1 -0
  352. package/dist/components/co-select.js +1 -1
  353. package/dist/components/co-separator.js +1 -1
  354. package/dist/components/co-sidebar-nav.js +1 -1
  355. package/dist/components/co-sidebar.js +1 -1
  356. package/dist/components/co-skeleton.js +1 -1
  357. package/dist/components/co-slider.js +1 -1
  358. package/dist/components/co-switch.js +1 -1
  359. package/dist/components/co-tab-group.js +1 -1
  360. package/dist/components/co-tab.js +1 -1
  361. package/dist/components/co-tags-field.js +1 -1
  362. package/dist/components/co-textarea.js +1 -1
  363. package/dist/components/co-toast.js +1 -1
  364. package/dist/components/co-toggle-button-group.js +1 -1
  365. package/dist/components/co-toggle-button.js +1 -1
  366. package/dist/components/co-tooltip.js +1 -1
  367. package/dist/components/co-transfer-list.js +1 -1
  368. package/dist/components/co-video.js +1 -1
  369. package/dist/components/index.js +1 -1
  370. package/dist/components/{p-D3Y_ti3Q.js → p-B0buzt_E.js} +1 -1
  371. package/dist/components/p-B3igDRut.js +1 -0
  372. package/dist/components/{p-CegCk7FL.js → p-Bgxofdfb.js} +1 -1
  373. package/dist/components/p-BhSJcOUS.js +1 -0
  374. package/dist/components/{p-DKh8ZK4U.js → p-BnTTeIFH.js} +1 -1
  375. package/dist/components/{p-DeZxp9vb.js → p-Bx1OwdIV.js} +1 -1
  376. package/dist/components/{p-C_ULDaks.js → p-BxiKVtk4.js} +1 -1
  377. package/dist/components/{p-DxCFMMfY.js → p-C7tPadNy.js} +1 -1
  378. package/dist/components/p-CBzpUqwG.js +1 -0
  379. package/dist/components/{p-BNKz39GA.js → p-CUvAZhuM.js} +1 -1
  380. package/dist/components/{p-tloAgDin.js → p-CZKHHCdL.js} +1 -1
  381. package/dist/components/{p-BB2OaYKF.js → p-CybHxq25.js} +1 -1
  382. package/dist/components/{p-BFeE_fiq.js → p-CzkeIavk.js} +1 -1
  383. package/dist/components/p-D7dk2gM7.js +1 -0
  384. package/dist/components/p-DTS-dgEe.js +1 -0
  385. package/dist/components/{p-B7vGYFbO.js → p-HXlAaApx.js} +1 -1
  386. package/dist/components/p-K6LC1Hz4.js +1 -0
  387. package/dist/components/p-LAxCvyJl.js +1 -0
  388. package/dist/components/p-vLFwJ77w.js +1 -0
  389. package/dist/esm/co-accordion.entry.js +3 -3
  390. package/dist/esm/co-app-shell.entry.js +3 -3
  391. package/dist/esm/co-autocomplete.entry.js +2 -2
  392. package/dist/esm/co-avatar-group.entry.js +1 -1
  393. package/dist/esm/co-avatar.entry.js +9 -4
  394. package/dist/esm/co-badge.entry.js +2 -2
  395. package/dist/esm/co-bottom-sheet.entry.js +4 -4
  396. package/dist/esm/co-breadcrumb-item.entry.js +35 -0
  397. package/dist/esm/co-breadcrumb.entry.js +53 -0
  398. package/dist/esm/co-button-group.entry.js +3 -3
  399. package/dist/esm/co-button.entry.js +10 -4
  400. package/dist/esm/co-calendar-month.entry.js +2 -2
  401. package/dist/esm/co-calendar_3.entry.js +40 -10
  402. package/dist/esm/co-card.entry.js +3 -3
  403. package/dist/esm/co-checkbox-group.entry.js +1 -1
  404. package/dist/esm/co-checkbox.entry.js +18 -6
  405. package/dist/esm/co-chip.entry.js +12 -7
  406. package/dist/esm/co-color-picker.entry.js +4 -4
  407. package/dist/esm/co-column-picker.entry.js +3 -3
  408. package/dist/esm/co-combobox.entry.js +2 -2
  409. package/dist/esm/co-command-search.entry.js +5 -5
  410. package/dist/esm/co-data-table-pagination.entry.js +5 -5
  411. package/dist/esm/co-data-table.entry.js +23 -16
  412. package/dist/esm/co-date-picker.entry.js +2 -2
  413. package/dist/esm/co-date-range-picker.entry.js +2 -2
  414. package/dist/esm/co-date-range.entry.js +2 -2
  415. package/dist/esm/co-drive-card.entry.js +79 -0
  416. package/dist/esm/co-drop-zone.entry.js +61 -0
  417. package/dist/esm/co-empty-state.entry.js +13 -3
  418. package/dist/esm/co-event-calendar.entry.js +3 -3
  419. package/dist/esm/co-fab.entry.js +3 -3
  420. package/dist/esm/co-file-field.entry.js +7 -7
  421. package/dist/esm/co-file-type-tile.entry.js +76 -0
  422. package/dist/esm/co-helper-text.entry.js +3 -3
  423. package/dist/esm/co-icon-button.entry.js +23 -7
  424. package/dist/esm/co-icon.entry.js +3 -3
  425. package/dist/esm/co-input.entry.js +36 -7
  426. package/dist/esm/co-json-field.entry.js +5 -5
  427. package/dist/esm/co-lightbox.entry.js +5 -5
  428. package/dist/esm/co-list-footer.entry.js +2 -2
  429. package/dist/esm/co-list-item.entry.js +5 -5
  430. package/dist/esm/co-loader.entry.js +32 -0
  431. package/dist/esm/co-media-thumb.entry.js +34 -0
  432. package/dist/esm/co-menu-divider.entry.js +2 -2
  433. package/dist/esm/co-menu-item.entry.js +11 -3
  434. package/dist/esm/co-menu.entry.js +3 -3
  435. package/dist/esm/co-modal.entry.js +29 -5
  436. package/dist/esm/co-navbar.entry.js +3 -3
  437. package/dist/esm/co-number-field.entry.js +4 -4
  438. package/dist/esm/co-option-list.entry.js +377 -0
  439. package/dist/esm/{co-loader_2.entry.js → co-overlay.entry.js} +3 -32
  440. package/dist/esm/co-page-header.entry.js +2 -2
  441. package/dist/esm/co-phone-field.entry.js +3 -3
  442. package/dist/esm/co-popover.entry.js +3 -3
  443. package/dist/esm/co-progress-bar.entry.js +3 -3
  444. package/dist/esm/co-progress-circle.entry.js +3 -3
  445. package/dist/esm/co-radio-group.entry.js +4 -4
  446. package/dist/esm/co-radio.entry.js +4 -4
  447. package/dist/esm/co-rating.entry.js +4 -4
  448. package/dist/esm/co-ref-field.entry.js +4 -4
  449. package/dist/esm/co-rich-text-editor.entry.js +4 -4
  450. package/dist/esm/co-rich-text-toolbar.entry.js +1 -1
  451. package/dist/esm/co-rich-text-viewer.entry.js +2 -2
  452. package/dist/esm/co-row.entry.js +3 -3
  453. package/dist/esm/co-segmented-bar.entry.js +56 -0
  454. package/dist/esm/co-select.entry.js +6 -6
  455. package/dist/esm/co-separator.entry.js +2 -2
  456. package/dist/esm/co-sidebar-nav.entry.js +3 -3
  457. package/dist/esm/co-sidebar.entry.js +3 -3
  458. package/dist/esm/co-skeleton.entry.js +2 -2
  459. package/dist/esm/co-slider.entry.js +3 -3
  460. package/dist/esm/co-switch.entry.js +5 -5
  461. package/dist/esm/co-tab-group.entry.js +15 -3
  462. package/dist/esm/co-tab.entry.js +8 -5
  463. package/dist/esm/co-tags-field.entry.js +8 -8
  464. package/dist/esm/co-textarea.entry.js +6 -6
  465. package/dist/esm/co-toast.entry.js +10 -4
  466. package/dist/esm/co-toggle-button-group.entry.js +16 -4
  467. package/dist/esm/co-toggle-button.entry.js +9 -5
  468. package/dist/esm/co-tooltip.entry.js +3 -3
  469. package/dist/esm/co-transfer-list.entry.js +3 -3
  470. package/dist/esm/co-video.entry.js +3 -3
  471. package/dist/esm/cobalt.js +3 -3
  472. package/dist/esm/{fieldChip-GPikjpYw.js → fieldChip-BBu4ukje.js} +1 -1
  473. package/dist/esm/{index-w_Wxgclf.js → index-Cyrxk8Qq.js} +64 -11
  474. package/dist/esm/{index-CYsftTKf.js → index-Es9IUmmt.js} +68 -8
  475. package/dist/esm/loader.js +3 -3
  476. package/dist/esm/{requiredMark-CEbXKHcU.js → requiredMark-Bg25QWFn.js} +1 -1
  477. package/dist/types/components/co-avatar/co-avatar.d.ts +2 -0
  478. package/dist/types/components/co-breadcrumb/co-breadcrumb.d.ts +27 -0
  479. package/dist/types/components/co-breadcrumb-item/co-breadcrumb-item.d.ts +33 -0
  480. package/dist/types/components/co-button/co-button.d.ts +4 -0
  481. package/dist/types/components/co-checkbox/co-checkbox.d.ts +10 -2
  482. package/dist/types/components/co-chip/co-chip.d.ts +15 -3
  483. package/dist/types/components/co-data-table/co-data-table.d.ts +13 -1
  484. package/dist/types/components/co-drawer/co-drawer.d.ts +12 -0
  485. package/dist/types/components/co-drive-card/co-drive-card.d.ts +52 -0
  486. package/dist/types/components/co-drop-zone/co-drop-zone.d.ts +38 -0
  487. package/dist/types/components/co-empty-state/co-empty-state.d.ts +6 -0
  488. package/dist/types/components/co-file-type-tile/co-file-type-tile.d.ts +11 -0
  489. package/dist/types/components/co-icon-button/co-icon-button.d.ts +18 -3
  490. package/dist/types/components/co-input/co-input.d.ts +13 -1
  491. package/dist/types/components/co-media-thumb/co-media-thumb.d.ts +21 -0
  492. package/dist/types/components/co-menu/co-menu.d.ts +4 -0
  493. package/dist/types/components/co-menu-item/co-menu-item.d.ts +10 -1
  494. package/dist/types/components/co-modal/co-modal.d.ts +20 -2
  495. package/dist/types/components/co-option-list/co-option-list.d.ts +101 -0
  496. package/dist/types/components/co-option-list/optionListLogic.d.ts +69 -0
  497. package/dist/types/components/co-segmented-bar/co-segmented-bar.d.ts +32 -0
  498. package/dist/types/components/co-tab/co-tab.d.ts +4 -0
  499. package/dist/types/components/co-tab-group/co-tab-group.d.ts +3 -0
  500. package/dist/types/components/co-toast/co-toast.d.ts +7 -0
  501. package/dist/types/components/co-toggle-button/co-toggle-button.d.ts +6 -0
  502. package/dist/types/components/co-toggle-button-group/co-toggle-button-group.d.ts +5 -0
  503. package/dist/types/components.d.ts +1361 -55
  504. package/package.json +4 -4
  505. package/dist/cobalt/p-0e8c0d87.entry.js +0 -1
  506. package/dist/cobalt/p-136ad468.entry.js +0 -1
  507. package/dist/cobalt/p-14b59277.entry.js +0 -1
  508. package/dist/cobalt/p-1774d211.entry.js +0 -1
  509. package/dist/cobalt/p-180e1106.entry.js +0 -1
  510. package/dist/cobalt/p-201eaf35.entry.js +0 -1
  511. package/dist/cobalt/p-2d2ce434.entry.js +0 -1
  512. package/dist/cobalt/p-3a257cb0.entry.js +0 -1
  513. package/dist/cobalt/p-4431faac.entry.js +0 -1
  514. package/dist/cobalt/p-456fa86f.entry.js +0 -1
  515. package/dist/cobalt/p-4c01d984.entry.js +0 -1
  516. package/dist/cobalt/p-69d4c0c8.entry.js +0 -1
  517. package/dist/cobalt/p-6c480916.entry.js +0 -1
  518. package/dist/cobalt/p-8012e152.entry.js +0 -1
  519. package/dist/cobalt/p-80b27203.entry.js +0 -1
  520. package/dist/cobalt/p-867c1465.entry.js +0 -1
  521. package/dist/cobalt/p-86a143d7.entry.js +0 -1
  522. package/dist/cobalt/p-929e647f.entry.js +0 -1
  523. package/dist/cobalt/p-92bd9b29.entry.js +0 -1
  524. package/dist/cobalt/p-98ab5f3f.entry.js +0 -1
  525. package/dist/cobalt/p-9d69c067.entry.js +0 -1
  526. package/dist/cobalt/p-CYsftTKf.js +0 -2
  527. package/dist/cobalt/p-c4f59532.entry.js +0 -1
  528. package/dist/cobalt/p-e54dd404.entry.js +0 -1
  529. package/dist/cobalt/p-eb18fdbf.entry.js +0 -1
  530. package/dist/cobalt/p-eb73052a.entry.js +0 -1
  531. package/dist/cobalt/p-oImf-7fN.js +0 -1
  532. package/dist/components/p-Ba4v1NXo.js +0 -1
  533. package/dist/components/p-EPZfLt5l.js +0 -1
  534. package/dist/components/p-FMnqPWcM.js +0 -1
  535. package/dist/components/p-Hzh9U2cM.js +0 -1
  536. package/dist/components/p-WZ06pT2Y.js +0 -1
@@ -1 +1 @@
1
- import{p as e,H as t,c as o,h as r,t as i}from"./index.js";import{R as n}from"./p-CegCk7FL.js";import{g as a,d as c}from"./p-D3Y_ti3Q.js";import{d as s}from"./p-BNKz39GA.js";const l=e(class e extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.coInput=o(this,"coInput",7),this.coChange=o(this,"coChange",7),this.coFocus=o(this,"coFocus",7),this.coBlur=o(this,"coBlur",7),this.coClear=o(this,"coClear",7),this.coReady=o(this,"coReady",7),this.coFontPopupShow=o(this,"coFontPopupShow",7),this.coFontPopupHide=o(this,"coFontPopupHide",7),this.value=null,this.preset="task",this.placeholder="",this.status="default",this.disabled=!1,this.readonly=!1,this.required=!1,this.showCharacterCount=!1,this.autofocus=!1,this.toolbar="auto",this.locale="en",this.ready=!1,this.hasFocus=!1,this.charCount=0,this.bubbleDragged=!1,this.bubbleDragOffset={x:0,y:0},this.bubbleDragPos={x:0,y:0},this.bubblePositionLocked=!1,this.bubbleLockPos={x:0,y:0},this.applyingBubbleLock=!1,this._loadedAccountFonts=[],this._fontLoaderCalled=!1,this._fontLoaderLoading=!1,this.lastEmittedJson=null,this.lastEmittedHtml="",this.applyingExternal=!1,this.rt=n,this.imgLayoutVisible=!1,this.handleUpdate=e=>{if(this.refreshCharCount(),this.applyingExternal)return;const t=this.buildOutput(e);this.lastEmittedJson=t.json?JSON.stringify(t.json):null,this.lastEmittedHtml=t.html,this.coInput.emit(t),this.readonly&&this.coChange.emit(t)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{clearTimeout(this.blurTimeout),this.blurTimeout=setTimeout((()=>{var e,t;(null===(e=this.editor)||void 0===e?void 0:e.isFocused)||(null===(t=this.bubbleEl)||void 0===t?void 0:t.contains(document.activeElement))||(this.hasFocus=!1,this.editor&&this.coChange.emit(this.buildOutput(this.editor)),this.coBlur.emit())}),100)}}async componentDidLoad(){var e,t;if(!this.contentEl)return;const o="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled;o&&(this.bubbleEl=this.createBubbleElement()),this.editor=this.rt.createEditor({preset:this.preset,element:this.contentEl,content:this.parseValue(this.value),editable:!this.disabled&&!this.readonly,placeholder:this.placeholder,maxLength:this.maxLength,features:this.parsedFeatures,customExtensions:null!==(e=this.customExtensions)&&void 0!==e?e:[],bubbleMenuElement:this.bubbleEl,imageUpload:this.imageUpload,onUpdate:e=>this.handleUpdate(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),"document"===this.preset&&this.contentEl.classList.add("co-rte-content--site"),o&&this.imagesEnabled&&(this.contentEl.style.position="relative",this.imgLayoutEl=this.createImageLayoutBar(),this.contentEl.appendChild(this.imgLayoutEl)),this.editor.on("transaction",(({transaction:e})=>{this.bubbleEl&&(this.updateBubbleActiveStates(),(this.bubbleDragged||this.bubblePositionLocked)&&this.bubbleEl&&this.applyBubbleFixedPosition()),this.imagesEnabled&&e.docChanged&&this.syncImageLayouts(),this.updateImageLayoutBar()})),this.bubbleEl&&this.toolbarEl&&(this.toolbarEl.addEventListener("mousedown",(()=>{this.closeBubbleDropdowns()})),this.toolbarEl.addEventListener("coPopoverChange",(e=>{var t;const o=null===(t=e.detail)||void 0===t?void 0:t.open;this.suppressBubble(!!o)}))),this.lastEmittedJson=null!==(t=this.value)&&void 0!==t?t:null,this.ready=!0,this.refreshCharCount(),this.syncToolbar(),this.coReady.emit(),this.autofocus&&this.editor.commands.focus(),requestAnimationFrame((()=>this.syncImageLayouts()))}disconnectedCallback(){var e,t,o,r;clearTimeout(this.blurTimeout),clearTimeout(this.bubbleLockTimer),null===(e=this.bubbleStyleObserver)||void 0===e||e.disconnect(),this.bubbleDragMoveHandler&&document.removeEventListener("mousemove",this.bubbleDragMoveHandler),this.bubbleDragEndHandler&&document.removeEventListener("mouseup",this.bubbleDragEndHandler),this.bubbleOutsideClickHandler&&document.removeEventListener("click",this.bubbleOutsideClickHandler,!0),null===(t=this.editor)||void 0===t||t.destroy(),this.editor=void 0,null===(o=this.bubbleEl)||void 0===o||o.remove(),null===(r=this.imgLayoutEl)||void 0===r||r.remove()}componentDidRender(){this.syncToolbar()}onAccountFontsChange(){var e;if(this._fontDropdownRenderFn){const t=(null===(e=this._fontDropdownSearchInput)||void 0===e?void 0:e.value)||"";this._fontDropdownRenderFn(t)}}onValueChange(e){if(!this.editor||this.applyingExternal)return;const t=null!=e?e:null;if(t!==this.lastEmittedJson&&t!==this.lastEmittedHtml){this.applyingExternal=!0;try{""===t||null===t?this.editor.commands.clearContent(!1):this.editor.commands.setContent(this.parseValue(e),{emitUpdate:!1})}finally{this.applyingExternal=!1,this.lastEmittedJson=t,this.lastEmittedHtml="",this.refreshCharCount()}}}onEditableChange(){var e;null===(e=this.editor)||void 0===e||e.setEditable(!this.disabled&&!this.readonly)}async getJSON(){return this.editor&&!this.editor.isEmpty?this.editor.getJSON():null}async getHtml(){return this.editor?this.sanitizeHtml(this.editor.getHTML()):""}async getText(){var e,t;return null!==(t=null===(e=this.editor)||void 0===e?void 0:e.getText())&&void 0!==t?t:""}async clear(){this.editor&&(this.editor.commands.clearContent(!0),this.coClear.emit())}async focusEditor(){var e;null===(e=this.editor)||void 0===e||e.commands.focus()}async setContent(e){var t;null===(t=this.editor)||void 0===t||t.commands.setContent(e)}async getEditorInstance(){var e;return null!==(e=this.editor)&&void 0!==e?e:null}get imagesEnabled(){var e;const t=this.parsedFeatures;return null!==(e=null==t?void 0:t.image)&&void 0!==e?e:"document"===this.preset}get parsedFeatures(){if(this.features){if("string"==typeof this.features)try{return JSON.parse(this.features)}catch(e){return}return this.features}}parseValue(e){if(!e)return"";try{return JSON.parse(e)}catch(t){return e}}sanitizeHtml(e){return this.rt.sanitize(e,this.preset)}buildOutput(e){const t=e.isEmpty;return{json:t?null:e.getJSON(),html:t?"":this.sanitizeHtml(e.getHTML()),text:e.getText()}}lockBubblePosition(e=1e3){if(!this.bubbleEl)return;const t=this.bubbleEl.getBoundingClientRect();0!==t.width&&(this.bubbleLockPos={x:t.left,y:t.top},this.bubblePositionLocked=!0,clearTimeout(this.bubbleLockTimer),this.bubbleLockTimer=setTimeout((()=>{this.bubblePositionLocked=!1}),e))}applyBubbleFixedPosition(){if(!this.bubbleEl)return;const e=this.bubbleDragged?this.bubbleDragPos:this.bubbleLockPos;this.applyingBubbleLock=!0,this.bubbleEl.style.position="fixed",this.bubbleEl.style.top=e.y+"px",this.bubbleEl.style.left=e.x+"px",this.bubbleEl.style.transform="none",this.bubbleEl.style.visibility="visible",requestAnimationFrame((()=>{this.applyingBubbleLock=!1}))}setupBubbleStyleObserver(e){e.addEventListener("co-bubble-hide",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1,clearTimeout(this.bubbleLockTimer),this.closeBubbleDropdowns(),e.style.position="",e.style.top="",e.style.left="",e.style.transform=""})),e.addEventListener("co-bubble-show",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1})),this.bubbleStyleObserver=new MutationObserver((()=>{this.applyingBubbleLock||(this.bubblePositionLocked||this.bubbleDragged)&&this.applyBubbleFixedPosition()})),this.bubbleStyleObserver.observe(e,{attributes:!0,attributeFilter:["style"]})}suppressBubble(e){this.bubbleEl&&(this.bubbleEl.classList.toggle("co-rte-bubble--suppressed",e),e&&this.closeBubbleDropdowns())}closeBubbleDropdowns(){this.bubbleEl&&(this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{e.style.display="none"})),this.bubbleLinkFormEl&&(this.bubbleLinkFormEl.style.display="none"))}refreshCharCount(){var e;const t=null===(e=this.editor)||void 0===e?void 0:e.storage;(null==t?void 0:t.characterCount)&&(this.charCount=t.characterCount.characters(),this.charCountEl&&(this.charCountEl.textContent=null!=this.maxLength?`${this.charCount} / ${this.maxLength}`:""+this.charCount))}syncToolbar(){this.toolbarEl&&this.editor&&this.toolbarEl.editor!==this.editor&&(this.toolbarEl.editor=this.editor),this.toolbarEl&&(this.toolbarEl.imageUpload=this.imageUpload)}get resolvedToolbar(){return"auto"!==this.toolbar?this.toolbar:this.rt.defaultToolbarForPreset(this.preset)}get resolvedFontFamilies(){if(!this.fontFamilies)return e.DEFAULT_FONTS;if("string"==typeof this.fontFamilies)try{return JSON.parse(this.fontFamilies)}catch(t){return e.DEFAULT_FONTS}return this.fontFamilies}get resolvedAccountFonts(){if(this.accountFonts){if("string"==typeof this.accountFonts)try{return JSON.parse(this.accountFonts)}catch(e){return[]}return this.accountFonts}return this._loadedAccountFonts}registerFontFace(t,o){if(o&&t&&!e._registeredFonts.has(t)){e._registeredFonts.add(t);try{const e=new FontFace(t,`url("${o}")`);e.load().then((()=>document.fonts.add(e))).catch((()=>{}))}catch(e){}}}async loadFontsViaCallback(){var e,t,o;if(!this._fontLoaderCalled&&this.fontLoader){this._fontLoaderCalled=!0,this._fontLoaderLoading=!0,null===(e=this._fontDropdownRenderFn)||void 0===e||e.call(this,"");try{const e=await this.fontLoader();Array.isArray(e)&&(this._loadedAccountFonts=e.map((e=>(e.url&&this.registerFontFace(e.label,e.url),{label:e.label,value:e.value}))))}catch(e){console.error("[co-rich-text-editor] fontLoader error",e)}finally{this._fontLoaderLoading=!1;const e=(null===(t=this._fontDropdownSearchInput)||void 0===t?void 0:t.value)||"";null===(o=this._fontDropdownRenderFn)||void 0===o||o.call(this,e)}}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";default:return"info"}}createBubbleElement(){const e=document.createElement("div");e.className="co-rte-bubble",e.style.visibility="hidden",e.style.position="absolute",e.style.top="0",e.style.left="0",e.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),this.bubbleOutsideClickHandler=t=>{e.contains(t.target)||this.closeBubbleDropdowns()},document.addEventListener("click",this.bubbleOutsideClickHandler,!0),this.setupBubbleStyleObserver(e);const t="document"===this.preset;if(t){const t=document.createElement("div");t.className="co-rte-bubble__drag-handle",t.innerHTML='<co-icon name="dots-six-vertical" size="14"></co-icon>',t.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const o=e.getBoundingClientRect();this.bubbleDragOffset={x:t.clientX-o.left,y:t.clientY-o.top},this.bubbleDragged||(this.bubbleDragPos={x:o.left,y:o.top}),this.bubbleDragged=!0,this.bubbleDragMoveHandler=t=>{this.bubbleDragPos.x=t.clientX-this.bubbleDragOffset.x,this.bubbleDragPos.y=t.clientY-this.bubbleDragOffset.y,e.style.position="fixed",e.style.top=this.bubbleDragPos.y+"px",e.style.left=this.bubbleDragPos.x+"px",e.style.transform="none",e.style.visibility="visible"},this.bubbleDragEndHandler=()=>{document.removeEventListener("mousemove",this.bubbleDragMoveHandler),document.removeEventListener("mouseup",this.bubbleDragEndHandler)},document.addEventListener("mousemove",this.bubbleDragMoveHandler),document.addEventListener("mouseup",this.bubbleDragEndHandler)})),e.appendChild(t)}const o=document.createElement("div");o.className="co-rte-bubble__row";let r=null,i=null,n=null,c=null,s=null,l=null;if(t){const e=this.createBubbleFontFamilySelect();o.appendChild(e),r=this.createBubbleFontSizePanel(),o.appendChild(r.wrap),i=this.createBubbleFontWeightPanel(),o.appendChild(i.wrap),o.appendChild(this.createSep());const t=this.createBubbleColorPicker("textColor",(e=>{this.editor&&this.editor.chain().focus().setColor(e).run()}));o.appendChild(t),o.appendChild(this.createSep())}const b=a(this.locale),d=[{action:"bold",icon:"text-b",label:b.bold,check:"bold"},{action:"italic",icon:"text-italic",label:b.italic,check:"italic"}];"comment"!==this.preset&&d.push({action:"underline",icon:"text-underline",label:b.underline,check:"underline"}),d.forEach((({action:e,icon:t,label:r,check:i})=>{const n=this.createBubbleBtn(t,r,e,i,(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"bold":t.toggleBold().run();break;case"italic":t.toggleItalic().run();break;case"underline":t.toggleUnderline().run()}}));o.appendChild(n)})),o.appendChild(this.createSep()),(t||"email"===this.preset)&&([{align:"left",icon:"text-align-left",label:b.alignLeft},{align:"center",icon:"text-align-center",label:b.center},{align:"right",icon:"text-align-right",label:b.alignRight},{align:"justify",icon:"text-align-justify",label:b.justify}].forEach((({align:e,icon:t,label:r})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn",i.title=r,i.setAttribute("aria-label",r),i.setAttribute("data-action","textAlign"),i.setAttribute("data-align",e),i.innerHTML=`<co-icon name="${t}" size="16"></co-icon>`,i.addEventListener("click",(()=>{this.editor&&this.editor.chain().focus().setTextAlign(e).run()})),o.appendChild(i)})),o.appendChild(this.createSep())),"comment"===this.preset||t||(o.appendChild(this.createBubbleBtn("list-bullets",b.bulletList,"bulletList","bulletList",(()=>{this.editor&&this.editor.chain().focus().toggleBulletList().run()}))),o.appendChild(this.createBubbleBtn("list-numbers",b.orderedList,"orderedList","orderedList",(()=>{this.editor&&this.editor.chain().focus().toggleOrderedList().run()}))),o.appendChild(this.createSep()));const u=this.createBubbleBtn("link",b.link,"link","link",(()=>{this.editor&&this.toggleBubbleLinkForm(!0)}));o.appendChild(u),t&&(o.appendChild(this.createSep()),n=this.createBubbleLineHeightPanel(),c=this.createBubbleLetterSpacingPanel(),s=this.createBubbleBgColorPanel(),l=this.createBubbleOverflowMenu({lineHeight:n,letterSpacing:c,bgColor:s}),o.appendChild(l.overflowWrap)),e.appendChild(o),t&&(r&&e.appendChild(r.panelEl),i&&e.appendChild(i.panelEl),n&&e.appendChild(n),c&&e.appendChild(c),s&&e.appendChild(s));const h=document.createElement("div");h.className="co-rte-bubble__link-form",h.style.display="none",this.bubbleLinkFormEl=h;const p=document.createElement("input");p.type="url",p.className="co-rte-bubble__link-input",p.placeholder="https://...",this.bubbleLinkInputEl=p,p.addEventListener("keydown",(e=>{"Enter"===e.key&&this.submitBubbleLinkImperative(),"Escape"===e.key&&this.toggleBubbleLinkForm(!1)}));const f=document.createElement("button");f.type="button",f.className="co-rte-bubble__link-btn",f.innerHTML='<co-icon name="check" size="14"></co-icon>',f.addEventListener("click",(()=>this.submitBubbleLinkImperative()));const m=document.createElement("button");return m.type="button",m.className="co-rte-bubble__link-btn co-rte-bubble__link-unlink",m.title=b.unlinkLink,m.innerHTML='<co-icon name="link-break" size="14"></co-icon>',m.addEventListener("click",(()=>{this.editor&&(this.editor.chain().focus().unsetLink().run(),this.toggleBubbleLinkForm(!1))})),this.bubbleLinkUnlinkEl=m,h.appendChild(p),h.appendChild(f),h.appendChild(m),e.appendChild(h),e}createSep(){const e=document.createElement("span");return e.className="co-rte-bubble__sep",e}positionDropdown(e,t){const o=e.getBoundingClientRect();t.removeAttribute("data-position"),t.style.removeProperty("left"),t.style.removeProperty("transform");const r=t.offsetWidth||224,i=window.innerHeight-o.bottom;if(t.setAttribute("data-position",i>=(t.offsetHeight||320)||i>o.top?"below":"above"),t.classList.contains("co-rte-bubble__color-dropdown")){const o=(e.parentElement||e).getBoundingClientRect(),i=o.left+o.width/2-r/2,n=i+r,a=8;i<a?(t.style.left="0",t.style.transform="none"):n>window.innerWidth-a&&(t.style.left="auto",t.style.right="0",t.style.transform="none")}}positionPanelNearBubble(e){if(!this.bubbleEl)return;const t=this.bubbleEl.querySelector(".co-rte-bubble__overflow-menu"),o=t&&"none"!==t.style.display?t.getBoundingClientRect():this.bubbleEl.getBoundingClientRect(),r=e.offsetHeight||320,i=e.offsetWidth||230;let n=o.top;n+r>window.innerHeight-8&&(n=window.innerHeight-8-r),n<8&&(n=8);let a=o.left-i-4;a<8&&(a=o.right+4),a+i>window.innerWidth-8&&(a=window.innerWidth-8-i),e.style.position="fixed",e.style.top=n+"px",e.style.left=a+"px",e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")}createBubbleBtn(e,t,o,r,i){const n=document.createElement("button");return n.type="button",n.className="co-rte-bubble__btn",n.title=t,n.setAttribute("aria-label",t),n.setAttribute("data-action",o),n.setAttribute("data-check",r),n.innerHTML=`<co-icon name="${e}" size="16"></co-icon>`,n.addEventListener("click",i),n}createBubbleFontFamilySelect(){const e=document.createElement("div");e.className="co-rte-bubble__select co-rte-bubble__select--font",e.setAttribute("data-select","fontFamily");const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__select-trigger",t.innerHTML='<span class="co-rte-bubble__select-label">Sans-serif</span><co-icon name="caret-down" size="12"></co-icon>';const o=document.createElement("div");o.className="co-rte-bubble__select-dropdown co-rte-bubble__select-dropdown--font",o.style.display="none";const r=document.createElement("div");r.className="co-rte-bubble__font-search";const i=document.createElement("input");i.type="text",i.className="co-rte-bubble__font-search-input",i.placeholder=a(this.locale).searchFont,r.appendChild(i),o.appendChild(r);const n=document.createElement("div");n.className="co-rte-bubble__font-list",o.appendChild(n);const c=(e,r)=>{const n=document.createElement("button");return n.type="button",n.className="co-rte-bubble__select-option",n.setAttribute("data-value",r),n.textContent=e,n.style.fontFamily=r.includes(",")?r:`"${r}", sans-serif`,n.addEventListener("click",(()=>{if(!this.editor)return;this.editor.chain().focus().setFontFamily(r).run(),o.style.display="none";const n=t.querySelector(".co-rte-bubble__select-label");n&&(n.textContent=e),i.value="",this.coFontPopupHide.emit()})),n},s=e=>{n.innerHTML="";const t=e.toLowerCase(),o=this.resolvedAccountFonts,r=this.resolvedFontFamilies,i=t?o.filter((e=>e.label.toLowerCase().includes(t))):o,s=t?r.filter((e=>e.label.toLowerCase().includes(t))):r;if(!i.length&&!s.length){const e=document.createElement("div");return e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).noResults,void n.appendChild(e)}if((this.fontsLoading||this._fontLoaderLoading)&&!i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).loadingFonts,n.appendChild(e)}if(i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).importedFonts,n.appendChild(e),i.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}if(s.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).systemFonts,n.appendChild(e),s.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}};return i.addEventListener("input",(()=>s(i.value))),this._fontDropdownRenderFn=s,this._fontDropdownSearchInput=i,t.addEventListener("click",(()=>{const r=e.closest(".co-rte-bubble");r&&(r.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==o&&(e.style.display="none")})),r.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const n="none"!==o.style.display;o.style.display=n?"none":"block",n?this.coFontPopupHide.emit():(this.coFontPopupShow.emit(),this.loadFontsViaCallback(),this.positionDropdown(t,o),s(""),setTimeout((()=>i.focus()),0))})),e.appendChild(t),e.appendChild(o),e}createBubbleSelect(e,t,o,r){const i=document.createElement("div");i.className="co-rte-bubble__select",i.setAttribute("data-select",e);const n=document.createElement("button");n.type="button",n.className="co-rte-bubble__select-trigger",n.innerHTML=`<span class="co-rte-bubble__select-label">${o}</span><co-icon name="caret-down" size="12"></co-icon>`;const a=document.createElement("div");return a.className="co-rte-bubble__select-dropdown",a.style.display="none",t.forEach((({label:t,value:o})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__select-option",i.setAttribute("data-value",o),i.textContent=t,"fontWeight"===e&&(i.style.fontWeight=o),i.addEventListener("click",(()=>{r(o),a.style.display="none";const e=n.querySelector(".co-rte-bubble__select-label");e&&(e.textContent=t)})),a.appendChild(i)})),n.addEventListener("click",(()=>{const e=i.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==a&&(e.style.display="none")})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const t="none"!==a.style.display;a.style.display=t?"none":"block",t||this.positionDropdown(n,a)})),i.appendChild(n),i.appendChild(a),i}createBubbleColorPicker(e,t){const o=document.createElement("div");o.className="co-rte-bubble__color",o.setAttribute("data-color",e);const r="textColor"===e?"":"highlighter",i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn";const n=a(this.locale);i.title="textColor"===e?n.textColor:n.backgroundColor,i.innerHTML="textColor"===e?'<span class="co-rte-bubble__color-indicator"><span class="co-rte-bubble__color-letter">A</span><span class="co-rte-bubble__color-bar" style="background:#000000"></span></span>':`<co-icon name="${r}" size="16"></co-icon>`;const c=document.createElement("div");c.className="co-rte-bubble__color-dropdown",c.style.display="none";const s="textColor"===e?n.textColor:n.backgroundColor,{resetDrag:l}=this.addDragHeader(c,s);c.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()}));const b=document.createElement("div");b.className="co-rte-bubble__color-grid",["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"].forEach((e=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__color-swatch",o.style.background=e,"#ffffff"===e&&(o.style.border="1px solid #e0e0e0"),o.addEventListener("click",(()=>{t(e),c.style.display="none"})),b.appendChild(o)}));const d=document.createElement("div");d.className="co-rte-bubble__color-hex";const u=document.createElement("input");u.type="text",u.className="co-rte-bubble__color-hex-input",u.placeholder="#hex",u.maxLength=7,u.addEventListener("keydown",(e=>{if("Enter"===e.key){const e=u.value.trim();/^#[0-9a-fA-F]{3,6}$/.test(e)&&(t(e),c.style.display="none",u.value="")}}));const h=document.createElement("button");return h.type="button",h.className="co-rte-bubble__color-clear",h.innerHTML='<co-icon name="x" size="12"></co-icon> '+n.noColor,h.addEventListener("click",(()=>{this.editor&&("textColor"===e?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().unsetHighlight().run(),c.style.display="none")})),c.appendChild(b),d.appendChild(u),c.appendChild(d),c.appendChild(h),i.addEventListener("click",(()=>{const e=o.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e!==c&&(e.style.display="none")}))),"none"!==c.style.display?c.style.display="none":(l(),c.style.position="",c.style.top="",c.style.left="",c.style.bottom="",c.style.right="",c.style.transform="",c.style.display="block",this.positionDropdown(i,c))})),o.appendChild(i),o.appendChild(c),o}closeAllBubblePopups(...e){if(!this.bubbleEl)return;const t=e.filter(Boolean);this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleLinkFormEl&&!t.includes(this.bubbleLinkFormEl)&&(this.bubbleLinkFormEl.style.display="none")}addDragHeader(e,t){let o=!1,r={x:0,y:0},i={x:0,y:0};const n=document.createElement("div");n.className="co-rte-bubble__panel-header";const a=document.createElement("div");a.className="co-rte-bubble__panel-drag",a.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const c=document.createElement("span");c.className="co-rte-bubble__panel-title",c.textContent=t;const s=document.createElement("button");return s.type="button",s.className="co-rte-bubble__panel-close",s.innerHTML='<co-icon name="x" size="14"></co-icon>',s.addEventListener("click",(()=>{e.style.display="none"})),n.appendChild(a),n.appendChild(c),n.appendChild(s),a.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const n=e.getBoundingClientRect();i={x:t.clientX-n.left,y:t.clientY-n.top},o||(r={x:n.left,y:n.top}),o=!0;const a=t=>{r.x=t.clientX-i.x,r.y=t.clientY-i.y,e.style.position="fixed",e.style.top=r.y+"px",e.style.left=r.x+"px",e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")},c=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",c)})),e.insertBefore(n,e.firstChild),{header:n,resetDrag:()=>{o=!1}}}createBubblePanel(e){const t=document.createElement("div");t.className="co-rte-bubble__select",t.setAttribute("data-select",e.name);const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__select-trigger",o.innerHTML=`<span class="co-rte-bubble__select-label">${e.triggerLabel}</span><co-icon name="caret-down" size="12"></co-icon>`;const r=document.createElement("div");r.className="co-rte-bubble__panel",r.setAttribute("data-panel",e.name),r.style.display="none";const i=document.createElement("div");i.className="co-rte-bubble__panel-header";const n=document.createElement("div");n.className="co-rte-bubble__panel-drag",n.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const a=document.createElement("span");a.className="co-rte-bubble__panel-title",a.textContent=e.title;const c=document.createElement("button");c.type="button",c.className="co-rte-bubble__panel-close",c.innerHTML='<co-icon name="x" size="14"></co-icon>',c.addEventListener("click",(()=>{r.style.display="none"})),i.appendChild(n),i.appendChild(a),i.appendChild(c),r.appendChild(i);let s=!1,l={x:0,y:0},b={x:0,y:0};if(n.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation();const t=r.getBoundingClientRect();b={x:e.clientX-t.left,y:e.clientY-t.top},s||(l={x:t.left,y:t.top}),s=!0;const o=e=>{l.x=e.clientX-b.x,l.y=e.clientY-b.y,r.style.position="fixed",r.style.top=l.y+"px",r.style.left=l.x+"px",r.style.bottom="auto",r.style.right="auto",r.style.transform="none",r.removeAttribute("data-position")},i=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)})),e.hasCustomInput){const t=document.createElement("div");t.className="co-rte-bubble__panel-input-wrap";const o=document.createElement("input");o.type=e.inputType||"text",o.className="co-rte-bubble__panel-input",o.placeholder=e.inputPlaceholder||"",o.addEventListener("mousedown",(e=>e.stopPropagation())),o.addEventListener("keydown",(t=>{if("Enter"===t.key){const t=o.value.trim();t&&e.onCustomInput&&(e.onCustomInput(t),o.value="")}"Escape"===t.key&&(r.style.display="none")})),t.appendChild(o),r.appendChild(t)}const d=document.createElement("div");return d.className="co-rte-bubble__panel-options",e.options.forEach((t=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__panel-option",o.setAttribute("data-value",t.value),e.renderOption?e.renderOption(t,o):o.textContent=t.label,o.addEventListener("click",(()=>{e.onSelect(t.value),r.style.display="none",s=!1})),d.appendChild(o)})),r.appendChild(d),r.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),o.addEventListener("click",(()=>{this.closeAllBubblePopups(r),"none"!==r.style.display?r.style.display="none":(s=!1,r.style.position="",r.style.top="",r.style.left="",r.style.bottom="",r.style.right="",r.style.transform="",r.style.display="block",this.positionDropdown(o,r))})),t.appendChild(o),{wrap:t,panelEl:r,updateLabel:e=>{const t=o.querySelector(".co-rte-bubble__select-label");t&&(t.textContent=e)}}}createBubbleFontSizePanel(){const e=a(this.locale),t=[{label:e.title,value:"h1"},{label:e.heading1,value:"h2"},{label:e.heading2,value:"h3"},{label:"---",value:"---"},...["8px","10px","12px","14px","16px","18px","20px","24px","28px","32px","36px","48px","64px","72px"].map((e=>({label:e,value:e})))];return this.createBubblePanel({name:"fontSize",title:e.fontSize,triggerLabel:"16px",hasCustomInput:!0,inputType:"number",inputPlaceholder:e.writeSize,options:t,renderOption:(e,t)=>{if("---"===e.value)return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");"h1"===e.value?(t.textContent=e.label,t.style.fontSize="24px",t.style.fontWeight="700",t.style.padding="6px 8px"):"h2"===e.value?(t.textContent=e.label,t.style.fontSize="18px",t.style.fontWeight="700",t.style.padding="5px 8px"):"h3"===e.value?(t.textContent=e.label,t.style.fontSize="15px",t.style.fontWeight="700",t.style.padding="4px 8px"):(t.textContent=e.label,t.style.fontSize=Math.min(parseInt(e.value),36)+"px",t.style.lineHeight="1.3")},onSelect:e=>{if(!this.editor||"---"===e)return;const t=this.editor.chain().focus();"h1"===e?t.toggleHeading({level:1}).run():"h2"===e?t.toggleHeading({level:2}).run():"h3"===e?t.toggleHeading({level:3}).run():t.setFontSize(e).run()},onCustomInput:e=>{if(!this.editor)return;const t=parseInt(e);t>0&&this.editor.chain().focus().setFontSize(t+"px").run()}})}createBubbleFontWeightPanel(){return this.createBubblePanel({name:"fontWeight",title:a(this.locale).fontWeight,triggerLabel:"Regular",hasCustomInput:!1,options:[{label:"Thin",value:"100"},{label:"Extra Light",value:"200"},{label:"Light",value:"300"},{label:"Regular",value:"400"},{label:"Medium",value:"500"},{label:"Semi Bold",value:"600"},{label:"Bold",value:"700"},{label:"Extra Bold",value:"800"},{label:"Black",value:"900"}],renderOption:(e,t)=>{t.style.fontWeight=e.value,t.innerHTML=`<span class="co-rte-bubble__panel-opt-row"><span>${e.label}</span><span class="co-rte-bubble__panel-opt-value">${e.value}</span></span>`},onSelect:e=>{this.editor&&this.editor.chain().focus().setFontWeight(e).run()}})}createBubbleLineHeightPanel(){const{panelEl:e}=this.createBubblePanel({name:"lineHeight",title:a(this.locale).lineSpacing,triggerLabel:"1.5",hasCustomInput:!0,inputPlaceholder:"1.5, 20px, 150%...",options:[{label:"0.5",value:"0.5"},{label:"1",value:"1"},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"1.75",value:"1.75"},{label:"2",value:"2"},{label:"2.5",value:"2.5"},{label:"3",value:"3"},{label:"---",value:"---"},{label:"16px",value:"16px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"32px",value:"32px"},{label:"---",value:"---2"},{label:"100%",value:"100%"},{label:"150%",value:"150%"},{label:"200%",value:"200%"}],renderOption:(e,t)=>{if(e.value.startsWith("---"))return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");t.textContent=e.label},onSelect:e=>{this.editor&&!e.startsWith("---")&&this.editor.chain().focus().setLineHeight(e).run()},onCustomInput:e=>{this.editor&&this.editor.chain().focus().setLineHeight(e).run()}});return e}createBubbleLetterSpacingPanel(){const{panelEl:e}=this.createBubblePanel({name:"letterSpacing",title:a(this.locale).letterSpacing,triggerLabel:a(this.locale).normal,hasCustomInput:!0,inputPlaceholder:"Custom (em)...",options:[{label:"-0.05em",value:"-0.05em"},{label:"Normal",value:"normal"},{label:"0.05em",value:"0.05em"},{label:"0.1em",value:"0.1em"},{label:"0.2em",value:"0.2em"}],onSelect:e=>{this.editor&&("normal"===e?this.editor.chain().focus().unsetLetterSpacing().run():this.editor.chain().focus().setLetterSpacing(e).run())},onCustomInput:e=>{if(!this.editor)return;const t=e.includes("em")||e.includes("px")?e:e+"em";this.editor.chain().focus().setLetterSpacing(t).run()}});return e}createBubbleBgColorPanel(){const e=this.createBubbleColorPicker("bgColor",(e=>{this.editor&&this.editor.chain().focus().toggleHighlight({color:e}).run()})),t=e.querySelector(".co-rte-bubble__btn");return t&&(t.style.display="none"),e}createBubbleOverflowMenu(e){const t=document.createElement("div");t.className="co-rte-bubble__overflow";const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__btn";const r=a(this.locale);o.title=r.moreOptions,o.setAttribute("aria-label",r.moreOptions),o.innerHTML='<co-icon name="dots-three" size="16"></co-icon>';const i=document.createElement("div");i.className="co-rte-bubble__overflow-menu",i.style.display="none";const{resetDrag:n}=this.addDragHeader(i,r.moreOptions);i.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),[{icon:"text-strikethrough",label:r.strikethrough,action:"strike",check:"strike",type:"toggle"},{icon:"highlighter",label:r.backgroundColor,action:"bgColor",type:"panel",panel:e.bgColor},{icon:"list-bullets",label:r.bulletList,action:"bulletList",check:"bulletList",type:"toggle"},{icon:"list-numbers",label:r.orderedList,action:"orderedList",check:"orderedList",type:"toggle"},{icon:"text-superscript",label:r.superscript,action:"superscript",check:"superscript",type:"toggle"},{icon:"text-subscript",label:r.subscript,action:"subscript",check:"subscript",type:"toggle"},{icon:"line-segments",label:r.lineSpacing,action:"lineHeight",type:"panel",panel:e.lineHeight,valueAttr:"lineHeight"},{icon:"text-aa",label:r.letterSpacing,action:"letterSpacing",type:"panel",panel:e.letterSpacing,valueAttr:"letterSpacing"},{icon:"minus",label:r.horizontalRule,action:"horizontalRule",type:"toggle"},{icon:"eraser",label:r.clearFormat,action:"clearFormat",type:"toggle"}].forEach((e=>{if("lineHeight"===e.action||"horizontalRule"===e.action){const e=document.createElement("div");e.className="co-rte-bubble__overflow-sep",i.appendChild(e)}const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__overflow-item",t.setAttribute("data-overflow-item",e.action),e.check&&t.setAttribute("data-check",e.check);let o="";e.valueAttr&&(o=`<span class="co-rte-bubble__overflow-value" data-overflow-value="${e.valueAttr}"></span>`),t.innerHTML=`<co-icon name="${e.icon}" size="16"></co-icon><span>${e.label}</span>${o}`,t.addEventListener("click",(()=>{if(!this.editor)return;if("panel"===e.type&&e.panel){if("bgColor"===e.action){const t=e.panel.querySelector(".co-rte-bubble__color-dropdown");if(t){const e="none"!==t.style.display;this.closeAllBubblePopups(i,e?void 0:t),t.style.display=e?"none":"block",e||this.positionPanelNearBubble(t)}}else{const t="none"!==e.panel.style.display;this.closeAllBubblePopups(i,t?void 0:e.panel),e.panel.style.display=t?"none":"block",t||this.positionPanelNearBubble(e.panel)}return}const t=this.editor.chain().focus();switch(e.action){case"strike":t.toggleStrike().run();break;case"bulletList":t.toggleBulletList().run();break;case"orderedList":t.toggleOrderedList().run();break;case"superscript":t.toggleSuperscript().run();break;case"subscript":t.toggleSubscript().run();break;case"horizontalRule":t.setHorizontalRule().run(),i.style.display="none";break;case"clearFormat":t.unsetAllMarks().clearNodes().run(),i.style.display="none"}})),i.appendChild(t)}));const c=document.createElement("div");c.className="co-rte-bubble__overflow-table-section",c.style.display="none";const s=document.createElement("div");s.className="co-rte-bubble__overflow-sep",c.appendChild(s);const l=document.createElement("div");l.className="co-rte-bubble__overflow-section-title",l.textContent=r.tableOptions,c.appendChild(l),[{action:"addColumnBefore",icon:"columns-plus-left",label:r.addColumnBefore},{action:"addColumnAfter",icon:"columns-plus-right",label:r.addColumnAfter},{action:"addRowBefore",icon:"rows-plus-top",label:r.addRowAbove},{action:"addRowAfter",icon:"rows-plus-bottom",label:r.addRowBelow},{action:"mergeCells",icon:"arrows-merge",label:r.mergeCells},{action:"splitCell",icon:"arrows-split",label:r.splitCell},{action:"toggleHeaderRow",icon:"rows",label:r.headerRow}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item",r.setAttribute("data-overflow-item",e),"toggleHeaderRow"===e&&r.setAttribute("data-check","toggleHeaderRow"),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"addColumnAfter":t.addColumnAfter().run();break;case"addColumnBefore":t.addColumnBefore().run();break;case"addRowAfter":t.addRowAfter().run();break;case"addRowBefore":t.addRowBefore().run();break;case"mergeCells":t.mergeCells().run();break;case"splitCell":t.splitCell().run();break;case"toggleHeaderRow":t.toggleHeaderRow().run()}})),c.appendChild(r)}));const b=document.createElement("div");return b.className="co-rte-bubble__overflow-sep",c.appendChild(b),[{action:"deleteColumn",icon:"minus-square",label:r.deleteColumn},{action:"deleteRow",icon:"x-square",label:r.deleteRow},{action:"deleteTable",icon:"trash",label:r.deleteTable}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item co-rte-bubble__overflow-item--danger",r.setAttribute("data-overflow-item",e),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"deleteColumn":t.deleteColumn().run();break;case"deleteRow":t.deleteRow().run();break;case"deleteTable":t.deleteTable().run(),i.style.display="none"}})),c.appendChild(r)})),i.appendChild(c),o.addEventListener("click",(()=>{this.closeAllBubblePopups(i),"none"!==i.style.display?i.style.display="none":(n(),i.style.position="",i.style.top="",i.style.left="",i.style.bottom="",i.style.right="",i.style.transform="",i.style.display="block",this.positionDropdown(o,i))})),t.appendChild(o),t.appendChild(i),{overflowWrap:t,overflowMenu:i}}toggleBubbleLinkForm(e){var t,o;if(this.bubbleLinkFormEl&&this.bubbleLinkInputEl&&(this.bubbleLinkFormEl.style.display=e?"flex":"none",e)){const e=(null===(t=this.editor)||void 0===t?void 0:t.isActive("link"))&&(null===(o=this.editor.getAttributes("link"))||void 0===o?void 0:o.href)||"";this.bubbleLinkInputEl.value=e,this.bubbleLinkUnlinkEl&&(this.bubbleLinkUnlinkEl.style.display=e?"flex":"none"),setTimeout((()=>{var e;return null===(e=this.bubbleLinkInputEl)||void 0===e?void 0:e.focus()}),0)}}submitBubbleLinkImperative(){if(!this.editor||!this.bubbleLinkInputEl)return;const e=this.bubbleLinkInputEl.value.trim();e?(this.editor.chain().focus().setLink({href:e}).run(),this.toggleBubbleLinkForm(!1)):this.toggleBubbleLinkForm(!1)}updateBubbleActiveStates(){if(!this.editor||!this.bubbleEl)return;this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive(t))})),this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-align]").forEach((e=>{const t=e.getAttribute("data-align");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive({textAlign:t}))}));const e=this.bubbleEl.querySelector('[data-select="fontFamily"] .co-rte-bubble__select-label');if(e){const t=this.editor.getAttributes("textStyle"),o=(null==t?void 0:t.fontFamily)||"";e.textContent=o?o.split(",")[0].replace(/['"]/g,"").trim():"Sans-serif"}const t=this.bubbleEl.querySelector('[data-select="fontSize"] .co-rte-bubble__select-label');if(t){const e=this.editor.getAttributes("textStyle"),o=a(this.locale);t.textContent=this.editor.isActive("heading",{level:1})?o.title:this.editor.isActive("heading",{level:2})?o.headingAbbr1:this.editor.isActive("heading",{level:3})?o.headingAbbr2:(null==e?void 0:e.fontSize)||"16px"}const o=this.bubbleEl.querySelector('[data-select="fontWeight"] .co-rte-bubble__select-label');if(o){const e=this.editor.getAttributes("textStyle");o.textContent={100:"Thin",200:"Extra Light",300:"Light",400:"Regular",500:"Medium",600:"Semi-bold",700:"Bold",800:"Extra-bold",900:"Black"}[(null==e?void 0:e.fontWeight)||"400"]||"Regular"}this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-item[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__overflow-item--active",this.editor.isActive(t))}));const r=this.bubbleEl.querySelector('[data-overflow-value="lineHeight"]');if(r){const e=this.editor.getAttributes("paragraph"),t=this.editor.getAttributes("heading");r.textContent=(null==e?void 0:e.lineHeight)||(null==t?void 0:t.lineHeight)||""}const i=this.bubbleEl.querySelector('[data-overflow-value="letterSpacing"]');if(i){const e=this.editor.getAttributes("textStyle");i.textContent=(null==e?void 0:e.letterSpacing)||""}const n=this.bubbleEl.querySelector(".co-rte-bubble__color-bar");if(n){const e=this.editor.getAttributes("textStyle");n.style.background=(null==e?void 0:e.color)||"#000000"}const c=this.bubbleEl.querySelector(".co-rte-bubble__overflow-table-section");if(c){const e=this.editor.isActive("table");if(c.style.display=e?"block":"none",e){const e=c.querySelector('[data-overflow-item="toggleHeaderRow"]');if(e){const t=this.editor.view,{$anchor:o}=this.editor.state.selection;let r=o.depth,i=!1;for(;r>0;){if("table"===o.node(r).type.name){const e=t.nodeDOM(o.start(r)-1);if(e){const t=(e.querySelector("table")||e).querySelector("tr");i=!!t&&null!==t.querySelector("th")}break}r--}e.classList.toggle("co-rte-bubble__overflow-item--active",i)}}}}createImageLayoutBar(){const t=document.createElement("div");t.className="co-rte-img-layout",t.style.display="none",t.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()}));const o=a(this.locale),r={inline:o.imageLayoutInline,"wrap-left":o.imageLayoutWrapLeft,"wrap-right":o.imageLayoutWrapRight,center:o.imageLayoutCenter,"full-width":o.imageLayoutFullWidth};return["inline","wrap-left","wrap-right","center","full-width"].forEach((o=>{const i=document.createElement("button");i.type="button",i.className="co-rte-img-layout__btn",i.setAttribute("data-layout",o),i.setAttribute("data-tooltip",r[o]||o),i.setAttribute("aria-label",r[o]||o),i.innerHTML=`<co-icon name="${e.IMG_LAYOUT_ICONS[o]}" size="18"></co-icon>`,i.addEventListener("click",(()=>this.setImageLayout(o))),t.appendChild(i)})),t}setImageLayout(e){if(!this.editor||!this.contentEl)return;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return;const i=o.from,n=t.tr.setNodeMarkup(i,void 0,Object.assign(Object.assign({},r.attrs),{imageLayout:e}));this.editor.view.dispatch(n),this.editor.commands.setNodeSelection(i),requestAnimationFrame((()=>{this.syncImageLayouts(),this.updateImageLayoutBar()}))}getSelectedImageInfo(){var e;if(!this.editor)return null;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return null;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return null;const i=o.from,n=this.editor.view.nodeDOM(i);return n?{node:r,pos:i,container:(null===(e=n.closest)||void 0===e?void 0:e.call(n,"[data-resize-container]"))||n}:null}syncImageLayouts(){if(!this.editor)return;const e=this.editor.view;this.editor.state.doc.descendants(((t,o)=>{var r;if("image"!==t.type.name)return!0;const i=e.nodeDOM(o),n=(null===(r=null==i?void 0:i.closest)||void 0===r?void 0:r.call(i,"[data-resize-container]"))||i;return!n||(n.dataset.imageLayout=t.attrs.imageLayout||"inline",n.style.position="",n.style.left="",n.style.top="",n.style.zIndex="",!0)}))}updateImageLayoutBarPosition(){if(!this.imgLayoutEl||!this.contentEl)return;const e=this.getSelectedImageInfo();if(!e)return;const t=e.container.getBoundingClientRect(),o=this.contentEl.getBoundingClientRect(),r=this.imgLayoutEl.offsetWidth||194;let i=t.left+t.width/2-o.left+this.contentEl.scrollLeft-r/2;i=Math.max(4,Math.min(i,o.width-r-4));const n=t.bottom-o.top+this.contentEl.scrollTop+8;this.imgLayoutEl.style.left=i+"px",this.imgLayoutEl.style.top=n+"px"}updateImageLayoutBar(){if(!this.imgLayoutEl||!this.editor)return;const e=this.getSelectedImageInfo();if(!e)return void(this.imgLayoutVisible&&(this.imgLayoutEl.style.display="none",this.imgLayoutVisible=!1));this.imgLayoutEl.style.display="flex",this.imgLayoutVisible=!0,this.updateImageLayoutBarPosition();const t=e.node.attrs.imageLayout||"inline";this.imgLayoutEl.querySelectorAll(".co-rte-img-layout__btn").forEach((e=>{e.classList.toggle("co-rte-img-layout__btn--active",e.getAttribute("data-layout")===t)}))}render(){const e="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled,t=this.showCharacterCount||null!=this.maxLength;return r("div",{key:"d24b8e5db1151bcd983790ea15f68aaf4838ff43",class:{"co-rich-text-editor":!0,"co-rich-text-editor--focused":this.hasFocus,"co-rich-text-editor--disabled":this.disabled,"co-rich-text-editor--readonly":this.readonly,"co-rich-text-editor--loading":!this.ready,["co-rich-text-editor--"+this.status]:"default"!==this.status},part:"wrapper"},(this.label||this.secondaryLabel)&&r("div",{key:"1622079a94d8ebb190642f91463b715f3456fcf4",class:"co-rich-text-editor__labels"},this.label&&r("label",{key:"bb5c0754a63d46d45ce8f211ae0f0e8c4ddbc478",class:"co-rich-text-editor__label",part:"label"},this.label),this.secondaryLabel&&r("span",{key:"1af0a217a38746c3a78693c552be44df6d03b276",class:"co-rich-text-editor__secondary-label"},this.secondaryLabel)),r("div",{key:"e5ad90dd90061be3e40136eece0f485e5cfb89a1",class:"co-rich-text-editor__frame"},e&&r("co-rich-text-toolbar",{key:"56f3da29e9259cd37fdf6e7511dc54efb30085ca",class:"co-rich-text-editor__toolbar",part:"toolbar",variant:this.resolvedToolbar,disabled:this.disabled||this.readonly,locale:this.locale,ref:e=>this.toolbarEl=e}),r("div",{key:"bb0dc27e8625171284cae02b5cae28dcbe638991",class:"co-rich-text-editor__box"},r("div",{key:"647563e73112023ec546418787dbf61acb58853d",class:"co-rte-content",part:"content",role:"textbox","aria-multiline":"true","aria-label":this.label,"aria-required":this.required?"true":void 0,"aria-invalid":"error"===this.status?"true":void 0,ref:e=>this.contentEl=e}))),r("div",{key:"460dad69fd1781f11d751565d0ca09015013e8ce",class:"co-rich-text-editor__footer"},this.helperText&&r("div",{key:"69d8fb55797eb8f35885fa10e86cf08e4d0e45ec",class:"co-rich-text-editor__helper co-rich-text-editor__helper--"+this.status,part:"helper"},r("co-icon",{key:"d1c3cc4f06284b865c889dac7492305a4b7d8dfd",name:this.helperIcon,size:14}),r("span",{key:"361940f354fcee5a309cd2ef5cff84b73689650e"},this.helperText)),t&&r("span",{key:"2b5a1b6e04ba3d428346034d092bf83978de0124",class:"co-rich-text-editor__count",ref:e=>this.charCountEl=e},this.charCount,null!=this.maxLength?" / "+this.maxLength:"")))}get el(){return this}static get watchers(){return{accountFonts:[{onAccountFontsChange:0}],value:[{onValueChange:0}],disabled:[{onEditableChange:0}],readonly:[{onEditableChange:0}]}}static get style(){return'co-rich-text-editor{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body)}.co-rich-text-editor{display:flex;flex-direction:column;gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__label,.co-rich-text-editor__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-rich-text-editor__frame{display:flex;flex-direction:column;background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);transition:border-color 0.15s ease, box-shadow 0.15s ease;min-height:0;flex:1;position:relative;overflow:visible}.co-rich-text-editor__box{display:flex;flex-direction:column;min-height:0;flex:1;position:relative;overflow-y:auto;overflow-x:hidden}.co-rich-text-editor--focused .co-rich-text-editor__frame{border-color:var(--co-semantic-border-focus, var(--co-color-base-negro, #1a1a1a));box-shadow:0 0 0 3px var(--co-semantic-border-focus-ring, rgba(37, 99, 235, 0.15))}.co-rich-text-editor--error .co-rich-text-editor__frame{border-color:var(--co-color-status-error)}.co-rich-text-editor--success .co-rich-text-editor__frame{border-color:var(--co-color-status-success)}.co-rich-text-editor--disabled .co-rich-text-editor__frame,.co-rich-text-editor--readonly .co-rich-text-editor__frame{opacity:0.7;cursor:not-allowed}.co-rich-text-editor--loading .co-rte-content{min-height:96px;background:linear-gradient(90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100%);background-size:200% 100%;animation:co-rte-skeleton 1.2s ease-in-out infinite}@keyframes co-rte-skeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}.co-rich-text-editor__toolbar{position:relative;flex-shrink:0;z-index:60}.co-rte-content{min-height:96px;color:var(--co-semantic-text-default);flex:1 0 auto;display:flex;flex-direction:column}.co-rte-content .ProseMirror{outline:none;flex:1 0 auto;line-height:1.5;padding:var(--co-spacing-md);box-sizing:border-box}.co-rte-content .ProseMirror p{margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror p:last-child{margin-bottom:0}.co-rte-content .ProseMirror>p{margin-bottom:var(--co-spacing-sm) !important}.co-rte-content .ProseMirror>p:last-child{margin-bottom:0 !important}.co-rte-content .ProseMirror [style*="text-align: justify"]{text-align-last:left}.co-rte-content .ProseMirror [style*="text-align: center"]{text-align:center}.co-rte-content .ProseMirror [style*="text-align: right"]{text-align:right}.co-rte-content .ProseMirror h1,.co-rte-content .ProseMirror h2,.co-rte-content .ProseMirror h3,.co-rte-content .ProseMirror h4{margin:var(--co-spacing-md) 0 var(--co-spacing-sm);font-weight:600;line-height:1.3}.co-rte-content .ProseMirror h1{font-size:var(--co-font-size-28, 28px)}.co-rte-content .ProseMirror h2{font-size:var(--co-font-size-20, 20px)}.co-rte-content .ProseMirror h3{font-size:var(--co-font-size-16, 16px)}.co-rte-content .ProseMirror ul,.co-rte-content .ProseMirror ol{padding-left:var(--co-spacing-xl);margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"]{list-style:none;padding-left:0;margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"] li{display:flex;align-items:flex-start;gap:var(--co-spacing-sm, 8px)}.co-rte-content .ProseMirror ul[data-type="taskList"] li>label{flex:0 0 auto;margin-top:0.15em;user-select:none}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div{flex:1 1 auto;min-width:0}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div>p{margin:0}.co-rte-content .ProseMirror ul[data-type="taskList"] input[type="checkbox"]{width:16px;height:16px;cursor:pointer;accent-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="strike"] li[data-checked="true"]>div{text-decoration:line-through;color:var(--co-semantic-text-muted, #999)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="plain"] li[data-checked="true"]>div{text-decoration:none}.co-rte-content .ProseMirror blockquote{border-left:3px solid var(--co-semantic-border-default, var(--co-semantic-border-subtle));padding-left:var(--co-spacing-md);margin:0 0 var(--co-spacing-sm) 0;color:var(--co-semantic-text-secondary)}.co-rte-content .ProseMirror a{color:var(--co-color-base-negro, #1a1a1a);text-decoration:underline;text-underline-offset:2px}.co-rte-content .ProseMirror img{max-width:100%;height:auto;border-radius:var(--co-border-radius-xs);margin:var(--co-spacing-sm) 0;cursor:default;-webkit-user-drag:none;user-select:none}.co-rte-content .ProseMirror img.ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a)}.co-rte-content [data-resize-container].ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-container]{position:relative;display:inline-block;width:fit-content;max-width:100%;margin:var(--co-spacing-sm) 0;line-height:0}.co-rte-content [data-resize-container][data-resize-state="true"]{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-wrapper]{position:relative;display:inline-block;line-height:0}.co-rte-content [data-resize-handle]{width:10px;height:10px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:5;opacity:0;pointer-events:none}.co-rte-content [data-resize-container][data-resize-state="true"] [data-resize-handle],.co-rte-content [data-resize-container].ProseMirror-selectednode [data-resize-handle]{opacity:1;pointer-events:auto}.co-rte-content [data-resize-handle="top-left"]{cursor:nw-resize}.co-rte-content [data-resize-handle="top-right"]{cursor:ne-resize}.co-rte-content [data-resize-handle="bottom-left"]{cursor:sw-resize}.co-rte-content [data-resize-handle="bottom-right"]{cursor:se-resize}.co-rte-content [data-resize-handle="top"],.co-rte-content [data-resize-handle="bottom"]{width:30px;height:6px;border-radius:3px;left:50% !important;transform:translateX(-50%)}.co-rte-content [data-resize-handle="top"]{cursor:n-resize}.co-rte-content [data-resize-handle="bottom"]{cursor:s-resize}.co-rte-content [data-resize-handle="left"],.co-rte-content [data-resize-handle="right"]{width:6px;height:30px;border-radius:3px;top:50% !important;transform:translateY(-50%)}.co-rte-content [data-resize-handle="left"]{cursor:w-resize}.co-rte-content [data-resize-handle="right"]{cursor:e-resize}.co-rte-content [data-resize-container] img{max-width:100%;display:block;border-radius:0;margin:0}.co-rte-content .ProseMirror hr{border:none;border-top:1px solid var(--co-semantic-border-default, #e0e0e0);margin:var(--co-spacing-lg) 0}.co-rte-content .ProseMirror code{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:0.1em 0.3em;border-radius:var(--co-border-radius-xxs)}.co-rte-content .ProseMirror pre{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:var(--co-spacing-md);border-radius:var(--co-border-radius-xs);overflow-x:auto;margin:var(--co-spacing-sm) 0}.co-rte-content .ProseMirror pre code{background:none;padding:0;border-radius:0}.co-rte-content .ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);color:var(--co-semantic-text-muted);float:left;height:0;pointer-events:none}.co-rte-content .co-rte-variable,.co-rte-content .co-rte-mention{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-size:0.9em;white-space:nowrap}.co-rte-content .co-rte-mention{background:var(--co-color-primary-verde)}.co-rich-text-editor__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm);padding:0 var(--co-spacing-xs);min-height:0}.co-rich-text-editor__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-12, 12px)}.co-rich-text-editor__helper--error{color:var(--co-color-status-error)}.co-rich-text-editor__helper--success{color:var(--co-color-status-success)}.co-rich-text-editor__count{margin-left:auto;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12, 12px)}.co-rte-bubble.co-rte-bubble--suppressed{display:none !important}.co-rte-bubble{position:absolute;z-index:50;display:flex;flex-direction:row;align-items:center;gap:2px;padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);user-select:none;white-space:nowrap}.co-rte-bubble__drag-handle{display:flex;align-items:center;justify-content:center;cursor:grab;color:var(--co-semantic-text-muted, #999);width:18px;height:28px;margin:0 2px 0 0;flex-shrink:0}.co-rte-bubble__drag-handle:hover{color:var(--co-semantic-text-secondary, #555)}.co-rte-bubble__drag-handle:active{cursor:grabbing}.co-rte-bubble__row{display:flex;align-items:center;gap:2px;flex-wrap:nowrap}.co-rte-bubble__btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer}.co-rte-bubble__btn:hover:not(.co-rte-bubble__btn--active){background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-bubble__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-bubble__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-bubble__sep{display:inline-block;width:1px;height:18px;margin:0 4px;background:var(--co-semantic-border-default, rgba(0, 0, 0, 0.12));flex-shrink:0}.co-rte-bubble__select{position:relative}.co-rte-bubble__select-trigger{display:flex;align-items:center;gap:2px;height:28px;padding:0 6px;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;white-space:nowrap;transition:background 0.12s, border-color 0.12s}.co-rte-bubble__select-trigger:hover{background:var(--co-semantic-surface-hover, #f5f5f5);border-color:var(--co-semantic-border-default, #e0e0e0)}.co-rte-bubble__select-label{max-width:72px;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__select--font .co-rte-bubble__select-label{max-width:110px}.co-rte-bubble__select-dropdown{position:absolute;bottom:100%;left:0;z-index:120;min-width:100px;max-height:260px;overflow-y:auto;padding:var(--co-spacing-xxs, 2px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal}.co-rte-bubble__select-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__select-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__select-option{display:block;width:100%;padding:4px 8px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;text-align:left;cursor:pointer;white-space:nowrap}.co-rte-bubble__select-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__select-dropdown--font{min-width:200px;max-height:320px;overflow:hidden;overflow-y:auto;display:flex;flex-direction:column;white-space:normal}.co-rte-bubble__font-search{padding:6px 6px 4px;flex-shrink:0}.co-rte-bubble__font-search-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none;box-sizing:border-box}.co-rte-bubble__font-search-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__font-list{max-height:260px;overflow-y:auto;padding:0 var(--co-spacing-xxs, 2px) var(--co-spacing-xxs, 2px)}.co-rte-bubble__font-section-header{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);text-transform:uppercase;letter-spacing:0.5px}.co-rte-bubble__font-empty{padding:12px 8px;text-align:center;color:var(--co-semantic-text-muted, #888);font-size:12px}.co-rte-bubble__color{position:relative}.co-rte-bubble__color-dropdown{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);z-index:120;width:224px;padding:var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal;max-width:calc(100vw - 16px)}.co-rte-bubble__color-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__color-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__color-grid{display:grid;grid-template-columns:repeat(10, 1fr);gap:2px}.co-rte-bubble__color-swatch{width:20px;height:20px;padding:0;border:none;border-radius:3px;cursor:pointer;transition:transform 0.1s, box-shadow 0.1s}.co-rte-bubble__color-swatch:hover{transform:scale(1.2);box-shadow:0 0 0 2px var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-hex{display:flex;align-items:center;gap:4px;margin-top:6px}.co-rte-bubble__color-hex-input{width:100%;padding:3px 6px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:3px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-mono, monospace);font-size:11px;outline:none}.co-rte-bubble__color-hex-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-clear{display:flex;align-items:center;gap:4px;width:100%;padding:3px 6px;margin-top:4px;border:none;background:transparent;color:var(--co-semantic-text-secondary, #666);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;border-radius:3px}.co-rte-bubble__color-clear:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__link-form{display:flex;align-items:center;gap:4px;margin-left:4px}.co-rte-bubble__link-input{width:160px;padding:3px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none}.co-rte-bubble__link-input::placeholder{color:var(--co-semantic-text-muted, #999)}.co-rte-bubble__link-input:focus{border-color:var(--co-color-base-negro, #1a1a1a);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.1)}.co-rte-bubble__link-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:var(--co-color-base-negro, #1a1a1a);color:#fff;cursor:pointer}.co-rte-bubble__link-btn:hover{opacity:0.9}.co-rte-bubble__link-unlink{background:var(--co-semantic-surface-error, #ef4444)}.co-rte-bubble__panel{position:absolute;z-index:140;width:230px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);overflow:hidden;user-select:none}.co-rte-bubble__panel-header{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--co-semantic-border-subtle, #eee)}.co-rte-bubble__panel-drag{cursor:grab;display:flex;align-items:center;justify-content:center;color:var(--co-semantic-text-muted, #999);flex-shrink:0}.co-rte-bubble__panel-drag:active{cursor:grabbing}.co-rte-bubble__panel-title{flex:1;font-size:12px;font-weight:600;color:var(--co-semantic-text-default, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__panel-close{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-muted, #999);cursor:pointer;flex-shrink:0}.co-rte-bubble__panel-close:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input-wrap{padding:6px 8px}.co-rte-bubble__panel-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:4px;font-size:12px;font-family:inherit;outline:none;box-sizing:border-box;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__panel-options{max-height:280px;overflow-y:auto;padding:2px 4px 4px}.co-rte-bubble__panel-option{display:block;width:100%;padding:5px 8px;border:none;border-radius:3px;background:transparent;cursor:pointer;text-align:left;font-family:inherit;color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__panel-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:4px 8px}.co-rte-bubble__panel-opt-row{display:flex;justify-content:space-between;align-items:center;width:100%}.co-rte-bubble__panel-opt-value{color:var(--co-semantic-text-muted, #999);font-size:11px;font-weight:400 !important;min-width:28px;text-align:right}.co-rte-bubble__panel[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px}.co-rte-bubble__panel[data-position="below"]{top:100%;bottom:auto;margin-top:4px}.co-rte-bubble__overflow{position:relative}.co-rte-bubble__overflow-menu{position:absolute;bottom:100%;right:0;z-index:130;min-width:230px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px}.co-rte-bubble__overflow-menu[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__overflow-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:none;border-radius:4px;background:transparent;font-family:inherit;font-size:13px;color:var(--co-semantic-text-default, #333);cursor:pointer;text-align:left;white-space:nowrap}.co-rte-bubble__overflow-item:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__overflow-item--active{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-color-base-negro, #1a1a1a);font-weight:600}.co-rte-bubble__overflow-value{margin-left:auto;color:var(--co-semantic-text-muted, #999);font-size:11px}.co-rte-bubble__overflow-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:3px 8px}.co-rte-bubble__overflow-section-title{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);letter-spacing:0.5px}.co-rte-bubble__overflow-item--danger{color:var(--co-color-status-error, #aa2e1b)}.co-rte-bubble__overflow-item--danger:hover{background:rgba(170, 46, 27, 0.06)}.co-rte-bubble__color-indicator{display:flex;flex-direction:column;align-items:center;gap:1px;line-height:1}.co-rte-bubble__color-letter{font-family:var(--co-font-family-primary);font-size:14px;font-weight:700;color:var(--co-semantic-text-default, #333);line-height:1}.co-rte-bubble__color-bar{width:14px;height:3px;border-radius:1px}.co-rte-content .callout{display:flex;gap:0.75rem;padding:1rem;border-radius:var(--co-border-radius-xs, 8px);border:2px solid;margin:1rem 0}.co-rte-content .callout--info{background:#eff6ff;border-color:#bfdbfe}.co-rte-content .callout--warning{background:#fffbeb;border-color:#fde68a}.co-rte-content .callout--success{background:#f0fdf4;border-color:#bbf7d0}.co-rte-content .callout--error{background:#fef2f2;border-color:#fecaca}.co-rte-content .callout__icon{flex-shrink:0;font-size:1.2em}.co-rte-content .callout__content{flex:1}.co-rte-content .callout__content p{margin:0}.co-rte-content table{border-collapse:collapse;table-layout:auto;width:100%;margin:1rem 0;overflow:hidden}.co-rte-content .tableWrapper{overflow-x:auto;max-width:100%}.co-rte-content td,.co-rte-content th{min-width:1em;border:1px solid var(--co-semantic-border-default, #e0e0e0);padding:0.5rem;vertical-align:top;box-sizing:border-box;position:relative}.co-rte-content th{font-weight:600;text-align:left;background-color:#e3e3e3;color:var(--co-semantic-text-default, #333)}.co-rte-content .ProseMirror table th{background-color:#e3e3e3}.co-rte-content .selectedCell{background:rgba(0, 0, 0, 0.06)}.co-rte-content .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--co-color-base-negro, #1a1a1a);pointer-events:none}.co-rte-content .ProseMirror.resize-cursor,.co-rte-content .ProseMirror.resize-cursor *{cursor:col-resize}.co-rte-content iframe{border-radius:var(--co-border-radius-xs, 8px);max-width:100%;aspect-ratio:16 / 9;width:100%;height:auto;display:block;margin:0}.co-rte-content .co-rte-embed{position:relative;display:block;max-width:100%;margin:1rem 0;line-height:0}.co-rte-content .co-rte-embed::before{content:\'\';position:absolute;inset:0;z-index:1}.co-rte-content .co-rte-embed.ProseMirror-selectednode,.co-rte-content .co-rte-embed--selected{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:2px;border-radius:var(--co-border-radius-xs, 8px)}.co-rte-content .co-rte-embed__handle{position:absolute;width:12px;height:12px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:3;opacity:0;pointer-events:none}.co-rte-content .co-rte-embed.ProseMirror-selectednode .co-rte-embed__handle,.co-rte-content .co-rte-embed--selected .co-rte-embed__handle{opacity:1;pointer-events:auto}.co-rte-content .co-rte-embed__handle--bottom-right{right:-6px;bottom:-6px;cursor:nwse-resize}.co-rte-content .co-rte-embed__handle--bottom-left{left:-6px;bottom:-6px;cursor:nesw-resize}.co-rte-content .co-rte-embed--resizing{outline:2px dashed var(--co-color-base-negro, #1a1a1a);outline-offset:2px}.co-rich-text-editor--readonly .co-rte-embed::before,.co-rich-text-editor--disabled .co-rte-embed::before{display:none}.co-rich-text-editor--readonly .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--readonly .co-rte-embed--selected,.co-rich-text-editor--disabled .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--disabled .co-rte-embed--selected{outline:none !important}.co-rte-img-layout{position:absolute;z-index:50;display:flex;align-items:center;gap:2px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 2px 12px rgba(0, 0, 0, 0.12);pointer-events:auto}.co-rte-img-layout__btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer;transition:background 0.12s, border-color 0.12s}.co-rte-img-layout__btn:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-img-layout__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-img-layout__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-img-layout__btn[data-tooltip]{position:relative}.co-rte-img-layout__btn[data-tooltip]::after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:4px 8px;background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary);font-size:11px;font-weight:500;line-height:1.3;white-space:nowrap;border-radius:4px;pointer-events:none;opacity:0;transition:opacity 0.12s ease;z-index:100}.co-rte-img-layout__btn[data-tooltip]:hover::after{opacity:1;transition-delay:0.3s}.co-rte-content [data-resize-container][data-image-layout="wrap-left"]{float:left;max-width:50%;margin:4px 16px 8px 0}.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:right;max-width:50%;margin:4px 0 8px 16px}.co-rte-content [data-resize-container][data-image-layout="center"]{display:block;margin:12px auto}.co-rte-content [data-resize-container][data-image-layout="full-width"]{display:block;width:100%;margin:12px 0}.co-rte-content [data-resize-container][data-image-layout="full-width"] [data-resize-wrapper],.co-rte-content [data-resize-container][data-image-layout="full-width"] img{width:100%}@media (max-width: 768px){.co-rte-content [data-resize-container][data-image-layout="wrap-left"],.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:none;max-width:100%;display:block;margin:12px 0}}.co-rte-content--site .ProseMirror{width:var(--co-rte-content-width, 80%);max-width:100%;margin:0 auto}@media (max-width: 768px){.co-rte-content--site .ProseMirror{width:100%}}.co-rich-text-editor--readonly [data-resize-handle],.co-rich-text-editor--disabled [data-resize-handle]{display:none !important}.co-rich-text-editor--readonly [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--disabled [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--readonly img.ProseMirror-selectednode,.co-rich-text-editor--disabled img.ProseMirror-selectednode{outline:none !important}'}},[0,"co-rich-text-editor",{value:[1025],preset:[1],placeholder:[1],label:[1],secondaryLabel:[1,"secondary-label"],helperText:[1,"helper-text"],status:[1],disabled:[4],readonly:[4],required:[4],maxLength:[2,"max-length"],showCharacterCount:[4,"show-character-count"],autofocus:[4],toolbar:[1],features:[1],customExtensions:[16],imageUpload:[16],fontFamilies:[1,"font-families"],accountFonts:[1,"account-fonts"],fontsLoading:[4,"fonts-loading"],fontLoader:[16],locale:[1],ready:[32],hasFocus:[32],getJSON:[64],getHtml:[64],getText:[64],clear:[64],focusEditor:[64],setContent:[64],getEditorInstance:[64]},void 0,{accountFonts:[{onAccountFontsChange:0}],value:[{onValueChange:0}],disabled:[{onEditableChange:0}],readonly:[{onEditableChange:0}]}]);function b(){"undefined"!=typeof customElements&&["co-rich-text-editor","co-icon","co-rich-text-toolbar"].forEach((e=>{switch(e){case"co-rich-text-editor":customElements.get(i(e))||customElements.define(i(e),l);break;case"co-icon":customElements.get(i(e))||s();break;case"co-rich-text-toolbar":customElements.get(i(e))||c()}}))}l.DEFAULT_FONTS=[{label:"Arial",value:"Arial, sans-serif"},{label:"Calibri",value:"Calibri, sans-serif"},{label:"Cambria",value:"Cambria, serif"},{label:"Comic Sans MS",value:"'Comic Sans MS', cursive"},{label:"Courier New",value:"'Courier New', monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Geist",value:"'Geist', sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Inter",value:"'Inter', sans-serif"},{label:"Lato",value:"'Lato', sans-serif"},{label:"Montserrat",value:"'Montserrat', sans-serif"},{label:"Open Sans",value:"'Open Sans', sans-serif"},{label:"Poppins",value:"'Poppins', sans-serif"},{label:"Roboto",value:"'Roboto', sans-serif"},{label:"Segoe UI",value:"'Segoe UI', sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Times New Roman",value:"'Times New Roman', serif"},{label:"Trebuchet MS",value:"'Trebuchet MS', sans-serif"},{label:"Verdana",value:"Verdana, sans-serif"}],l._registeredFonts=new Set,l.IMG_LAYOUT_ICONS={inline:"image-square","wrap-left":"text-align-left","wrap-right":"text-align-right",center:"text-align-center","full-width":"arrows-horizontal"},b();const d=l,u=b;export{d as CoRichTextEditor,u as defineCustomElement}
1
+ import{p as e,H as t,c as o,h as r,t as i}from"./index.js";import{R as n}from"./p-Bgxofdfb.js";import{g as a,d as c}from"./p-B0buzt_E.js";import{d as s}from"./p-CUvAZhuM.js";const l=e(class e extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.coInput=o(this,"coInput",7),this.coChange=o(this,"coChange",7),this.coFocus=o(this,"coFocus",7),this.coBlur=o(this,"coBlur",7),this.coClear=o(this,"coClear",7),this.coReady=o(this,"coReady",7),this.coFontPopupShow=o(this,"coFontPopupShow",7),this.coFontPopupHide=o(this,"coFontPopupHide",7),this.value=null,this.preset="task",this.placeholder="",this.status="default",this.disabled=!1,this.readonly=!1,this.required=!1,this.showCharacterCount=!1,this.autofocus=!1,this.toolbar="auto",this.locale="en",this.ready=!1,this.hasFocus=!1,this.charCount=0,this.bubbleDragged=!1,this.bubbleDragOffset={x:0,y:0},this.bubbleDragPos={x:0,y:0},this.bubblePositionLocked=!1,this.bubbleLockPos={x:0,y:0},this.applyingBubbleLock=!1,this._loadedAccountFonts=[],this._fontLoaderCalled=!1,this._fontLoaderLoading=!1,this.lastEmittedJson=null,this.lastEmittedHtml="",this.applyingExternal=!1,this.rt=n,this.imgLayoutVisible=!1,this.handleUpdate=e=>{if(this.refreshCharCount(),this.applyingExternal)return;const t=this.buildOutput(e);this.lastEmittedJson=t.json?JSON.stringify(t.json):null,this.lastEmittedHtml=t.html,this.coInput.emit(t),this.readonly&&this.coChange.emit(t)},this.handleFocus=()=>{this.hasFocus=!0,this.coFocus.emit()},this.handleBlur=()=>{clearTimeout(this.blurTimeout),this.blurTimeout=setTimeout((()=>{var e,t;(null===(e=this.editor)||void 0===e?void 0:e.isFocused)||(null===(t=this.bubbleEl)||void 0===t?void 0:t.contains(document.activeElement))||(this.hasFocus=!1,this.editor&&this.coChange.emit(this.buildOutput(this.editor)),this.coBlur.emit())}),100)}}async componentDidLoad(){var e,t;if(!this.contentEl)return;const o="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled;o&&(this.bubbleEl=this.createBubbleElement()),this.editor=this.rt.createEditor({preset:this.preset,element:this.contentEl,content:this.parseValue(this.value),editable:!this.disabled&&!this.readonly,placeholder:this.placeholder,maxLength:this.maxLength,features:this.parsedFeatures,customExtensions:null!==(e=this.customExtensions)&&void 0!==e?e:[],bubbleMenuElement:this.bubbleEl,imageUpload:this.imageUpload,onUpdate:e=>this.handleUpdate(e),onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur()}),"document"===this.preset&&this.contentEl.classList.add("co-rte-content--site"),o&&this.imagesEnabled&&(this.contentEl.style.position="relative",this.imgLayoutEl=this.createImageLayoutBar(),this.contentEl.appendChild(this.imgLayoutEl)),this.editor.on("transaction",(({transaction:e})=>{this.bubbleEl&&(this.updateBubbleActiveStates(),(this.bubbleDragged||this.bubblePositionLocked)&&this.bubbleEl&&this.applyBubbleFixedPosition()),this.imagesEnabled&&e.docChanged&&this.syncImageLayouts(),this.updateImageLayoutBar()})),this.bubbleEl&&this.toolbarEl&&(this.toolbarEl.addEventListener("mousedown",(()=>{this.closeBubbleDropdowns()})),this.toolbarEl.addEventListener("coPopoverChange",(e=>{var t;const o=null===(t=e.detail)||void 0===t?void 0:t.open;this.suppressBubble(!!o)}))),this.lastEmittedJson=null!==(t=this.value)&&void 0!==t?t:null,this.ready=!0,this.refreshCharCount(),this.syncToolbar(),this.coReady.emit(),this.autofocus&&this.editor.commands.focus(),requestAnimationFrame((()=>this.syncImageLayouts()))}disconnectedCallback(){var e,t,o,r;clearTimeout(this.blurTimeout),clearTimeout(this.bubbleLockTimer),null===(e=this.bubbleStyleObserver)||void 0===e||e.disconnect(),this.bubbleDragMoveHandler&&document.removeEventListener("mousemove",this.bubbleDragMoveHandler),this.bubbleDragEndHandler&&document.removeEventListener("mouseup",this.bubbleDragEndHandler),this.bubbleOutsideClickHandler&&document.removeEventListener("click",this.bubbleOutsideClickHandler,!0),null===(t=this.editor)||void 0===t||t.destroy(),this.editor=void 0,null===(o=this.bubbleEl)||void 0===o||o.remove(),null===(r=this.imgLayoutEl)||void 0===r||r.remove()}componentDidRender(){this.syncToolbar()}onAccountFontsChange(){var e;if(this._fontDropdownRenderFn){const t=(null===(e=this._fontDropdownSearchInput)||void 0===e?void 0:e.value)||"";this._fontDropdownRenderFn(t)}}onValueChange(e){if(!this.editor||this.applyingExternal)return;const t=null!=e?e:null;if(t!==this.lastEmittedJson&&t!==this.lastEmittedHtml){this.applyingExternal=!0;try{""===t||null===t?this.editor.commands.clearContent(!1):this.editor.commands.setContent(this.parseValue(e),{emitUpdate:!1})}finally{this.applyingExternal=!1,this.lastEmittedJson=t,this.lastEmittedHtml="",this.refreshCharCount()}}}onEditableChange(){var e;null===(e=this.editor)||void 0===e||e.setEditable(!this.disabled&&!this.readonly)}async getJSON(){return this.editor&&!this.editor.isEmpty?this.editor.getJSON():null}async getHtml(){return this.editor?this.sanitizeHtml(this.editor.getHTML()):""}async getText(){var e,t;return null!==(t=null===(e=this.editor)||void 0===e?void 0:e.getText())&&void 0!==t?t:""}async clear(){this.editor&&(this.editor.commands.clearContent(!0),this.coClear.emit())}async focusEditor(){var e;null===(e=this.editor)||void 0===e||e.commands.focus()}async setContent(e){var t;null===(t=this.editor)||void 0===t||t.commands.setContent(e)}async getEditorInstance(){var e;return null!==(e=this.editor)&&void 0!==e?e:null}get imagesEnabled(){var e;const t=this.parsedFeatures;return null!==(e=null==t?void 0:t.image)&&void 0!==e?e:"document"===this.preset}get parsedFeatures(){if(this.features){if("string"==typeof this.features)try{return JSON.parse(this.features)}catch(e){return}return this.features}}parseValue(e){if(!e)return"";try{return JSON.parse(e)}catch(t){return e}}sanitizeHtml(e){return this.rt.sanitize(e,this.preset)}buildOutput(e){const t=e.isEmpty;return{json:t?null:e.getJSON(),html:t?"":this.sanitizeHtml(e.getHTML()),text:e.getText()}}lockBubblePosition(e=1e3){if(!this.bubbleEl)return;const t=this.bubbleEl.getBoundingClientRect();0!==t.width&&(this.bubbleLockPos={x:t.left,y:t.top},this.bubblePositionLocked=!0,clearTimeout(this.bubbleLockTimer),this.bubbleLockTimer=setTimeout((()=>{this.bubblePositionLocked=!1}),e))}applyBubbleFixedPosition(){if(!this.bubbleEl)return;const e=this.bubbleDragged?this.bubbleDragPos:this.bubbleLockPos;this.applyingBubbleLock=!0,this.bubbleEl.style.position="fixed",this.bubbleEl.style.top=e.y+"px",this.bubbleEl.style.left=e.x+"px",this.bubbleEl.style.transform="none",this.bubbleEl.style.visibility="visible",requestAnimationFrame((()=>{this.applyingBubbleLock=!1}))}setupBubbleStyleObserver(e){e.addEventListener("co-bubble-hide",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1,clearTimeout(this.bubbleLockTimer),this.closeBubbleDropdowns(),e.style.position="",e.style.top="",e.style.left="",e.style.transform=""})),e.addEventListener("co-bubble-show",(()=>{this.bubbleDragged=!1,this.bubblePositionLocked=!1})),this.bubbleStyleObserver=new MutationObserver((()=>{this.applyingBubbleLock||(this.bubblePositionLocked||this.bubbleDragged)&&this.applyBubbleFixedPosition()})),this.bubbleStyleObserver.observe(e,{attributes:!0,attributeFilter:["style"]})}suppressBubble(e){this.bubbleEl&&(this.bubbleEl.classList.toggle("co-rte-bubble--suppressed",e),e&&this.closeBubbleDropdowns())}closeBubbleDropdowns(){this.bubbleEl&&(this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{e.style.display="none"})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{e.style.display="none"})),this.bubbleLinkFormEl&&(this.bubbleLinkFormEl.style.display="none"))}refreshCharCount(){var e;const t=null===(e=this.editor)||void 0===e?void 0:e.storage;(null==t?void 0:t.characterCount)&&(this.charCount=t.characterCount.characters(),this.charCountEl&&(this.charCountEl.textContent=null!=this.maxLength?`${this.charCount} / ${this.maxLength}`:""+this.charCount))}syncToolbar(){this.toolbarEl&&this.editor&&this.toolbarEl.editor!==this.editor&&(this.toolbarEl.editor=this.editor),this.toolbarEl&&(this.toolbarEl.imageUpload=this.imageUpload)}get resolvedToolbar(){return"auto"!==this.toolbar?this.toolbar:this.rt.defaultToolbarForPreset(this.preset)}get resolvedFontFamilies(){if(!this.fontFamilies)return e.DEFAULT_FONTS;if("string"==typeof this.fontFamilies)try{return JSON.parse(this.fontFamilies)}catch(t){return e.DEFAULT_FONTS}return this.fontFamilies}get resolvedAccountFonts(){if(this.accountFonts){if("string"==typeof this.accountFonts)try{return JSON.parse(this.accountFonts)}catch(e){return[]}return this.accountFonts}return this._loadedAccountFonts}registerFontFace(t,o){if(o&&t&&!e._registeredFonts.has(t)){e._registeredFonts.add(t);try{const e=new FontFace(t,`url("${o}")`);e.load().then((()=>document.fonts.add(e))).catch((()=>{}))}catch(e){}}}async loadFontsViaCallback(){var e,t,o;if(!this._fontLoaderCalled&&this.fontLoader){this._fontLoaderCalled=!0,this._fontLoaderLoading=!0,null===(e=this._fontDropdownRenderFn)||void 0===e||e.call(this,"");try{const e=await this.fontLoader();Array.isArray(e)&&(this._loadedAccountFonts=e.map((e=>(e.url&&this.registerFontFace(e.label,e.url),{label:e.label,value:e.value}))))}catch(e){console.error("[co-rich-text-editor] fontLoader error",e)}finally{this._fontLoaderLoading=!1;const e=(null===(t=this._fontDropdownSearchInput)||void 0===t?void 0:t.value)||"";null===(o=this._fontDropdownRenderFn)||void 0===o||o.call(this,e)}}}get helperIcon(){switch(this.status){case"error":case"warning":return"warning-circle";case"success":return"check-circle";default:return"info"}}createBubbleElement(){const e=document.createElement("div");e.className="co-rte-bubble",e.style.visibility="hidden",e.style.position="absolute",e.style.top="0",e.style.left="0",e.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),this.bubbleOutsideClickHandler=t=>{e.contains(t.target)||this.closeBubbleDropdowns()},document.addEventListener("click",this.bubbleOutsideClickHandler,!0),this.setupBubbleStyleObserver(e);const t="document"===this.preset;if(t){const t=document.createElement("div");t.className="co-rte-bubble__drag-handle",t.innerHTML='<co-icon name="dots-six-vertical" size="14"></co-icon>',t.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const o=e.getBoundingClientRect();this.bubbleDragOffset={x:t.clientX-o.left,y:t.clientY-o.top},this.bubbleDragged||(this.bubbleDragPos={x:o.left,y:o.top}),this.bubbleDragged=!0,this.bubbleDragMoveHandler=t=>{this.bubbleDragPos.x=t.clientX-this.bubbleDragOffset.x,this.bubbleDragPos.y=t.clientY-this.bubbleDragOffset.y,e.style.position="fixed",e.style.top=this.bubbleDragPos.y+"px",e.style.left=this.bubbleDragPos.x+"px",e.style.transform="none",e.style.visibility="visible"},this.bubbleDragEndHandler=()=>{document.removeEventListener("mousemove",this.bubbleDragMoveHandler),document.removeEventListener("mouseup",this.bubbleDragEndHandler)},document.addEventListener("mousemove",this.bubbleDragMoveHandler),document.addEventListener("mouseup",this.bubbleDragEndHandler)})),e.appendChild(t)}const o=document.createElement("div");o.className="co-rte-bubble__row";let r=null,i=null,n=null,c=null,s=null,l=null;if(t){const e=this.createBubbleFontFamilySelect();o.appendChild(e),r=this.createBubbleFontSizePanel(),o.appendChild(r.wrap),i=this.createBubbleFontWeightPanel(),o.appendChild(i.wrap),o.appendChild(this.createSep());const t=this.createBubbleColorPicker("textColor",(e=>{this.editor&&this.editor.chain().focus().setColor(e).run()}));o.appendChild(t),o.appendChild(this.createSep())}const b=a(this.locale),d=[{action:"bold",icon:"text-b",label:b.bold,check:"bold"},{action:"italic",icon:"text-italic",label:b.italic,check:"italic"}];"comment"!==this.preset&&d.push({action:"underline",icon:"text-underline",label:b.underline,check:"underline"}),d.forEach((({action:e,icon:t,label:r,check:i})=>{const n=this.createBubbleBtn(t,r,e,i,(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"bold":t.toggleBold().run();break;case"italic":t.toggleItalic().run();break;case"underline":t.toggleUnderline().run()}}));o.appendChild(n)})),o.appendChild(this.createSep()),(t||"email"===this.preset)&&([{align:"left",icon:"text-align-left",label:b.alignLeft},{align:"center",icon:"text-align-center",label:b.center},{align:"right",icon:"text-align-right",label:b.alignRight},{align:"justify",icon:"text-align-justify",label:b.justify}].forEach((({align:e,icon:t,label:r})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn",i.title=r,i.setAttribute("aria-label",r),i.setAttribute("data-action","textAlign"),i.setAttribute("data-align",e),i.innerHTML=`<co-icon name="${t}" size="16"></co-icon>`,i.addEventListener("click",(()=>{this.editor&&this.editor.chain().focus().setTextAlign(e).run()})),o.appendChild(i)})),o.appendChild(this.createSep())),"comment"===this.preset||t||(o.appendChild(this.createBubbleBtn("list-bullets",b.bulletList,"bulletList","bulletList",(()=>{this.editor&&this.editor.chain().focus().toggleBulletList().run()}))),o.appendChild(this.createBubbleBtn("list-numbers",b.orderedList,"orderedList","orderedList",(()=>{this.editor&&this.editor.chain().focus().toggleOrderedList().run()}))),o.appendChild(this.createSep()));const u=this.createBubbleBtn("link",b.link,"link","link",(()=>{this.editor&&this.toggleBubbleLinkForm(!0)}));o.appendChild(u),t&&(o.appendChild(this.createSep()),n=this.createBubbleLineHeightPanel(),c=this.createBubbleLetterSpacingPanel(),s=this.createBubbleBgColorPanel(),l=this.createBubbleOverflowMenu({lineHeight:n,letterSpacing:c,bgColor:s}),o.appendChild(l.overflowWrap)),e.appendChild(o),t&&(r&&e.appendChild(r.panelEl),i&&e.appendChild(i.panelEl),n&&e.appendChild(n),c&&e.appendChild(c),s&&e.appendChild(s));const h=document.createElement("div");h.className="co-rte-bubble__link-form",h.style.display="none",this.bubbleLinkFormEl=h;const p=document.createElement("input");p.type="url",p.className="co-rte-bubble__link-input",p.placeholder="https://...",this.bubbleLinkInputEl=p,p.addEventListener("keydown",(e=>{"Enter"===e.key&&this.submitBubbleLinkImperative(),"Escape"===e.key&&this.toggleBubbleLinkForm(!1)}));const f=document.createElement("button");f.type="button",f.className="co-rte-bubble__link-btn",f.innerHTML='<co-icon name="check" size="14"></co-icon>',f.addEventListener("click",(()=>this.submitBubbleLinkImperative()));const m=document.createElement("button");return m.type="button",m.className="co-rte-bubble__link-btn co-rte-bubble__link-unlink",m.title=b.unlinkLink,m.innerHTML='<co-icon name="link-break" size="14"></co-icon>',m.addEventListener("click",(()=>{this.editor&&(this.editor.chain().focus().unsetLink().run(),this.toggleBubbleLinkForm(!1))})),this.bubbleLinkUnlinkEl=m,h.appendChild(p),h.appendChild(f),h.appendChild(m),e.appendChild(h),e}createSep(){const e=document.createElement("span");return e.className="co-rte-bubble__sep",e}positionDropdown(e,t){const o=e.getBoundingClientRect();t.removeAttribute("data-position"),t.style.removeProperty("left"),t.style.removeProperty("transform");const r=t.offsetWidth||224,i=window.innerHeight-o.bottom;if(t.setAttribute("data-position",i>=(t.offsetHeight||320)||i>o.top?"below":"above"),t.classList.contains("co-rte-bubble__color-dropdown")){const o=(e.parentElement||e).getBoundingClientRect(),i=o.left+o.width/2-r/2,n=i+r,a=8;i<a?(t.style.left="0",t.style.transform="none"):n>window.innerWidth-a&&(t.style.left="auto",t.style.right="0",t.style.transform="none")}}positionPanelNearBubble(e){if(!this.bubbleEl)return;const t=this.bubbleEl.querySelector(".co-rte-bubble__overflow-menu"),o=t&&"none"!==t.style.display?t.getBoundingClientRect():this.bubbleEl.getBoundingClientRect(),r=e.offsetHeight||320,i=e.offsetWidth||230;let n=o.top;n+r>window.innerHeight-8&&(n=window.innerHeight-8-r),n<8&&(n=8);let a=o.left-i-4;a<8&&(a=o.right+4),a+i>window.innerWidth-8&&(a=window.innerWidth-8-i),e.style.position="fixed",e.style.top=n+"px",e.style.left=a+"px",e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")}createBubbleBtn(e,t,o,r,i){const n=document.createElement("button");return n.type="button",n.className="co-rte-bubble__btn",n.title=t,n.setAttribute("aria-label",t),n.setAttribute("data-action",o),n.setAttribute("data-check",r),n.innerHTML=`<co-icon name="${e}" size="16"></co-icon>`,n.addEventListener("click",i),n}createBubbleFontFamilySelect(){const e=document.createElement("div");e.className="co-rte-bubble__select co-rte-bubble__select--font",e.setAttribute("data-select","fontFamily");const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__select-trigger",t.innerHTML='<span class="co-rte-bubble__select-label">Sans-serif</span><co-icon name="caret-down" size="12"></co-icon>';const o=document.createElement("div");o.className="co-rte-bubble__select-dropdown co-rte-bubble__select-dropdown--font",o.style.display="none";const r=document.createElement("div");r.className="co-rte-bubble__font-search";const i=document.createElement("input");i.type="text",i.className="co-rte-bubble__font-search-input",i.placeholder=a(this.locale).searchFont,r.appendChild(i),o.appendChild(r);const n=document.createElement("div");n.className="co-rte-bubble__font-list",o.appendChild(n);const c=(e,r)=>{const n=document.createElement("button");return n.type="button",n.className="co-rte-bubble__select-option",n.setAttribute("data-value",r),n.textContent=e,n.style.fontFamily=r.includes(",")?r:`"${r}", sans-serif`,n.addEventListener("click",(()=>{if(!this.editor)return;this.editor.chain().focus().setFontFamily(r).run(),o.style.display="none";const n=t.querySelector(".co-rte-bubble__select-label");n&&(n.textContent=e),i.value="",this.coFontPopupHide.emit()})),n},s=e=>{n.innerHTML="";const t=e.toLowerCase(),o=this.resolvedAccountFonts,r=this.resolvedFontFamilies,i=t?o.filter((e=>e.label.toLowerCase().includes(t))):o,s=t?r.filter((e=>e.label.toLowerCase().includes(t))):r;if(!i.length&&!s.length){const e=document.createElement("div");return e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).noResults,void n.appendChild(e)}if((this.fontsLoading||this._fontLoaderLoading)&&!i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-empty",e.textContent=a(this.locale).loadingFonts,n.appendChild(e)}if(i.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).importedFonts,n.appendChild(e),i.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}if(s.length){const e=document.createElement("div");e.className="co-rte-bubble__font-section-header",e.textContent=a(this.locale).systemFonts,n.appendChild(e),s.forEach((({label:e,value:t})=>n.appendChild(c(e,t))))}};return i.addEventListener("input",(()=>s(i.value))),this._fontDropdownRenderFn=s,this._fontDropdownSearchInput=i,t.addEventListener("click",(()=>{const r=e.closest(".co-rte-bubble");r&&(r.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==o&&(e.style.display="none")})),r.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const n="none"!==o.style.display;o.style.display=n?"none":"block",n?this.coFontPopupHide.emit():(this.coFontPopupShow.emit(),this.loadFontsViaCallback(),this.positionDropdown(t,o),s(""),setTimeout((()=>i.focus()),0))})),e.appendChild(t),e.appendChild(o),e}createBubbleSelect(e,t,o,r){const i=document.createElement("div");i.className="co-rte-bubble__select",i.setAttribute("data-select",e);const n=document.createElement("button");n.type="button",n.className="co-rte-bubble__select-trigger",n.innerHTML=`<span class="co-rte-bubble__select-label">${o}</span><co-icon name="caret-down" size="12"></co-icon>`;const a=document.createElement("div");return a.className="co-rte-bubble__select-dropdown",a.style.display="none",t.forEach((({label:t,value:o})=>{const i=document.createElement("button");i.type="button",i.className="co-rte-bubble__select-option",i.setAttribute("data-value",o),i.textContent=t,"fontWeight"===e&&(i.style.fontWeight=o),i.addEventListener("click",(()=>{r(o),a.style.display="none";const e=n.querySelector(".co-rte-bubble__select-label");e&&(e.textContent=t)})),a.appendChild(i)})),n.addEventListener("click",(()=>{const e=i.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e!==a&&(e.style.display="none")})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e.style.display="none"})));const t="none"!==a.style.display;a.style.display=t?"none":"block",t||this.positionDropdown(n,a)})),i.appendChild(n),i.appendChild(a),i}createBubbleColorPicker(e,t){const o=document.createElement("div");o.className="co-rte-bubble__color",o.setAttribute("data-color",e);const r="textColor"===e?"":"highlighter",i=document.createElement("button");i.type="button",i.className="co-rte-bubble__btn";const n=a(this.locale);i.title="textColor"===e?n.textColor:n.backgroundColor,i.innerHTML="textColor"===e?'<span class="co-rte-bubble__color-indicator"><span class="co-rte-bubble__color-letter">A</span><span class="co-rte-bubble__color-bar" style="background:#000000"></span></span>':`<co-icon name="${r}" size="16"></co-icon>`;const c=document.createElement("div");c.className="co-rte-bubble__color-dropdown",c.style.display="none";const s="textColor"===e?n.textColor:n.backgroundColor,{resetDrag:l}=this.addDragHeader(c,s);c.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()}));const b=document.createElement("div");b.className="co-rte-bubble__color-grid",["#000000","#434343","#666666","#999999","#b7b7b7","#cccccc","#d9d9d9","#efefef","#f3f3f3","#ffffff","#980000","#ff0000","#ff9900","#ffff00","#00ff00","#00ffff","#4a86e8","#0000ff","#9900ff","#ff00ff","#e6b8af","#f4cccc","#fce5cd","#fff2cc","#d9ead3","#d0e0e3","#c9daf8","#cfe2f3","#d9d2e9","#ead1dc"].forEach((e=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__color-swatch",o.style.background=e,"#ffffff"===e&&(o.style.border="1px solid #e0e0e0"),o.addEventListener("click",(()=>{t(e),c.style.display="none"})),b.appendChild(o)}));const d=document.createElement("div");d.className="co-rte-bubble__color-hex";const u=document.createElement("input");u.type="text",u.className="co-rte-bubble__color-hex-input",u.placeholder="#hex",u.maxLength=7,u.addEventListener("keydown",(e=>{if("Enter"===e.key){const e=u.value.trim();/^#[0-9a-fA-F]{3,6}$/.test(e)&&(t(e),c.style.display="none",u.value="")}}));const h=document.createElement("button");return h.type="button",h.className="co-rte-bubble__color-clear",h.innerHTML='<co-icon name="x" size="12"></co-icon> '+n.noColor,h.addEventListener("click",(()=>{this.editor&&("textColor"===e?this.editor.chain().focus().unsetColor().run():this.editor.chain().focus().unsetHighlight().run(),c.style.display="none")})),c.appendChild(b),d.appendChild(u),c.appendChild(d),c.appendChild(h),i.addEventListener("click",(()=>{const e=o.closest(".co-rte-bubble");e&&(e.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{e.style.display="none"})),e.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{e!==c&&(e.style.display="none")}))),"none"!==c.style.display?c.style.display="none":(l(),c.style.position="",c.style.top="",c.style.left="",c.style.bottom="",c.style.right="",c.style.transform="",c.style.display="block",this.positionDropdown(i,c))})),o.appendChild(i),o.appendChild(c),o}closeAllBubblePopups(...e){if(!this.bubbleEl)return;const t=e.filter(Boolean);this.bubbleEl.querySelectorAll(".co-rte-bubble__select-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__color-dropdown").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__panel").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-menu").forEach((e=>{t.includes(e)||(e.style.display="none")})),this.bubbleLinkFormEl&&!t.includes(this.bubbleLinkFormEl)&&(this.bubbleLinkFormEl.style.display="none")}addDragHeader(e,t){let o=!1,r={x:0,y:0},i={x:0,y:0};const n=document.createElement("div");n.className="co-rte-bubble__panel-header";const a=document.createElement("div");a.className="co-rte-bubble__panel-drag",a.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const c=document.createElement("span");c.className="co-rte-bubble__panel-title",c.textContent=t;const s=document.createElement("button");return s.type="button",s.className="co-rte-bubble__panel-close",s.innerHTML='<co-icon name="x" size="14"></co-icon>',s.addEventListener("click",(()=>{e.style.display="none"})),n.appendChild(a),n.appendChild(c),n.appendChild(s),a.addEventListener("mousedown",(t=>{t.preventDefault(),t.stopPropagation();const n=e.getBoundingClientRect();i={x:t.clientX-n.left,y:t.clientY-n.top},o||(r={x:n.left,y:n.top}),o=!0;const a=t=>{r.x=t.clientX-i.x,r.y=t.clientY-i.y,e.style.position="fixed",e.style.top=r.y+"px",e.style.left=r.x+"px",e.style.bottom="auto",e.style.right="auto",e.style.transform="none",e.removeAttribute("data-position")},c=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",c)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",c)})),e.insertBefore(n,e.firstChild),{header:n,resetDrag:()=>{o=!1}}}createBubblePanel(e){const t=document.createElement("div");t.className="co-rte-bubble__select",t.setAttribute("data-select",e.name);const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__select-trigger",o.innerHTML=`<span class="co-rte-bubble__select-label">${e.triggerLabel}</span><co-icon name="caret-down" size="12"></co-icon>`;const r=document.createElement("div");r.className="co-rte-bubble__panel",r.setAttribute("data-panel",e.name),r.style.display="none";const i=document.createElement("div");i.className="co-rte-bubble__panel-header";const n=document.createElement("div");n.className="co-rte-bubble__panel-drag",n.innerHTML='<co-icon name="dots-six" size="14"></co-icon>';const a=document.createElement("span");a.className="co-rte-bubble__panel-title",a.textContent=e.title;const c=document.createElement("button");c.type="button",c.className="co-rte-bubble__panel-close",c.innerHTML='<co-icon name="x" size="14"></co-icon>',c.addEventListener("click",(()=>{r.style.display="none"})),i.appendChild(n),i.appendChild(a),i.appendChild(c),r.appendChild(i);let s=!1,l={x:0,y:0},b={x:0,y:0};if(n.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation();const t=r.getBoundingClientRect();b={x:e.clientX-t.left,y:e.clientY-t.top},s||(l={x:t.left,y:t.top}),s=!0;const o=e=>{l.x=e.clientX-b.x,l.y=e.clientY-b.y,r.style.position="fixed",r.style.top=l.y+"px",r.style.left=l.x+"px",r.style.bottom="auto",r.style.right="auto",r.style.transform="none",r.removeAttribute("data-position")},i=()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",i)})),e.hasCustomInput){const t=document.createElement("div");t.className="co-rte-bubble__panel-input-wrap";const o=document.createElement("input");o.type=e.inputType||"text",o.className="co-rte-bubble__panel-input",o.placeholder=e.inputPlaceholder||"",o.addEventListener("mousedown",(e=>e.stopPropagation())),o.addEventListener("keydown",(t=>{if("Enter"===t.key){const t=o.value.trim();t&&e.onCustomInput&&(e.onCustomInput(t),o.value="")}"Escape"===t.key&&(r.style.display="none")})),t.appendChild(o),r.appendChild(t)}const d=document.createElement("div");return d.className="co-rte-bubble__panel-options",e.options.forEach((t=>{const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__panel-option",o.setAttribute("data-value",t.value),e.renderOption?e.renderOption(t,o):o.textContent=t.label,o.addEventListener("click",(()=>{e.onSelect(t.value),r.style.display="none",s=!1})),d.appendChild(o)})),r.appendChild(d),r.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),o.addEventListener("click",(()=>{this.closeAllBubblePopups(r),"none"!==r.style.display?r.style.display="none":(s=!1,r.style.position="",r.style.top="",r.style.left="",r.style.bottom="",r.style.right="",r.style.transform="",r.style.display="block",this.positionDropdown(o,r))})),t.appendChild(o),{wrap:t,panelEl:r,updateLabel:e=>{const t=o.querySelector(".co-rte-bubble__select-label");t&&(t.textContent=e)}}}createBubbleFontSizePanel(){const e=a(this.locale),t=[{label:e.title,value:"h1"},{label:e.heading1,value:"h2"},{label:e.heading2,value:"h3"},{label:"---",value:"---"},...["8px","10px","12px","14px","16px","18px","20px","24px","28px","32px","36px","48px","64px","72px"].map((e=>({label:e,value:e})))];return this.createBubblePanel({name:"fontSize",title:e.fontSize,triggerLabel:"16px",hasCustomInput:!0,inputType:"number",inputPlaceholder:e.writeSize,options:t,renderOption:(e,t)=>{if("---"===e.value)return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");"h1"===e.value?(t.textContent=e.label,t.style.fontSize="24px",t.style.fontWeight="700",t.style.padding="6px 8px"):"h2"===e.value?(t.textContent=e.label,t.style.fontSize="18px",t.style.fontWeight="700",t.style.padding="5px 8px"):"h3"===e.value?(t.textContent=e.label,t.style.fontSize="15px",t.style.fontWeight="700",t.style.padding="4px 8px"):(t.textContent=e.label,t.style.fontSize=Math.min(parseInt(e.value),36)+"px",t.style.lineHeight="1.3")},onSelect:e=>{if(!this.editor||"---"===e)return;const t=this.editor.chain().focus();"h1"===e?t.toggleHeading({level:1}).run():"h2"===e?t.toggleHeading({level:2}).run():"h3"===e?t.toggleHeading({level:3}).run():t.setFontSize(e).run()},onCustomInput:e=>{if(!this.editor)return;const t=parseInt(e);t>0&&this.editor.chain().focus().setFontSize(t+"px").run()}})}createBubbleFontWeightPanel(){return this.createBubblePanel({name:"fontWeight",title:a(this.locale).fontWeight,triggerLabel:"Regular",hasCustomInput:!1,options:[{label:"Thin",value:"100"},{label:"Extra Light",value:"200"},{label:"Light",value:"300"},{label:"Regular",value:"400"},{label:"Medium",value:"500"},{label:"Semi Bold",value:"600"},{label:"Bold",value:"700"},{label:"Extra Bold",value:"800"},{label:"Black",value:"900"}],renderOption:(e,t)=>{t.style.fontWeight=e.value,t.innerHTML=`<span class="co-rte-bubble__panel-opt-row"><span>${e.label}</span><span class="co-rte-bubble__panel-opt-value">${e.value}</span></span>`},onSelect:e=>{this.editor&&this.editor.chain().focus().setFontWeight(e).run()}})}createBubbleLineHeightPanel(){const{panelEl:e}=this.createBubblePanel({name:"lineHeight",title:a(this.locale).lineSpacing,triggerLabel:"1.5",hasCustomInput:!0,inputPlaceholder:"1.5, 20px, 150%...",options:[{label:"0.5",value:"0.5"},{label:"1",value:"1"},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"1.75",value:"1.75"},{label:"2",value:"2"},{label:"2.5",value:"2.5"},{label:"3",value:"3"},{label:"---",value:"---"},{label:"16px",value:"16px"},{label:"20px",value:"20px"},{label:"24px",value:"24px"},{label:"32px",value:"32px"},{label:"---",value:"---2"},{label:"100%",value:"100%"},{label:"150%",value:"150%"},{label:"200%",value:"200%"}],renderOption:(e,t)=>{if(e.value.startsWith("---"))return t.className="co-rte-bubble__panel-sep",t.disabled=!0,void(t.style.pointerEvents="none");t.textContent=e.label},onSelect:e=>{this.editor&&!e.startsWith("---")&&this.editor.chain().focus().setLineHeight(e).run()},onCustomInput:e=>{this.editor&&this.editor.chain().focus().setLineHeight(e).run()}});return e}createBubbleLetterSpacingPanel(){const{panelEl:e}=this.createBubblePanel({name:"letterSpacing",title:a(this.locale).letterSpacing,triggerLabel:a(this.locale).normal,hasCustomInput:!0,inputPlaceholder:"Custom (em)...",options:[{label:"-0.05em",value:"-0.05em"},{label:"Normal",value:"normal"},{label:"0.05em",value:"0.05em"},{label:"0.1em",value:"0.1em"},{label:"0.2em",value:"0.2em"}],onSelect:e=>{this.editor&&("normal"===e?this.editor.chain().focus().unsetLetterSpacing().run():this.editor.chain().focus().setLetterSpacing(e).run())},onCustomInput:e=>{if(!this.editor)return;const t=e.includes("em")||e.includes("px")?e:e+"em";this.editor.chain().focus().setLetterSpacing(t).run()}});return e}createBubbleBgColorPanel(){const e=this.createBubbleColorPicker("bgColor",(e=>{this.editor&&this.editor.chain().focus().toggleHighlight({color:e}).run()})),t=e.querySelector(".co-rte-bubble__btn");return t&&(t.style.display="none"),e}createBubbleOverflowMenu(e){const t=document.createElement("div");t.className="co-rte-bubble__overflow";const o=document.createElement("button");o.type="button",o.className="co-rte-bubble__btn";const r=a(this.locale);o.title=r.moreOptions,o.setAttribute("aria-label",r.moreOptions),o.innerHTML='<co-icon name="dots-three" size="16"></co-icon>';const i=document.createElement("div");i.className="co-rte-bubble__overflow-menu",i.style.display="none";const{resetDrag:n}=this.addDragHeader(i,r.moreOptions);i.addEventListener("mousedown",(e=>{"INPUT"!==e.target.tagName&&e.preventDefault(),this.lockBubblePosition()})),[{icon:"text-strikethrough",label:r.strikethrough,action:"strike",check:"strike",type:"toggle"},{icon:"highlighter",label:r.backgroundColor,action:"bgColor",type:"panel",panel:e.bgColor},{icon:"list-bullets",label:r.bulletList,action:"bulletList",check:"bulletList",type:"toggle"},{icon:"list-numbers",label:r.orderedList,action:"orderedList",check:"orderedList",type:"toggle"},{icon:"text-superscript",label:r.superscript,action:"superscript",check:"superscript",type:"toggle"},{icon:"text-subscript",label:r.subscript,action:"subscript",check:"subscript",type:"toggle"},{icon:"line-segments",label:r.lineSpacing,action:"lineHeight",type:"panel",panel:e.lineHeight,valueAttr:"lineHeight"},{icon:"text-aa",label:r.letterSpacing,action:"letterSpacing",type:"panel",panel:e.letterSpacing,valueAttr:"letterSpacing"},{icon:"minus",label:r.horizontalRule,action:"horizontalRule",type:"toggle"},{icon:"eraser",label:r.clearFormat,action:"clearFormat",type:"toggle"}].forEach((e=>{if("lineHeight"===e.action||"horizontalRule"===e.action){const e=document.createElement("div");e.className="co-rte-bubble__overflow-sep",i.appendChild(e)}const t=document.createElement("button");t.type="button",t.className="co-rte-bubble__overflow-item",t.setAttribute("data-overflow-item",e.action),e.check&&t.setAttribute("data-check",e.check);let o="";e.valueAttr&&(o=`<span class="co-rte-bubble__overflow-value" data-overflow-value="${e.valueAttr}"></span>`),t.innerHTML=`<co-icon name="${e.icon}" size="16"></co-icon><span>${e.label}</span>${o}`,t.addEventListener("click",(()=>{if(!this.editor)return;if("panel"===e.type&&e.panel){if("bgColor"===e.action){const t=e.panel.querySelector(".co-rte-bubble__color-dropdown");if(t){const e="none"!==t.style.display;this.closeAllBubblePopups(i,e?void 0:t),t.style.display=e?"none":"block",e||this.positionPanelNearBubble(t)}}else{const t="none"!==e.panel.style.display;this.closeAllBubblePopups(i,t?void 0:e.panel),e.panel.style.display=t?"none":"block",t||this.positionPanelNearBubble(e.panel)}return}const t=this.editor.chain().focus();switch(e.action){case"strike":t.toggleStrike().run();break;case"bulletList":t.toggleBulletList().run();break;case"orderedList":t.toggleOrderedList().run();break;case"superscript":t.toggleSuperscript().run();break;case"subscript":t.toggleSubscript().run();break;case"horizontalRule":t.setHorizontalRule().run(),i.style.display="none";break;case"clearFormat":t.unsetAllMarks().clearNodes().run(),i.style.display="none"}})),i.appendChild(t)}));const c=document.createElement("div");c.className="co-rte-bubble__overflow-table-section",c.style.display="none";const s=document.createElement("div");s.className="co-rte-bubble__overflow-sep",c.appendChild(s);const l=document.createElement("div");l.className="co-rte-bubble__overflow-section-title",l.textContent=r.tableOptions,c.appendChild(l),[{action:"addColumnBefore",icon:"columns-plus-left",label:r.addColumnBefore},{action:"addColumnAfter",icon:"columns-plus-right",label:r.addColumnAfter},{action:"addRowBefore",icon:"rows-plus-top",label:r.addRowAbove},{action:"addRowAfter",icon:"rows-plus-bottom",label:r.addRowBelow},{action:"mergeCells",icon:"arrows-merge",label:r.mergeCells},{action:"splitCell",icon:"arrows-split",label:r.splitCell},{action:"toggleHeaderRow",icon:"rows",label:r.headerRow}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item",r.setAttribute("data-overflow-item",e),"toggleHeaderRow"===e&&r.setAttribute("data-check","toggleHeaderRow"),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"addColumnAfter":t.addColumnAfter().run();break;case"addColumnBefore":t.addColumnBefore().run();break;case"addRowAfter":t.addRowAfter().run();break;case"addRowBefore":t.addRowBefore().run();break;case"mergeCells":t.mergeCells().run();break;case"splitCell":t.splitCell().run();break;case"toggleHeaderRow":t.toggleHeaderRow().run()}})),c.appendChild(r)}));const b=document.createElement("div");return b.className="co-rte-bubble__overflow-sep",c.appendChild(b),[{action:"deleteColumn",icon:"minus-square",label:r.deleteColumn},{action:"deleteRow",icon:"x-square",label:r.deleteRow},{action:"deleteTable",icon:"trash",label:r.deleteTable}].forEach((({action:e,icon:t,label:o})=>{const r=document.createElement("button");r.type="button",r.className="co-rte-bubble__overflow-item co-rte-bubble__overflow-item--danger",r.setAttribute("data-overflow-item",e),r.innerHTML=`<co-icon name="${t}" size="16"></co-icon><span>${o}</span>`,r.addEventListener("click",(()=>{if(!this.editor)return;const t=this.editor.chain().focus();switch(e){case"deleteColumn":t.deleteColumn().run();break;case"deleteRow":t.deleteRow().run();break;case"deleteTable":t.deleteTable().run(),i.style.display="none"}})),c.appendChild(r)})),i.appendChild(c),o.addEventListener("click",(()=>{this.closeAllBubblePopups(i),"none"!==i.style.display?i.style.display="none":(n(),i.style.position="",i.style.top="",i.style.left="",i.style.bottom="",i.style.right="",i.style.transform="",i.style.display="block",this.positionDropdown(o,i))})),t.appendChild(o),t.appendChild(i),{overflowWrap:t,overflowMenu:i}}toggleBubbleLinkForm(e){var t,o;if(this.bubbleLinkFormEl&&this.bubbleLinkInputEl&&(this.bubbleLinkFormEl.style.display=e?"flex":"none",e)){const e=(null===(t=this.editor)||void 0===t?void 0:t.isActive("link"))&&(null===(o=this.editor.getAttributes("link"))||void 0===o?void 0:o.href)||"";this.bubbleLinkInputEl.value=e,this.bubbleLinkUnlinkEl&&(this.bubbleLinkUnlinkEl.style.display=e?"flex":"none"),setTimeout((()=>{var e;return null===(e=this.bubbleLinkInputEl)||void 0===e?void 0:e.focus()}),0)}}submitBubbleLinkImperative(){if(!this.editor||!this.bubbleLinkInputEl)return;const e=this.bubbleLinkInputEl.value.trim();e?(this.editor.chain().focus().setLink({href:e}).run(),this.toggleBubbleLinkForm(!1)):this.toggleBubbleLinkForm(!1)}updateBubbleActiveStates(){if(!this.editor||!this.bubbleEl)return;this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive(t))})),this.bubbleEl.querySelectorAll(".co-rte-bubble__btn[data-align]").forEach((e=>{const t=e.getAttribute("data-align");t&&e.classList.toggle("co-rte-bubble__btn--active",this.editor.isActive({textAlign:t}))}));const e=this.bubbleEl.querySelector('[data-select="fontFamily"] .co-rte-bubble__select-label');if(e){const t=this.editor.getAttributes("textStyle"),o=(null==t?void 0:t.fontFamily)||"";e.textContent=o?o.split(",")[0].replace(/['"]/g,"").trim():"Sans-serif"}const t=this.bubbleEl.querySelector('[data-select="fontSize"] .co-rte-bubble__select-label');if(t){const e=this.editor.getAttributes("textStyle"),o=a(this.locale);t.textContent=this.editor.isActive("heading",{level:1})?o.title:this.editor.isActive("heading",{level:2})?o.headingAbbr1:this.editor.isActive("heading",{level:3})?o.headingAbbr2:(null==e?void 0:e.fontSize)||"16px"}const o=this.bubbleEl.querySelector('[data-select="fontWeight"] .co-rte-bubble__select-label');if(o){const e=this.editor.getAttributes("textStyle");o.textContent={100:"Thin",200:"Extra Light",300:"Light",400:"Regular",500:"Medium",600:"Semi-bold",700:"Bold",800:"Extra-bold",900:"Black"}[(null==e?void 0:e.fontWeight)||"400"]||"Regular"}this.bubbleEl.querySelectorAll(".co-rte-bubble__overflow-item[data-check]").forEach((e=>{const t=e.getAttribute("data-check");t&&e.classList.toggle("co-rte-bubble__overflow-item--active",this.editor.isActive(t))}));const r=this.bubbleEl.querySelector('[data-overflow-value="lineHeight"]');if(r){const e=this.editor.getAttributes("paragraph"),t=this.editor.getAttributes("heading");r.textContent=(null==e?void 0:e.lineHeight)||(null==t?void 0:t.lineHeight)||""}const i=this.bubbleEl.querySelector('[data-overflow-value="letterSpacing"]');if(i){const e=this.editor.getAttributes("textStyle");i.textContent=(null==e?void 0:e.letterSpacing)||""}const n=this.bubbleEl.querySelector(".co-rte-bubble__color-bar");if(n){const e=this.editor.getAttributes("textStyle");n.style.background=(null==e?void 0:e.color)||"#000000"}const c=this.bubbleEl.querySelector(".co-rte-bubble__overflow-table-section");if(c){const e=this.editor.isActive("table");if(c.style.display=e?"block":"none",e){const e=c.querySelector('[data-overflow-item="toggleHeaderRow"]');if(e){const t=this.editor.view,{$anchor:o}=this.editor.state.selection;let r=o.depth,i=!1;for(;r>0;){if("table"===o.node(r).type.name){const e=t.nodeDOM(o.start(r)-1);if(e){const t=(e.querySelector("table")||e).querySelector("tr");i=!!t&&null!==t.querySelector("th")}break}r--}e.classList.toggle("co-rte-bubble__overflow-item--active",i)}}}}createImageLayoutBar(){const t=document.createElement("div");t.className="co-rte-img-layout",t.style.display="none",t.addEventListener("mousedown",(e=>{e.preventDefault(),e.stopPropagation()}));const o=a(this.locale),r={inline:o.imageLayoutInline,"wrap-left":o.imageLayoutWrapLeft,"wrap-right":o.imageLayoutWrapRight,center:o.imageLayoutCenter,"full-width":o.imageLayoutFullWidth};return["inline","wrap-left","wrap-right","center","full-width"].forEach((o=>{const i=document.createElement("button");i.type="button",i.className="co-rte-img-layout__btn",i.setAttribute("data-layout",o),i.setAttribute("data-tooltip",r[o]||o),i.setAttribute("aria-label",r[o]||o),i.innerHTML=`<co-icon name="${e.IMG_LAYOUT_ICONS[o]}" size="18"></co-icon>`,i.addEventListener("click",(()=>this.setImageLayout(o))),t.appendChild(i)})),t}setImageLayout(e){if(!this.editor||!this.contentEl)return;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return;const i=o.from,n=t.tr.setNodeMarkup(i,void 0,Object.assign(Object.assign({},r.attrs),{imageLayout:e}));this.editor.view.dispatch(n),this.editor.commands.setNodeSelection(i),requestAnimationFrame((()=>{this.syncImageLayouts(),this.updateImageLayoutBar()}))}getSelectedImageInfo(){var e;if(!this.editor)return null;const{state:t}=this.editor,o=t.selection;if("NodeSelection"!==o.constructor.name)return null;const r=o.node;if("image"!==(null==r?void 0:r.type.name))return null;const i=o.from,n=this.editor.view.nodeDOM(i);return n?{node:r,pos:i,container:(null===(e=n.closest)||void 0===e?void 0:e.call(n,"[data-resize-container]"))||n}:null}syncImageLayouts(){if(!this.editor)return;const e=this.editor.view;this.editor.state.doc.descendants(((t,o)=>{var r;if("image"!==t.type.name)return!0;const i=e.nodeDOM(o),n=(null===(r=null==i?void 0:i.closest)||void 0===r?void 0:r.call(i,"[data-resize-container]"))||i;return!n||(n.dataset.imageLayout=t.attrs.imageLayout||"inline",n.style.position="",n.style.left="",n.style.top="",n.style.zIndex="",!0)}))}updateImageLayoutBarPosition(){if(!this.imgLayoutEl||!this.contentEl)return;const e=this.getSelectedImageInfo();if(!e)return;const t=e.container.getBoundingClientRect(),o=this.contentEl.getBoundingClientRect(),r=this.imgLayoutEl.offsetWidth||194;let i=t.left+t.width/2-o.left+this.contentEl.scrollLeft-r/2;i=Math.max(4,Math.min(i,o.width-r-4));const n=t.bottom-o.top+this.contentEl.scrollTop+8;this.imgLayoutEl.style.left=i+"px",this.imgLayoutEl.style.top=n+"px"}updateImageLayoutBar(){if(!this.imgLayoutEl||!this.editor)return;const e=this.getSelectedImageInfo();if(!e)return void(this.imgLayoutVisible&&(this.imgLayoutEl.style.display="none",this.imgLayoutVisible=!1));this.imgLayoutEl.style.display="flex",this.imgLayoutVisible=!0,this.updateImageLayoutBarPosition();const t=e.node.attrs.imageLayout||"inline";this.imgLayoutEl.querySelectorAll(".co-rte-img-layout__btn").forEach((e=>{e.classList.toggle("co-rte-img-layout__btn--active",e.getAttribute("data-layout")===t)}))}render(){const e="none"!==this.resolvedToolbar&&!this.readonly&&!this.disabled,t=this.showCharacterCount||null!=this.maxLength;return r("div",{key:"1ba222ae8d8e46a45619685771253cdd3d1befd3",class:{"co-rich-text-editor":!0,"co-rich-text-editor--focused":this.hasFocus,"co-rich-text-editor--disabled":this.disabled,"co-rich-text-editor--readonly":this.readonly,"co-rich-text-editor--loading":!this.ready,["co-rich-text-editor--"+this.status]:"default"!==this.status},part:"wrapper"},(this.label||this.secondaryLabel)&&r("div",{key:"3bb65d173c680c2b8581aeeacdf9e94045378c43",class:"co-rich-text-editor__labels"},this.label&&r("label",{key:"a8c743e49b37c486e80fe0227bf1d7954ade234f",class:"co-rich-text-editor__label",part:"label"},this.label),this.secondaryLabel&&r("span",{key:"a0d33d71573bd06d4c2b568973144ddd22424362",class:"co-rich-text-editor__secondary-label"},this.secondaryLabel)),r("div",{key:"39d4776d45ca2a616b64c9aab1eb15a99ae916ce",class:"co-rich-text-editor__frame"},e&&r("co-rich-text-toolbar",{key:"80844f77a0a1aadd7a9b109110e99d218c98542c",class:"co-rich-text-editor__toolbar",part:"toolbar",variant:this.resolvedToolbar,disabled:this.disabled||this.readonly,locale:this.locale,ref:e=>this.toolbarEl=e}),r("div",{key:"f60519b8253b6070f6ac0f0a292e0402075f401a",class:"co-rich-text-editor__box"},r("div",{key:"858aaa1ee60e6ed5142c72831d4b5f321b77132e",class:"co-rte-content",part:"content",role:"textbox","aria-multiline":"true","aria-label":this.label,"aria-required":this.required?"true":void 0,"aria-invalid":"error"===this.status?"true":void 0,ref:e=>this.contentEl=e}))),r("div",{key:"320d390eccc2fd2381c26568241e2ebb335a6aa2",class:"co-rich-text-editor__footer"},this.helperText&&r("div",{key:"de5d9e8605e3a8edd037e9e49884a55f641b4585",class:"co-rich-text-editor__helper co-rich-text-editor__helper--"+this.status,part:"helper"},r("co-icon",{key:"ef7d3a8894a084e09e692839800bf8f1eb9c9b3f",name:this.helperIcon,size:14}),r("span",{key:"a914b24fce4d891f7a7936051e04fa2f9dae6d62"},this.helperText)),t&&r("span",{key:"f9d197782e4e983b72f7432dd9b2fb8324f45a0b",class:"co-rich-text-editor__count",ref:e=>this.charCountEl=e},this.charCount,null!=this.maxLength?" / "+this.maxLength:"")))}get el(){return this}static get watchers(){return{accountFonts:[{onAccountFontsChange:0}],value:[{onValueChange:0}],disabled:[{onEditableChange:0}],readonly:[{onEditableChange:0}]}}static get style(){return'co-rich-text-editor{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);letter-spacing:var(--co-font-letter-spacing-body)}.co-rich-text-editor{display:flex;flex-direction:column;gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__labels{display:flex;align-items:center;justify-content:space-between;padding:0 var(--co-spacing-xs);gap:var(--co-spacing-sm2, 6px)}.co-rich-text-editor__label,.co-rich-text-editor__secondary-label{color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-14);font-weight:400;line-height:1}.co-rich-text-editor__frame{display:flex;flex-direction:column;background:var(--co-semantic-surface-secondary);border:1px solid var(--co-semantic-border-subtle);border-radius:var(--co-border-radius-xs);transition:border-color 0.15s ease, box-shadow 0.15s ease;min-height:0;flex:1;position:relative;overflow:visible}.co-rich-text-editor__box{display:flex;flex-direction:column;min-height:0;flex:1;position:relative;overflow-y:auto;overflow-x:hidden}.co-rich-text-editor--focused .co-rich-text-editor__frame{border-color:var(--co-semantic-border-focus, var(--co-color-base-negro, #1a1a1a));box-shadow:0 0 0 3px var(--co-semantic-border-focus-ring, rgba(37, 99, 235, 0.15))}.co-rich-text-editor--error .co-rich-text-editor__frame{border-color:var(--co-color-status-error)}.co-rich-text-editor--success .co-rich-text-editor__frame{border-color:var(--co-color-status-success)}.co-rich-text-editor--disabled .co-rich-text-editor__frame,.co-rich-text-editor--readonly .co-rich-text-editor__frame{opacity:0.7;cursor:not-allowed}.co-rich-text-editor--loading .co-rte-content{min-height:96px;background:linear-gradient(90deg, var(--co-semantic-surface-secondary) 0%, var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.04)) 50%, var(--co-semantic-surface-secondary) 100%);background-size:200% 100%;animation:co-rte-skeleton 1.2s ease-in-out infinite}@keyframes co-rte-skeleton{0%{background-position:200% 0}100%{background-position:-200% 0}}.co-rich-text-editor__toolbar{position:relative;flex-shrink:0;z-index:60}.co-rte-content{min-height:96px;color:var(--co-semantic-text-default);flex:1 0 auto;display:flex;flex-direction:column}.co-rte-content .ProseMirror{outline:none;flex:1 0 auto;line-height:1.5;padding:var(--co-spacing-md);box-sizing:border-box}.co-rte-content .ProseMirror p{margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror p:last-child{margin-bottom:0}.co-rte-content .ProseMirror>p{margin-bottom:var(--co-spacing-sm) !important}.co-rte-content .ProseMirror>p:last-child{margin-bottom:0 !important}.co-rte-content .ProseMirror [style*="text-align: justify"]{text-align-last:left}.co-rte-content .ProseMirror [style*="text-align: center"]{text-align:center}.co-rte-content .ProseMirror [style*="text-align: right"]{text-align:right}.co-rte-content .ProseMirror h1,.co-rte-content .ProseMirror h2,.co-rte-content .ProseMirror h3,.co-rte-content .ProseMirror h4{margin:var(--co-spacing-md) 0 var(--co-spacing-sm);font-weight:600;line-height:1.3}.co-rte-content .ProseMirror h1{font-size:var(--co-font-size-28, 28px)}.co-rte-content .ProseMirror h2{font-size:var(--co-font-size-20, 20px)}.co-rte-content .ProseMirror h3{font-size:var(--co-font-size-16, 16px)}.co-rte-content .ProseMirror ul,.co-rte-content .ProseMirror ol{padding-left:var(--co-spacing-xl);margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"]{list-style:none;padding-left:0;margin:0 0 var(--co-spacing-sm) 0}.co-rte-content .ProseMirror ul[data-type="taskList"] li{display:flex;align-items:flex-start;gap:var(--co-spacing-sm, 8px)}.co-rte-content .ProseMirror ul[data-type="taskList"] li>label{flex:0 0 auto;margin-top:0.15em;user-select:none}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div{flex:1 1 auto;min-width:0}.co-rte-content .ProseMirror ul[data-type="taskList"] li>div>p{margin:0}.co-rte-content .ProseMirror ul[data-type="taskList"] input[type="checkbox"]{width:16px;height:16px;cursor:pointer;accent-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="strike"] li[data-checked="true"]>div{text-decoration:line-through;color:var(--co-semantic-text-muted, #999)}.co-rte-content .ProseMirror ul[data-type="taskList"][data-variant="plain"] li[data-checked="true"]>div{text-decoration:none}.co-rte-content .ProseMirror blockquote{border-left:3px solid var(--co-semantic-border-default, var(--co-semantic-border-subtle));padding-left:var(--co-spacing-md);margin:0 0 var(--co-spacing-sm) 0;color:var(--co-semantic-text-secondary)}.co-rte-content .ProseMirror a{color:var(--co-color-base-negro, #1a1a1a);text-decoration:underline;text-underline-offset:2px}.co-rte-content .ProseMirror img{max-width:100%;height:auto;border-radius:var(--co-border-radius-xs);margin:var(--co-spacing-sm) 0;cursor:default;-webkit-user-drag:none;user-select:none}.co-rte-content .ProseMirror img.ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a)}.co-rte-content [data-resize-container].ProseMirror-selectednode{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-container]{position:relative;display:inline-block;width:fit-content;max-width:100%;margin:var(--co-spacing-sm) 0;line-height:0}.co-rte-content [data-resize-container][data-resize-state="true"]{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:0px;border-radius:0}.co-rte-content [data-resize-wrapper]{position:relative;display:inline-block;line-height:0}.co-rte-content [data-resize-handle]{width:10px;height:10px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:5;opacity:0;pointer-events:none}.co-rte-content [data-resize-container][data-resize-state="true"] [data-resize-handle],.co-rte-content [data-resize-container].ProseMirror-selectednode [data-resize-handle]{opacity:1;pointer-events:auto}.co-rte-content [data-resize-handle="top-left"]{cursor:nw-resize}.co-rte-content [data-resize-handle="top-right"]{cursor:ne-resize}.co-rte-content [data-resize-handle="bottom-left"]{cursor:sw-resize}.co-rte-content [data-resize-handle="bottom-right"]{cursor:se-resize}.co-rte-content [data-resize-handle="top"],.co-rte-content [data-resize-handle="bottom"]{width:30px;height:6px;border-radius:3px;left:50% !important;transform:translateX(-50%)}.co-rte-content [data-resize-handle="top"]{cursor:n-resize}.co-rte-content [data-resize-handle="bottom"]{cursor:s-resize}.co-rte-content [data-resize-handle="left"],.co-rte-content [data-resize-handle="right"]{width:6px;height:30px;border-radius:3px;top:50% !important;transform:translateY(-50%)}.co-rte-content [data-resize-handle="left"]{cursor:w-resize}.co-rte-content [data-resize-handle="right"]{cursor:e-resize}.co-rte-content [data-resize-container] img{max-width:100%;display:block;border-radius:0;margin:0}.co-rte-content .ProseMirror hr{border:none;border-top:1px solid var(--co-semantic-border-default, #e0e0e0);margin:var(--co-spacing-lg) 0}.co-rte-content .ProseMirror code{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:0.1em 0.3em;border-radius:var(--co-border-radius-xxs)}.co-rte-content .ProseMirror pre{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:var(--co-spacing-md);border-radius:var(--co-border-radius-xs);overflow-x:auto;margin:var(--co-spacing-sm) 0}.co-rte-content .ProseMirror pre code{background:none;padding:0;border-radius:0}.co-rte-content .ProseMirror p.is-editor-empty:first-child::before{content:attr(data-placeholder);color:var(--co-semantic-text-muted);float:left;height:0;pointer-events:none}.co-rte-content .co-rte-variable,.co-rte-content .co-rte-mention{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-size:0.9em;white-space:nowrap}.co-rte-content .co-rte-mention{background:var(--co-color-primary-verde)}.co-rich-text-editor__footer{display:flex;align-items:center;justify-content:space-between;gap:var(--co-spacing-sm);padding:0 var(--co-spacing-xs);min-height:0}.co-rich-text-editor__helper{display:flex;align-items:center;gap:var(--co-spacing-xs);color:var(--co-semantic-text-secondary);font-size:var(--co-font-size-12, 12px)}.co-rich-text-editor__helper--error{color:var(--co-color-status-error)}.co-rich-text-editor__helper--success{color:var(--co-color-status-success)}.co-rich-text-editor__count{margin-left:auto;color:var(--co-semantic-text-muted);font-size:var(--co-font-size-12, 12px)}.co-rte-bubble.co-rte-bubble--suppressed{display:none !important}.co-rte-bubble{position:absolute;z-index:50;display:flex;flex-direction:row;align-items:center;gap:2px;padding:var(--co-spacing-xs, 4px) var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);user-select:none;white-space:nowrap}.co-rte-bubble__drag-handle{display:flex;align-items:center;justify-content:center;cursor:grab;color:var(--co-semantic-text-muted, #999);width:18px;height:28px;margin:0 2px 0 0;flex-shrink:0}.co-rte-bubble__drag-handle:hover{color:var(--co-semantic-text-secondary, #555)}.co-rte-bubble__drag-handle:active{cursor:grabbing}.co-rte-bubble__row{display:flex;align-items:center;gap:2px;flex-wrap:nowrap}.co-rte-bubble__btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:none;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer}.co-rte-bubble__btn:hover:not(.co-rte-bubble__btn--active){background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-bubble__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-bubble__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-bubble__sep{display:inline-block;width:1px;height:18px;margin:0 4px;background:var(--co-semantic-border-default, rgba(0, 0, 0, 0.12));flex-shrink:0}.co-rte-bubble__select{position:relative}.co-rte-bubble__select-trigger{display:flex;align-items:center;gap:2px;height:28px;padding:0 6px;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;white-space:nowrap;transition:background 0.12s, border-color 0.12s}.co-rte-bubble__select-trigger:hover{background:var(--co-semantic-surface-hover, #f5f5f5);border-color:var(--co-semantic-border-default, #e0e0e0)}.co-rte-bubble__select-label{max-width:72px;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__select--font .co-rte-bubble__select-label{max-width:110px}.co-rte-bubble__select-dropdown{position:absolute;bottom:100%;left:0;z-index:120;min-width:100px;max-height:260px;overflow-y:auto;padding:var(--co-spacing-xxs, 2px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xxs, 4px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal}.co-rte-bubble__select-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__select-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__select-option{display:block;width:100%;padding:4px 8px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;text-align:left;cursor:pointer;white-space:nowrap}.co-rte-bubble__select-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__select-dropdown--font{min-width:200px;max-height:320px;overflow:hidden;overflow-y:auto;display:flex;flex-direction:column;white-space:normal}.co-rte-bubble__font-search{padding:6px 6px 4px;flex-shrink:0}.co-rte-bubble__font-search-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none;box-sizing:border-box}.co-rte-bubble__font-search-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__font-list{max-height:260px;overflow-y:auto;padding:0 var(--co-spacing-xxs, 2px) var(--co-spacing-xxs, 2px)}.co-rte-bubble__font-section-header{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);text-transform:uppercase;letter-spacing:0.5px}.co-rte-bubble__font-empty{padding:12px 8px;text-align:center;color:var(--co-semantic-text-muted, #888);font-size:12px}.co-rte-bubble__color{position:relative}.co-rte-bubble__color-dropdown{position:absolute;bottom:100%;left:50%;transform:translateX(-50%);z-index:120;width:224px;padding:var(--co-spacing-sm, 8px);background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px;white-space:normal;max-width:calc(100vw - 16px)}.co-rte-bubble__color-dropdown[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px;margin-top:0}.co-rte-bubble__color-dropdown[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__color-grid{display:grid;grid-template-columns:repeat(10, 1fr);gap:2px}.co-rte-bubble__color-swatch{width:20px;height:20px;padding:0;border:none;border-radius:3px;cursor:pointer;transition:transform 0.1s, box-shadow 0.1s}.co-rte-bubble__color-swatch:hover{transform:scale(1.2);box-shadow:0 0 0 2px var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-hex{display:flex;align-items:center;gap:4px;margin-top:6px}.co-rte-bubble__color-hex-input{width:100%;padding:3px 6px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:3px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-mono, monospace);font-size:11px;outline:none}.co-rte-bubble__color-hex-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__color-clear{display:flex;align-items:center;gap:4px;width:100%;padding:3px 6px;margin-top:4px;border:none;background:transparent;color:var(--co-semantic-text-secondary, #666);font-family:var(--co-font-family-primary);font-size:11px;cursor:pointer;border-radius:3px}.co-rte-bubble__color-clear:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__link-form{display:flex;align-items:center;gap:4px;margin-left:4px}.co-rte-bubble__link-input{width:160px;padding:3px 8px;border:1px solid var(--co-semantic-border-default, #ccc);border-radius:4px;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333);font-family:var(--co-font-family-primary);font-size:12px;outline:none}.co-rte-bubble__link-input::placeholder{color:var(--co-semantic-text-muted, #999)}.co-rte-bubble__link-input:focus{border-color:var(--co-color-base-negro, #1a1a1a);box-shadow:0 0 0 2px rgba(0, 0, 0, 0.1)}.co-rte-bubble__link-btn{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:4px;background:var(--co-color-base-negro, #1a1a1a);color:#fff;cursor:pointer}.co-rte-bubble__link-btn:hover{opacity:0.9}.co-rte-bubble__link-unlink{background:var(--co-semantic-surface-error, #ef4444)}.co-rte-bubble__panel{position:absolute;z-index:140;width:230px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);overflow:hidden;user-select:none}.co-rte-bubble__panel-header{display:flex;align-items:center;gap:4px;padding:6px 8px;border-bottom:1px solid var(--co-semantic-border-subtle, #eee)}.co-rte-bubble__panel-drag{cursor:grab;display:flex;align-items:center;justify-content:center;color:var(--co-semantic-text-muted, #999);flex-shrink:0}.co-rte-bubble__panel-drag:active{cursor:grabbing}.co-rte-bubble__panel-title{flex:1;font-size:12px;font-weight:600;color:var(--co-semantic-text-default, #333);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.co-rte-bubble__panel-close{display:flex;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:3px;background:transparent;color:var(--co-semantic-text-muted, #999);cursor:pointer;flex-shrink:0}.co-rte-bubble__panel-close:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input-wrap{padding:6px 8px}.co-rte-bubble__panel-input{width:100%;padding:4px 8px;border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:4px;font-size:12px;font-family:inherit;outline:none;box-sizing:border-box;background:var(--co-semantic-surface-secondary, #fff);color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-input:focus{border-color:var(--co-color-base-negro, #1a1a1a)}.co-rte-bubble__panel-options{max-height:280px;overflow-y:auto;padding:2px 4px 4px}.co-rte-bubble__panel-option{display:block;width:100%;padding:5px 8px;border:none;border-radius:3px;background:transparent;cursor:pointer;text-align:left;font-family:inherit;color:var(--co-semantic-text-default, #333)}.co-rte-bubble__panel-option:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__panel-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:4px 8px}.co-rte-bubble__panel-opt-row{display:flex;justify-content:space-between;align-items:center;width:100%}.co-rte-bubble__panel-opt-value{color:var(--co-semantic-text-muted, #999);font-size:11px;font-weight:400 !important;min-width:28px;text-align:right}.co-rte-bubble__panel[data-position="above"]{bottom:100%;top:auto;margin-bottom:4px}.co-rte-bubble__panel[data-position="below"]{top:100%;bottom:auto;margin-top:4px}.co-rte-bubble__overflow{position:relative}.co-rte-bubble__overflow-menu{position:absolute;bottom:100%;right:0;z-index:130;min-width:230px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 4px 16px rgba(0, 0, 0, 0.12);margin-bottom:4px}.co-rte-bubble__overflow-menu[data-position="below"]{top:100%;bottom:auto;margin-top:4px;margin-bottom:0}.co-rte-bubble__overflow-item{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:none;border-radius:4px;background:transparent;font-family:inherit;font-size:13px;color:var(--co-semantic-text-default, #333);cursor:pointer;text-align:left;white-space:nowrap}.co-rte-bubble__overflow-item:hover{background:var(--co-semantic-surface-hover, #f5f5f5)}.co-rte-bubble__overflow-item--active{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));color:var(--co-color-base-negro, #1a1a1a);font-weight:600}.co-rte-bubble__overflow-value{margin-left:auto;color:var(--co-semantic-text-muted, #999);font-size:11px}.co-rte-bubble__overflow-sep{height:1px;background:var(--co-semantic-border-subtle, #eee);margin:3px 8px}.co-rte-bubble__overflow-section-title{padding:6px 8px 2px;font-size:11px;font-weight:600;color:var(--co-semantic-text-muted, #888);letter-spacing:0.5px}.co-rte-bubble__overflow-item--danger{color:var(--co-color-status-error, #aa2e1b)}.co-rte-bubble__overflow-item--danger:hover{background:rgba(170, 46, 27, 0.06)}.co-rte-bubble__color-indicator{display:flex;flex-direction:column;align-items:center;gap:1px;line-height:1}.co-rte-bubble__color-letter{font-family:var(--co-font-family-primary);font-size:14px;font-weight:700;color:var(--co-semantic-text-default, #333);line-height:1}.co-rte-bubble__color-bar{width:14px;height:3px;border-radius:1px}.co-rte-content .callout{display:flex;gap:0.75rem;padding:1rem;border-radius:var(--co-border-radius-xs, 8px);border:2px solid;margin:1rem 0}.co-rte-content .callout--info{background:#eff6ff;border-color:#bfdbfe}.co-rte-content .callout--warning{background:#fffbeb;border-color:#fde68a}.co-rte-content .callout--success{background:#f0fdf4;border-color:#bbf7d0}.co-rte-content .callout--error{background:#fef2f2;border-color:#fecaca}.co-rte-content .callout__icon{flex-shrink:0;font-size:1.2em}.co-rte-content .callout__content{flex:1}.co-rte-content .callout__content p{margin:0}.co-rte-content table{border-collapse:collapse;table-layout:auto;width:100%;margin:1rem 0;overflow:hidden}.co-rte-content .tableWrapper{overflow-x:auto;max-width:100%}.co-rte-content td,.co-rte-content th{min-width:1em;border:1px solid var(--co-semantic-border-default, #e0e0e0);padding:0.5rem;vertical-align:top;box-sizing:border-box;position:relative}.co-rte-content th{font-weight:600;text-align:left;background-color:#e3e3e3;color:var(--co-semantic-text-default, #333)}.co-rte-content .ProseMirror table th{background-color:#e3e3e3}.co-rte-content .selectedCell{background:rgba(0, 0, 0, 0.06)}.co-rte-content .column-resize-handle{position:absolute;right:-2px;top:0;bottom:0;width:4px;background-color:var(--co-color-base-negro, #1a1a1a);pointer-events:none}.co-rte-content .ProseMirror.resize-cursor,.co-rte-content .ProseMirror.resize-cursor *{cursor:col-resize}.co-rte-content iframe{border-radius:var(--co-border-radius-xs, 8px);max-width:100%;aspect-ratio:16 / 9;width:100%;height:auto;display:block;margin:0}.co-rte-content .co-rte-embed{position:relative;display:block;max-width:100%;margin:1rem 0;line-height:0}.co-rte-content .co-rte-embed::before{content:\'\';position:absolute;inset:0;z-index:1}.co-rte-content .co-rte-embed.ProseMirror-selectednode,.co-rte-content .co-rte-embed--selected{outline:2px solid var(--co-color-base-negro, #1a1a1a);outline-offset:2px;border-radius:var(--co-border-radius-xs, 8px)}.co-rte-content .co-rte-embed__handle{position:absolute;width:12px;height:12px;background:var(--co-color-base-negro, #1a1a1a);border:1.5px solid #fff;border-radius:50%;box-shadow:0 0 2px rgba(0, 0, 0, 0.3);z-index:3;opacity:0;pointer-events:none}.co-rte-content .co-rte-embed.ProseMirror-selectednode .co-rte-embed__handle,.co-rte-content .co-rte-embed--selected .co-rte-embed__handle{opacity:1;pointer-events:auto}.co-rte-content .co-rte-embed__handle--bottom-right{right:-6px;bottom:-6px;cursor:nwse-resize}.co-rte-content .co-rte-embed__handle--bottom-left{left:-6px;bottom:-6px;cursor:nesw-resize}.co-rte-content .co-rte-embed--resizing{outline:2px dashed var(--co-color-base-negro, #1a1a1a);outline-offset:2px}.co-rich-text-editor--readonly .co-rte-embed::before,.co-rich-text-editor--disabled .co-rte-embed::before{display:none}.co-rich-text-editor--readonly .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--readonly .co-rte-embed--selected,.co-rich-text-editor--disabled .co-rte-embed.ProseMirror-selectednode,.co-rich-text-editor--disabled .co-rte-embed--selected{outline:none !important}.co-rte-img-layout{position:absolute;z-index:50;display:flex;align-items:center;gap:2px;padding:4px;background:var(--co-semantic-surface-secondary, #fff);border:1px solid var(--co-semantic-border-default, #e0e0e0);border-radius:var(--co-border-radius-xs, 8px);box-shadow:0 2px 12px rgba(0, 0, 0, 0.12);pointer-events:auto}.co-rte-img-layout__btn{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;padding:0;border:1px solid transparent;border-radius:var(--co-border-radius-xxs, 4px);background:transparent;color:var(--co-semantic-text-default, #333);cursor:pointer;transition:background 0.12s, border-color 0.12s}.co-rte-img-layout__btn:hover{background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06))}.co-rte-img-layout__btn--active{background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff)}.co-rte-img-layout__btn--active:hover{background:var(--co-color-base-negro, #333)}.co-rte-img-layout__btn[data-tooltip]{position:relative}.co-rte-img-layout__btn[data-tooltip]::after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);padding:4px 8px;background:var(--co-color-base-negro, #1a1a1a);color:var(--co-color-base-blanco, #fff);font-family:var(--co-font-family-primary);font-size:11px;font-weight:500;line-height:1.3;white-space:nowrap;border-radius:4px;pointer-events:none;opacity:0;transition:opacity 0.12s ease;z-index:100}.co-rte-img-layout__btn[data-tooltip]:hover::after{opacity:1;transition-delay:0.3s}.co-rte-content [data-resize-container][data-image-layout="wrap-left"]{float:left;max-width:50%;margin:4px 16px 8px 0}.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:right;max-width:50%;margin:4px 0 8px 16px}.co-rte-content [data-resize-container][data-image-layout="center"]{display:block;margin:12px auto}.co-rte-content [data-resize-container][data-image-layout="full-width"]{display:block;width:100%;margin:12px 0}.co-rte-content [data-resize-container][data-image-layout="full-width"] [data-resize-wrapper],.co-rte-content [data-resize-container][data-image-layout="full-width"] img{width:100%}@media (max-width: 768px){.co-rte-content [data-resize-container][data-image-layout="wrap-left"],.co-rte-content [data-resize-container][data-image-layout="wrap-right"]{float:none;max-width:100%;display:block;margin:12px 0}}.co-rte-content--site .ProseMirror{width:var(--co-rte-content-width, 80%);max-width:100%;margin:0 auto}@media (max-width: 768px){.co-rte-content--site .ProseMirror{width:100%}}.co-rich-text-editor--readonly [data-resize-handle],.co-rich-text-editor--disabled [data-resize-handle]{display:none !important}.co-rich-text-editor--readonly [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--disabled [data-resize-container].ProseMirror-selectednode,.co-rich-text-editor--readonly img.ProseMirror-selectednode,.co-rich-text-editor--disabled img.ProseMirror-selectednode{outline:none !important}'}},[0,"co-rich-text-editor",{value:[1025],preset:[1],placeholder:[1],label:[1],secondaryLabel:[1,"secondary-label"],helperText:[1,"helper-text"],status:[1],disabled:[4],readonly:[4],required:[4],maxLength:[2,"max-length"],showCharacterCount:[4,"show-character-count"],autofocus:[4],toolbar:[1],features:[1],customExtensions:[16],imageUpload:[16],fontFamilies:[1,"font-families"],accountFonts:[1,"account-fonts"],fontsLoading:[4,"fonts-loading"],fontLoader:[16],locale:[1],ready:[32],hasFocus:[32],getJSON:[64],getHtml:[64],getText:[64],clear:[64],focusEditor:[64],setContent:[64],getEditorInstance:[64]},void 0,{accountFonts:[{onAccountFontsChange:0}],value:[{onValueChange:0}],disabled:[{onEditableChange:0}],readonly:[{onEditableChange:0}]}]);function b(){"undefined"!=typeof customElements&&["co-rich-text-editor","co-icon","co-rich-text-toolbar"].forEach((e=>{switch(e){case"co-rich-text-editor":customElements.get(i(e))||customElements.define(i(e),l);break;case"co-icon":customElements.get(i(e))||s();break;case"co-rich-text-toolbar":customElements.get(i(e))||c()}}))}l.DEFAULT_FONTS=[{label:"Arial",value:"Arial, sans-serif"},{label:"Calibri",value:"Calibri, sans-serif"},{label:"Cambria",value:"Cambria, serif"},{label:"Comic Sans MS",value:"'Comic Sans MS', cursive"},{label:"Courier New",value:"'Courier New', monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Geist",value:"'Geist', sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Impact",value:"Impact, sans-serif"},{label:"Inter",value:"'Inter', sans-serif"},{label:"Lato",value:"'Lato', sans-serif"},{label:"Montserrat",value:"'Montserrat', sans-serif"},{label:"Open Sans",value:"'Open Sans', sans-serif"},{label:"Poppins",value:"'Poppins', sans-serif"},{label:"Roboto",value:"'Roboto', sans-serif"},{label:"Segoe UI",value:"'Segoe UI', sans-serif"},{label:"Tahoma",value:"Tahoma, sans-serif"},{label:"Times New Roman",value:"'Times New Roman', serif"},{label:"Trebuchet MS",value:"'Trebuchet MS', sans-serif"},{label:"Verdana",value:"Verdana, sans-serif"}],l._registeredFonts=new Set,l.IMG_LAYOUT_ICONS={inline:"image-square","wrap-left":"text-align-left","wrap-right":"text-align-right",center:"text-align-center","full-width":"arrows-horizontal"},b();const d=l,u=b;export{d as CoRichTextEditor,u as defineCustomElement}
@@ -1 +1 @@
1
- import{C as o,d as s}from"./p-D3Y_ti3Q.js";const t=o,p=s;export{t as CoRichTextToolbar,p as defineCustomElement}
1
+ import{C as o,d as s}from"./p-B0buzt_E.js";const t=o,p=s;export{t as CoRichTextToolbar,p as defineCustomElement}
@@ -1 +1 @@
1
- import{t,p as e,H as i,h as r}from"./index.js";import{p as a}from"./p-B2QLgWrz.js";const o={comment:["p","br","strong","em","a","span"],task:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote"],email:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","h2","h3","div","img"],document:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","h1","h2","h3","h4","hr","div","mark","img","table","thead","tbody","tr","th","td","iframe"]},c=/^https:\/\/[^\s"'<>]+$/i,s=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.value=null,this.format="html",this.preset="document",this.compact=!1,this.html=""}componentWillLoad(){return this.compute()}watchInputs(){return this.compute()}sanitizeHtml(t){var e;a.addHook("uponSanitizeElement",((t,e)=>{var i,r;if("input"===e.tagName&&"checkbox"!==t.type&&(null===(i=t.parentNode)||void 0===i||i.removeChild(t)),"iframe"===e.tagName){const e=t.getAttribute("src")||"";c.test(e)||null===(r=t.parentNode)||void 0===r||r.removeChild(t)}}));try{return a.sanitize(t,{ALLOWED_TAGS:null!==(e=o[this.preset])&&void 0!==e?e:o.document,ALLOWED_ATTR:["href","target","rel","data-variable","data-mention-id","data-mention-label","style","colspan","rowspan","src","alt","width","height","allowfullscreen","frameborder","allow","loading","data-youtube-video","data-iframe","data-image-layout","data-file-id","type","checked","disabled"],ALLOW_DATA_ATTR:!1,FORBID_TAGS:["script","object","embed","form","textarea","style"],ADD_ATTR:["allowfullscreen","frameborder","allow","loading"]})}finally{a.removeHook("uponSanitizeElement")}}async compute(){if(this.value)if("html"!==this.format)try{const t=JSON.parse(this.value),e=await import("./p-CegCk7FL.js").then((function(t){return t.R}));this.html=e.jsonToHtml(t,this.preset)}catch(t){this.html=""}else this.html=this.sanitizeHtml(this.value);else this.html=""}render(){return this.html?r("div",{class:{"co-rich-text-viewer":!0,"co-rich-text-viewer--compact":this.compact,"co-rich-text-viewer--site":"document"===this.preset},part:"content",innerHTML:this.html}):r("div",{class:"co-rich-text-viewer co-rich-text-viewer--empty",part:"empty"},this.emptyText||"")}static get watchers(){return{value:[{watchInputs:0}],format:[{watchInputs:0}],preset:[{watchInputs:0}]}}static get style(){return':host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);color:var(--co-semantic-text-default);line-height:1.5}.co-rich-text-viewer{padding:var(--co-spacing-md) 0}.co-rich-text-viewer--compact{padding:var(--co-spacing-sm) 0}.co-rich-text-viewer--empty{color:var(--co-semantic-text-muted);font-style:italic}.co-rich-text-viewer p{margin:0 0 var(--co-spacing-sm)}.co-rich-text-viewer p:last-child{margin-bottom:0}.co-rich-text-viewer h1,.co-rich-text-viewer h2,.co-rich-text-viewer h3,.co-rich-text-viewer h4{margin:var(--co-spacing-md) 0 var(--co-spacing-sm);font-weight:600;line-height:1.3}.co-rich-text-viewer ul,.co-rich-text-viewer ol{padding-left:var(--co-spacing-xl);margin:0 0 var(--co-spacing-sm)}.co-rich-text-viewer blockquote{border-left:3px solid var(--co-semantic-border-subtle);padding-left:var(--co-spacing-md);margin:0 0 var(--co-spacing-sm);color:var(--co-semantic-text-secondary)}.co-rich-text-viewer a{color:var(--co-color-primary-azul);text-decoration:underline}.co-rich-text-viewer img{max-width:100%;height:auto;border-radius:var(--co-border-radius-xs);margin:var(--co-spacing-sm) 0}.co-rich-text-viewer img[data-image-layout="wrap-left"]{float:left;max-width:50%;margin:4px 16px 8px 0}.co-rich-text-viewer img[data-image-layout="wrap-right"]{float:right;max-width:50%;margin:4px 0 8px 16px}.co-rich-text-viewer img[data-image-layout="center"]{display:block;margin:12px auto}.co-rich-text-viewer img[data-image-layout="full-width"]{display:block;width:100%;margin:12px 0}@media (max-width: 768px){.co-rich-text-viewer img[data-image-layout="wrap-left"],.co-rich-text-viewer img[data-image-layout="wrap-right"]{float:none;max-width:100%;display:block;margin:12px 0}}.co-rich-text-viewer img[style*="position:absolute"],.co-rich-text-viewer img[style*="position: absolute"]{position:static !important;left:auto !important;top:auto !important;z-index:auto !important}.co-rich-text-viewer iframe{width:100%;max-width:100%;aspect-ratio:16 / 9;height:auto;display:block;border:0;border-radius:var(--co-border-radius-xs);margin:0}.co-rich-text-viewer .co-rte-iframe,.co-rich-text-viewer [data-youtube-video]{display:block;max-width:100%;margin:var(--co-spacing-sm) 0}.co-rich-text-viewer code{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:0.1em 0.3em;border-radius:var(--co-border-radius-xxs)}.co-rich-text-viewer .co-rte-variable,.co-rich-text-viewer [data-variable]{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-primary-azul);color:var(--co-color-base-blanco, #fff);font-size:0.9em}.co-rich-text-viewer--site{width:var(--co-rte-content-width, 80%);max-width:100%;margin:0 auto}@media (max-width: 768px){.co-rich-text-viewer--site{width:100%}}'}},[1,"co-rich-text-viewer",{value:[1],format:[1],preset:[1],emptyText:[1,"empty-text"],compact:[4],html:[32]},void 0,{value:[{watchInputs:0}],format:[{watchInputs:0}],preset:[{watchInputs:0}]}]);function n(){"undefined"!=typeof customElements&&["co-rich-text-viewer"].forEach((e=>{"co-rich-text-viewer"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))}n();const l=s,m=n;export{l as CoRichTextViewer,m as defineCustomElement}
1
+ import{t,p as e,H as i,h as r}from"./index.js";import{p as a}from"./p-B2QLgWrz.js";const o={comment:["p","br","strong","em","a","span"],task:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote"],email:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","h2","h3","div","img"],document:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","h1","h2","h3","h4","hr","div","mark","img","table","thead","tbody","tr","th","td","iframe"]},c=/^https:\/\/[^\s"'<>]+$/i,s=e(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.value=null,this.format="html",this.preset="document",this.compact=!1,this.html=""}componentWillLoad(){return this.compute()}watchInputs(){return this.compute()}sanitizeHtml(t){var e;a.addHook("uponSanitizeElement",((t,e)=>{var i,r;if("input"===e.tagName&&"checkbox"!==t.type&&(null===(i=t.parentNode)||void 0===i||i.removeChild(t)),"iframe"===e.tagName){const e=t.getAttribute("src")||"";c.test(e)||null===(r=t.parentNode)||void 0===r||r.removeChild(t)}}));try{return a.sanitize(t,{ALLOWED_TAGS:null!==(e=o[this.preset])&&void 0!==e?e:o.document,ALLOWED_ATTR:["href","target","rel","data-variable","data-mention-id","data-mention-label","style","colspan","rowspan","src","alt","width","height","allowfullscreen","frameborder","allow","loading","data-youtube-video","data-iframe","data-image-layout","data-file-id","type","checked","disabled"],ALLOW_DATA_ATTR:!1,FORBID_TAGS:["script","object","embed","form","textarea","style"],ADD_ATTR:["allowfullscreen","frameborder","allow","loading"]})}finally{a.removeHook("uponSanitizeElement")}}async compute(){if(this.value)if("html"!==this.format)try{const t=JSON.parse(this.value),e=await import("./p-Bgxofdfb.js").then((function(t){return t.R}));this.html=e.jsonToHtml(t,this.preset)}catch(t){this.html=""}else this.html=this.sanitizeHtml(this.value);else this.html=""}render(){return this.html?r("div",{class:{"co-rich-text-viewer":!0,"co-rich-text-viewer--compact":this.compact,"co-rich-text-viewer--site":"document"===this.preset},part:"content",innerHTML:this.html}):r("div",{class:"co-rich-text-viewer co-rich-text-viewer--empty",part:"empty"},this.emptyText||"")}static get watchers(){return{value:[{watchInputs:0}],format:[{watchInputs:0}],preset:[{watchInputs:0}]}}static get style(){return':host{display:block;font-family:var(--co-font-family-primary);font-size:var(--co-font-size-14);color:var(--co-semantic-text-default);line-height:1.5}.co-rich-text-viewer{padding:var(--co-spacing-md) 0}.co-rich-text-viewer--compact{padding:var(--co-spacing-sm) 0}.co-rich-text-viewer--empty{color:var(--co-semantic-text-muted);font-style:italic}.co-rich-text-viewer p{margin:0 0 var(--co-spacing-sm)}.co-rich-text-viewer p:last-child{margin-bottom:0}.co-rich-text-viewer h1,.co-rich-text-viewer h2,.co-rich-text-viewer h3,.co-rich-text-viewer h4{margin:var(--co-spacing-md) 0 var(--co-spacing-sm);font-weight:600;line-height:1.3}.co-rich-text-viewer ul,.co-rich-text-viewer ol{padding-left:var(--co-spacing-xl);margin:0 0 var(--co-spacing-sm)}.co-rich-text-viewer blockquote{border-left:3px solid var(--co-semantic-border-subtle);padding-left:var(--co-spacing-md);margin:0 0 var(--co-spacing-sm);color:var(--co-semantic-text-secondary)}.co-rich-text-viewer a{color:var(--co-color-primary-azul);text-decoration:underline}.co-rich-text-viewer img{max-width:100%;height:auto;border-radius:var(--co-border-radius-xs);margin:var(--co-spacing-sm) 0}.co-rich-text-viewer img[data-image-layout="wrap-left"]{float:left;max-width:50%;margin:4px 16px 8px 0}.co-rich-text-viewer img[data-image-layout="wrap-right"]{float:right;max-width:50%;margin:4px 0 8px 16px}.co-rich-text-viewer img[data-image-layout="center"]{display:block;margin:12px auto}.co-rich-text-viewer img[data-image-layout="full-width"]{display:block;width:100%;margin:12px 0}@media (max-width: 768px){.co-rich-text-viewer img[data-image-layout="wrap-left"],.co-rich-text-viewer img[data-image-layout="wrap-right"]{float:none;max-width:100%;display:block;margin:12px 0}}.co-rich-text-viewer img[style*="position:absolute"],.co-rich-text-viewer img[style*="position: absolute"]{position:static !important;left:auto !important;top:auto !important;z-index:auto !important}.co-rich-text-viewer iframe{width:100%;max-width:100%;aspect-ratio:16 / 9;height:auto;display:block;border:0;border-radius:var(--co-border-radius-xs);margin:0}.co-rich-text-viewer .co-rte-iframe,.co-rich-text-viewer [data-youtube-video]{display:block;max-width:100%;margin:var(--co-spacing-sm) 0}.co-rich-text-viewer code{font-family:var(--co-font-family-mono);font-size:0.9em;background:var(--co-semantic-surface-hover, rgba(0, 0, 0, 0.06));padding:0.1em 0.3em;border-radius:var(--co-border-radius-xxs)}.co-rich-text-viewer .co-rte-variable,.co-rich-text-viewer [data-variable]{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-primary-azul);color:var(--co-color-base-blanco, #fff);font-size:0.9em}.co-rich-text-viewer--site{width:var(--co-rte-content-width, 80%);max-width:100%;margin:0 auto}@media (max-width: 768px){.co-rich-text-viewer--site{width:100%}}'}},[1,"co-rich-text-viewer",{value:[1],format:[1],preset:[1],emptyText:[1,"empty-text"],compact:[4],html:[32]},void 0,{value:[{watchInputs:0}],format:[{watchInputs:0}],preset:[{watchInputs:0}]}]);function n(){"undefined"!=typeof customElements&&["co-rich-text-viewer"].forEach((e=>{"co-rich-text-viewer"===e&&(customElements.get(t(e))||customElements.define(t(e),s))}))}n();const l=s,m=n;export{l as CoRichTextViewer,m as defineCustomElement}
@@ -1 +1 @@
1
- import{t as o,p as r,H as e,h as c}from"./index.js";const a=r(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.position="single",this.size="sm"}render(){return c("div",{key:"75c5a2693135e21a3a4379d8bbb6d9be5bdf6bf5",class:{"co-row":!0,["co-row--"+this.position]:!0,["co-row--"+this.size]:!0},part:"row"},c("div",{key:"beb274682f02b428b93315b057fbfe11bf2be037",class:"co-row__prefix"},c("slot",{key:"0c9381d277795df7230da6eb05b9a5fa46726cf2",name:"prefix"})),c("div",{key:"2753f7c221e17d9eb91a685567a16470210652de",class:"co-row__content"},c("slot",{key:"257befca88d731c4b6c3b8545fa3f2db6c56482c"})),c("div",{key:"934ecc29de8822bf084a4d49e828aa64481dbbe3",class:"co-row__suffix"},c("slot",{key:"baa9de54437b45d4fe54f3e2faaf28d9b8cc8ed0",name:"suffix"})))}static get style(){return":host{display:block}.co-row{display:flex;align-items:center;gap:var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-subtle);font-family:var(--co-font-family-primary);box-sizing:border-box}.co-row--sm{padding:var(--co-spacing-sm2) var(--co-spacing-lg);min-height:40px;font-size:var(--co-font-size-14)}.co-row--lg{padding:var(--co-spacing-lg) var(--co-spacing-xl);min-height:76px;font-size:var(--co-font-size-16)}.co-row--single{border-radius:var(--co-border-radius-lg)}.co-row--top{border-radius:var(--co-border-radius-lg) var(--co-border-radius-lg) 0 0;border-bottom:none}.co-row--middle{border-radius:0;border-bottom:none}.co-row--bottom{border-radius:0 0 var(--co-border-radius-lg) var(--co-border-radius-lg)}.co-row__prefix,.co-row__suffix{display:flex;align-items:center;gap:var(--co-spacing-sm);flex-shrink:0;color:var(--co-semantic-text-muted)}.co-row__prefix:empty,.co-row__suffix:empty{display:none}.co-row__content{display:flex;flex-direction:column;flex:1;min-width:0;gap:var(--co-spacing-xs)}.co-row__suffix{margin-left:auto}"}},[257,"co-row",{position:[1],size:[1]}]);function s(){"undefined"!=typeof customElements&&["co-row"].forEach((r=>{"co-row"===r&&(customElements.get(o(r))||customElements.define(o(r),a))}))}s();const i=a,t=s;export{i as CoRow,t as defineCustomElement}
1
+ import{t as o,p as r,H as e,h as c}from"./index.js";const s=r(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.position="single",this.size="sm"}render(){return c("div",{key:"47d99fa50bacbc5b2651f7a672e4ff7106959622",class:{"co-row":!0,["co-row--"+this.position]:!0,["co-row--"+this.size]:!0},part:"row"},c("div",{key:"ccae8616bc848d06b30b784f273c68df7d307a5b",class:"co-row__prefix"},c("slot",{key:"3aa5343c6343398b77d55dffe79e7c3d04d4dc53",name:"prefix"})),c("div",{key:"3497f2ad38a0b3c016a3f027dec7386ffc9f478e",class:"co-row__content"},c("slot",{key:"46f6c4b01998a726ac92b23c6ff2eb9c1cd548b8"})),c("div",{key:"50dbfe45d87abb540ee94d49ec5e3ff600c68aba",class:"co-row__suffix"},c("slot",{key:"207dbcf5ce290c8dbd73768f7dbceba897b16114",name:"suffix"})))}static get style(){return":host{display:block}.co-row{display:flex;align-items:center;gap:var(--co-spacing-md);background:var(--co-semantic-surface-page);border:1px solid var(--co-semantic-border-subtle);font-family:var(--co-font-family-primary);box-sizing:border-box}.co-row--sm{padding:var(--co-spacing-sm2) var(--co-spacing-lg);min-height:40px;font-size:var(--co-font-size-14)}.co-row--lg{padding:var(--co-spacing-lg) var(--co-spacing-xl);min-height:76px;font-size:var(--co-font-size-16)}.co-row--single{border-radius:var(--co-border-radius-lg)}.co-row--top{border-radius:var(--co-border-radius-lg) var(--co-border-radius-lg) 0 0;border-bottom:none}.co-row--middle{border-radius:0;border-bottom:none}.co-row--bottom{border-radius:0 0 var(--co-border-radius-lg) var(--co-border-radius-lg)}.co-row__prefix,.co-row__suffix{display:flex;align-items:center;gap:var(--co-spacing-sm);flex-shrink:0;color:var(--co-semantic-text-muted)}.co-row__prefix:empty,.co-row__suffix:empty{display:none}.co-row__content{display:flex;flex-direction:column;flex:1;min-width:0;gap:var(--co-spacing-xs)}.co-row__suffix{margin-left:auto}"}},[257,"co-row",{position:[1],size:[1]}]);function a(){"undefined"!=typeof customElements&&["co-row"].forEach((r=>{"co-row"===r&&(customElements.get(o(r))||customElements.define(o(r),s))}))}a();const i=s,t=a;export{i as CoRow,t as defineCustomElement}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface CoSegmentedBar extends Components.CoSegmentedBar, HTMLElement {}
4
+ export const CoSegmentedBar: {
5
+ prototype: CoSegmentedBar;
6
+ new (): CoSegmentedBar;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1 @@
1
+ import{t as e,p as t,H as r,h as s}from"./index.js";const a=t(class extends r{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.thickness=10,this.radius="full",this.trackColor="var(--co-color-gray-100)",this.total=100,this.segments="[]"}get parsedSegments(){const e=this.segments;let t=e;if("string"==typeof e){if(!e.trim())return[];try{t=JSON.parse(e)}catch(e){return[]}}return Array.isArray(t)?t.filter((e=>!!e&&"number"==typeof e.value&&"string"==typeof e.color)).map((e=>({value:e.value,color:e.color,label:e.label}))):[]}render(){const e=this.parsedSegments,t=this.total>0?this.total:100;return s("div",{key:"a21a02b0177c838b376ffc116b7798463f51e247",class:"co-segmented-bar",part:"segmented-bar"},s("div",{key:"c85455d5178013b07aee2650d994e8a49fc1692d",class:{"co-segmented-bar__track":!0,["co-segmented-bar__track--radius-"+this.radius]:!0},part:"track",style:{height:this.thickness+"px",background:this.trackColor}},e.map(((e,r)=>s("span",{key:r,class:"co-segmented-bar__segment",part:"segment",title:e.label,style:{width:e.value/t*100+"%",background:e.color}})))),s("slot",{key:"aaf981fc73735cb1a63ad9e169145d1cbd36113d",name:"legend"}))}static get style(){return":host{display:block;width:100%}.co-segmented-bar{width:100%}.co-segmented-bar__track{position:relative;width:100%;display:flex;overflow:hidden;}.co-segmented-bar__track--radius-full{border-radius:var(--co-border-radius-full, 9999px)}.co-segmented-bar__track--radius-sm{border-radius:var(--co-border-radius-sm, 12px)}.co-segmented-bar__track--radius-lg{border-radius:var(--co-border-radius-lg, 16px)}.co-segmented-bar__segment{display:block;height:100%;}"}},[257,"co-segmented-bar",{thickness:[2],radius:[1],trackColor:[1,"track-color"],total:[2],segments:[1]}]);function o(){"undefined"!=typeof customElements&&["co-segmented-bar"].forEach((t=>{"co-segmented-bar"===t&&(customElements.get(e(t))||customElements.define(e(t),a))}))}o();const c=a,d=o;export{c as CoSegmentedBar,d as defineCustomElement}