@prolibu-suite/cobalt-core 0.9.5 → 0.10.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.
- package/custom-elements.json +750 -80
- package/dist/cjs/co-accordion.cjs.entry.js +1 -1
- package/dist/cjs/co-action-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-app-shell.cjs.entry.js +4 -4
- package/dist/cjs/co-audio-player.cjs.entry.js +1 -1
- package/dist/cjs/co-autocomplete.cjs.entry.js +2 -2
- package/dist/cjs/co-avatar-group.cjs.entry.js +1 -1
- package/dist/cjs/co-avatar_2.cjs.entry.js +49 -17
- package/dist/cjs/co-badge.cjs.entry.js +11 -3
- package/dist/cjs/co-bottom-sheet.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb-item.cjs.entry.js +1 -1
- package/dist/cjs/co-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/co-button-group.cjs.entry.js +1 -1
- package/dist/cjs/co-button.cjs.entry.js +2 -2
- package/dist/cjs/co-calendar-month_2.cjs.entry.js +55 -20
- package/dist/cjs/co-calendar_3.cjs.entry.js +27 -15
- package/dist/cjs/co-card.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel-item.cjs.entry.js +1 -1
- package/dist/cjs/co-carousel.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox-group.cjs.entry.js +2 -2
- package/dist/cjs/co-checkbox.cjs.entry.js +6 -6
- package/dist/cjs/co-chip_2.cjs.entry.js +8 -5
- package/dist/cjs/co-color-picker.cjs.entry.js +1048 -27
- package/dist/cjs/co-column-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-combobox.cjs.entry.js +2 -2
- package/dist/cjs/co-command-search.cjs.entry.js +1 -1
- package/dist/cjs/co-data-table-pagination.cjs.entry.js +5 -5
- package/dist/cjs/co-data-table.cjs.entry.js +1 -1
- package/dist/cjs/co-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-date-range-picker.cjs.entry.js +3 -3
- package/dist/cjs/co-date-range.cjs.entry.js +2 -2
- package/dist/cjs/co-date-time-picker.cjs.entry.js +101 -130
- package/dist/cjs/co-drive-card.cjs.entry.js +2 -2
- package/dist/cjs/co-drop-zone.cjs.entry.js +2 -2
- package/dist/cjs/co-emoji-picker.cjs.entry.js +4 -4
- package/dist/cjs/co-empty-state.cjs.entry.js +4 -4
- package/dist/cjs/co-event-calendar.cjs.entry.js +4 -4
- package/dist/cjs/co-event-popover.cjs.entry.js +3 -3
- package/dist/cjs/co-fab.cjs.entry.js +3 -3
- package/dist/cjs/co-file-field.cjs.entry.js +102 -106
- package/dist/cjs/co-file-type-tile.cjs.entry.js +3 -3
- package/dist/cjs/co-helper-text.cjs.entry.js +3 -3
- package/dist/cjs/co-icon-button.cjs.entry.js +6 -6
- package/dist/cjs/co-icon.cjs.entry.js +3 -3
- package/dist/cjs/co-input.cjs.entry.js +26 -4
- package/dist/cjs/co-json-field.cjs.entry.js +5 -5
- package/dist/cjs/co-lightbox.cjs.entry.js +204 -21
- package/dist/cjs/co-list-footer.cjs.entry.js +2 -2
- package/dist/cjs/co-list-item.cjs.entry.js +5 -5
- package/dist/cjs/co-loader.cjs.entry.js +1 -1
- package/dist/cjs/co-media-thumb.cjs.entry.js +3 -3
- package/dist/cjs/co-menu-divider.cjs.entry.js +2 -2
- package/dist/cjs/co-menu-item.cjs.entry.js +84 -3
- package/dist/cjs/co-menu.cjs.entry.js +2 -2
- package/dist/cjs/co-modal.cjs.entry.js +6 -4
- package/dist/cjs/co-navbar.cjs.entry.js +4 -4
- package/dist/cjs/co-number-field.cjs.entry.js +272 -9
- package/dist/cjs/co-overlay.cjs.entry.js +6 -4
- package/dist/cjs/co-page-header.cjs.entry.js +2 -2
- package/dist/cjs/co-phone-field.cjs.entry.js +3 -3
- package/dist/cjs/co-popover.cjs.entry.js +58 -21
- package/dist/cjs/co-progress-bar.cjs.entry.js +3 -3
- package/dist/cjs/co-progress-circle.cjs.entry.js +3 -3
- package/dist/cjs/co-provider-logo_2.cjs.entry.js +47 -3
- package/dist/cjs/co-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/co-radio.cjs.entry.js +4 -4
- package/dist/cjs/co-rating.cjs.entry.js +4 -4
- package/dist/cjs/co-ref-field.cjs.entry.js +4 -4
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +11 -8
- package/dist/cjs/co-rich-text-toolbar.cjs.entry.js +7 -3
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +4 -3
- package/dist/cjs/co-row.cjs.entry.js +3 -3
- package/dist/cjs/co-segmented-bar.cjs.entry.js +1 -1
- package/dist/cjs/co-select.cjs.entry.js +2 -2
- package/dist/cjs/co-separator.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar-nav.cjs.entry.js +2 -2
- package/dist/cjs/co-sidebar.cjs.entry.js +3 -3
- package/dist/cjs/co-slider.cjs.entry.js +3 -3
- package/dist/cjs/co-switch.cjs.entry.js +6 -6
- package/dist/cjs/co-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/co-tab.cjs.entry.js +3 -3
- package/dist/cjs/co-tags-field.cjs.entry.js +8 -8
- package/dist/cjs/co-textarea.cjs.entry.js +6 -6
- package/dist/cjs/co-time-field.cjs.entry.js +325 -0
- package/dist/cjs/co-toast.cjs.entry.js +2 -2
- package/dist/cjs/co-toggle-button-group.cjs.entry.js +4 -4
- package/dist/cjs/co-toggle-button.cjs.entry.js +4 -4
- package/dist/cjs/co-transfer-list.cjs.entry.js +1 -1
- package/dist/cjs/co-video.cjs.entry.js +32 -7
- package/dist/cjs/cobalt.cjs.js +2 -2
- package/dist/cjs/color-CML2Cfdh.js +142 -0
- package/dist/cjs/{dateI18n-wblvKRq_.js → dateI18n-BK2qHqoC.js} +36 -0
- package/dist/cjs/{fieldChip-BLzo9MEV.js → fieldChip-B6YIGU1V.js} +1 -1
- package/dist/cjs/fileI18n-6sdbKvo6.js +88 -0
- package/dist/cjs/{index-DFZ5YhIT.js → index-BYwrR87Z.js} +28 -10
- package/dist/cjs/{index-DK-2Lzmf.js → index-MDAnKsze.js} +25 -21
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{positioning-DCj_AJ2T.js → positioning-CyatXeT_.js} +32 -13
- package/dist/cjs/{requiredMark-C1xcrzSZ.js → requiredMark-D-t-IPN0.js} +1 -1
- package/dist/cjs/{toolbar-config-BQfWTW6P.js → toolbar-config-BSGas-Wl.js} +10 -0
- package/dist/cobalt/cobalt.css +1 -1
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-f83b48fd.entry.js → p-011dc80b.entry.js} +1 -1
- package/dist/cobalt/{p-316c62c0.entry.js → p-0678c797.entry.js} +1 -1
- package/dist/cobalt/{p-43bd298d.entry.js → p-08e42e00.entry.js} +1 -1
- package/dist/cobalt/{p-1c68bc41.entry.js → p-10b82207.entry.js} +1 -1
- package/dist/cobalt/{p-a8c64cc3.entry.js → p-15d59169.entry.js} +1 -1
- package/dist/cobalt/{p-07d570a6.entry.js → p-16954cea.entry.js} +1 -1
- package/dist/cobalt/{p-85a61e28.entry.js → p-17244412.entry.js} +1 -1
- package/dist/cobalt/p-1788aab5.entry.js +1 -0
- package/dist/cobalt/p-1a589c8e.entry.js +1 -0
- package/dist/cobalt/{p-da546d08.entry.js → p-1dc55e43.entry.js} +1 -1
- package/dist/cobalt/p-20a39218.entry.js +1 -0
- package/dist/cobalt/{p-4c7e3984.entry.js → p-23ab0cc5.entry.js} +1 -1
- package/dist/cobalt/{p-fabe5fb2.entry.js → p-2636b7eb.entry.js} +1 -1
- package/dist/cobalt/{p-88a0659f.entry.js → p-27a7e549.entry.js} +1 -1
- package/dist/cobalt/{p-18d34b01.entry.js → p-290066ef.entry.js} +1 -1
- package/dist/cobalt/{p-89e38c5e.entry.js → p-2f9cbbd5.entry.js} +1 -1
- package/dist/cobalt/{p-ef5e1167.entry.js → p-325b91b6.entry.js} +1 -1
- package/dist/cobalt/{p-60cb66f5.entry.js → p-37f5036b.entry.js} +1 -1
- package/dist/cobalt/p-3cc3ff93.entry.js +1 -0
- package/dist/cobalt/p-410bee4d.entry.js +1 -0
- package/dist/cobalt/{p-6795a258.entry.js → p-44c4e4a3.entry.js} +1 -1
- package/dist/cobalt/{p-4b083da4.entry.js → p-44ea675f.entry.js} +1 -1
- package/dist/cobalt/{p-2828ecf6.entry.js → p-4592ca00.entry.js} +1 -1
- package/dist/cobalt/p-4908f33f.entry.js +1 -0
- package/dist/cobalt/{p-342e1da4.entry.js → p-4d65e713.entry.js} +1 -1
- package/dist/cobalt/{p-dca4cd5f.entry.js → p-4d897896.entry.js} +1 -1
- package/dist/cobalt/{p-33ea4a90.entry.js → p-50bcc76f.entry.js} +1 -1
- package/dist/cobalt/{p-ac91259e.entry.js → p-5298c030.entry.js} +1 -1
- package/dist/cobalt/p-54c987d7.entry.js +1 -0
- package/dist/cobalt/p-56551580.entry.js +1 -0
- package/dist/cobalt/p-58137c9e.entry.js +1 -0
- package/dist/cobalt/{p-4f754c9a.entry.js → p-58d9b650.entry.js} +1 -1
- package/dist/cobalt/p-59963937.entry.js +1 -0
- package/dist/cobalt/{p-2d329ac8.entry.js → p-623cc195.entry.js} +1 -1
- package/dist/cobalt/p-63825d7f.entry.js +1 -0
- package/dist/cobalt/{p-8e667eb6.entry.js → p-66b11b38.entry.js} +1 -1
- package/dist/cobalt/{p-fb3a095b.entry.js → p-6bf6bc3e.entry.js} +1 -1
- package/dist/cobalt/p-6f700f0d.entry.js +1 -0
- package/dist/cobalt/p-73c6d735.entry.js +1 -0
- package/dist/cobalt/{p-a6357340.entry.js → p-76249983.entry.js} +1 -1
- package/dist/cobalt/{p-bfc2a849.entry.js → p-82266f11.entry.js} +1 -1
- package/dist/cobalt/{p-a9b29cc2.entry.js → p-826ee074.entry.js} +1 -1
- package/dist/cobalt/{p-23b3ff3f.entry.js → p-83a9a05a.entry.js} +1 -1
- package/dist/cobalt/{p-568cfe8d.entry.js → p-83ea631d.entry.js} +1 -1
- package/dist/cobalt/p-85501c6a.entry.js +1 -0
- package/dist/cobalt/{p-dfd25f1d.entry.js → p-88195a63.entry.js} +1 -1
- package/dist/cobalt/p-8fa5dc4a.entry.js +1 -0
- package/dist/cobalt/{p-c8dba82f.entry.js → p-91e73a92.entry.js} +1 -1
- package/dist/cobalt/{p-ac466658.entry.js → p-92b092db.entry.js} +1 -1
- package/dist/cobalt/{p-36197363.entry.js → p-996f4e38.entry.js} +1 -1
- package/dist/cobalt/p-BRbgGqLw.js +1 -0
- package/dist/cobalt/{p-BL0sCfMH.js → p-Bryf3-Js.js} +1 -1
- package/dist/cobalt/p-DFHRS9cJ.js +1 -0
- package/dist/cobalt/{p-CrtiywTB.js → p-DH5lfRNj.js} +1 -1
- package/dist/{components/p-WeuPA9Rw.js → cobalt/p-DOL2zACE.js} +1 -1
- package/dist/cobalt/p-D_zA1Pv4.js +1 -0
- package/dist/cobalt/{p-fef5db54.entry.js → p-a32b20eb.entry.js} +1 -1
- package/dist/cobalt/p-aa9400bf.entry.js +1 -0
- package/dist/cobalt/{p-8eb485c8.entry.js → p-aaca6dab.entry.js} +1 -1
- package/dist/cobalt/{p-e5495539.entry.js → p-aae86f96.entry.js} +1 -1
- package/dist/cobalt/{p-8f38e24d.entry.js → p-ad33c40e.entry.js} +1 -1
- package/dist/cobalt/p-b0c4fc71.entry.js +1 -0
- package/dist/cobalt/{p-da18b5f4.entry.js → p-b1e8d69e.entry.js} +1 -1
- package/dist/cobalt/p-b48917c9.entry.js +1 -0
- package/dist/cobalt/{p-7e53e9c8.entry.js → p-b565104d.entry.js} +1 -1
- package/dist/cobalt/{p-b0319a2d.entry.js → p-b90d41e4.entry.js} +1 -1
- package/dist/cobalt/{p-c5684c79.entry.js → p-bd683db3.entry.js} +1 -1
- package/dist/cobalt/{p-1ddbc48b.entry.js → p-c124e82b.entry.js} +1 -1
- package/dist/cobalt/{p-95efe661.entry.js → p-c2ebf0ec.entry.js} +1 -1
- package/dist/cobalt/{p-76420ac1.entry.js → p-c32c176a.entry.js} +1 -1
- package/dist/cobalt/{p-54ae807d.entry.js → p-c465d619.entry.js} +1 -1
- package/dist/cobalt/{p-ab45d9bd.entry.js → p-c91d4fc6.entry.js} +1 -1
- package/dist/cobalt/{p-ce35c898.entry.js → p-d29bb0fa.entry.js} +1 -1
- package/dist/cobalt/{p-7c5e846a.entry.js → p-db805569.entry.js} +1 -1
- package/dist/cobalt/p-e01f9b9a.entry.js +1 -0
- package/dist/cobalt/p-e3aae282.entry.js +1 -0
- package/dist/cobalt/{p-d15d3a97.entry.js → p-e4264532.entry.js} +1 -1
- package/dist/cobalt/{p-93c68029.entry.js → p-e48f4e45.entry.js} +1 -1
- package/dist/cobalt/{p-3f0eed59.entry.js → p-e49a564c.entry.js} +1 -1
- package/dist/cobalt/p-e8a2f993.entry.js +1 -0
- package/dist/cobalt/p-e8a4e6b0.entry.js +1 -0
- package/dist/cobalt/p-ea20f048.entry.js +1 -0
- package/dist/cobalt/{p-c1e7fb32.entry.js → p-eb063cc0.entry.js} +1 -1
- package/dist/cobalt/p-eb82358d.entry.js +1 -0
- package/dist/cobalt/{p-2114c036.entry.js → p-eb8691f2.entry.js} +1 -1
- package/dist/cobalt/{p-e8878cf9.entry.js → p-ee2023da.entry.js} +1 -1
- package/dist/cobalt/p-ee9a623d.entry.js +1 -0
- package/dist/cobalt/p-ef5ca521.entry.js +1 -0
- package/dist/cobalt/p-f4e1c3c3.entry.js +1 -0
- package/dist/cobalt/{p-e364b8a5.entry.js → p-f57dffca.entry.js} +1 -1
- package/dist/cobalt/p-f6691108.entry.js +1 -0
- package/dist/cobalt/p-f68dd124.entry.js +1 -0
- package/dist/cobalt/p-fMqVDypp.js +1 -0
- package/dist/cobalt/{p-0c463d9a.entry.js → p-fd150cc6.entry.js} +1 -1
- package/dist/cobalt/{p-0e91e5c4.entry.js → p-fe7e8813.entry.js} +1 -1
- package/dist/cobalt/p-gKnOhsd2.js +1 -0
- package/dist/cobalt/p-jYd9gu_c.js +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/co-app-shell/co-app-shell.css +107 -41
- package/dist/collection/components/co-app-shell/co-app-shell.js +2 -2
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-badge/co-badge.css +18 -0
- package/dist/collection/components/co-badge/co-badge.js +29 -1
- package/dist/collection/components/co-button/co-button.css +4 -4
- package/dist/collection/components/co-checkbox/co-checkbox.css +12 -3
- package/dist/collection/components/co-checkbox/co-checkbox.js +6 -6
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.css +1 -3
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-color-picker/co-color-picker.css +252 -5
- package/dist/collection/components/co-color-picker/co-color-picker.js +932 -15
- package/dist/collection/components/co-color-picker/presets.js +113 -15
- package/dist/collection/components/co-column-picker/co-column-picker.js +2 -2
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.js +1 -1
- package/dist/collection/components/co-data-table-pagination/co-data-table-pagination.js +4 -4
- package/dist/collection/components/co-date-field/co-date-field.js +4 -4
- package/dist/collection/components/co-date-range/co-date-range.js +1 -1
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.css +128 -32
- package/dist/collection/components/co-date-time-picker/co-date-time-picker.js +142 -138
- package/dist/collection/components/co-drawer/co-drawer.css +99 -36
- package/dist/collection/components/co-drawer/co-drawer.js +19 -7
- package/dist/collection/components/co-drive-card/co-drive-card.js +1 -1
- package/dist/collection/components/co-drop-zone/co-drop-zone.js +1 -1
- package/dist/collection/components/co-emoji-picker/co-emoji-picker.js +2 -2
- package/dist/collection/components/co-empty-state/co-empty-state.css +28 -0
- package/dist/collection/components/co-empty-state/co-empty-state.js +2 -2
- package/dist/collection/components/co-event-calendar/co-event-calendar.js +2 -2
- package/dist/collection/components/co-event-popover/co-event-popover.js +1 -1
- package/dist/collection/components/co-fab/co-fab.js +2 -2
- package/dist/collection/components/co-file-field/co-file-field.css +55 -2
- package/dist/collection/components/co-file-field/co-file-field.js +41 -13
- package/dist/collection/components/co-file-field/co-file-field.utils.js +51 -4
- package/dist/collection/components/co-file-type-tile/co-file-type-tile.js +2 -2
- package/dist/collection/components/co-helper-text/co-helper-text.js +2 -2
- package/dist/collection/components/co-icon/co-icon.js +2 -2
- package/dist/collection/components/co-icon-button/co-icon-button.css +40 -2
- package/dist/collection/components/co-icon-button/co-icon-button.js +43 -4
- package/dist/collection/components/co-input/co-input.css +33 -0
- package/dist/collection/components/co-input/co-input.js +25 -2
- package/dist/collection/components/co-json-field/co-json-field.js +3 -3
- package/dist/collection/components/co-lightbox/co-lightbox.css +23 -0
- package/dist/collection/components/co-lightbox/co-lightbox.js +209 -20
- package/dist/collection/components/co-list-footer/co-list-footer.js +1 -1
- package/dist/collection/components/co-list-item/co-list-item.js +4 -4
- package/dist/collection/components/co-media-thumb/co-media-thumb.js +2 -2
- package/dist/collection/components/co-menu/co-menu.js +1 -1
- package/dist/collection/components/co-menu-divider/co-menu-divider.js +1 -1
- package/dist/collection/components/co-menu-item/co-menu-item.js +67 -3
- package/dist/collection/components/co-modal/co-modal.css +106 -37
- package/dist/collection/components/co-modal/co-modal.js +4 -2
- package/dist/collection/components/co-navbar/co-navbar.css +4 -2
- package/dist/collection/components/co-navbar/co-navbar.js +2 -2
- package/dist/collection/components/co-number-field/co-number-field.css +22 -0
- package/dist/collection/components/co-number-field/co-number-field.js +216 -9
- package/dist/collection/components/co-option-list/co-option-list.css +25 -4
- package/dist/collection/components/co-option-list/co-option-list.js +26 -3
- package/dist/collection/components/co-overlay/co-overlay.js +5 -3
- package/dist/collection/components/co-page-header/co-page-header.js +1 -1
- package/dist/collection/components/co-phone-field/co-phone-field.js +1 -1
- package/dist/collection/components/co-popover/co-popover.css +18 -3
- package/dist/collection/components/co-popover/co-popover.js +83 -20
- package/dist/collection/components/co-progress-bar/co-progress-bar.js +2 -2
- package/dist/collection/components/co-progress-circle/co-progress-circle.js +2 -2
- package/dist/collection/components/co-radio/co-radio.js +3 -3
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-rating/co-rating.js +3 -3
- package/dist/collection/components/co-ref-field/co-ref-field.js +3 -3
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.css +14 -1
- package/dist/collection/components/co-rich-text-editor/co-rich-text-editor.js +9 -6
- package/dist/collection/components/co-rich-text-toolbar/co-rich-text-toolbar.js +7 -3
- package/dist/collection/components/co-rich-text-viewer/co-rich-text-viewer.js +3 -2
- package/dist/collection/components/co-row/co-row.js +2 -2
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +1 -1
- package/dist/collection/components/co-separator/co-separator.js +1 -1
- package/dist/collection/components/co-sidebar/co-sidebar.js +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.css +2 -2
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-skeleton/co-skeleton.css +18 -0
- package/dist/collection/components/co-skeleton/co-skeleton.js +83 -1
- package/dist/collection/components/co-slider/co-slider.js +2 -2
- package/dist/collection/components/co-switch/co-switch.css +3 -3
- package/dist/collection/components/co-switch/co-switch.js +3 -3
- package/dist/collection/components/co-tab/co-tab.js +2 -2
- package/dist/collection/components/co-tab-group/co-tab-group.js +2 -2
- package/dist/collection/components/co-tags-field/co-tags-field.js +5 -5
- package/dist/collection/components/co-textarea/co-textarea.js +4 -4
- package/dist/collection/components/co-time-field/co-time-field.css +111 -0
- package/dist/collection/components/co-time-field/co-time-field.js +536 -0
- package/dist/collection/components/co-toast/co-toast.css +13 -7
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-toggle-button/co-toggle-button.css +16 -11
- package/dist/collection/components/co-toggle-button/co-toggle-button.js +2 -2
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.css +7 -1
- package/dist/collection/components/co-toggle-button-group/co-toggle-button-group.js +2 -2
- package/dist/collection/components/co-tooltip/co-tooltip.css +18 -1
- package/dist/collection/components/co-tooltip/co-tooltip.js +49 -16
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-video/co-video.js +34 -9
- package/dist/collection/utils/amountText.js +95 -0
- package/dist/collection/utils/color.js +109 -3
- package/dist/collection/utils/colorPickerI18n.js +55 -0
- package/dist/collection/utils/dateI18n.js +36 -0
- package/dist/collection/utils/fileI18n.js +3 -0
- package/dist/collection/utils/positioning.js +37 -4
- package/dist/collection/utils/submenu.js +35 -0
- package/dist/components/co-accordion.js +1 -1
- package/dist/components/co-action-bar.js +1 -1
- package/dist/components/co-app-shell.js +1 -1
- package/dist/components/co-audio-player.js +1 -1
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-avatar-group.js +1 -1
- package/dist/components/co-avatar.js +1 -1
- package/dist/components/co-badge.js +1 -1
- package/dist/components/co-breadcrumb-item.js +1 -1
- package/dist/components/co-breadcrumb.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-calendar-month.js +1 -1
- package/dist/components/co-calendar-timegrid.js +1 -1
- package/dist/components/co-calendar.js +1 -1
- package/dist/components/co-carousel.js +1 -1
- package/dist/components/co-checkbox-group.js +1 -1
- package/dist/components/co-checkbox.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-color-picker.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table-pagination.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-field.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-drive-card.js +1 -1
- package/dist/components/co-drop-zone.js +1 -1
- package/dist/components/co-emoji-picker.js +1 -1
- package/dist/components/co-empty-state.js +1 -1
- package/dist/components/co-event-calendar.js +1 -1
- package/dist/components/co-event-popover.js +1 -1
- package/dist/components/co-fab.js +1 -1
- package/dist/components/co-file-field.js +1 -1
- package/dist/components/co-file-type-tile.js +1 -1
- package/dist/components/co-helper-text.js +1 -1
- package/dist/components/co-icon-button.js +1 -1
- package/dist/components/co-icon.js +1 -1
- package/dist/components/co-input.js +1 -1
- package/dist/components/co-json-field.js +1 -1
- package/dist/components/co-lightbox.js +1 -1
- package/dist/components/co-list-footer.js +1 -1
- package/dist/components/co-list-item.js +1 -1
- package/dist/components/co-media-thumb.js +1 -1
- package/dist/components/co-menu-divider.js +1 -1
- package/dist/components/co-menu-item.js +1 -1
- package/dist/components/co-menu.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-navbar.js +1 -1
- package/dist/components/co-number-field.js +1 -1
- package/dist/components/co-option-list.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-page-header.js +1 -1
- package/dist/components/co-phone-field.js +1 -1
- package/dist/components/co-popover.js +1 -1
- package/dist/components/co-progress-bar.js +1 -1
- package/dist/components/co-progress-circle.js +1 -1
- package/dist/components/co-radio-group.js +1 -1
- package/dist/components/co-radio.js +1 -1
- package/dist/components/co-rating.js +1 -1
- package/dist/components/co-ref-field.js +1 -1
- package/dist/components/co-rich-text-editor.js +1 -1
- package/dist/components/co-rich-text-toolbar.js +1 -1
- package/dist/components/co-rich-text-viewer.js +1 -1
- package/dist/components/co-row.js +1 -1
- package/dist/components/co-select.js +1 -1
- package/dist/components/co-separator.js +1 -1
- package/dist/components/co-sidebar-nav.js +1 -1
- package/dist/components/co-sidebar.js +1 -1
- package/dist/components/co-skeleton.js +1 -1
- package/dist/components/co-slider.js +1 -1
- package/dist/components/co-switch.js +1 -1
- package/dist/components/co-tab-group.js +1 -1
- package/dist/components/co-tab.js +1 -1
- package/dist/components/co-tags-field.js +1 -1
- package/dist/components/co-textarea.js +1 -1
- package/dist/components/co-time-field.d.ts +11 -0
- package/dist/components/co-time-field.js +1 -0
- package/dist/components/co-toast.js +1 -1
- package/dist/components/co-toggle-button-group.js +1 -1
- package/dist/components/co-toggle-button.js +1 -1
- package/dist/components/co-tooltip.js +1 -1
- package/dist/components/co-transfer-list.js +1 -1
- package/dist/components/co-video.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/p-9ceBPSd1.js +1 -0
- package/dist/components/p-B1QFLcY9.js +1 -0
- package/dist/components/p-B2IsXte7.js +1 -0
- package/dist/components/p-B4NCaKrR.js +1 -0
- package/dist/components/p-BBP5__CY.js +1 -0
- package/dist/components/{p-Dabi98BI.js → p-BGDqldEg.js} +1 -1
- package/dist/components/p-BRbgGqLw.js +1 -0
- package/dist/components/p-Be_kyNRE.js +1 -0
- package/dist/components/{p-BL0sCfMH.js → p-Bryf3-Js.js} +1 -1
- package/dist/components/p-BsTO1uUA.js +1 -0
- package/dist/components/{p-CuZXTvDM.js → p-Bv6U5y3d.js} +1 -1
- package/dist/components/p-BxP8OBw6.js +1 -0
- package/dist/components/{p-P8wvwhM2.js → p-CFFDmGPS.js} +1 -1
- package/dist/components/{p-CA_JAK9s.js → p-CT2enQ6h.js} +1 -1
- package/dist/components/p-CXPRaTuo.js +1 -0
- package/dist/components/{p-D5EdMieb.js → p-Cl3AdEQJ.js} +1 -1
- package/dist/components/p-CnX3L8aF.js +1 -0
- package/dist/components/p-DFHRS9cJ.js +1 -0
- package/dist/components/p-DIo66nBr.js +1 -0
- package/dist/components/{p-Dj1EZ5qD.js → p-DNJAIVfI.js} +1 -1
- package/dist/{cobalt/p-WeuPA9Rw.js → components/p-DOL2zACE.js} +1 -1
- package/dist/components/p-DRP8D9ro.js +1 -0
- package/dist/components/p-DkDTmHCg.js +1 -0
- package/dist/components/{p-Bxk96Zgc.js → p-Du_CgT5E.js} +1 -1
- package/dist/components/{p-BHYtxTzM.js → p-HxVRXXXC.js} +1 -1
- package/dist/components/{p-B0Dc-I_C.js → p-NNxjElcX.js} +1 -1
- package/dist/components/p-gKnOhsd2.js +1 -0
- package/dist/components/p-jYd9gu_c.js +1 -0
- package/dist/components/{p-D4qzGifz.js → p-vby0ITbe.js} +1 -1
- package/dist/components/{p-D6OUW6oW.js → p-x4grh-eZ.js} +1 -1
- package/dist/esm/co-accordion.entry.js +1 -1
- package/dist/esm/co-action-bar.entry.js +1 -1
- package/dist/esm/co-app-shell.entry.js +4 -4
- package/dist/esm/co-audio-player.entry.js +1 -1
- package/dist/esm/co-autocomplete.entry.js +2 -2
- package/dist/esm/co-avatar-group.entry.js +1 -1
- package/dist/esm/co-avatar_2.entry.js +49 -17
- package/dist/esm/co-badge.entry.js +11 -3
- package/dist/esm/co-bottom-sheet.entry.js +1 -1
- package/dist/esm/co-breadcrumb-item.entry.js +1 -1
- package/dist/esm/co-breadcrumb.entry.js +1 -1
- package/dist/esm/co-button-group.entry.js +1 -1
- package/dist/esm/co-button.entry.js +2 -2
- package/dist/esm/co-calendar-month_2.entry.js +37 -2
- package/dist/esm/co-calendar_3.entry.js +27 -15
- package/dist/esm/co-card.entry.js +1 -1
- package/dist/esm/co-carousel-item.entry.js +1 -1
- package/dist/esm/co-carousel.entry.js +2 -2
- package/dist/esm/co-checkbox-group.entry.js +2 -2
- package/dist/esm/co-checkbox.entry.js +6 -6
- package/dist/esm/co-chip_2.entry.js +8 -5
- package/dist/esm/co-color-picker.entry.js +1048 -27
- package/dist/esm/co-column-picker.entry.js +3 -3
- package/dist/esm/co-combobox.entry.js +2 -2
- package/dist/esm/co-command-search.entry.js +1 -1
- package/dist/esm/co-data-table-pagination.entry.js +5 -5
- package/dist/esm/co-data-table.entry.js +1 -1
- package/dist/esm/co-date-picker.entry.js +3 -3
- package/dist/esm/co-date-range-picker.entry.js +3 -3
- package/dist/esm/co-date-range.entry.js +2 -2
- package/dist/esm/co-date-time-picker.entry.js +101 -130
- package/dist/esm/co-drive-card.entry.js +2 -2
- package/dist/esm/co-drop-zone.entry.js +2 -2
- package/dist/esm/co-emoji-picker.entry.js +4 -4
- package/dist/esm/co-empty-state.entry.js +4 -4
- package/dist/esm/co-event-calendar.entry.js +4 -4
- package/dist/esm/co-event-popover.entry.js +3 -3
- package/dist/esm/co-fab.entry.js +3 -3
- package/dist/esm/co-file-field.entry.js +95 -99
- package/dist/esm/co-file-type-tile.entry.js +3 -3
- package/dist/esm/co-helper-text.entry.js +3 -3
- package/dist/esm/co-icon-button.entry.js +6 -6
- package/dist/esm/co-icon.entry.js +3 -3
- package/dist/esm/co-input.entry.js +26 -4
- package/dist/esm/co-json-field.entry.js +5 -5
- package/dist/esm/co-lightbox.entry.js +204 -21
- package/dist/esm/co-list-footer.entry.js +2 -2
- package/dist/esm/co-list-item.entry.js +5 -5
- package/dist/esm/co-loader.entry.js +1 -1
- package/dist/esm/co-media-thumb.entry.js +3 -3
- package/dist/esm/co-menu-divider.entry.js +2 -2
- package/dist/esm/co-menu-item.entry.js +84 -3
- package/dist/esm/co-menu.entry.js +2 -2
- package/dist/esm/co-modal.entry.js +6 -4
- package/dist/esm/co-navbar.entry.js +4 -4
- package/dist/esm/co-number-field.entry.js +272 -9
- package/dist/esm/co-overlay.entry.js +6 -4
- package/dist/esm/co-page-header.entry.js +2 -2
- package/dist/esm/co-phone-field.entry.js +3 -3
- package/dist/esm/co-popover.entry.js +58 -21
- package/dist/esm/co-progress-bar.entry.js +3 -3
- package/dist/esm/co-progress-circle.entry.js +3 -3
- package/dist/esm/co-provider-logo_2.entry.js +47 -3
- package/dist/esm/co-radio-group.entry.js +1 -1
- package/dist/esm/co-radio.entry.js +4 -4
- package/dist/esm/co-rating.entry.js +4 -4
- package/dist/esm/co-ref-field.entry.js +4 -4
- package/dist/esm/co-rich-text-editor.entry.js +11 -8
- package/dist/esm/co-rich-text-toolbar.entry.js +7 -3
- package/dist/esm/co-rich-text-viewer.entry.js +4 -3
- package/dist/esm/co-row.entry.js +3 -3
- package/dist/esm/co-segmented-bar.entry.js +1 -1
- package/dist/esm/co-select.entry.js +2 -2
- package/dist/esm/co-separator.entry.js +2 -2
- package/dist/esm/co-sidebar-nav.entry.js +2 -2
- package/dist/esm/co-sidebar.entry.js +3 -3
- package/dist/esm/co-slider.entry.js +3 -3
- package/dist/esm/co-switch.entry.js +6 -6
- package/dist/esm/co-tab-group.entry.js +3 -3
- package/dist/esm/co-tab.entry.js +3 -3
- package/dist/esm/co-tags-field.entry.js +8 -8
- package/dist/esm/co-textarea.entry.js +6 -6
- package/dist/esm/co-time-field.entry.js +323 -0
- package/dist/esm/co-toast.entry.js +2 -2
- package/dist/esm/co-toggle-button-group.entry.js +4 -4
- package/dist/esm/co-toggle-button.entry.js +4 -4
- package/dist/esm/co-transfer-list.entry.js +1 -1
- package/dist/esm/co-video.entry.js +32 -7
- package/dist/esm/cobalt.js +3 -3
- package/dist/esm/color-BRbgGqLw.js +136 -0
- package/dist/esm/{dateI18n-CnNpoKwg.js → dateI18n-jYd9gu_c.js} +36 -0
- package/dist/esm/{fieldChip-DsAfq1e0.js → fieldChip-uyggU8VV.js} +1 -1
- package/dist/esm/fileI18n-gKnOhsd2.js +84 -0
- package/dist/esm/{index-RuXxdKzC.js → index-68iUQp5j.js} +28 -10
- package/dist/esm/{index-CrtiywTB.js → index-DH5lfRNj.js} +25 -21
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{positioning-BMdapAL8.js → positioning-DFHRS9cJ.js} +32 -13
- package/dist/esm/{requiredMark-DCD-ZA51.js → requiredMark-BCJUuZvC.js} +1 -1
- package/dist/esm/{toolbar-config-WeuPA9Rw.js → toolbar-config-DOL2zACE.js} +10 -0
- package/dist/types/components/co-badge/co-badge.d.ts +7 -0
- package/dist/types/components/co-checkbox/co-checkbox.d.ts +1 -1
- package/dist/types/components/co-color-picker/co-color-picker.d.ts +358 -4
- package/dist/types/components/co-color-picker/presets.d.ts +107 -4
- package/dist/types/components/co-date-time-picker/co-date-time-picker.d.ts +43 -21
- package/dist/types/components/co-drawer/co-drawer.d.ts +4 -3
- package/dist/types/components/co-file-field/co-file-field.d.ts +14 -0
- package/dist/types/components/co-file-field/co-file-field.utils.d.ts +18 -1
- package/dist/types/components/co-icon-button/co-icon-button.d.ts +9 -0
- package/dist/types/components/co-input/co-input.d.ts +4 -0
- package/dist/types/components/co-lightbox/co-lightbox.d.ts +60 -4
- package/dist/types/components/co-menu-item/co-menu-item.d.ts +16 -0
- package/dist/types/components/co-number-field/co-number-field.d.ts +42 -1
- package/dist/types/components/co-option-list/co-option-list.d.ts +3 -0
- package/dist/types/components/co-overlay/co-overlay.d.ts +4 -2
- package/dist/types/components/co-popover/co-popover.d.ts +16 -0
- package/dist/types/components/co-rich-text-toolbar/co-rich-text-toolbar.d.ts +1 -1
- package/dist/types/components/co-skeleton/co-skeleton.d.ts +13 -0
- package/dist/types/components/co-time-field/co-time-field.d.ts +60 -0
- package/dist/types/components/co-tooltip/co-tooltip.d.ts +5 -0
- package/dist/types/components/co-video/co-video.d.ts +4 -0
- package/dist/types/components.d.ts +451 -87
- package/dist/types/utils/amountText.d.ts +34 -0
- package/dist/types/utils/color.d.ts +44 -1
- package/dist/types/utils/colorPickerI18n.d.ts +26 -0
- package/dist/types/utils/dateI18n.d.ts +12 -0
- package/dist/types/utils/fileI18n.d.ts +1 -0
- package/dist/types/utils/positioning.d.ts +10 -0
- package/dist/types/utils/submenu.d.ts +44 -0
- package/package.json +3 -3
- package/dist/cjs/color-YhUkm10t.js +0 -32
- package/dist/cjs/time-LBHtzLHe.js +0 -42
- package/dist/cobalt/p-07904986.entry.js +0 -1
- package/dist/cobalt/p-09799193.entry.js +0 -1
- package/dist/cobalt/p-17ae943c.entry.js +0 -1
- package/dist/cobalt/p-23a103a0.entry.js +0 -1
- package/dist/cobalt/p-2f88d151.entry.js +0 -1
- package/dist/cobalt/p-3495fda1.entry.js +0 -1
- package/dist/cobalt/p-409f28bb.entry.js +0 -1
- package/dist/cobalt/p-682b3313.entry.js +0 -1
- package/dist/cobalt/p-6bf814f9.entry.js +0 -1
- package/dist/cobalt/p-7c88163e.entry.js +0 -1
- package/dist/cobalt/p-7cf4b4ae.entry.js +0 -1
- package/dist/cobalt/p-7ea87b75.entry.js +0 -1
- package/dist/cobalt/p-8183f56f.entry.js +0 -1
- package/dist/cobalt/p-8345b25f.entry.js +0 -1
- package/dist/cobalt/p-8b4b3589.entry.js +0 -1
- package/dist/cobalt/p-983af614.entry.js +0 -1
- package/dist/cobalt/p-BG4WRR22.js +0 -1
- package/dist/cobalt/p-BMdapAL8.js +0 -1
- package/dist/cobalt/p-CF8OB_TM.js +0 -1
- package/dist/cobalt/p-CnNpoKwg.js +0 -1
- package/dist/cobalt/p-T4la7ly_.js +0 -1
- package/dist/cobalt/p-a2d31248.entry.js +0 -1
- package/dist/cobalt/p-a6b5cadd.entry.js +0 -1
- package/dist/cobalt/p-b8581787.entry.js +0 -1
- package/dist/cobalt/p-bcedbd73.entry.js +0 -1
- package/dist/cobalt/p-d40a465f.entry.js +0 -1
- package/dist/cobalt/p-dea43204.entry.js +0 -1
- package/dist/cobalt/p-dfcf667d.entry.js +0 -1
- package/dist/cobalt/p-e6882ddd.entry.js +0 -1
- package/dist/cobalt/p-e84eda2e.entry.js +0 -1
- package/dist/cobalt/p-f25967fb.entry.js +0 -1
- package/dist/cobalt/p-f5f1b463.entry.js +0 -1
- package/dist/cobalt/p-fd39f410.entry.js +0 -1
- package/dist/cobalt/p-mAGnZXRn.js +0 -1
- package/dist/components/p-BMdapAL8.js +0 -1
- package/dist/components/p-BTQEg3UO.js +0 -1
- package/dist/components/p-BZIB4JDs.js +0 -1
- package/dist/components/p-Bbny3WUc.js +0 -1
- package/dist/components/p-C1Kv3zYZ.js +0 -1
- package/dist/components/p-CF8OB_TM.js +0 -1
- package/dist/components/p-CR0izsJC.js +0 -1
- package/dist/components/p-CnNpoKwg.js +0 -1
- package/dist/components/p-DP0bbhfN.js +0 -1
- package/dist/components/p-DbipMAyT.js +0 -1
- package/dist/components/p-DgUBcJIS.js +0 -1
- package/dist/components/p-DolCkNsL.js +0 -1
- package/dist/components/p-gI62K3Be.js +0 -1
- package/dist/components/p-hfGFsvaD.js +0 -1
- package/dist/esm/color-BG4WRR22.js +0 -30
- package/dist/esm/time-CF8OB_TM.js +0 -37
|
@@ -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-BL0sCfMH.js";import{g as a,d as c}from"./p-P8wvwhM2.js";import{d as s}from"./p-Dj1EZ5qD.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.coAttachmentsSelected=o(this,"coAttachmentsSelected",7),this.value=null,this.preset="task",this.placeholder="",this.status="default",this.variant="default",this.disabled=!1,this.readonly=!1,this.required=!1,this.showCharacterCount=!1,this.autofocus=!1,this.toolbar="auto",this.attachmentsEnabled=!1,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:"27f9e0072f0f8066a193bd6d0ce89dcb3f554477",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,"co-rich-text-editor--flat":"flat"===this.variant},part:"wrapper"},(this.label||this.secondaryLabel)&&r("div",{key:"c45d77264e26bb840952a488b6d6b5e7f9806886",class:"co-rich-text-editor__labels"},this.label&&r("label",{key:"aee6d4babf7db51bfdc56b79cb66093a3c405a1d",class:"co-rich-text-editor__label",part:"label"},this.label),this.secondaryLabel&&r("span",{key:"7accfc51bf56f8e58ba1662cad7b6cf3c32f4111",class:"co-rich-text-editor__secondary-label"},this.secondaryLabel)),r("div",{key:"a728ccc17bd1295278c7dc07d1b5254f954b0fbf",class:"co-rich-text-editor__frame"},e&&r("co-rich-text-toolbar",{key:"fa79e86fc7e11e9663e848189ba831d46f34166e",class:"co-rich-text-editor__toolbar",part:"toolbar",variant:this.resolvedToolbar,disabled:this.disabled||this.readonly,locale:this.locale,attachmentsEnabled:this.attachmentsEnabled,attachmentAccept:this.attachmentAccept,onCoAttachmentsSelected:e=>{e.stopPropagation(),this.coAttachmentsSelected.emit(e.detail)},ref:e=>this.toolbarEl=e}),r("div",{key:"2e3724a1692a91bb98e054bb71a4802a057db3f2",class:"co-rich-text-editor__box"},r("div",{key:"c1ebc7ba2ffab04ae55acabe19b09a1c641729e6",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:"13340aec99b0250e59e0fdc7fa71484907bd6674",class:"co-rich-text-editor__footer"},this.helperText&&r("div",{key:"9b6ca8c34a4df7a55bced0df8a8816097c7db1b0",class:"co-rich-text-editor__helper co-rich-text-editor__helper--"+this.status,part:"helper"},r("co-icon",{key:"29858116e3978fc15da5f6de79334741c494b513",name:this.helperIcon,size:14}),r("span",{key:"dd863ec791e6b082512bdc92453e623dd1b5df0a"},this.helperText)),t&&r("span",{key:"42ce76f53ad1447027fff7aaf9b0605b42804edb",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-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);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--flat .co-rich-text-editor__frame{background:transparent;border-color:transparent}.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;border-top-left-radius:calc(var(--co-border-radius-xs) - 1px);border-top-right-radius:calc(var(--co-border-radius-xs) - 1px)}.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-azul-200);color:var(--co-color-azul-800)}.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 var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.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 var(--co-motion-duration-fast), box-shadow var(--co-motion-duration-fast)}.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-status-error, #aa2e1b)}.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 var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.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 var(--co-motion-duration-fast) var(--co-motion-ease-out);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],variant:[513],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],attachmentsEnabled:[4,"attachments-enabled"],attachmentAccept:[1,"attachment-accept"],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-Bryf3-Js.js";import{g as a,d as c}from"./p-CFFDmGPS.js";import{d as s}from"./p-DNJAIVfI.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.coAttachmentsSelected=o(this,"coAttachmentsSelected",7),this.value=null,this.preset="task",this.placeholder="",this.status="default",this.variant="default",this.disabled=!1,this.readonly=!1,this.required=!1,this.showCharacterCount=!1,this.autofocus=!1,this.toolbar="auto",this.attachmentsEnabled=!1,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&&(e.stopPropagation(),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&&(t.stopPropagation(),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:"135188e840e6c824750f41311c8317677754a57e",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,"co-rich-text-editor--flat":"flat"===this.variant},part:"wrapper"},(this.label||this.secondaryLabel)&&r("div",{key:"6efe3d162583d450797bde27f772ed400f764f89",class:"co-rich-text-editor__labels"},this.label&&r("label",{key:"e7e4b81fe3c7ac101b7583ef2aa75635c9730fc9",class:"co-rich-text-editor__label",part:"label"},this.label),this.secondaryLabel&&r("span",{key:"57d843617b4faadb72997c94f89d3032da83c0ef",class:"co-rich-text-editor__secondary-label"},this.secondaryLabel)),r("div",{key:"8bdfacbab4a4b782d19cb1f3b42237387ed686c0",class:"co-rich-text-editor__frame"},e&&r("co-rich-text-toolbar",{key:"ef14095c7489e7f090cebaf227345a6ec7e8681f",class:"co-rich-text-editor__toolbar",part:"toolbar",variant:this.resolvedToolbar,disabled:this.disabled||this.readonly,locale:this.locale,attachmentsEnabled:this.attachmentsEnabled,attachmentAccept:this.attachmentAccept,onCoAttachmentsSelected:e=>{e.stopPropagation(),this.coAttachmentsSelected.emit(e.detail)},ref:e=>this.toolbarEl=e}),r("div",{key:"554599eaefefb60470801d1ef6ced9ad271b197c",class:"co-rich-text-editor__box"},r("div",{key:"85a5e5ace0ad305a58b4a18dd1f5cf102b5f480a",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:"dbc4bdbafa74e8fc19b243c151e5ade688b8f463",class:"co-rich-text-editor__footer"},this.helperText&&r("div",{key:"464cbd83eef858073cd82cfc2d71772bf0a7904a",class:"co-rich-text-editor__helper co-rich-text-editor__helper--"+this.status,part:"helper"},r("co-icon",{key:"1bd007d69fac6948e30d585ad7b9f3ece0fe85ca",name:this.helperIcon,size:14}),r("span",{key:"33c618629fc830ff7cdb1bdb1b576bbbc3369435"},this.helperText)),t&&r("span",{key:"c0bfa6e67be05fe892c2f51b12392810e4d3fed0",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-page);border:1px solid var(--co-semantic-border-field);border-radius:var(--co-border-radius-xs);transition:border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);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--flat .co-rich-text-editor__frame{background:transparent;border-color:transparent}.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;border-top-left-radius:calc(var(--co-border-radius-xs) - 1px);border-top-right-radius:calc(var(--co-border-radius-xs) - 1px)}.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-azul-200);color:var(--co-color-azul-800)}.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;max-width:100%;box-sizing:border-box;flex-wrap:wrap}.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:wrap;max-width:100%;min-width:0}.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 var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.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 var(--co-motion-duration-fast), box-shadow var(--co-motion-duration-fast)}.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-status-error, #aa2e1b)}.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 var(--co-motion-duration-fast), border-color var(--co-motion-duration-fast)}.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 var(--co-motion-duration-fast) var(--co-motion-ease-out);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],variant:[513],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],attachmentsEnabled:[4,"attachments-enabled"],attachmentAccept:[1,"attachment-accept"],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-
|
|
1
|
+
import{C as o,d as s}from"./p-CFFDmGPS.js";const m=o,p=s;export{m 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"],"block-email":["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","h2","h3","div","img"]},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()}get parsedFeatures(){if(this.features){if("string"==typeof this.features)try{return JSON.parse(this.features)}catch(t){return}return this.features}}sanitizeHtml(t){var e,i;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)}}));const r=["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"];if(null===(e=this.parsedFeatures)||void 0===e?void 0:e.mentions)for(const t of["data-id","data-value","data-denotation-char","data-index"])r.includes(t)||r.push(t);try{return a.sanitize(t,{ALLOWED_TAGS:null!==(i=o[this.preset])&&void 0!==i?i:o.document,ALLOWED_ATTR:r,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-
|
|
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"],notes:["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","mark"],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"],"block-email":["p","br","strong","em","a","span","u","s","code","ul","ol","li","blockquote","h2","h3","div","img"]},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()}get parsedFeatures(){if(this.features){if("string"==typeof this.features)try{return JSON.parse(this.features)}catch(t){return}return this.features}}sanitizeHtml(t){var e,i;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)}}));const r=["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","data-color"];if(null===(e=this.parsedFeatures)||void 0===e?void 0:e.mentions)for(const t of["data-id","data-value","data-denotation-char","data-index"])r.includes(t)||r.push(t);try{return a.sanitize(t,{ALLOWED_TAGS:null!==(i=o[this.preset])&&void 0!==i?i:o.document,ALLOWED_ATTR:r,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-Bryf3-Js.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}],features:[{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 [data-mention-id],.co-rich-text-viewer [data-denotation-char=\'@\'][data-id]{display:inline-block;padding:0.05em 0.4em;border-radius:var(--co-border-radius-xxs);background:var(--co-color-azul-200);color:var(--co-color-azul-800);font-size:0.9em;white-space:nowrap}.co-rich-text-viewer #userMentionsTracker{display:none}.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],features:[1],html:[32]},void 0,{value:[{watchInputs:0}],format:[{watchInputs:0}],preset:[{watchInputs:0}],features:[{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,d=n;export{l as CoRichTextViewer,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as o,p as
|
|
1
|
+
import{t as o,p as e,H as r,h as c}from"./index.js";const a=e(class extends r{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.position="single",this.size="sm"}render(){return c("div",{key:"cf40ecb8896089a87f527be917396d1f01057cec",class:{"co-row":!0,["co-row--"+this.position]:!0,["co-row--"+this.size]:!0},part:"row"},c("div",{key:"8d24887fb9704673fe0facfaabd792ca455bd479",class:"co-row__prefix"},c("slot",{key:"d2546cc155fe508f8f2a7eba580a99e370e82887",name:"prefix"})),c("div",{key:"5e6c33efacc0dde29f202a09c664294ad7524572",class:"co-row__content"},c("slot",{key:"5efffa62218f021f439ad12eba00cb1479ccfc58"})),c("div",{key:"42cc9c00f8ca199e4e29ac8e2f6b6b585c2b3a99",class:"co-row__suffix"},c("slot",{key:"3389e9ef5a2914629a7c2d1246d37c5fa956be33",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((e=>{"co-row"===e&&(customElements.get(o(e))||customElements.define(o(e),a))}))}s();const i=a,t=s;export{i as CoRow,t as defineCustomElement}
|