@heartlandone/vega 2.89.0 → 2.90.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/dist/cjs/{app-globals-4872f4e6.js → app-globals-08924736.js} +9 -7
- package/dist/cjs/{code-block-7c49d175.js → code-block-89850671.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-aae22ddf.js → component-value-history-controller-slimmer.abstract-a8da4087.js} +3 -3
- package/dist/cjs/{content-state-76b81780.js → content-state-e1c3efe6.js} +2 -2
- package/dist/cjs/{date-required-rule-71f71b32.js → date-required-rule-3437acbc.js} +1 -1
- package/dist/cjs/{design-token-c80d3f32.js → design-token-939bf72c.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-e95427b5.js → element-appender-slimmer-14e85a91.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-430b4f02.js → form-field-controller-slimmer-c4ebee27.js} +1 -1
- package/dist/cjs/{image-annotation-action-7959fd77.js → image-annotation-action-f86690fd.js} +26 -2
- package/dist/cjs/index.cjs.js +19 -19
- package/dist/cjs/{inject-keyboard-manager-3ccf1cb6.js → inject-keyboard-manager-743de047.js} +1 -1
- package/dist/cjs/{internal-translation-controller-5582d789.js → internal-translation-controller-9785d4e8.js} +4 -0
- package/dist/cjs/{keyboard-manager-5babfda8.js → keyboard-manager-5396083a.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-a73354ca.js → keyboard-manager-slimmer-eedcfbc8.js} +1 -1
- package/dist/cjs/link-extension-dafeeed0.js +583 -0
- package/dist/cjs/loader.cjs.js +11 -12
- package/dist/cjs/{month-view-generator-43e75062.js → month-view-generator-c7492e06.js} +1 -1
- package/dist/cjs/{public-rules-b23ab52d.js → public-rules-b032050f.js} +7 -7
- package/dist/cjs/{range-abe1b989.js → range-efdf6f78.js} +1 -1
- package/dist/cjs/{replace-selected-text-action-ef079fed.js → replace-selected-text-action-0f7b7c78.js} +1 -1
- package/dist/cjs/{responsive-format-facade-cc368403.js → responsive-format-facade-d112aa9f.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-bbd727a2.js → rich-text-editor-required-rule-86d9cd4d.js} +1 -1
- package/dist/cjs/{split-cell-operation-b1fe91b5.js → split-cell-operation-b41344bd.js} +3 -3
- package/dist/cjs/{state-border-formatter-398134c1.js → state-border-formatter-c3c9b90d.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-67421e2b.js → string-format-strategy.abstract-d51050cd.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-e84530b9.js → string-input-formatter-slimmer-23fdb50e.js} +1 -1
- package/dist/cjs/{string-mask-strategy-f9806f9b.js → string-mask-strategy-10fe0f6d.js} +2 -2
- package/dist/cjs/{style-formatter-da3a556b.js → style-formatter-11c95331.js} +2 -2
- package/dist/cjs/{time-required-rule-618109fa.js → time-required-rule-2fd7c828.js} +1 -1
- package/dist/cjs/{token-extension-dfee303a.js → token-extension-2e3e1631.js} +125 -498
- package/dist/cjs/{translation-slimmer-1a7a2b6d.js → translation-slimmer-e8549aff.js} +17 -1
- package/dist/cjs/{type-guard-474dec0d.js → type-guard-9917b11f.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-00c18527.js → valid-credit-card-number-rule-8c541bcd.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_4.cjs.entry.js +6 -6
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +14 -7
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +17 -7
- package/dist/cjs/vega-input-numeric.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-passcode.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +6 -6
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +17 -10
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +63 -31
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +65 -22
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +18 -5
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -5
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +11 -12
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.css +8 -11
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +35 -7
- package/dist/collection/components/vega-field-label/vega-field-label.js +2 -2
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +35 -1
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.css +8 -11
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +35 -7
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +36 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +15 -12
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +30 -16
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/link/link-extension.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/link/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/link/utils.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/rte-extension-state-store.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +39 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +13 -4
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/slimmers/renderers/vega-selection-chip-group-renderer.js +4 -1
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +34 -0
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.js +4 -2
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +5 -4
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +16 -0
- package/dist/collection/helpers/translation/locales/en.js +4 -0
- package/dist/esm/{app-globals-081bbfd9.js → app-globals-a4134d21.js} +9 -7
- package/dist/esm/{code-block-17f596fc.js → code-block-9a17d89b.js} +2 -2
- package/dist/esm/{component-value-history-controller-slimmer.abstract-21e9126a.js → component-value-history-controller-slimmer.abstract-a64c3678.js} +3 -3
- package/dist/esm/{content-state-96741bb0.js → content-state-d59b4560.js} +3 -3
- package/dist/esm/{date-required-rule-d6ce832c.js → date-required-rule-cb960229.js} +1 -1
- package/dist/esm/{design-token-0a575bf2.js → design-token-f73ebce9.js} +3 -3
- package/dist/esm/{element-appender-slimmer-44bbb5c6.js → element-appender-slimmer-c62cf540.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-03894a51.js → form-field-controller-slimmer-514a3195.js} +1 -1
- package/dist/esm/{image-annotation-action-e8ab7b64.js → image-annotation-action-f4ea265c.js} +26 -3
- package/dist/esm/index.js +16 -17
- package/dist/esm/{inject-keyboard-manager-e5874185.js → inject-keyboard-manager-6522df5c.js} +1 -1
- package/dist/esm/{internal-translation-controller-84958bc9.js → internal-translation-controller-653bd7e3.js} +4 -0
- package/dist/esm/{keyboard-manager-404b9c17.js → keyboard-manager-9615fa9b.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-c8fcfe60.js → keyboard-manager-slimmer-21bdc3a4.js} +1 -1
- package/dist/esm/link-extension-be164793.js +576 -0
- package/dist/esm/loader.js +11 -12
- package/dist/esm/{month-view-generator-d341fa5a.js → month-view-generator-1b7c9bb8.js} +1 -1
- package/dist/esm/{public-rules-09387dcf.js → public-rules-58f31834.js} +7 -7
- package/dist/esm/{range-47d9f95e.js → range-1c1c20fa.js} +1 -1
- package/dist/esm/{replace-selected-text-action-a217dc89.js → replace-selected-text-action-1abc5200.js} +1 -1
- package/dist/esm/{responsive-format-facade-51c0c2e1.js → responsive-format-facade-12697af2.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-cca16fd0.js → rich-text-editor-required-rule-050d292b.js} +1 -1
- package/dist/esm/{split-cell-operation-ddde4106.js → split-cell-operation-8251d2a1.js} +3 -3
- package/dist/esm/{state-border-formatter-50394e9c.js → state-border-formatter-55cee24d.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-de17b899.js → string-format-strategy.abstract-14c1e874.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-c3d483ef.js → string-input-formatter-slimmer-ec297247.js} +1 -1
- package/dist/esm/{string-mask-strategy-87efdb9e.js → string-mask-strategy-18760123.js} +2 -2
- package/dist/esm/{style-formatter-c20c1988.js → style-formatter-6073ae27.js} +2 -2
- package/dist/esm/{time-required-rule-026c17a1.js → time-required-rule-9b775d24.js} +1 -1
- package/dist/esm/{token-extension-76323d76.js → token-extension-6cb7dcb2.js} +58 -429
- package/dist/esm/{translation-slimmer-7f195ba8.js → translation-slimmer-d32eb861.js} +17 -1
- package/dist/esm/{type-guard-30eec79c.js → type-guard-fd1f4760.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-1ac471e8.js → valid-credit-card-number-rule-dfd3e0a6.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_4.entry.js +6 -6
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +14 -7
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +8 -8
- package/dist/esm/vega-date-picker_2.entry.js +13 -13
- package/dist/esm/vega-dialog_2.entry.js +3 -3
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +7 -7
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +3 -3
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +5 -5
- package/dist/esm/vega-input-credit-card.entry.js +17 -7
- package/dist/esm/vega-input-numeric.entry.js +5 -5
- package/dist/esm/vega-input-passcode.entry.js +5 -5
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +6 -6
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +8 -8
- package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +17 -10
- package/dist/esm/vega-rich-text-content.entry.js +40 -8
- package/dist/esm/vega-rich-text-editor_4.entry.js +64 -21
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
- package/dist/esm/vega-selection-chip_2.entry.js +18 -5
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +8 -5
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +11 -12
- package/dist/sri/vega-sri-manifest.json +302 -306
- package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +10 -1
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +10 -0
- package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +10 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +8 -5
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +16 -12
- package/dist/types/components/vega-rich-text-editor/extensions/link/link-extension.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/link/type.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/link/utils.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/rte-extension-state-store.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/slimmers/renderers/vega-selection-chip-group-renderer.d.ts +1 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +10 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.d.ts +3 -2
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +4 -3
- package/dist/types/components.d.ts +50 -2
- package/dist/types/helpers/slimmers/translation/translation-slimmer.d.ts +11 -0
- package/dist/types/helpers/translation/interface.d.ts +4 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-02492864.entry.js +1 -0
- package/dist/vega/{p-df3a649c.entry.js → p-0278cd2b.entry.js} +1 -1
- package/dist/vega/{p-630cd479.js → p-0542b8ac.js} +1 -1
- package/dist/vega/p-0a1c7f80.js +1 -0
- package/dist/vega/{p-b9bd85d6.entry.js → p-0cc4a052.entry.js} +1 -1
- package/dist/vega/{p-976536c7.entry.js → p-1b4abd76.entry.js} +1 -1
- package/dist/vega/{p-efe6e4e6.entry.js → p-1ee185d9.entry.js} +1 -1
- package/dist/vega/{p-c3be0c29.entry.js → p-203f4ce9.entry.js} +1 -1
- package/dist/vega/p-2620a164.js +1 -0
- package/dist/vega/{p-2abdca42.js → p-277c306b.js} +1 -1
- package/dist/vega/{p-2c5352fe.entry.js → p-285e5e52.entry.js} +1 -1
- package/dist/vega/p-2c7e1bcb.js +1 -0
- package/dist/vega/{p-1ab4c08d.js → p-30487f0e.js} +1 -1
- package/dist/vega/{p-c016b230.entry.js → p-30a6b7aa.entry.js} +1 -1
- package/dist/vega/p-350d1b75.entry.js +1 -0
- package/dist/vega/{p-4c6baf92.entry.js → p-355ea330.entry.js} +1 -1
- package/dist/vega/{p-50e7020c.js → p-35d617d5.js} +1 -1
- package/dist/vega/{p-6c484462.entry.js → p-3755d8d3.entry.js} +1 -1
- package/dist/vega/{p-61536fcf.entry.js → p-3e956269.entry.js} +1 -1
- package/dist/vega/{p-fae4d64e.js → p-3ed6a602.js} +1 -1
- package/dist/vega/{p-a0705cd0.entry.js → p-4386625c.entry.js} +1 -1
- package/dist/vega/{p-b66d46ce.js → p-44f39eee.js} +1 -1
- package/dist/vega/{p-df71c830.entry.js → p-44f81987.entry.js} +1 -1
- package/dist/vega/{p-d93574dd.entry.js → p-456890f5.entry.js} +1 -1
- package/dist/vega/p-465590d1.entry.js +1 -0
- package/dist/vega/{p-f764b62e.entry.js → p-47ffdc0f.entry.js} +1 -1
- package/dist/vega/p-4fdd0a71.js +1 -0
- package/dist/vega/{p-9a562813.entry.js → p-54141828.entry.js} +1 -1
- package/dist/vega/{p-35e800ac.js → p-566ba295.js} +1 -1
- package/dist/vega/{p-baef217a.entry.js → p-581d89bb.entry.js} +1 -1
- package/dist/vega/p-5f048811.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-8ce92f5f.entry.js → p-616d7096.entry.js} +1 -1
- package/dist/vega/{p-dbb02b32.entry.js → p-6528739f.entry.js} +1 -1
- package/dist/vega/{p-b3b22e36.entry.js → p-667c980d.entry.js} +1 -1
- package/dist/vega/{p-f597b65e.entry.js → p-6845ed5c.entry.js} +1 -1
- package/dist/vega/p-6cedb325.js +1 -0
- package/dist/vega/{p-78a6e741.entry.js → p-6d99a0b3.entry.js} +1 -1
- package/dist/vega/{p-43af604c.entry.js → p-6fec4d46.entry.js} +1 -1
- package/dist/vega/{p-337440ce.entry.js → p-716a393e.entry.js} +1 -1
- package/dist/vega/p-73ce8fef.js +1 -0
- package/dist/vega/p-788a7a5a.js +1 -0
- package/dist/vega/{p-ed0cc518.entry.js → p-7fe292af.entry.js} +1 -1
- package/dist/vega/{p-ad89f499.js → p-820ff54c.js} +1 -1
- package/dist/vega/p-82c133aa.js +1 -0
- package/dist/vega/{p-f7e8081e.js → p-844b7826.js} +1 -1
- package/dist/vega/{p-93cbc231.entry.js → p-850ea38b.entry.js} +1 -1
- package/dist/vega/p-85dcd07b.js +3 -0
- package/dist/vega/{p-3a49089e.js → p-881622fd.js} +1 -1
- package/dist/vega/{p-6a3ea3f0.entry.js → p-88c29aae.entry.js} +1 -1
- package/dist/vega/{p-a9b6ce74.js → p-8a054a13.js} +1 -1
- package/dist/vega/{p-bd5566e3.entry.js → p-8d9c4338.entry.js} +1 -1
- package/dist/vega/{p-26a54a73.entry.js → p-939c486f.entry.js} +1 -1
- package/dist/vega/{p-76454c9a.js → p-97e7da55.js} +1 -1
- package/dist/vega/{p-89d55444.entry.js → p-99545fd7.entry.js} +1 -1
- package/dist/vega/{p-157a2459.entry.js → p-99ea0fa0.entry.js} +1 -1
- package/dist/vega/{p-be6c1415.js → p-a809b33a.js} +1 -1
- package/dist/vega/{p-8865613a.entry.js → p-a9a70696.entry.js} +1 -1
- package/dist/vega/{p-9cb92fa3.entry.js → p-aae71499.entry.js} +1 -1
- package/dist/vega/{p-b2488adb.js → p-b0f55f5f.js} +1 -1
- package/dist/vega/{p-09deb867.entry.js → p-b5c08306.entry.js} +1 -1
- package/dist/vega/{p-c91e0a43.js → p-b7c90543.js} +1 -1
- package/dist/vega/{p-fc0ce3b5.entry.js → p-bcd3bd79.entry.js} +1 -1
- package/dist/vega/{p-8457b6b7.entry.js → p-bce9f489.entry.js} +1 -1
- package/dist/vega/{p-57b34bf9.entry.js → p-c0a6ed53.entry.js} +1 -1
- package/dist/vega/{p-48ea74b5.entry.js → p-c1c5bd2c.entry.js} +1 -1
- package/dist/vega/{p-f7cab150.entry.js → p-c5621f60.entry.js} +1 -1
- package/dist/vega/{p-94a064a3.js → p-c596bb49.js} +1 -1
- package/dist/vega/{p-dd529875.js → p-c9c42a07.js} +1 -1
- package/dist/vega/{p-d1cc3544.entry.js → p-d0e7c14b.entry.js} +1 -1
- package/dist/vega/{p-cdde6e64.entry.js → p-d6422004.entry.js} +1 -1
- package/dist/vega/{p-1e68e217.entry.js → p-d76cb9da.entry.js} +1 -1
- package/dist/vega/{p-c4bd6cf8.entry.js → p-d871e8eb.entry.js} +1 -1
- package/dist/vega/p-d905159c.entry.js +1 -0
- package/dist/vega/{p-285b161c.entry.js → p-dfda6e01.entry.js} +1 -1
- package/dist/vega/{p-3390bb20.js → p-e30a4f3e.js} +1 -1
- package/dist/vega/{p-059ba5f5.entry.js → p-e8c5a446.entry.js} +1 -1
- package/dist/vega/{p-091fbc35.js → p-eb927e2b.js} +1 -1
- package/dist/vega/{p-fbde6153.js → p-ecea4d24.js} +1 -1
- package/dist/vega/{p-44d2f9e7.entry.js → p-ed1dbc98.entry.js} +1 -1
- package/dist/vega/p-f0b99c3a.entry.js +1 -0
- package/dist/vega/{p-363e453b.js → p-f0d6e2f2.js} +1 -1
- package/dist/vega/{p-4b34df4c.entry.js → p-f251a907.entry.js} +1 -1
- package/dist/vega/{p-9a35a34f.entry.js → p-f5c8024e.entry.js} +1 -1
- package/dist/vega/{p-fa398acc.entry.js → p-f70cfac5.entry.js} +1 -1
- package/dist/vega/p-f830deb8.js +1 -0
- package/dist/vega/{p-2f2201d6.entry.js → p-f9ae396b.entry.js} +1 -1
- package/dist/vega/{p-e80e7cd9.entry.js → p-fd2a49be.entry.js} +1 -1
- package/dist/vega/{p-3ef9c69d.entry.js → p-fe573f85.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/base-renderer-0a3b62b7.js +0 -9
- package/dist/cjs/dto-renderer-manager-7eb5c5ce.js +0 -98
- package/dist/esm/base-renderer-101f6d04.js +0 -7
- package/dist/esm/dto-renderer-manager-abc7eb5f.js +0 -96
- package/dist/vega/p-2e86aee5.js +0 -1
- package/dist/vega/p-3a5737fa.js +0 -1
- package/dist/vega/p-5f09aba8.js +0 -1
- package/dist/vega/p-5fd29f29.entry.js +0 -1
- package/dist/vega/p-66b2a285.entry.js +0 -1
- package/dist/vega/p-73508c24.js +0 -1
- package/dist/vega/p-7fbd11b0.js +0 -1
- package/dist/vega/p-894fb9c9.entry.js +0 -1
- package/dist/vega/p-89947a43.js +0 -1
- package/dist/vega/p-8a3d12e6.js +0 -1
- package/dist/vega/p-a18d280f.js +0 -3
- package/dist/vega/p-a7b5f497.js +0 -1
- package/dist/vega/p-b6c3ce6d.js +0 -1
- package/dist/vega/p-ca4773c3.entry.js +0 -1
- package/dist/vega/p-efe48ed5.entry.js +0 -1
- package/dist/vega/p-f7c6af07.js +0 -1
- package/dist/vega/p-ff24b342.entry.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,F as t,H as i,r as o,c as a,g as r}from"./p-6b2342e0.js";import{R as n}from"./p-280cbcdb.js";import{g as s,s as d}from"./p-519a7d55.js";import{Z as p,_ as l}from"./p-b2488adb.js";import{c,M as h,V as f,I as b}from"./p-6e1ab235.js";import{V as m,I as v}from"./p-8ce9e214.js";import{F as g}from"./p-3a49089e.js";import{C as x}from"./p-328dbe8e.js";import{c as u}from"./p-d7790113.js";import{r as w,y,V as j,g as R,i as I,s as C}from"./p-fcefb62c.js";import{F as k}from"./p-cb378636.js";import{C as O}from"./p-2d0d575f.js";import{c as D}from"./p-3a620268.js";import{D as S}from"./p-526e3634.js";import{l as z}from"./p-3a93730e.js";import{h as A,l as E}from"./p-f0e828d8.js";import{f as V}from"./p-ad89f499.js";import{K as L}from"./p-3a5737fa.js";import{f as H}from"./p-528748fa.js";import{M as T}from"./p-78a57a17.js";import{T as F}from"./p-52b8f2d2.js";import{P as _}from"./p-81dd00d0.js";import"./p-abd7aeaa.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-091fbc35.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-a58cacca.js";import"./p-46cab60a.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";import"./p-b75ee3ba.js";import"./p-94a064a3.js";import"./p-49a2e141.js";import"./p-0c667d6a.js";import"./p-3390bb20.js";import"./p-dd529875.js";const M=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented when a value is edited in the combo box",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented when a value is edited in the combo box",payloadValue:e=>!1===e.autoValidation}];var K=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class N extends f{constructor(){super(...arguments),this.onItemClick=async()=>{this.valueController.setValue(await this.dropdownRef.getSelection()),await this.clearInput()},this.onDropdownHide=async()=>{await this.clearInput()},this.onDropdownCreate=async e=>{this.createEventEmit.emit(e),await this.clearInput()},this.onInputChange=async e=>{const t=e.target.value;(this.useDefaultFilter||this.vegaDropdownProps.dynamicOption)&&(await this.dropdownRef.show(),await this.dropdownRef.search(t)),!this.isTemplateMode&&this.useDefaultFilter||this.searchEventEmit.emit(t)}}connectedCallback(){this.isTemplateMode=null!==this.host.querySelector("[slot=items]")}getDropdownRef(){return this.dropdownRef}getSearchInputRef(){return this.searchInputRef}focusInput(){this.searchInputRef.focus()}async hide(){await this.dropdownRef.hide()}async show(){await this.dropdownRef.show()}replaceItemsSlot(e){e&&this.itemsSlotRef&&(this.itemsSlotRef.remove(),this.dropdownRef.append(e))}renderDropdown(){return e("vega-dropdown",Object.assign({trigger:this.disabled?"none":"click",source:this.source,selectType:"multiple",selectedSourceKey:this.value,matchTargetWidth:!0,useDefaultFilter:this.useDefaultFilter},this.vegaDropdownProps,{ref:e=>{this.dropdownRef=e,S.addUniqueObserverToNode(e,w,(async e=>{await this.onDropdownCreate(e.detail)})),S.addUniqueObserverToNode(e,y,(async()=>{await this.onDropdownHide()})),S.addUniqueObserverToNode(e,j,(async()=>{await this.onItemClick()})),S.addUniqueObserverToNode(e,z,(e=>{const t=Array.from(e).filter((e=>!this.source.find((t=>t.key===e.itemKey)))).map((e=>({key:e.itemKey,label:e.label})));this.sourceController.setSource([...this.source,...t])}))}}),this.renderContainer(),this.renderItemsSlot())}renderContainer(){const i=V(this.containerMaxHeight,"widthAndHeight");return e("div",{class:{"vega-combo-box-container":!0,[`vega-combo-box-size-${this.size}`]:!0}},i?e("div",{class:"vega-combo-box-container-content",style:i?{maxHeight:i}:void 0},this.renderSelectedContainer(),this.renderInputContainer()):e(t,null,this.renderSelectedContainer(),this.renderInputContainer()))}renderItemsSlot(){return this.isTemplateMode&&e("div",{slot:"items",ref:e=>{this.itemsSlotRef=e}})}renderSelectedContainer(){const i=this.value.map((e=>this.source.find((t=>t.key===e)))).filter((e=>e));return e(t,null,i.map((e=>this.renderSelectedChip(e))))}renderSelectedChip(t){return e("vega-chip",{key:t.key,text:A.sanitize(t.label,E),variant:"outlined",showCloseIcon:!this.disabled,size:"small",ref:e=>{S.addUniqueObserverToNode(e,R,(async()=>{await this.onChipClose(t.key)}))}})}renderInputContainer(){return e("div",{class:"vega-combo-box-input-container"},e("input",{onInput:this.onInputChange,"aria-label":this.label||"No label defined",placeholder:0===this.value.length?this.placeholder:"",ref:e=>this.searchInputRef=e,onKeyDown:D(),disabled:this.disabled}))}async onChipClose(e){this.valueController.setValue([...this.value.filter((t=>t!==e))]),await this.dropdownRef.hide()}async clearInput(){this.searchInputRef.value="",await this.dropdownRef.search("")}}K([c()],N.prototype,"host",void 0),K([c()],N.prototype,"value",void 0),K([c()],N.prototype,"source",void 0),K([c()],N.prototype,"disabled",void 0),K([c()],N.prototype,"size",void 0),K([c()],N.prototype,"containerMaxHeight",void 0),K([c()],N.prototype,"vegaDropdownProps",void 0),K([c()],N.prototype,"label",void 0),K([c()],N.prototype,"placeholder",void 0),K([c()],N.prototype,"useDefaultFilter",void 0),K([c()],N.prototype,"createEventEmit",void 0),K([c()],N.prototype,"searchEventEmit",void 0),K([c()],N.prototype,"valueController",void 0),K([c()],N.prototype,"sourceController",void 0),K([h("connectedCallback")],N.prototype,"connectedCallback",null);class P extends f{setValue(e){this.value=e}}!function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);r>3&&n&&Object.defineProperty(t,i,n)}([c({writable:!0})],P.prototype,"value",void 0);var G=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class U extends f{constructor(){super(...arguments),this.onLabelClick=()=>{this.dropdownRenderer.focusInput()}}render(){return e(i,{class:{"vega-combo-box-disabled":this.disabled}},this.renderLabel(),this.dropdownRenderer.renderDropdown(),this.renderHint())}renderLabel(){return e("vega-field-label",{onClick:this.onLabelClick,"is-field-required":this.required,disabled:this.disabled,optional:this.optional,label:this.label})}renderHint(){return e("div",{class:"vega-combo-box-hint"},this.hint)}}G([c()],U.prototype,"required",void 0),G([c()],U.prototype,"optional",void 0),G([c()],U.prototype,"hint",void 0),G([c()],U.prototype,"disabled",void 0),G([c()],U.prototype,"dropdownRenderer",void 0),G([c()],U.prototype,"label",void 0);var q=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class B extends L{constructor(){super((e=>[{keyCode:"Backspace",activeElementInScope:[e.dropdownRenderer.getSearchInputRef()],eventName:"keydown",callback:e.deleteLastSelectedItem},{keyCode:"ArrowLeft",activeElementInScope:[e.host],callback:()=>e.controlDirectionByKeyboard("ArrowLeft")},{keyCode:"ArrowRight",activeElementInScope:[e.host],callback:()=>e.controlDirectionByKeyboard("ArrowRight")}])),this.deleteLastSelectedItem=()=>{""===this.dropdownRenderer.getSearchInputRef().value&&(this.value.pop(),this.valueController.setValue([...this.value]))}}controlDirectionByKeyboard(e){const t=s();if(t&&t.classList.contains("vega-chip-close-icon")){const i=H(t,"vega-chip");"ArrowLeft"===e&&this.focusItemByKeyboard(i.previousSibling),"ArrowRight"===e&&this.focusItemByKeyboard(i.nextSibling)}else"ArrowLeft"===e&&0===this.dropdownRenderer.getSearchInputRef().selectionStart&&this.focusItemByKeyboard(this.host.shadowRoot.querySelector("vega-chip:last-of-type"))}focusItemByKeyboard(e){e&&(e.classList.contains("vega-combo-box-input-container")?e.querySelector("input").focus():e.shadowRoot.querySelector(".vega-chip-close-icon").focus())}}q([c()],B.prototype,"host",void 0),q([c()],B.prototype,"value",void 0),q([c()],B.prototype,"dropdownRenderer",void 0),q([c()],B.prototype,"valueController",void 0);var W=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Z extends f{constructor(){super(...arguments),this.mutationObserver=new T({mutationFilter:F("VEGA-DROPDOWN-ITEM"),options:{childList:!0,subtree:!0},callback:()=>this.appendHostItemsToDropdown()})}componentDidLoad(){this.appendHostItemsToDropdown()}appendHostItemsToDropdown(){this.dropdownRenderer.replaceItemsSlot(this.host.querySelector("[slot=items]"))}}W([b()],Z.prototype,"mutationObserver",void 0),W([c()],Z.prototype,"host",void 0),W([c()],Z.prototype,"dropdownRenderer",void 0),W([h("componentDidLoad")],Z.prototype,"componentDidLoad",null);class $ extends f{setSource(e){this.source=e}}!function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);r>3&&n&&Object.defineProperty(t,i,n)}([c({writable:!0})],$.prototype,"source",void 0);var J=function(e,t,i,o){var a,r=arguments.length,n=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,o);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(n=(r<3?a(n):r>3?a(t,i,n):a(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const Q=class{constructor(e){o(this,e),this.vegaChange=a(this,"vegaChange",7),this.change=a(this,"change",7),this.vegaCreate=a(this,"vegaCreate",7),this.create=a(this,"create",7),this.vegaSearch=a(this,"vegaSearch",7),this.search=a(this,"search",7),this.globalSlimmers={},this.itemsSlotController=new Z,this.keyboardController=new B,this.valueController=new P,this.sourceController=new $,this.renderer=new U,this.dropdownRenderer=new N,this.pageResizeSlimmer=new _,this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new n:null}],validationRulesName:"validationRules",defaultValue:[],attributeGetter:e=>this[e],inputContainerGetter:()=>this.dropdownRenderer.getDropdownRef(),touchableAreaGetter:()=>[this.dropdownRenderer.getSearchInputRef()]}),this.changeEventEmit=u(Q,I),this.createEventEmit=u(Q,w),this.searchEventEmit=u(Q,C),this.dropdownEventPrevent=new x([w,C],(()=>this.dropdownRenderer.getDropdownRef()),{customPreventHandle:e=>{e.stopImmediatePropagation()}}),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(M),this.label="",this.required=!1,this.optional=!1,this.source=[],this.value=[],this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.disabled=!1,this.placeholder="",this.hint="",this.size="medium",this.vegaDropdownProps={},this.useDefaultFilter=!0}watchSource(){this.source=p(this.source,l)?this.source:[]}watchValue(){this.changeEventEmit.emit(this.value),O.notify(k,{host:this.host,detail:this.value})}watchValidationRules(){}watchContainerMaxHeight(){}async close(){this.disabled||await this.dropdownRenderer.hide()}async open(){this.disabled||await this.dropdownRenderer.show()}render(){return d(this.renderer.render(),this.host)}get host(){return r(this)}static get watchers(){return{source:["watchSource"],value:["watchValue"],validationRules:["watchValidationRules"],containerMaxHeight:["watchContainerMaxHeight"]}}};J([v()],Q.prototype,"globalSlimmers",void 0),J([b()],Q.prototype,"itemsSlotController",void 0),J([b()],Q.prototype,"keyboardController",void 0),J([b()],Q.prototype,"valueController",void 0),J([b()],Q.prototype,"sourceController",void 0),J([b()],Q.prototype,"renderer",void 0),J([b()],Q.prototype,"dropdownRenderer",void 0),J([b()],Q.prototype,"pageResizeSlimmer",void 0),J([b()],Q.prototype,"formFieldController",void 0),J([b()],Q.prototype,"changeEventEmit",void 0),J([b()],Q.prototype,"createEventEmit",void 0),J([b()],Q.prototype,"searchEventEmit",void 0),J([b()],Q.prototype,"dropdownEventPrevent",void 0),J([b()],Q.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),Q.style=':host{display:inline-block;width:100%;min-width:0px;text-align:left;line-height:normal}.vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;border-radius:8px;gap:8px;display:block;display:flex;flex-wrap:wrap;align-items:center;cursor:pointer}.vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-combo-box-container-content{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%;max-height:100%;overflow-y:auto;overflow-x:hidden;min-height:26px}.vega-combo-box-container:focus-within{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-combo-box-container .vega-combo-box-input-container{width:-webkit-min-content;width:-moz-min-content;width:min-content;flex-grow:1}.vega-combo-box-container input{border-style:none;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));width:100%}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-combo-box-container input{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.vega-combo-box-container input:focus{outline:2px solid transparent;outline-offset:2px}.vega-combo-box-size-medium{padding-left:12px;padding-right:12px;padding-top:11px;padding-bottom:11px}.vega-combo-box-size-small{padding-left:12px;padding-right:12px;padding-top:7px;padding-bottom:7px}.vega-combo-box-container:focus{outline:none}vega-field-label{margin-bottom:8px}.error .vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.error .vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.error .vega-combo-box-container:focus-within{border:1px solid rgba(var(--v-border-input-field-danger-focus, 233, 71, 104, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host(.vega-combo-box-disabled) .vega-combo-box-container{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));--tw-shadow:0 0 #0000;box-shadow:rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px}:host(.vega-combo-box-disabled) .vega-combo-box-container:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.vega-combo-box-disabled) vega-icon{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}.vega-combo-box-container input::placeholder{color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1))}.vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}.vega-combo-box-hint{padding-left:8px;padding-right:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-top:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-combo-box-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-error:not(.vega-hidden)+.vega-combo-box-hint{padding-top:4px}vega-dropdown{display:block}';export{Q as vega_combo_box}
|
package/dist/vega/p-89947a43.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as t}from"./p-8b5d3a52.js";import{a as e,g as n,D as i,f as r,r as a}from"./p-528748fa.js";import{L as s,I as o}from"./p-6e1ab235.js";import{I as l,c}from"./p-9a6bd32c.js";import{I as h}from"./p-781fd6e0.js";import{c as d}from"./p-6a334573.js";import{P as u}from"./p-81dd00d0.js";import{i as p}from"./p-46cab60a.js";import{V as f}from"./p-091fbc35.js";import{R as w,E as g,h as b,U as m,V as v,B as y,a as x,I as L,b as C,c as S,P as k,A as T,d as A}from"./p-a18d280f.js";import{s as E,A as O,a as I,R,b as N,M as j,c as B,d as _,e as D,f as M,g as H,I as V,h as P,i as K,j as F,k as z,l as $,B as q,m as W,n as G,C as U,o as Z,p as J,q as Q,S as X,U as Y,N as tt,r as et,t as nt}from"./p-50e7020c.js";import{i as it}from"./p-b2488adb.js";import{R as rt}from"./p-b6c3ce6d.js";import{V as at}from"./p-a7b5f497.js";import{V as st}from"./p-724df1f5.js";import{v as ot}from"./p-4866e390.js";import{D as lt,d as ct}from"./p-526e3634.js";import{V as ht,a as dt,b as ut,c as pt}from"./p-fcefb62c.js";import{R as ft,a as wt,S as gt,T as bt,b as mt,c as vt,d as yt,e as xt,C as Lt,M as Ct,f as St,g as kt,h as Tt,i as At,j as Et,k as Ot,l as It,m as Rt,n as Nt,o as jt,p as Bt,q as _t,s as Dt,r as Mt,t as Ht,I as Vt,u as Pt,v as Kt,w as Ft,x as zt,y as $t,z as qt,A as Wt,B as Gt,D as Ut,E as Zt,F as Jt,G as Qt,H as Xt,J as Yt,K as te,L as ee,N as ne,O as ie,P as re,Q as ae,U as se,W as oe,X as le,Y as ce}from"./p-5f09aba8.js";import{C as he}from"./p-2d0d575f.js";import{V as de,a as ue,b as pe}from"./p-3a93730e.js";import{r as fe}from"./p-77e64f26.js";import{V as we}from"./p-3e09aeed.js";import{t as ge}from"./p-b75ee3ba.js";import{p as be}from"./p-0c667d6a.js";import{c as me}from"./p-a841cf13.js";import{d as ve}from"./p-1bc5b3bc.js";import{R as ye}from"./p-2e86aee5.js";const xe=[{payloadKey:"IS_LOAD_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaLoaderController is called",canAccept:(t,e)=>"VegaLoaderController"===t&&"load"===e,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaLoaderController is called",canAccept:(t,e)=>"VegaLoaderController"===t&&"close"===e,payloadValue:()=>!0}];class Le{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Le,["load","close"],xe)}load(t={}){let e=t.containerSelector||"body",n=document.querySelector(e);if(n&&Le.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY.includes(n.tagName)&&(e="body",n=document.querySelector("body")),!n)return s.error("Container is not found by selector: ",e),null;const i=this.createLoadingIndicator(t.indicatorOptions),r=this.createLoader(e);return r.append(i),this.appendLoader(r,n)}close(t){const e=this.findLoader(t);if(e){if(e.dataset.container){const t=document.querySelector(e.dataset.container);t&&t.dataset.vegaLoaderOriginPosition&&(t.style.position=t.dataset.vegaLoaderOriginPosition)}e.remove()}}findLoader(t){var e,n;let i;if(t.includes(">>>")){const[r,a]=t.split(">>>");i=null===(n=null===(e=document.querySelector(r))||void 0===e?void 0:e.shadowRoot)||void 0===n?void 0:n.getElementById(a)}else i=document.getElementById(t);return i}createLoader(n){const i=document.createElement("vega-loader-wrapper");return i.className=e(["body"===n?"fixed-wrapper":"absolute-wrapper"]),i.dataset.container=n,i.id=`vega-loader-${t()}`,i}createLoadingIndicator(t={}){const e=document.createElement("vega-loading-indicator");return Object.assign(e,t),e}appendLoader(t,e){return e.dataset.vegaLoaderOriginPosition=e.style.position,e.style.position="relative",e.shadowRoot?(e.shadowRoot.append(t),`${t.dataset.container}>>>${t.id}`):(e.append(t),t.id)}}Le.SPECIAL_ELEMENT_TO_WRAP_FULL_BODY=["VEGA-MODAL"],function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);a>3&&s&&Object.defineProperty(e,n,s)}([l()],Le.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Ce=new Le,Se=[{payloadKey:"IS_OPEN_METHOD_CALLED",payloadDescription:"Indicate if the method open of public API VegaNotifyController is called",canAccept:(t,e)=>"VegaNotifyController"===t&&"open"===e,payloadValue:()=>!0},{payloadKey:"IS_CLOSE_METHOD_CALLED",payloadDescription:"Indicate if the method close of public API VegaNotifyController is called",canAccept:(t,e)=>"VegaNotifyController"===t&&"close"===e,payloadValue:()=>!0},{payloadKey:"IS_CLOSEALL_METHOD_CALLED",payloadDescription:"Indicate if the method closeAll of public API VegaNotifyController is called",canAccept:(t,e)=>"VegaNotifyController"===t&&"closeAll"===e,payloadValue:()=>!0}];var ke=function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);return a>3&&s&&Object.defineProperty(e,n,s),s};class Te{constructor(){this.resizeObserverSlimmer=d(Te,u,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{var e;!(t[0].contentRect.height>0)&&(null===(e=this.container)||void 0===e?void 0:e.classList.contains("hydrated"))&&(h.removeZIndex(this.container,"top"),this.container.remove(),this.container=null)},target:()=>this.container}]),this.vegaPublicAPIRuntimeMetricsSlimmer=c(Te,["open","close","closeAll"],Se)}async open(t){const e=this.createPageNotification(t);return this.getContainer().append(e),e.id}async closeAll(){this.container&&Array.from(this.container.children).forEach((t=>{t.close()}))}async close(t){await document.getElementById(t).close()}connectResizeObserver(){}createPageNotification(e){const r=document.createElement("vega-page-notification");return Object.keys(e).forEach((t=>{void 0!==e[t]&&(r[t]=e[t])})),r.style.marginBottom=n()===i.MOBILE?"12px":"16px",r.id=`vega-page-notification-${t()}`,r}getContainer(){return this.container||(this.container=document.createElement("vega-page-notification-list"),h.setZIndex(this.container,"top"),n()===i.MOBILE?this.container.classList.add("vega-page-notification-list-bottom"):this.container.classList.add("vega-page-notification-list-topRight"),document.body.append(this.container),this.connectResizeObserver()),this.container}}ke([o()],Te.prototype,"resizeObserverSlimmer",void 0),ke([l()],Te.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Ae=new Te,Ee=[{payloadKey:"IS_SETSEMANTICS_METHOD_CALLED",payloadDescription:"Indicate if the method setSemantics of public API VegaEventManager is called",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:()=>!0},{payloadKey:"IS_GETSEMANTICS_METHOD_CALLED",payloadDescription:"Indicate if the method getSemantics of public API VegaEventManager is called",canAccept:(t,e)=>"VegaEventManager"===t&&"getSemantics"===e,payloadValue:()=>!0},{payloadKey:"IS_GETENABLEDEVENTIDSBYCOMPONENT_METHOD_CALLED",payloadDescription:"Indicate if the method getEnabledEventIdsByComponent of public API VegaEventManager is called",canAccept:(t,e)=>"VegaEventManager"===t&&"getEnabledEventIdsByComponent"===e,payloadValue:()=>!0},{payloadKey:"globalEventIsNative",payloadDescription:"Indicate if the vega components will emit events without the vega prefix",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>!(!t.global||"native"!==t.global.namespace)},{payloadKey:"eventOfSpecificComponentsIsNative",payloadDescription:"Indicate if the vega components will emit events with the vega prefix, but special components will emit events without vega prefix",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;if(e.components){const t=Object.keys(e.components);return!!(t.length>0&&"native"===e.components[t[0]].namespace)}return!1}},{payloadKey:"eventOfSpecificComponentsIsVega",payloadDescription:"Indicate if the vega components will emit events without the vega prefix, but special components will emit events with vega prefix",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;if(e.global&&e.components){const t=Object.keys(e.components);return!!("native"===e.global.namespace&&t.length>0&&"vega"===e.components[t[0]].namespace)}return!1}},{payloadKey:"globalJqueryDelegatedEventIsTrue",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>!(!t.global||!0!==t.global.jqueryDelegatedEvent)},{payloadKey:"jqueryDelegatedEventIsCustomStrategy",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;return!!(e.global&&Array.isArray(e.global.jqueryDelegatedEvent)&&e.global.jqueryDelegatedEvent.length>0)}},{payloadKey:"jqueryDelegatedEventOfSpecialComponentsIsTrue",payloadDescription:"Indicate if the use jQuery with event delegation",canAccept:(t,e)=>"VegaEventManager"===t&&"setSemantics"===e,payloadValue:t=>{const e=t;if(e.components){const t=Object.keys(e.components);return!!(t.length>0&&!0===e.components[t[0]].jqueryDelegatedEvent)}return!1}}];class Oe{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Oe,["setSemantics","getSemantics","getEnabledEventIdsByComponent"],Ee)}setSemantics(t){p.setSemantics(t)}getSemantics(t){return p.getSemantics(t)}getEnabledEventIdsByComponent(t){return p.getEnabledEventIdsByComponent(t)}}!function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);a>3&&s&&Object.defineProperty(e,n,s)}([l()],Oe.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Ie=new Oe,Re=[{payloadKey:"IS_OVERRIDEZINDEXBASICVALUES_METHOD_CALLED",payloadDescription:"Indicate if the method overrideZIndexBasicValues of public API ZIndexManager is called",canAccept:(t,e)=>"VegaZIndexManager"===t&&"overrideZIndexBasicValues"===e,payloadValue:()=>!0},{payloadKey:"zIndexBasicValuesGreatThanTenThousand",payloadDescription:"Indicate if the basic z-index value is great than ten thousand",canAccept:(t,e)=>"VegaZIndexManager"===t&&"overrideZIndexBasicValues"===e,payloadValue:t=>t.base>1e4}];class Ne{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Ne,["overrideZIndexBasicValues"],Re)}overrideZIndexBasicValues(t){h.overrideZIndexBasicValues(t)}}!function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);a>3&&s&&Object.defineProperty(e,n,s)}([l()],Ne.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const je=new Ne,Be=[{payloadKey:"IS_WAITFORVEGA_METHOD_CALLED",payloadDescription:"Indicate if the method waitForVega of public API WaitForVegaHandler is called",canAccept:(t,e)=>"WaitForVegaHandler"===t&&"handle"===e,payloadValue:()=>!0}];class _e{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(_e,["handle"],Be)}async handle(){return await Promise.all(Array.from(document.querySelectorAll("*:not(.hydrated)")).filter((t=>t.tagName.startsWith("VEGA"))).map((t=>{var e;return null===(e=t.componentOnReady)||void 0===e?void 0:e.call(t)})))}}!function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);a>3&&s&&Object.defineProperty(e,n,s)}([l()],_e.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const De=new _e,Me=async()=>De.handle(),He=[{payloadKey:"IS_LOAD_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaSkeletonLoaderController is called",canAccept:(t,e)=>"VegaSkeletonLoaderController"===t&&"load"===e,payloadValue:()=>!0},{payloadKey:"IS_UNLOAD_METHOD_CALLED",payloadDescription:"Indicate if the method unLoad of public API VegaSkeletonLoaderController is called",canAccept:(t,e)=>"VegaSkeletonLoaderController"===t&&"unLoad"===e,payloadValue:()=>!0},{payloadKey:"IS_UNLOADALL_METHOD_CALLED",payloadDescription:"Indicate if the method unLoadAll of public API VegaSkeletonLoaderController is called",canAccept:(t,e)=>"VegaSkeletonLoaderController"===t&&"unLoadAll"===e,payloadValue:()=>!0}];class Ve{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Ve,["load","unLoad","unLoadAll"],He),this.loaderMap=new Map}load({target:e,type:n="text",width:i,height:r,items:a,layout:s}){const o=Array.from(document.body.querySelectorAll(e)),l=`vega-skeleton-loader-${t()}`,c=[];return o.forEach((t=>{const e=a?a.map(this.createSkeleton):[this.createSkeleton({type:n,width:i,height:r})],o=(s?[this.wrapLayout(e,s)]:e).map((t=>(t.dataset[Ve.LOADER_DATA_SET_KEY]=l,t)));c.push(...o),t.append(...o)})),this.loaderMap.set(l,c),l}unLoad(t){this.loaderMap.has(t)&&(this.loaderMap.get(t).forEach((t=>t.remove())),this.loaderMap.delete(t))}unLoadAll(){for(const t of this.loaderMap.values())t.forEach((t=>t.remove()));this.loaderMap.clear()}createSkeleton(t){const{type:e,width:n,height:i}=t,r=document.createElement("vega-skeleton");return Object.assign(r,{animated:!0,type:e,width:n,height:i}),r}wrapLayout(t,e){const n=document.createElement("vega-flex");return Object.assign(n,Object.assign({className:"vega-skeleton-loader-template-container"},e.props)),Object.assign(n.style,e.style),n.append(...t),n}}Ve.LOADER_DATA_SET_KEY="vegaSkeletonLoaderKey",function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);a>3&&s&&Object.defineProperty(e,n,s)}([l()],Ve.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const Pe=new Ve,Ke=[{payloadKey:"IS_INIT_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaTranslation.init is called",canAccept:(t,e)=>"TranslationController"===t&&"init"===e,payloadValue:()=>!0},{payloadKey:"IS_CHANGE_LANGUAGE_METHOD_CALLED",payloadDescription:"Indicate if the method load of public API VegaTranslation.changeLanguage is called",canAccept:(t,e)=>"TranslationController"===t&&"changeLanguage"===e,payloadValue:()=>!0}];class Fe{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=c(Fe,["init","changeLanguage"],Ke)}get currentLanguage(){return f.currentLanguage}init(t){f.init(t)}changeLanguage(t){f.changeLanguage(t)}}!function(t,e,n,i){var r,a=arguments.length,s=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,i);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(s=(a<3?r(s):a>3?r(e,n,s):r(e,n))||s);a>3&&s&&Object.defineProperty(e,n,s)}([l()],Fe.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const ze=new Fe,$e=new class{constructor(){this.extensionContextMap=new WeakMap}updateExtensionContext(t){if(t&&t.host){let e=t;const n=this.extensionContextMap.get(t.host);n&&(e=Object.assign(Object.assign({},n),t)),this.extensionContextMap.set(t.host,e)}}getExtensionContext(t){return t?this.extensionContextMap.get(t):null}};class qe extends at{injectRTEScopeStyles(){return""}render(t,e,n){var i;const r=this.doRender(n,t,e);return this.fallbackRegisterRef(r,t),this.appendChildren((null===(i=r.childrenContainerGetter)||void 0===i?void 0:i.call(r))||r,t,e,n),r}useRef(t){return t[qe.REGISTER_REF_FLAG]=!0,function(e){e&&E.register(e,t)}}getDTORenderer(t){return rt.getRTERenderer(t)}getExtensionContext(t){return $e.getExtensionContext(t)}appendChildren(t,e,n,i){Array.isArray(e.children)&&e.children.length&&!t.i&&(t.i=e.children.map((t=>this.renderChildren(t,n,i))).filter(it))}renderChildren(t,e,n){const i=this.getDTORenderer(t.type);if(i)return i.render(t,e,n)}fallbackRegisterRef(t,e){e[qe.REGISTER_REF_FLAG]||!t.o||t.o.ref||(t.o.ref=this.useRef(e))}}qe.REGISTER_REF_FLAG="__registeredRef__";const We=new WeakSet,Ge=new WeakMap;class Ue{constructor(){this.extensionContext=null,this.hasCustomStylesRenderers=new Set}static registerActionHandleStrategy(t,e,n){O.register(e,t,n)}static registerActionHandlerInterceptor(t,e,n){I.register(e,t,n)}static registerFilterStylesStrategy(t,e){R.register(t,e)}static attachAnnotationFromJson(t,e,n){var i,r;const a=null!==(i=Ge.get(t))&&void 0!==i?i:new Map,s=null!==(r=a.get(e))&&void 0!==r?r:new Set;if(s.add(n),a.set(e,s),Ge.set(t,a),We.has(t))return;We.add(t);const o=t.from.bind(t);t.from=function(e,n){const i=o(e,n),r=e.annotations,a=Ge.get(t);return r&&a&&a.forEach(((t,a)=>{const s=r[a];t.forEach((t=>{t(i,s,e,n)}))})),i}}prepareBeforeLoad(t){}initialExtensionAfterLoad(t){this.extensionContext=t,$e.updateExtensionContext(t)}destroyExtension(){}collectExtensionRendererStyles(){let t="";return this.hasCustomStylesRenderers.size>0&&this.hasCustomStylesRenderers.forEach((e=>{t+=`${e.injectRTEScopeStyles()}\n`})),t}registerNode(t,e){N.registerRTEDTOClass(t,e)}registerRenderer(t,e){rt.registerRTEDTORenderer(t,e),e instanceof qe&&e.injectRTEScopeStyles()&&this.hasCustomStylesRenderers.add(e)}registerToolbarButtonRenderer(t,e,n){n?rt.registerRTEToolbarButtonRendererForHost(n,t,e):rt.registerRTEToolbarButtonRenderer(t,e)}registerBlockBasicStrategies(t){w.registerBlockBasicStrategies(t)}unRegisterStrategy(t,e){O.unregister(t,e)}unRegisterInterceptor(t,e,n){I.unregister(t,e,n)}registerElementToBlockDTOClassStrategy(t){g.registerElementToBlockStrategy(t)}registerElementToNodeDTOClassStrategy(t){g.registerElementToNodeStrategy(t)}getElementToNodeDTOClassStrategies(){return g.getElementToNodeStrategies()}registerAnnotationHandler(t){b.registerHandler(t)}}class Ze{constructor(){this.dropdownEl=null,this.itemsContainerEl=null,this.buttonEl=null}isHidden(t){return t.sourceEditMode}getExtensionContext(t){return $e.getExtensionContext(t)}renderDropdown(t,e,n,i){return t("vega-dropdown",Object.assign({trigger:"click",searchable:!1,maxWidth:"200",itemDisplayRule:"ellipsis",ref:t=>{this.dropdownEl=t,lt.addUniqueObserverToNode(t,ht,(t=>{this.handleDropdownClick(t.detail,e)}))}},n),i)}renderDropdownListTemplate(t,e){return t("div",{slot:"items",onMouseDown:this.preventDefault,onKeyDown:t=>this.handleItemsKeyDown(t),ref:t=>{this.itemsContainerEl=t},class:"rte-dropdown-list"},[t("style",{nonce:ot.nonce},".rte-dropdown-list vega-dropdown-group vega-dropdown-group { padding-left: 4px }"),...e.map((e=>"children"in e?this.renderDropdownGroup(t,e):this.renderDropdownItem(t,e)))])}renderDropdownItem(t,e){return t("vega-dropdown-item",{key:e.key,itemKey:e.key,label:e.label,prefixIcon:e.icon})}renderDropdownGroup(t,e){return t("vega-dropdown-group",{key:e.key,label:e.label,divide:!1},e.children.map((e=>"children"in e?this.renderDropdownGroup(t,e):this.renderDropdownItem(t,e))))}renderButton(t,e,n){const{icon:i,label:r,showArrowIcon:a,tooltip:s}=n,o=this.isDisabled(e),l=t("vega-rich-text-editor-toolbar-button",{disabled:o,icon:i,hidden:this.isHidden(e),selected:this.isSelected(e),ref:t=>{this.buttonEl=t,lt.addUniqueObserverToNode(t,dt,(()=>this.handleButtonClick(e)))},onMouseDown:this.preventDefault,onKeyDown:t=>this.handleButtonKeyDown(t)},[this.renderButtonLabel(t,e,r),a?t("vega-icon",{size:"size-8",color:o?"text-disabled":"text-secondary",style:{marginLeft:"8px"},icon:st.getIconKey("chevron-down")}):null].filter(it));return(null==s?void 0:s.text)?t("vega-tooltip",{text:e.translation.t(s.text),placement:["bottom","top"]},[l]):l}renderButtonLabel(t,e,n){return n?t("vega-font",{variant:"font-field-label-sm",color:this.isDisabled(e)?"text-disabled":"text-primary"},n):null}isDisabled(t){return t.host.disabled}isSelected(t){return!1}preventDefault(t){t.preventDefault()}getListItemByKey(t,e){for(const n of t)if("children"in n){const t=this.getListItemByKey(n.children,e);if(t)return t}else if(n.key===e)return n;return null}handleButtonKeyDown(t){this.dropdownEl&&("Enter"===t.code||"Space"===t.code?(t.preventDefault(),t.stopPropagation(),this.dropdownEl.dispatchEvent(new MouseEvent("click",{bubbles:!0}))):"ArrowDown"!==t.code&&"ArrowUp"!==t.code||(t.preventDefault(),t.stopPropagation(),this.dropdownEl.show().then((()=>{this.focusDropdownItem("ArrowDown"===t.code?"first":"last")}))))}handleItemsKeyDown(t){var e,n,i;if("Escape"===t.code)return t.preventDefault(),t.stopPropagation(),this.dropdownEl&&this.dropdownEl.hide(),void(null===(e=this.buttonEl)||void 0===e||e.focus());if("ArrowDown"!==t.code&&"ArrowUp"!==t.code)return;t.preventDefault(),t.stopPropagation();const r=this.getDropdownItems();if(0===r.length)return;const a=r.findIndex((t=>{var e,n;return(null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector("li"))===(null===(n=t.shadowRoot)||void 0===n?void 0:n.activeElement)})),s="ArrowDown"===t.code?1:-1,o=-1===a?"ArrowDown"===t.code?0:r.length-1:a+s;for(let t=0;t<r.length;t++){const e=(o+t*s+r.length)%r.length;if(!r[e].disabled)return void(null===(i=null===(n=r[e].shadowRoot)||void 0===n?void 0:n.querySelector("li"))||void 0===i||i.focus())}}focusDropdownItem(t){var e,n;const i=this.getDropdownItems(),r="first"===t?i:[...i].reverse();for(const t of r)if(!t.disabled)return void(null===(n=null===(e=t.shadowRoot)||void 0===e?void 0:e.querySelector("li"))||void 0===n||n.focus())}getDropdownItems(){return this.itemsContainerEl?Array.from(this.itemsContainerEl.querySelectorAll("vega-dropdown-item")):[]}}class Je extends j{constructor(t,e){super(),this.type="INSERT_TOKEN_NODE",this.rteRange=null,this.actionHandleResult=!1,this.rteRange=t,this.token=e}}class Qe extends Ze{constructor(t){super(),this.tokenList=[],this.tokenList=t}render(t,e){return this.renderDropdown(t,e,{},[this.renderButton(t,e,{label:"Tokens",showArrowIcon:!0,tooltip:{text:"Insert token"}}),this.renderDropdownListTemplate(t,this.tokenList)])}isDisabled(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,getSelectedNodes:n}=e,[i]=n();return i?t.disabled||!O.canHandle("INSERT_TOKEN_NODE",i.parent):t.disabled}return!1}handleButtonClick(t){}handleDropdownClick(t,e){const n=this.getListItemByKey(this.tokenList,t),{rteRange:i}=e,{startNode:r}=i;if(r&&r.parent){const t=new Je(i,n);r.parent.apply(t),t.actionHandleResult&&this.flushEditorUI(e)}}flushEditorUI(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,flushValue:n}=e;n(t.value)}}}class Xe extends B{constructor(t,e,n,i,r){super(t,n,i,r),this.dtoName=Xe.dtoName,this.type="token",this.token=e,this.text=n}static from(t,e){const n=new Xe(t.id,t.token,t.text,e);return t.annotations&&(n.annotationMap=this.generateTextAnnotationMap(t.annotations)),n}toJSON(){const t=super.toJSON();return Object.assign({id:this.id,type:this.type,text:this.text,token:this.token},t.annotations?{annotations:t.annotations}:{})}isContentEditable(){return!1}clone(t){return new Xe(this.id,this.token,this.text,t,this.annotationMap)}toHtml(){return`<span class="token" contenteditable="false" template-token-key="${this.token}" token-key="${this.token}"${super.generateAttributeString()}>${this.text}</span>`}}Xe.dtoName="RTETokenNode";class Ye extends qe{doRender(t,e,n){const{id:i,token:r}=e;return t("span",Object.assign(Object.assign({key:i,"template-token-key":r,"token-key":r,contenteditable:"false",style:e.getStyles(),class:`token ${e.getClasses()}`},this.additionalAttributes(e)),{ref:this.useRef(e),onClick:t=>{t.preventDefault(),n&&!1!==n.editable&&this.handleTokenElementClick(t,e,n.host)}}),e.text)}injectRTEScopeStyles(){return"span[token-key]{padding: 0 2px; margin: 0 1px; background-color: rgba(var(--v-bg-status-info, 205,209,211))}"}handleTokenElementClick(t,e,n){t.preventDefault(),n&&n.value.apply(new m(e,void 0,!0))}additionalAttributes(t){const e=t.getCustomAttributesAnnotation();let n={wrapped:"true"};return e&&(n=Object.assign(Object.assign({},n),e.render())),n}}class tn extends Ze{constructor(t,e,n=""){super(),this.languageList=[],this.languageChangeCallback=null,this.selectedLanguage="",this.labelRef=null,this.handleDropdownClick=t=>{this.setSelectedLanguage(t),"function"==typeof this.languageChangeCallback&&this.languageChangeCallback(t)},this.languageList=t,this.languageChangeCallback=e,this.selectedLanguage=n}setSelectedLanguage(t){this.selectedLanguage=t,this.labelRef&&(this.labelRef.textContent=this.getLanguageLabelByKey(t))}isHidden(){return!1}render(t,e){return this.renderDropdown(t,e,{source:this.languageList},[this.renderButton(t,e,{label:this.getLanguageLabelByKey(this.selectedLanguage),showArrowIcon:!0,tooltip:{text:"Select language"}})])}renderButtonLabel(t,e,n){return t("vega-font",{variant:"font-field-label-sm",color:this.isDisabled(e)?"text-disabled":"text-primary",ref:t=>{this.labelRef=t}},n)}handleButtonClick(t){}getLanguageLabelByKey(t){var e;const n=this.getListItemByKey(this.languageList,t);return null!==(e=null==n?void 0:n.label)&&void 0!==e?e:"Select Language"}}class en extends Ue{constructor(t,e){super(),this.languageToolbarButtonRenderer=null,this.languageState={selectedLanguage:"",contentMap:{}},this.languageChangeCallBack=t=>{const e=this.languageState.selectedLanguage;this.extensionContext&&e&&(this.languageState.contentMap[e]=this.getRTELatestValue(this.extensionContext.host)),this.languageState.selectedLanguage=t,this.applyLanguageContent(t,this.languageState.contentMap)},this.languageList=t,e&&(this.languageState=Object.assign(Object.assign({},this.languageState),e)),!this.languageState.selectedLanguage&&t.length>0&&(this.languageState.selectedLanguage=t[0].key)}prepareBeforeLoad(t){this.languageToolbarButtonRenderer=new tn(this.languageList,this.languageChangeCallBack,this.languageState.selectedLanguage),this.registerToolbarButtonRenderer("languages",this.languageToolbarButtonRenderer,t)}initialExtensionAfterLoad(t){super.initialExtensionAfterLoad(t);const{selectedLanguage:e,contentMap:n}=this.languageState;this.languageToolbarButtonRenderer&&this.languageToolbarButtonRenderer.setSelectedLanguage(e),n&&n[e]&&this.applyLanguageContent(this.languageState.selectedLanguage,this.languageState.contentMap)}setState(t){const{selectedLanguage:e,contentMap:n}=t;this.languageToolbarButtonRenderer&&this.languageToolbarButtonRenderer.setSelectedLanguage(e),this.languageState.selectedLanguage=e,this.languageState.contentMap=Object.assign({},n),this.applyLanguageContent(e,n)}getState(){const{selectedLanguage:t,contentMap:e}=this.languageState;return this.extensionContext&&(e[t]=this.getRTELatestValue(this.extensionContext.host)),this.languageState}applyLanguageContent(t,e){if(this.extensionContext&&e){let n=e[t];const{host:i,flushValue:r}=this.extensionContext;n=n?n instanceof v?n:v.fromJSON(n,i.sourceEditConfig):v.createEmptyContent(),i.value!==n&&r(n,!0)}}getRTELatestValue(t){var e;let n=t.value;if(this.extensionContext&&this.extensionContext.isSourceEditMode()&&t.shadowRoot){const i=t.shadowRoot.querySelector(".source-view-container vega-code-block");if(i){let r;t.sourceEditConfig&&(r={autoMatchFormat:null===(e=t.sourceEditConfig.autoMatchFormat)||void 0===e||e,filterInlineStyles:t.sourceEditConfig.filterInlineStyles}),n=v.fromHtml(i.value.code,r)}}return n}}class nn extends j{constructor(t){super(),this.type="INSERT_FUNCTION_BLOCK",this.functionType=t}}class rn extends _{constructor(t){super(t),this.dtoName=rn.dtoName,this.type="function-block",this.children=[]}static from(t,e){const n=new rn(t.id),i={customClass:["statement"]};let{annotations:r}=t;return r=r?Object.assign(Object.assign({},r),i):i,super.convertAnnotationsToMap(n.annotationMap,r),n.children=this.generateBlockChildren(t.children,e,n),n}toHtml(){return`<div class="statement">${this.children.map((t=>t instanceof D?`<div class="statementelement"${this.getFunctionContentStyle(t)}>${t.getChildrenHtml()}</div>`:t.toHtml())).join("")}</div>`}clone(e){const n=new rn(t());return n.parent=e,n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,children:this.children.map((t=>t.toJSON()))})}getFunctionContentStyle(t){const e=new M(t);let n=e.toCssText({standalone:!0});const i=t.getAnnotationByType("TEXT_STYLE");if(i&&"paragraph"===i.textStyle){const t=e.toCssText(void 0,void 0,i.renderStyle({standalone:!0}));n=n.replace(t,"").trim()}return n?` style="${n}"`:""}}rn.dtoName="RTEFunctionBlock";class an extends H{handleAction(t,e){const{functionType:n}=t,i=this.getFunctionBlock(n),r=this.createNewParagraph(""),a=this.getReferenceBlock(e);a?a.parent.apply(new V(a,i,r)):e.apply(new P([i,r])),r&&(t.nextFocusNode=r.children[0])}getFunctionBlock(e){const n=t();return rn.from({id:n,type:"function-block",children:[{id:`${n}-1`,type:"logic-control-block",statementText:e.toUpperCase()},{id:`${n}-2`,annotations:{customClass:["statementelement"]},type:"paragraph",nodes:[{id:`${n}-2-1`,type:"text",text:" "}]},{id:`${n}-3`,type:"logic-control-block",statementText:"SHOW"},{id:`${n}-4`,annotations:{customClass:["statementelement"]},type:"paragraph",nodes:[{id:`${n}-4-1`,type:"text",text:" "}]}]})}getReferenceBlock(t){if(!(t instanceof v)){const e=t.parent;return e instanceof rn?e:t}}}class sn extends K{constructor(t,e,n){super(t),this.dtoName=sn.dtoName,this.type="logic-control-node",this.text="",this.text=e,this.parent=n}clone(){return new sn(this.id,this.text,this.parent)}toHtml(){return this.text}toJSON(){return{id:this.id,type:this.type,text:this.text}}getRangeEndOffset(){return 1}getRangeContainer(){const t=E.getDOMByEntity(this);if(t)return t.parentElement}isContentEditable(){return!1}}sn.dtoName="RTELogicControlNode";class on extends _{constructor(t,e,n){super(t),this.dtoName=on.dtoName,this.type="logic-control-block",this.children=[],this.statementText="",this.statementText=e,this.children=[new sn(`${t}-node-1`,e,this)],n&&(this.parent=n)}static from(t){return new on(t.id,t.statementText)}isNotEmpty(){return!0}getLastNode(){return this.children[this.children.length-1]}toHtml(){return`<div class='statementsyntax' contenteditable='false'>${this.statementText}</div>`}clone(t){return new on(this.id,this.statementText,t)}toJSON(){return{id:this.id,type:this.type,statementText:this.statementText}}}on.dtoName="RTELogicControlBlock";class ln extends Ze{render(t,e){return this.renderDropdown(t,e,{},[this.renderButton(t,e,{label:"Functions",showArrowIcon:!0,tooltip:{text:"Insert function"}}),this.renderDropdownListTemplate(t,ln.FUNCTION_LIST)])}isDisabled(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,getSelectedNodes:n}=e,i=n()[0];let r=!0;return i&&(r=O.canHandle("INSERT_FUNCTION_BLOCK",i.parent)),t.disabled||!r}return!1}handleButtonClick(){throw new Error("Method not implemented.")}handleDropdownClick(t,e){if(e){const n=this.getExtensionContext(e.host);if(n){const{host:e,getSelectedNodes:i}=n,r=i()[0],a=new nn(t);r?r.parent&&r.parent.apply(a):e.value.apply(a),a.nextFocusNode&&e.value.apply(new m(a.nextFocusNode,1))}}}}ln.FUNCTION_LIST=[{key:"IF",label:"Conditional"},{key:"FOREACH",label:"Foreach"}];class cn extends qe{doRender(t,e){return t("div",{key:e.id,class:"statementsyntax",ref:this.useRef(e)},t("span",{key:`${e.id}-1`,contenteditable:"false",ref:this.useRef(e.children[0])},e.statementText))}}class hn extends y{constructor(){super(...arguments),this.blockClassName="statementsyntax"}canHandle(t,e){const n=t[e];return n&&n.nodeType===Node.ELEMENT_NODE&&n.classList.contains(this.blockClassName)&&this.isFunctionBlockChild(n)?1:0}handle(e){const n=e[0];return on.from({id:t(),type:"logic-control-block",statementText:n.innerText})}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isFunctionBlockChild(t){return!(!t.parentElement||!t.parentElement.classList.contains("statement"))}}class dn extends qe{doRender(t,e){return t("div",{key:e.id,class:this.getElementClassName(e),ref:this.useRef(e)})}injectRTEScopeStyles(){return"div.statement{padding:2px 4px;background:rgba(var(--v-bg-accent3-secondary, 255, 239, 200));border:1px solid rgba(var(--v-bg-accent3-primary, 255, 220, 131));border-radius:4px;display:flex;flex-direction:row;justify-content:flex-start;align-items:stretch;gap:4px}div.statement .statementsyntax{padding:3px 0;line-height:22px}.rich-text-content div.statement .statementsyntax,.rich-text-content div.statement .statementelement{display:inline-block}div.statement+div.statement{margin-top:2px}div.statement .statementsyntax span{color:rgb(38, 42, 255);font-weight:bold}div.statement .statementelement{padding:2px 4px;background:rgba(var(--v-bg-secondary, 245, 247, 247));border:1px solid rgba(var(--v-border-color-input-field, 171, 198, 216));border-radius:4px;margin:0;min-width:8px}"}getElementClassName(t){let e=t.getClasses();return e.indexOf("statement")<0&&(e="statement "+e),e.trim()}}class un{}class pn extends un{canIntercept(t,e){return e.parent&&e.parent instanceof rn}intercept(t,e,n){const i=new L(n.children[0],0);i.isFlushable=!0,n.parent.apply(i)}}class fn extends H{handleAction(t,e){const n=this.createNewParagraph("");n&&(e.parent.apply(new V(e,n)),t.newBlock=n,this.focusToNextLine(n))}focusToNextLine(t){const e=this.getRootContent(t);e&&e.apply(new m(t.children[0],1))}}class wn extends j{constructor(t,e,n){super(),this.type="PASTE_PLAIN_TEXT",this.blocksToBeInserted=t,this.startNode=e,this.startOffset=n}}class gn extends pn{intercept(t,e,n){const{blocksToBeInserted:i,rteRange:r}=e;let{startNode:a,startOffset:s}=e;r&&(a=r.startNode,s=r.startOffset);const o=new wn(i,a,s);n.apply(o)}}class bn extends H{handleAction(t,e){const{blocksToBeInserted:n,startNode:i,startOffset:r}=t;if(i instanceof B){const t=n.flatMap((t=>t instanceof D?(this.copyLinkGroupAnnotations(e.annotationMap,t.annotationMap),t.children):[]));t.length>0&&(e.apply(r>0?new V(i,...t):new F(i,...t)),this.focusToNextLine(t[t.length-1],t[t.length-1].getRangeEndOffset()))}}focusToNextLine(t,e){const n=this.getRootContent(t);n&&n.apply(new m(t,e))}copyLinkGroupAnnotations(t,e){if(e&&e.has(z.LINK_GROUP)){const n=e.get(z.LINK_GROUP);t.has(z.LINK_GROUP)?n.linkGroups.forEach(((e,n)=>{t.get(z.LINK_GROUP).linkGroups.set(n,e)})):t.set(z.LINK_GROUP,e.get(z.LINK_GROUP))}}}const mn=new hn,vn=new class extends hn{constructor(){super(...arguments),this.blockClassName="statementelement"}handle(e,n){const i=b.generate(D,e[0]),r=Array.from(e[0].childNodes);return D.from({id:t(),type:"paragraph",annotations:Object.assign({customClass:[this.blockClassName]},i),nodes:this.generateChildNodes(r,void 0,n)})}},yn=new class extends x{canHandle(t,e){const n=t[e];return n&&"DIV"===n.tagName&&n.classList.contains("statement")&&n.childNodes.length&&n.querySelector(".statementsyntax")?1:0}handle(){return rn.from({id:t(),type:"function-block",annotations:{customClass:["statement"]},children:[]})}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}};class xn extends Ue{constructor(){super(),this.registerBlockBasicStrategies(on.name),this.registerBlockBasicStrategies(rn.name),this.preventFunctionBlockDefaultInsertNewParagraph(),this.registerNode("logic-control-block",on),this.registerRenderer("logic-control-block",new cn),this.registerNode("function-block",rn),this.registerRenderer("function-block",new dn),this.registerElementToBlockDTOClassStrategy(mn),this.registerElementToBlockDTOClassStrategy(vn),this.registerElementToBlockDTOClassStrategy(yn)}prepareBeforeLoad(t){this.registerToolbarButtonRenderer("functions",new ln,t)}preventFunctionBlockDefaultInsertNewParagraph(){this.unRegisterStrategy($.INSERT_NEW_PARAGRAPH,on.name),this.unRegisterStrategy($.APPEND_CHILDREN,rn.name),this.unRegisterStrategy($.INSERT_CHILDREN_AFTER,rn.name),this.unRegisterStrategy($.INSERT_CHILDREN_BEFORE,rn.name),this.unRegisterStrategy($.PASTE_CONTENT,on.name),Ue.registerActionHandleStrategy(rn.name,$.INSERT_NEW_PARAGRAPH,new fn)}}(()=>{const t=new an;Ue.registerActionHandleStrategy(v.name,"INSERT_FUNCTION_BLOCK",t),Ue.registerActionHandleStrategy(D.name,"INSERT_FUNCTION_BLOCK",t),Ue.registerActionHandleStrategy(C.name,"INSERT_FUNCTION_BLOCK",t),Ue.registerActionHandleStrategy(on.name,"INSERT_FUNCTION_BLOCK",t),Ue.registerActionHandleStrategy(D.name,"PASTE_PLAIN_TEXT",new bn),Ue.registerActionHandlerInterceptor(D.name,$.INSERT_NEW_PARAGRAPH,new pn),Ue.registerActionHandlerInterceptor(D.name,$.PASTE_CONTENT,new gn)})();class Ln extends j{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_BLOCK",this.tableBlock=t}}class Cn extends q{constructor(){super(...arguments),this.type=ft.CAPTION}static getDefaultStyles(){return{padding:"8px",border:"1px solid #ddd",borderBottom:"none",position:"relative",textAlign:"center",minHeight:"22px"}}clone(){return new Cn}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--extension-table-caption"}renderStyle(t){return(null==t?void 0:t.standalone)?Object.assign(Object.assign({},Cn.getDefaultStyles()),{backgroundColor:this.getCaptionBackgroundColor()}):null}toJSON(){return{caption:!0}}getCaptionBackgroundColor(){return we.isDarkMode()?wt.dark:wt.light}}class Sn extends _{constructor(t,e){super(t),this.dtoName=Sn.dtoName,this.type="table-caption";const{autoMatchFormat:n}=e||{autoMatchFormat:!0};n&&this.annotationMap.set(ft.CAPTION,new Cn)}static from(t,e){const n=new Sn(t.id,e),i=t.annotations||{},{caption:r}=i,a=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}(i,["caption"]);return r&&n.annotationMap.set(ft.CAPTION,new Cn),super.convertAnnotationsToMap(n.annotationMap,Object.assign({},a)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new Sn(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.isNotEmpty()))}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<caption${super.generateAttributeString(t)}>${e}</caption>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}O.register($.INSERT_CHILDREN_BEFORE,Sn.name,new S),O.register($.PASTE_CONTENT,Sn.name,new k),Sn.dtoName="RTETableCaptionBlock";class kn extends j{constructor(t){super(),this.type="TOGGLE_TABLE_CAPTION",this.isFlushable=!0,this.shouldEnable=t}}class Tn extends gt{canHandle(t){return t[0]===bt.CAPTION}execute(t,e,n){const i="rte-table-caption"===t[1],r=new kn(i),a=n.getCaption();if(i){const t=a&&a.isNotEmpty()?a:this.createCaptionBlock(null==a?void 0:a.id);a&&t===a||n.setCaption(t),r.nextFocusNode=t.getLastNode()}else a&&(n.setCaption(null),r.nextFocusNode=n.getFirstNode());this.syncCursorPosition(n,r.nextFocusNode)}syncCursorPosition(t,e){super.syncCursorPosition(t,e)}createCaptionBlock(e){const n={id:null!=e?e:t(),type:"table-caption",children:[{id:t(),type:"paragraph",nodes:[{id:t(),type:"text",text:""}]}]};return Sn.from(n)}}class An{static generateTablePropertiesForm(t){const e=t.annotationMap.get(ft.TABLE);let n={borderStyle:"none",borderColor:"",borderWidth:"",backgroundColor:"",width:"",height:"",textAlign:"center"};if(e){const t=e.toJSON().table,{style:i="none",color:r="",width:a=""}=t.border||{style:"none",color:"",width:""};n={backgroundColor:t.backgroundColor||"",width:t.width||"",height:t.height||"",textAlign:t.alignment,borderStyle:i,borderColor:r,borderWidth:a}}return n}updateCursorPosition(t,e){t&&e&&t.host.value.apply(new m(e,0))}}class En extends W{constructor(t){super(),this.isFlushable=!0;const{textAlign:e,width:n,borderWidth:i,borderColor:r,borderStyle:a,height:s}=t,o=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}(t,["textAlign","width","borderWidth","borderColor","borderStyle","height"]);this.tableProperties=Object.assign(Object.assign({},o),{alignment:e,border:{style:a,color:r,width:i?be(i):""},width:n?be(n):"",height:s?be(s):""})}toAnnotation(){return new mt(this.tableProperties)}}class On extends An{handle(t,e,n,i){e.apply(new En(n)),this.updateCursorPosition(t,i)}}class In extends An{handle(t,e,n,i){t&&t.host&&(t.flushValue(t.host.value),this.updateCursorPosition(t,i))}}class Rn extends An{handle(t,e,n){const i=new En(n);i.isFlushable=!1,e.apply(i)}}class Nn extends W{constructor(t,e){super(),this.isFlushable=!0,this.cellAnnotation=t,this.originAnnotation=e}toAnnotation(){return this.updateOriginAnnotation(),this.originAnnotation}updateOriginAnnotation(){Object.keys(this.cellAnnotation).forEach((t=>{this.originAnnotation[t]=this.cellAnnotation[t]}))}}class jn extends Nn{constructor(t,e){super(t,e),this.isFlushable=!0}toAnnotation(){return this.updateOriginAnnotation(),this.originAnnotation}}var Bn=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n};class _n{static getStyleCollectionFromCell(t){return t.reduce(((t,e)=>{const n=e.getAnnotationByType(ft.CELL);if(t[e.id]={},n){const i=n.toJSON().tableCell,{border:r}=i,a=Bn(i,["border"]),s={};r&&(s.borderStyle=r.style,s.borderColor=r.color,s.borderWidth=r.width),t[e.id]=me(Object.assign(Object.assign({},a),s))}return t}),{})}static convertStyleMapToFormField(t){const e={};for(const n in t){const i=t[n];for(const t in i)e[t]?e[t].push(i[t]):e[t]=[i[t]]}const n=Object.keys(t).length,i={};for(const t in e){const r=e[t],a=new Set(r);r.length===n&&1===a.size&&(i[t]=r[0])}return i}applyProperties(t,e,n){t.tableSelection.getSelectedCells().forEach((t=>{const i=e[t.id];if(i){const e=this.convertToVegaTableCellAnnotation(Object.assign({},i));this.applyAnnotation(t,e,n)}}))}updateCursorPosition(t,e){t&&e&&t.host.value.apply(new m(e,0))}convertToVegaTableCellAnnotation(t){const{borderStyle:e,borderWidth:n,borderColor:i}=t,r=Bn(t,["borderStyle","borderWidth","borderColor"]),a=me({style:e,width:n?be(n):"",color:i});return me(Object.assign(Object.assign({},r),{backgroundColor:r.backgroundColor||"",padding:r.padding?be(r.padding):"",width:r.width?be(r.width):"",height:r.height?be(r.height):"",verticalAlign:r.verticalAlign||"",textAlign:r.textAlign||"",border:a}))}applyAnnotation(t,e,n){const i=t.getAnnotationByType(ft.CELL)||new vt({},!1),r=t instanceof yt?new jn(e,i):new Nn(e,i);r.isFlushable=n,t.apply(r)}}class Dn extends _n{handle(t,e,n){t&&t.host&&(t.flushValue(t.host.value),this.updateCursorPosition(t,n))}}class Mn extends _n{handle(t,e){this.applyProperties(t,e,!1)}}class Hn extends _n{handle(t,e,n){this.applyProperties(t,e,!0),this.updateCursorPosition(t,n)}}class Vn{constructor(t){this.renderContext=t}getTableExtensionContext(){return this.renderContext?$e.getExtensionContext(this.renderContext.host):null}}class Pn extends Vn{constructor(t,e){super(e),this.popoverCloseType="none",this.tablePropertiesHandlerMap={save:new In,cancel:new On,change:new Rn},this.cellPropertiesHandlerMap={save:new Dn,cancel:new Hn,change:new Mn},this.handleTablePropertiesUpdate=t=>{const e=t.type.replace("vega","").toLowerCase();this.popoverCloseType=e,"change"!==e&&this.hide();const n=this.getTableExtensionContext();n&&this.tablePropertiesHandlerMap[e].handle(n,this.currentTableBlock,t.detail,this.currentFocusNode),"change"===e&&this.popoverRef.show(!0)},this.handleCellPropertiesUpdate=t=>{const e=t.type.replace("vega","").toLowerCase();this.popoverCloseType=e,"change"!==e&&this.hide();const n=this.getTableExtensionContext();n&&this.cellPropertiesHandlerMap[e].handle(n,t.detail,this.currentFocusNode),"change"===e&&this.popoverRef.show(!0)},this.tableColorSchema=t}destroy(){this.selectionAnchorRef&&this.selectionAnchorRef.parentNode&&(lt.removeUniqueObserverFromNode(this.selectionAnchorRef,de),this.selectionAnchorRef.parentNode.removeChild(this.selectionAnchorRef),this.selectionAnchorRef=null)}async show(t){let e=this.getTableRef();const n=this.getTableExtensionContext();let i=[];if(n&&(i=n.tableSelection.getSelectedCells()),t===bt.CELL&&i.length>1){const t=this.getOrCreateSelectionAnchor(i,e);t&&(e=t)}else t===bt.CELL&&1===i.length&&(e=E.getDOMByEntity(i[0]));this.updateContent(t),this.storeCurrentFocusNode(),fe.call(ct.getSubject(this.popoverRef,ue),e),await this.popoverRef.show()}async hide(){await this.popoverRef.hide()}reTarget(t,e){this.getTableRef=e,this.currentTableBlock=t}render(){const t=ge();if(t){const e=t.createElement("vega-popover");e.trigger="click",e.isScreenPosition=!0,e.className="rte-table-dynamic-popover",lt.addUniqueObserverToNode(e,ut,(()=>{const t=this.getTableExtensionContext();"change"===this.popoverCloseType&&t&&t.flushValue(t.host.value)}));const n=t.createElement("div");n.setAttribute("slot","popover"),n.className="rte-table-dynamic-popover-content";const i=t.createElement("vega-rich-text-table-properties");i.colors=this.tableColorSchema,i.type=bt.TABLE,i.setAttribute("type",bt.TABLE),i.addEventListener("vegaCancel",this.handleTablePropertiesUpdate),i.addEventListener("vegaChange",this.handleTablePropertiesUpdate),i.addEventListener("vegaSave",this.handleTablePropertiesUpdate);const r=t.createElement("vega-rich-text-table-properties");return r.colors=this.tableColorSchema,r.type=bt.CELL,r.setAttribute("type",bt.CELL),r.addEventListener("vegaCancel",this.handleCellPropertiesUpdate),r.addEventListener("vegaChange",this.handleCellPropertiesUpdate),r.addEventListener("vegaSave",this.handleCellPropertiesUpdate),n.appendChild(i),n.appendChild(r),e.appendChild(n),this.popoverRef=e,this.tablePropertiesFormRef=i,this.cellPropertiesFormRef=r,e}}updateContent(t){this.popoverCloseType="none";const e=this.getTableExtensionContext();"TABLE"===t?(this.tablePropertiesFormRef.classList.remove("vega-hidden"),this.cellPropertiesFormRef.classList.add("vega-hidden"),this.tablePropertiesFormRef.defaultValue=An.generateTablePropertiesForm(this.currentTableBlock)):"CELL"===t&&(this.cellPropertiesFormRef.classList.remove("vega-hidden"),this.tablePropertiesFormRef.classList.add("vega-hidden"),e&&(this.cellPropertiesFormRef.styleMap=_n.getStyleCollectionFromCell(e.tableSelection.getSelectedCells())),this.cellPropertiesFormRef.defaultValue=_n.convertStyleMapToFormField(this.cellPropertiesFormRef.styleMap)),e&&e.getSelection().removeAllRanges()}storeCurrentFocusNode(){const t=this.getTableExtensionContext();t&&(this.currentFocusNode=t.getSelectedNodes()[0])}getOrCreateSelectionAnchor(t,e){const n=ge();if(n&&e){const i=e.closest(".rich-text-content"),r=i.getBoundingClientRect();let a=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;t.map((t=>E.getDOMByEntity(t))).filter(it).forEach((t=>{const e=t.getBoundingClientRect();a=Math.min(a,e.left-r.left),s=Math.max(s,e.right-r.left),o=Math.min(o,e.top-r.top),l=Math.max(l,e.bottom-r.top)}));const c=s-a,h=l-o;return this.selectionAnchorRef=i.querySelector(".rte-table-selection-popover-anchor"),this.selectionAnchorRef||(this.selectionAnchorRef=n.createElement("div"),this.selectionAnchorRef.className="rte-table-selection-popover-anchor",this.selectionAnchorRef.style.position="absolute",this.selectionAnchorRef.style.pointerEvents="none",i.appendChild(this.selectionAnchorRef),lt.addUniqueObserverToNode(this.selectionAnchorRef,de,(()=>{this.destroy()}))),this.selectionAnchorRef.style.left=`${a}px`,this.selectionAnchorRef.style.top=`${o}px`,this.selectionAnchorRef.style.width=`${c}px`,this.selectionAnchorRef.style.height=`${h}px`,this.selectionAnchorRef}}}class Kn extends Vn{constructor(t){super(t),this.settingHandlers=[new xt,new Tn,new Lt,new Ct,new St],this.handleTableClick=(t,e,n)=>{const i=t.target.closest("table");i===n()&&(t.stopPropagation(),this.reTarget(e,n),this.tableDynamicPopover.hide(),fe.call(ct.getSubject(this.popoverRef,ue),i),this.popoverRef.show(!0))},this.syncSelectedCells=()=>{this.tableSettingRef&&(this.tableSettingRef.selectedCells=this.getTableSelectedCells())},this.handleSettingMenuClick=t=>{const e=this.settingHandlers.find((e=>e.canHandle(t.detail)));if(e){const n=this.getTableExtensionContext();n&&e.execute(t.detail,n,this.tableBlock),t.detail[0]===bt.CAPTION&&this.updateTableSettingCaption()}t.detail[0]!==bt.TABLE&&t.detail[0]!==bt.CELL||(this.popoverRef.hide(),this.tableDynamicPopover.show(t.detail[0]))},this.handleTableSettingPopoverShow=()=>{this.syncSelectedCells()},this.tableDynamicPopover=new Pn(kt.getTableColors(),t)}destroy(){this.tableDynamicPopover.destroy(),this.popoverContainer&&this.popoverContainer.remove()}render(){const t=ge();if(t&&this.renderContext){this.popoverContainer=t.createElement("div"),this.renderContext.host.appendChild(this.popoverContainer);const e=this.tableDynamicPopover.render(),n=t.createElement("vega-popover");n.trigger="click",n.isScreenPosition=!0,n.className="rte-table-setting-popover",lt.addUniqueObserverToNode(n,pt,this.handleTableSettingPopoverShow);const i=t.createElement("div");i.setAttribute("slot","popover");const r=t.createElement("vega-rich-text-table-setting");r.addEventListener("vegaClick",this.handleSettingMenuClick),i.appendChild(r),n.appendChild(i),this.popoverContainer.appendChild(n),this.popoverContainer.appendChild(e),this.popoverRef=n,this.tableSettingRef=r}}updateTableSettingCaption(){const t=this.tableBlock.hasCaption();this.tableSettingRef&&this.tableSettingRef.hasCaption!==t&&(this.tableSettingRef.hasCaption=t)}reTarget(t,e){this.tableSettingRef&&(this.tableBlock=t,this.tableSettingRef.target=e(),this.tableSettingRef.selectedCells=this.getTableSelectedCells(),this.tableDynamicPopover.reTarget(t,e))}getTableSelectedCells(){let t=[];const e=this.getTableExtensionContext();if(e&&e.tableSelection){const{tableSelection:n}=e;t=n.getSelectedCells()}return t}}class Fn extends qe{doRender(t,e,n){let i;const r=this.renderTable(t,e,(t=>i=t));this.renderTableToolbar(n);const a=e.getAnnotationByType(ft.TABLE),s=n.editable?[t("vega-rich-text-table-selection-widget",{onVegaRemove:t=>{t.stopPropagation(),this.handleTableRemove(e,i)},onClick:t=>{this.tableToolbar&&this.tableToolbar.handleTableClick(t,e,(()=>i))},onMouseLeave:()=>{this.tableToolbar&&this.tableToolbar.syncSelectedCells()}},[t("div",{contentEditable:!0,ref:this.useRef(e)},[r])])]:[r],o={};if(a){const t=a.renderStyle();o.width=t.width,o.margin=t.margin}const l=t("div",{class:"v-rte--extension-table-container",style:Object.assign({},o)},s);return l.childrenContainerGetter=()=>r,l}destroy(){this.destroyTableToolbar()}injectRTEScopeStyles(){return".v-rte--extension-table-container{display:table}table.v-rte--extension-table{border-collapse:collapse}table.v-rte--extension-table th,table.v-rte--extension-table td{border:1px solid #ddd;padding:12px;text-align:left;vertical-align:middle;min-width:55px;box-sizing:border-box;position:relative}table.v-rte--extension-table th{background-color:#f2f2f2}.rte-table-setting-popover,.rte-table-dynamic-popover{display:block}table.v-rte--extension-table .v-rte-table-cell-focused::after,table.v-rte--extension-table .v-rte-table-cell-selected::after{content:'';position:absolute;top:0;left:0;right:0;bottom:0;pointer-events:none;background-color:rgba(158, 207, 250, 0.3)}table.v-rte--extension-table:has(.v-rte-table-cell-selected){caret-color:transparent}table.v-rte--extension-table:has(.v-rte-table-cell-selected) ::selection{background-color:transparent}table.v-rte--extension-table:has(.v-rte-table-cell-selected) ::-moz-selection{background-color:transparent}.v-rte--extension-table-caption{padding:8px;border:1px solid #ddd;border-bottom:none;background-color:rgba(var(--v-bg-table-header, 240, 243, 247, 1));position:relative;display:table-caption;caption-side:top;min-height:22px;text-align:center;word-break:break-word;overflow-wrap:break-word}.v-rte--extension-table-caption.showPlaceholder::before{position:absolute;left:0;right:0;content:attr(data-placeholder);font-family:'Inter', sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0;color:rgba(var(--v-text-input-placeholder, 176, 180, 181, 1));text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}"}renderTable(t,e,n){var i;return t("table",Object.assign(Object.assign({key:e.id},null===(i=e.getCustomAttributesAnnotation())||void 0===i?void 0:i.render()),{style:e.getStyles(),class:e.getClasses(),ref:t=>{this.useRef(e)(t),n(t)}}))}handleTableRemove(t,e){t.parent.apply(new Ln(t)),this.destroySelectionAnchor(e)}destroySelectionAnchor(t){const e=t.closest(".rich-text-content");if(e){const t=e.querySelector(".rte-table-selection-popover-anchor");t&&he.notify(ct.getSubject(t,de),{host:t})}}renderTableToolbar(t){t.editable?this.tableToolbar||(this.tableToolbar=new Kn(t),this.tableToolbar.render()):this.destroyTableToolbar()}destroyTableToolbar(){var t;null===(t=this.tableToolbar)||void 0===t||t.destroy(),this.tableToolbar=null}}class zn extends qe{doRender(t,e){return t("thead",{key:e.id,ref:this.useRef(e)})}}class $n extends qe{doRender(t,e){return t("tr",{key:e.id,ref:this.useRef(e)})}}class qn extends qe{doRender(t,e,n){return this.renderByCellType(t,e,n,"td")}renderByCellType(t,e,n,i){var r;return t(i,Object.assign(Object.assign(Object.assign({key:`${e.id}-${i}`,ref:this.useRef(e)},null===(r=e.getCustomAttributesAnnotation())||void 0===r?void 0:r.render()),{style:e.getStyles(n),class:e.getClasses()}),n.editable?this.onSelectionListeners(e,n):void 0))}onSelectionListeners(t,e){return{onMouseDown:t=>{const n=r(t.target,"table"),i=r(t.currentTarget,"table")===n,a=t.target.closest("td, th");if(i&&a){const t=this.getExtensionContext(e.host);t&&t.tableSelection.focusCell(a)}},onMouseMove:n=>{n.stopPropagation(),n.preventDefault();const i=this.getExtensionContext(e.host);i&&i.tableSelection.dragOver(t)},onMouseUp:()=>{const t=this.getExtensionContext(e.host);t&&t.tableSelection.endDrag()}}}}class Wn extends qe{doRender(t,e){return t("tbody",{key:e.id,ref:this.useRef(e)})}}class Gn extends qn{doRender(t,e,n){return super.renderByCellType(t,e,n,"th")}}class Un extends j{constructor(t,e){super(),this.type="INSERT_TABLE_BLOCK",this.rowCount=t,this.columnCount=e}}class Zn extends Vn{constructor(){super(...arguments),this.hoveredRows=1,this.hoveredCols=1}render(t,e){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,ref:t=>{t&&(this.tablePickerPopoverRef=t,lt.addUniqueObserverToNode(t,pt,(()=>{this.resetPicker()})))}},[t("div",{slot:"popover"},[this.generatePickerStyles(t),this.generateTableSizeGrid(t)]),t("div",{slot:"popover-content"},e)])}generateTableSizeGrid(t){const e=[];for(let n=1;n<=10;n++)for(let i=1;i<=10;i++)e.push(t("button",{class:"rte-table-picker__cell","data-row":n,"data-col":i,onMouseenter:this.handlePickerCellHover.bind(this,n,i),onClick:this.handlePickerClick.bind(this,n,i)},[]));return t("div",{class:"rte-table-picker"},[t("div",{class:"rte-table-picker__grid",ref:t=>{t&&(this.tablePickerGridRef=t)},style:{gridTemplateColumns:"repeat(10, 16px)",gridTemplateRows:"repeat(10, 16px)"}},e),t("div",{class:"rte-table-picker__hint"},t("vega-hint",{ref:t=>{t&&(this.selectedHintRef=t)}},[`${this.hoveredRows} × ${this.hoveredCols}`]))])}generatePickerStyles(t){return t("style",{},["\n.rte-table-picker__grid { display: grid; gap: 2px; }\n.rte-table-picker__cell {\n box-sizing: border-box;\n border: 1px solid #ccc;\n background-color: transparent;\n cursor: pointer;\n}\n.rte-table-picker__cell:hover {\n background-color: #cae1fc;\n}\n.rte-table-picker__cell.active {\n background-color: #cae1fc;\n}\n.rte-table-picker__hint {\n text-align: center;\n}\n "])}createTable(t,e){const n=this.getTableExtensionContext();if(n){const{host:i,getSelectedNodes:r}=n,a=r()[0],s=new Un(t,e);a?a.parent&&a.parent.apply(s):i.value.apply(s),s.nextFocusNode&&i.value.apply(new m(s.nextFocusNode,1))}}handlePickerClick(t,e){this.createTable(t,e),this.tablePickerPopoverRef.hide()}handlePickerCellHover(t,e){this.hoveredRows=t,this.hoveredCols=e,Array.from(this.tablePickerGridRef.children).forEach((t=>{const e=Number(t.dataset.row),n=Number(t.dataset.col);e<=this.hoveredRows&&n<=this.hoveredCols?t.classList.add("active"):t.classList.remove("active")})),this.selectedHintRef.textContent=`${this.hoveredRows} × ${this.hoveredCols}`}resetPicker(){this.handlePickerCellHover(1,1)}}class Jn extends Ze{render(t,e){return new Zn(e).render(t,super.renderButton(t,e,{showArrowIcon:!0,icon:"rte-table",tooltip:{text:"Insert table"}}))}isDisabled(t){let e=super.isDisabled(t);const n=this.getExtensionContext(t.host);if(n){const{host:t,getSelectedNodes:i}=n,r=i()[0];let a=!0;r&&(a=O.canHandle("INSERT_TABLE_BLOCK",r.parent)&&O.canHandle($.INSERT_CHILDREN_AFTER,r.parent.parent)),e=t.disabled||!a}return e}handleButtonClick(){}handleDropdownClick(){}}st.register({"rte-table":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M48 264V160H232V264H48zm0 48H232V432H64c-8.8 0-16-7.2-16-16V312zM280 432V312H464V416c0 8.8-7.2 16-16 16H280zM464 264H280V160H464V264zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64z"/></svg>'}});class Qn extends H{handleAction(t,e){const n=this.createTableBlock(t.rowCount,t.columnCount),i=super.createNewParagraph(""),r=this.getReferenceBlock(e);r?r.parent.apply(new V(r,n,i)):e.apply(new P([n,i])),t.nextFocusNode=n.getFirstNode()}createTableBlock(e,n){const i=Math.max(e,1),r=Math.max(n,1);return Tt.from({id:t(),type:"table-block",children:[At(i,r)]})}getReferenceBlock(t){if(!(t instanceof v))return t}}class Xn extends un{canIntercept(t,e){const n=e.parent;return n instanceof Et&&1===n.children.length&&0===t.startOffset}intercept(){}}class Yn extends H{handleAction(t){const e=t.tableBlock,n=e.parent,i=super.getRootContent(e),r=super.createNewParagraph("");n.apply(new V(e,r)),n.apply(new G(e)),i&&i.apply(new m(r.getLastNode()))}}class ti extends un{canIntercept(t,e){return t.entityToBeRemoved&&1===e.children.length}intercept(e,n,i){if(!(n.entityToBeRemoved instanceof D)){const e=D.from({id:t(),type:"paragraph",nodes:[{id:t(),type:"text",text:""}]});return i.children=[],void i.apply(new P([e]))}n.entityToBeRemoved.apply(new P([new B(t(),"",n.entityToBeRemoved)]))}}class ei extends qe{doRender(t,e){return t("caption",{key:e.id,ref:this.useRef(e),style:e.getStyles(),class:[e.getClasses(),e.isNotEmpty()?null:"showPlaceholder"].filter(it).join(" "),"data-placeholder":"Enter table caption"})}}class ni extends H{getRowsMaxCellCount(t){let e=0;for(const n of t){let t=0;for(const e of n.children)t+=e.colSpan;e=Math.max(e,t)}return e}getRowCellStartCols(t){const e=this.getRowsMaxCellCount(t),n=new Array(t.length),i=new Array(e).fill(0);for(let e=0;e<t.length;e++){const r=t[e].children,a=new Array(r.length);let s=0;for(let t=0;t<r.length;t++){const e=r[t];for(;s<i.length&&i[s]>0;)s++;a[t]=s;const n=Math.max(e.colSpan,ni.DEFAULT_CELLSPAN);if(e.rowSpan>ni.DEFAULT_CELLSPAN)for(let t=0;t<n;t++){const n=s+t;n<i.length&&(i[n]=Math.max(i[n],e.rowSpan))}s+=n}n[e]=a;for(let t=0;t<i.length;t++)i[t]>0&&i[t]--}return n}updateCellSpan(t,e,n){const i=t.getCustomAttributesAnnotation();if(n<=ni.DEFAULT_CELLSPAN){if(i){const n=i.render();delete n[e],t.annotationMap.set(U.CUSTOM_ATTRIBUTE,new Z(n))}}else{const r=i?i.render():{};r[e]=n.toString(),t.annotationMap.set(U.CUSTOM_ATTRIBUTE,new Z(r))}}insertMovedCells(t,e,n){t.forEach(((t,i)=>{const r=e[i];if(r){const e=n[i]||[];t.sort(((t,e)=>t.logicalStartCol===e.logicalStartCol?e.cellIndex-t.cellIndex:e.logicalStartCol-t.logicalStartCol)),t.forEach((t=>{const{cell:n,logicalStartCol:i}=t;if(0===r.children.length)return r.apply(new P([n])),void(e[0]=i);const a=e.findIndex((t=>t>=i));-1===a?(r.apply(new V(r.children[r.children.length-1],n)),e.push(i)):0===a?(r.apply(new F(r.children[0],n)),e.unshift(i)):(r.apply(new F(r.children[a],n)),e.splice(a,0,i))}))}}))}splitRowsBySection(t){const e=[],n=[];return t.forEach((t=>{t.parent instanceof Ot?e.push(t):n.push(t)})),[e,n]}buildSelectedIndices(t,e){return new Set(t.map((t=>e.indexOf(t))).filter((t=>t>=0)))}intersectsRemovalRange(t,e,n,i){return t<=i&&e>=n}countRemovedRows(t,e,n){let i=0;for(let r=t;r<=e;r++)n.has(r)&&i++;return i}getHeadCellLength(t){let e=0;for(let n=0;n<t.children.length;n++){const i=t.children[n];if(!(i instanceof yt))break;e+=i.colSpan}return e}getTheStartSpanCell(t,e,n,i){const r={rowIndex:n};for(let a=n;a>=0;a--){const n=e[a];if(n.includes(i)){r.cell=t[a].children[n.indexOf(i)],r.rowIndex=a;break}}return r}getDefaultCellBlockTemplate(e,n,i=1){const r=me({colspan:n>1?n.toString():null,rowspan:i>1?i.toString():null}),a=t(),s={id:a,type:e,children:[{id:`${a}-p`,type:"paragraph",nodes:[{id:`${a}-p-t`,type:"text",text:""}]}]};return Object.keys(r).length>0&&(s.annotations={customAttribute:r}),s}getSortedValuesByNumericKey(t){return Array.from(t.entries()).sort((([t],[e])=>t-e)).map((([,t])=>t))}}ni.DEFAULT_CELLSPAN=1;class ii extends ni{handleAction(t,e){const{rowsToBeRemoved:n}=t,i=this.getFutureFocusRow(n[0],n[n.length-1],e),r=this.splitRowsBySection(n);if(this.removeRows(r[0]),this.removeRows(r[1]),i){const t=this.getRootContent(e);if(t){const e=i.getLastNode();t.apply(new m(e,e.getRangeEndOffset()))}}}removeRows(t){if(0===t.length)return;const e=t[0].parent,n=e.children,i=this.buildSelectedIndices(t,n);if(i.size>0){if(n.length===t.length)return void e.parent.apply(new G(e));const r=Math.min(...i),a=Math.max(...i),s=this.getRowCellStartCols(n),o=this.collectCellsToMove(n,s,i,r,a);this.insertMovedCells(o,n,s),t.forEach((t=>{t.parent.apply(new G(t))}))}}collectCellsToMove(t,e,n,i,r){const a=new Map,s=t.length;for(let o=0;o<s;o++){const l=t[o],c=l.children.length;for(let t=0;t<c;t++){const c=l.children[t],h=c.rowSpan;if(h<=ni.DEFAULT_CELLSPAN)continue;const d=o+h-1;if(!this.intersectsRemovalRange(o,d,i,r))continue;const u=h-this.countRemovedRows(o,d,n);if(o<i&&d>=i)this.updateCellSpan(c,"rowspan",u);else if(o>=i&&d>r){const i=r+1;if(i<s&&!n.has(i)){const n=e[o][t];a.has(i)||a.set(i,[]),a.get(i).push({cell:this.cloneCellWithRowSpan(c,u),newRowSpan:u,cellIndex:t,logicalStartCol:n})}}}}return a}cloneCellWithRowSpan(t,e){const n=t.clone(t.parent);return this.updateCellSpan(n,"rowspan",e),n}getFutureFocusRow(t,e,n){const i=n.children.filter((t=>t instanceof Ot||t instanceof It)).flatMap((t=>t.children)),r=i.indexOf(t),a=i.indexOf(e);return i[r-1]?i[r-1]:i[a+1]?i[a+1]:void 0}}class ri{constructor(){this.dragging=!1,this.anchorCell=null,this.selectedCells=new Set,this.syncRTESelectionWithDebounce=ve(this.syncRTESelection,100,this),this.handleSelectionChangeWithDebounce=ve(this.handleSelectionChange,10,this),this.filterSelectedCell=(t,e)=>{const n=new Set;if(t.intersectsNode(e)){if(e.nodeType===Node.TEXT_NODE){const t=E.getEntityByDOM(e.parentElement);if(t){const e=Rt(t.parent,Et);if(e)return n.add(e),Array.from(n)}}e.childNodes.forEach((e=>this.filterSelectedCell(t,e).forEach((t=>{n.add(t)}))))}return Array.from(n)},this.updateSelectedStyles=(t,e)=>{const n=1===e?"v-rte-table-cell-focused":"v-rte-table-cell-selected",i=E.getDOMByEntity(t);i&&i.classList.add(n)},this.handleDocMouseUp=()=>{this.endDrag();const t=ge();t&&t.removeEventListener("mouseup",this.handleDocMouseUp)},this.handleContentClick=()=>{this.clearSelection();const t=this.context.host.shadowRoot.querySelector(".rich-text-editor-container");t&&t.removeEventListener("mousedown",this.handleContentClick,!0)}}static computeRectRange(t,e){const n=t.parent.parent.parent;if(n!==e.parent.parent.parent)return[];const i=[];n.children.forEach((t=>{t.children.forEach((t=>i.push(t)))}));const{grid:r,cellMeta:a}=ri.buildCellGrid(i),s=a.get(t),o=a.get(e);if(!s||!o)return[];const l=s.row+s.rowSpan-1,c=s.col,h=s.col+s.colSpan-1,d=o.row+o.rowSpan-1,u=o.col,p=o.col+o.colSpan-1,f=Math.min(s.row,o.row),w=Math.max(l,d),g=Math.min(c,u),b=Math.max(h,p),m=new Set;for(let t=f;t<=w;t++){const e=r[t];for(let t=g;t<=b;t++){const n=e[t];n&&m.add(n)}}return Array.from(m)}static getCellSpan(t){let e=1,n=1;const i=t.getAnnotationByType(U.CUSTOM_ATTRIBUTE);if(i&&i.customAttribute){const t=i.customAttribute;t.rowSpan&&(e=parseInt(t.rowSpan,10)),t.colSpan&&(n=parseInt(t.colSpan,10))}if(1===e&&1===n){const i=E.getDOMByEntity(t);if(i){const t=i.getAttribute("rowSpan"),r=i.getAttribute("colSpan");t&&(e=parseInt(t,10)),r&&(n=parseInt(r,10))}}return{rowSpan:Number.isFinite(e)&&e>0?e:1,colSpan:Number.isFinite(n)&&n>0?n:1}}static buildCellGrid(t){const e=[],n=new Map;for(let i=0;i<t.length;i++){const r=t[i];e[i]||(e[i]=[]);let a=0;for(let t=0;t<r.children.length;t++){const s=r.children[t];for(;e[i][a];)a+=1;const{rowSpan:o,colSpan:l}=ri.getCellSpan(s);n.set(s,{row:i,col:a,rowSpan:o,colSpan:l});for(let t=0;t<o;t++){const n=i+t;e[n]||(e[n]=[]);for(let t=0;t<l;t++)e[n][a+t]=s}a+=l}}return{grid:e,cellMeta:n}}destroy(){this.removeSelectionChangeListener()}init(t){this.context=t,this.addSelectionChangeListener()}setSelectedCells(t){const e=Array.from(this.selectedCells)[0]||t[0];this.updateSelectedCells(t),this.emitCellSelectionChange(e,t)}getSelectedCells(){return Array.from(this.selectedCells)}focusCell(t){const e=E.getEntityByDOM(t);e&&(this.anchorCell=e,this.setSelectedCells([e]),this.addListeners())}dragOver(t){if(!this.anchorCell)return;const e=ri.computeRectRange(this.anchorCell,t);e.length>1&&this.startDrag(),this.dragging&&(this.preventTextSelection(e),this.updateSelectedCells(e,{debounceSync:!0}))}endDrag(){this.dragging=!1,this.anchorCell=null}emitCellSelectionChange(t,e){const n=Rt(t,Tt);if(n){const t=E.getDOMByEntity(n);t&&he.notify(ct.getSubject(t,pe),{host:t,detail:e})}}clearSelection(){this.selectedCells.forEach((t=>{const e=E.getDOMByEntity(t);e&&e.classList.remove("v-rte-table-cell-selected","v-rte-table-cell-focused")})),this.selectedCells.clear()}addSelectionChangeListener(){const t=ge();t&&t.addEventListener("selectionchange",this.handleSelectionChangeWithDebounce)}removeSelectionChangeListener(){const t=ge();t&&t.removeEventListener("selectionchange",this.handleSelectionChangeWithDebounce)}handleSelectionChange(){if(this.dragging)return void this.syncRTESelectionWithDebounce();const t=this.context.getSelection();if(t.rangeCount>0){const e=t.getRangeAt(0),n=e.commonAncestorContainer;if(r(n,"table")){const t=this.filterSelectedCell(e,n);this.setSelectedCells(t)}}}startDrag(){this.dragging=!0}updateSelectedCells(t,{debounceSync:e}={}){this.clearSelection(),t.forEach((e=>{this.selectedCells.add(e),this.updateSelectedStyles(e,t.length)})),e?this.syncRTESelectionWithDebounce():this.syncRTESelection()}syncRTESelection(){const t=Array.from(this.selectedCells),e=t.flatMap((t=>t.children.flatMap((t=>t.children.flatMap((t=>{if(t instanceof K)return t})))))).filter(it);t.length>1&&this.context.setSelectedNodes(e,{startNode:e[0],endNode:e[e.length-1],startOffset:0,endOffset:e[e.length-1].getRangeEndOffset()})}preventTextSelection(t){const e=this.context.getSelection();if(e.removeAllRanges(),t.length>0){const n=E.getDOMByEntity(t[0]);if(n){const t=new Range;t.setStart(n,0),t.setEnd(n,0),e.addRange(t)}}}addListeners(){const t=ge();t&&t.addEventListener("mouseup",this.handleDocMouseUp);const e=this.context.host.shadowRoot.querySelector(".rich-text-editor-container");e&&e.addEventListener("mousedown",this.handleContentClick,!0)}}class ai extends ni{handleAction(t,e){const{selectedRows:n}=t,[i,r]=this.splitRowsBySection(n);r.length>0?this.convertToHeaderRows(r,e):this.revertToBodyRows(i,e);const a=this.getRootContent(e);if(a){const t=n[0].getFirstNode();t&&a.apply(new m(t,0))}}convertToHeaderRows(e,n){let i=n.children.find((t=>t instanceof Ot));const r=e[0].parent;i||(i=Ot.from({id:t(),type:"table-head",children:[]}),n.apply(new F(r,i)));const a=r.children.indexOf(e[e.length-1]),s=r.children.slice(0,a+1),o=this.buildSelectedIndices(s,r.children),l=Math.min(...o),c=Math.max(...o);if(o.size>0){if(o.size<r.children.length){const t=this.getRowCellStartCols(r.children),e=this.collectCellsToMove(r.children,t,o,l,c);this.insertMovedCells(e,r.children,t)}this.convertBodyRowsToHeaderRows(r,i,s)}}convertBodyRowsToHeaderRows(t,e,n){for(let e=0;e<n.length;e++){const i=n[e];i.children=i.children.map((t=>this.convertTdToTh(t))),t.apply(new G(i))}e.apply(new P(n))}revertToBodyRows(e,n){let i=n.children.find((t=>t instanceof It));const r=e[0].parent;i||(i=It.from({id:t(),type:"table-body",children:[]}),n.apply(new V(r,i)));const a=r.children.indexOf(e[0]),s=r.children.slice(a),o=this.buildSelectedIndices(s,r.children);if(o.size>0){const t=this.getRowCellStartCols(r.children),e=this.collectCellsToMove(r.children,t,o,Math.min(...o),Math.max(...o));this.insertMovedCells(e,r.children,t),this.convertHeadRowsToBodyRows(r,i,s)}}convertHeadRowsToBodyRows(t,e,n){const i=e.children[0],r=this.getRowCellStartCols(n);for(let a=0;a<n.length;a++){const s=n[a];t.apply(new G(s));const o=i?this.getHeadCellLength(i):0;s.children=this.convertThToTd(s,r[a],o),i&&e.apply(new F(i,s))}i||e.apply(new P(n))}collectCellsToMove(t,e,n,i,r){const a=new Map,s=t.length;for(let o=0;o<s;o++){const l=t[o],c=l.children.length;for(let t=0;t<c;t++){const c=l.children[t],h=c.rowSpan;if(h<=ni.DEFAULT_CELLSPAN)continue;const d=o+h-1;if(!this.intersectsRemovalRange(o,d,i,r))continue;const u=this.countRemovedRows(o,d,n),p=h-u;if(o<i&&d>=i){this.updateCellSpan(c,"rowspan",p);const r=i;if(r<s&&n.has(r)){const n=e[o][t];a.has(r)||a.set(r,[]),a.get(r).push({cell:this.cloneCellWithRowSpan(c,u),newRowSpan:u,cellIndex:t,logicalStartCol:n})}}else if(o>=i&&d>r){this.updateCellSpan(c,"rowspan",u);const i=r+1;if(i<s&&!n.has(i)){const n=e[o][t];a.has(i)||a.set(i,[]),a.get(i).push({cell:this.cloneCellWithRowSpan(c,p),newRowSpan:p,cellIndex:t,logicalStartCol:n})}}}}return a}convertTdToTh(t){if(t instanceof yt)return t;const e=yt.from(t.toJSON());return e.parent=t.parent,e}convertThToTd(t,e,n){return t.children.map(((i,r)=>{let a=i;const s=e[r]<n,o=i.toJSON();return a=s?i:Et.from(this.deleteHeadCellDefaultBackground(o)),a.parent=t,a}))}cloneCellWithRowSpan(e,n){const i=e.clone(e.parent);i.id=t(),i.children=[];const r=this.createNewParagraph("");return r&&i.apply(new P([r])),this.updateCellSpan(i,"rowspan",n),i}deleteHeadCellDefaultBackground(t){var e;if(t&&t.annotations&&t.annotations.customStyle){delete t.annotations.tableCell;const n=t.annotations.customStyle.backgroundColor,i=Nt.getDefaultBackgroundColor();!n||n!==i&&(null===(e=a(n))||void 0===e?void 0:e.toUpperCase())!==i||delete t.annotations.customStyle.backgroundColor}return t}}class si extends jt{handleAction(t,e){const{insertDirection:n,tableCellInsertRange:i}=t,r=new Set(i.map((t=>t.id))),a=Bt(e),s=_t(a),[o,l]=this.getBoundaryCellColumnRange(i,a,s),c=n===Vt.LEFT?o:l+1,h=this.hasSelectedCellInsideTargetColumn(a,s,c,r),d=new Set;a.forEach(((t,i)=>{if(d.has(i))return;const o=this.findExpandableCell(t,i,c,s,n,r,h);if(o){const t=o.rowSpan;if(Dt(o,o.colSpan+1,o.rowSpan,e,!0),t>1)for(let e=1;e<t;e++)d.add(i+e);return}const l=this.findInsertPosition(t,i,c,s,a);if(l){const e=this.generateTableCell(l.templateCell);t.apply(l.before?new F(l.anchorCell,e):new V(l.anchorCell,e))}}))}findExpandableCell(t,e,n,i,r,a,s){const o=i[e],l=t.children.reduce(((t,e)=>t+(a.has(e.id)?1:0)),0);for(const c of t.children){const t=o.indexOf(c.id),h=t+c.colSpan,d=n===h,u=e+c.rowSpan>=i.length,p=a.has(c.id),f=n>t&&n<h;if(r===Vt.LEFT?f:f&&(!p||!u)||d&&c.colSpan>1&&p&&!u&&1===l&&!s)return c}return null}hasSelectedCellInsideTargetColumn(t,e,n,i){for(let r=0;r<t.length;r++){const a=t[r],s=e[r];for(const t of a.children){if(!i.has(t.id))continue;const e=s.indexOf(t.id),r=e+t.colSpan;if(n>e&&n<r)return!0}}return!1}findInsertPosition(t,e,n,i,r){const a=i[e];let s=t.children[0];if(n>=0&&n<a.length){const t=Mt(r,a[n]);t&&(s=t)}let o=0;for(let e=0;e<t.children.length;e++){const i=t.children[e];for(;o<a.length&&a[o]!==i.id;)o++;if(o>=n)return{anchorCell:i,templateCell:s,before:!0};const r=o+i.colSpan;if(r>n||e===t.children.length-1)return{anchorCell:i,templateCell:s,before:!1};o=r}return null}generateTableCell(t){return t instanceof yt?yt.from(Ht(t.type)):Et.from(Ht(t.type))}}class oi extends jt{handleAction(t,e){const n=Bt(e),i=_t(n),[r,a]=this.getBoundaryCellColumnRange(t.tableCellDeleteRange,n,i),s=Math.max(n.indexOf(t.tableCellDeleteRange[t.tableCellDeleteRange.length-1].parent),0),{coveredCellIds:o,coveredCells:l,adjustmentCellInfo:c}=this.getDeleteCellsInfo(n,r,a,i),h=this.findNextFocusableCell(n,i,r,a,o,s);this.deleteCells(l,c,e);const d=this.getRootContent(e),u=Ft(h);d&&u&&d.apply(new m(u))}getDeleteCellsInfo(t,e,n,i){const r=[],a=new Set,s=[],o=Pt(i);return t.forEach((t=>{t.children.forEach((t=>{const i=o.get(t.id);if(void 0===i)return;const{colSpan:l,rowSpan:c}=zt(t),h=this.getColumnOverlapCount(i,l,e,n);if(h<=0)return;if(h===l)return r.push(t),void a.add(t.id);const d=Math.max(1,l-h);s.push({cell:t,nextColSpan:d,rowSpan:c})}))})),{coveredCells:r,coveredCellIds:a,adjustmentCellInfo:s}}findNextFocusableCell(t,e,n,i,r,a){for(let s=0;s<t.length;s++){const o=this.findFocusableCellIdInGridRow(e[(a+s)%t.length],n,i,r);if(!o)continue;const l=Mt(t,o);if(l)return l}return null}findFocusableCellIdInGridRow(t,e,n,i){for(let e=n+1;e<t.length;e++){const n=t[e];if(n&&!i.has(n))return n}for(let n=e-1;n>=0;n--){const e=t[n];if(e&&!i.has(e))return e}return null}deleteCells(t,e,n){t.forEach((t=>{t.parent.apply(new G(t))}));const i=new Set;e.forEach((({cell:t,nextColSpan:e,rowSpan:r})=>{i.add(t.id),Dt(t,e,r,n)})),this.normalizeRemainingCellSpans(n,i)}normalizeRemainingCellSpans(t,e){Bt(t).forEach((n=>{n.children.forEach((n=>{const{colSpan:i,rowSpan:r}=zt(n);if(e.has(n.id)){const e=Kt(t);if(!(r>1&&i===e))return}Dt(n,i,r,t)}))}))}getColumnOverlapCount(t,e,n,i){const r=t+e-1,a=Math.max(t,n),s=Math.min(r,i);return a<=s?s-a+1:0}}class li extends j{constructor(t){super(),this.isFlushable=!0,this.type="CREATE_SEGMENT_TABLE_CELL",this.payload=t}}class ci extends H{handleAction(t,e){const{table:n,sourceCell:i,colSpan:r,cellType:a,keepSourceContent:s}=t.payload,o=s?this.convertCellType(i,a):$t(a);Dt(o,r,i.rowSpan,n),e.apply(new F(i,o))}convertCellType(t,e){return"table-head-cell"===e?yt.from(t.toJSON()):Et.from(t.toJSON())}}class hi extends H{handleAction(t,e){const{cell:n,targetCellType:i}=t.payload,r="table-head-cell"===i?yt.from(n.toJSON()):Et.from(n.toJSON());e.apply(new F(n,r)),e.apply(new G(n))}}class di extends H{handleAction(t,e){const{table:n,cell:i,col:r,cellStartCol:a,endCol:s,targetCellType:o}=t.payload,l=a+i.colSpan-1,c=r>a?r-a:0,h=Math.min(s,l),d=h-r+1,u=l-h;c>0&&e.apply(new li({table:n,sourceCell:i,colSpan:c,cellType:i.type,keepSourceContent:!0})),e.apply(new li({table:n,sourceCell:i,colSpan:d,cellType:o,keepSourceContent:0===c})),u>0&&e.apply(new li({table:n,sourceCell:i,colSpan:u,cellType:i.type,keepSourceContent:0===c&&d===i.colSpan})),e.apply(new G(i))}}class ui extends jt{handleAction(t,e){const n=Bt(e),i=_t(n),r=Pt(i),[a,s]=this.getBoundaryCellColumnRange(t.tableCellSelectRange,n,i),o=[],l=new Set;n.forEach((t=>{t.children.forEach((t=>{const e=r.get(t.id);void 0!==e&&e>=a&&e<=s&&!l.has(t.id)&&(l.add(t.id),o.push(t))}))})),t.selectCellCallback(o)}}class pi extends un{canIntercept(t){return t.childrenToBeInserted.some((t=>!(t instanceof Et)))}intercept(){}}class fi extends H{handleAction(t,e){const{targetCell:n,mergeCells:i,colSpan:r,rowSpan:a,direction:s}=t;this.mergeContentToTargetCell(n,i),Dt(n,r,a,e),this.deleteOtherSelectedCells(i,n),s!==qt.MERGE_CELL_LEFT&&s!==qt.MERGE_CELL_RIGHT&&a>1&&this.clearRowSpanIfUniformAcrossRow(n,e,a);const o=this.getRootContent(e),l=Ft(n);o&&l&&o.apply(new m(l))}mergeContentToTargetCell(t,e){const n=e.flatMap((t=>t.children)),i=n.filter((t=>t.isNotEmpty()));t.children=(i.length>0?i:[n[0]]).map((e=>e.clone(t)))}deleteOtherSelectedCells(t,e){t.forEach((t=>{t!==e&&t.parent.apply(new G(t))}))}clearRowSpanIfUniformAcrossRow(t,e,n){const i=t.parent.parent.children,r=_t(i),a=[];for(let e=0;e<r.length;e++)r[e].includes(t.id)&&a.push(e);if(a.length>1){const t=a[0],s=t+n-1,o=new Set;let l=Number.POSITIVE_INFINITY;for(let e=0;e<r[0].length;e++){let n=r[t][e],i=1,a=!1;for(let c=t+1;c<=s;c++)r[c][e]!==n?(i>1&&(a=!0,l=Math.min(l,i),o.add(n)),i=1,n=r[c][e]):i++;if(i<2&&!a){o.clear();break}i>1&&(l=Math.min(l,i),o.add(n))}o.size>0&&i.forEach((t=>{t.children.forEach((t=>{if(o.has(t.id)){const{rowSpan:n,colSpan:i}=zt(t);Dt(t,i,n-l+1,e)}}))}))}}}class wi extends x{canHandle(t,e){const n=t[e];return n&&"TABLE"===n.tagName?1:0}handle(e,n){return Tt.from({id:t(),type:"table-block",annotations:b.generate(Tt,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class gi extends y{canHandle(t,e){const n=t[e];return n&&"THEAD"===n.tagName?1:0}handle(e,n){return Ot.from({id:t(),type:"table-head",annotations:b.generate(Ot,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class bi extends y{canHandle(t,e){const n=t[e];return n&&"TBODY"===n.tagName?1:0}handle(e,n){return It.from({id:t(),type:"table-body",annotations:b.generate(It,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class mi extends y{canHandle(t,e){const n=t[e];return n&&"TR"===n.tagName?1:0}handle(e,n){return Wt.from({id:t(),type:"table-row",annotations:b.generate(Wt,e[0],n),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}}class vi extends y{canHandle(t,e){const n=t[e];return!n||"TD"!==n.tagName&&"TH"!==n.tagName?0:1}handle(e,n){const i=e[0],r=[{id:t(),type:"paragraph",annotations:{internalWrapper:n&&!n.autoMatchFormat},nodes:[{id:t(),type:"text",annotations:{plainText:n&&!n.autoMatchFormat},text:""}]}];return"TH"===i.tagName?yt.from({id:t(),type:"table-head-cell",annotations:this.getTableHeadCellAnnotations(i,n),children:r},n):Et.from({id:t(),type:"table-cell",annotations:b.generate(Et,i,n),children:r},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}getTableHeadCellAnnotations(t,e){const n=b.generate(yt,t,e);return n&&n.tableCell&&kt.getColorKey(n.tableCell.backgroundColor,!0)===wt.key&&(delete n.tableCell.backgroundColor,n.customStyle&&delete n.customStyle.backgroundColor),n}}class yi extends x{canHandle(t,e){const n=t[e];return n&&n.parentElement&&"TABLE"===n.parentElement.tagName&&"CAPTION"===n.tagName?1:0}handle(e,n){const i=this.getTableCaptionAnnotations(e[0],n);return Sn.from({id:t(),type:"table-caption",annotations:Object.assign(Object.assign({},i),{caption:!0}),children:[]},n)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}getTableCaptionAnnotations(t,e){const n=b.generate(Sn,t,e);return n&&n.customStyle&&n.customStyle.backgroundColor&&kt.getColorKey(n.customStyle.backgroundColor,!0)===wt.key&&delete n.customStyle.backgroundColor,n}}class xi extends T{getBackgroundColor(t){return t.style.backgroundColor?kt.getColorKey(t.style.backgroundColor)||t.style.backgroundColor:null}getBorder(t){const e=t.style,n=e.borderStyle,i=e.borderWidth,r=e.borderColor;if(r||n||i){const t="initial"===r?"":r;return{style:"initial"===n?"":n,width:"initial"===i?"":i,color:kt.getColorKey(t)||t}}return null}getWidth(t){if(t.style.width)return t.style.width;const e=t.getAttribute("width");return e?/^\d+$/.test(e)?`${e}px`:e:null}getHeight(t){if(t.style.height)return t.style.height;const e=t.getAttribute("height");return e?/^\d+$/.test(e)?`${e}px`:e:null}}class Li extends xi{canHandle(t){return"RTETableBlock"===t.dtoName}handle(t){const e=me({backgroundColor:this.getBackgroundColor(t),border:this.getBorder(t),width:this.getWidth(t),height:this.getHeight(t),alignment:this.getAlignment(t)});return Object.keys(e).length>0?{table:e}:{}}getAlignment(t){const e=t.classList;if(e.contains("v-rte--extension-table-align-left"))return"left";if(e.contains("v-rte--extension-table-align-center"))return"center";if(e.contains("v-rte--extension-table-align-right"))return"right";const n=t.style,i=n.marginLeft,r=n.marginRight;if("auto"===i&&"auto"===r)return"center";if("0"===i||"0px"===i)return"left";if("0"===r||"0px"===r)return"right";const a=t.getAttribute("align");return a&&["left","center","right"].includes(a)?a:null}}class Ci extends xi{canHandle(t){return"RTETableCellBlock"===t.dtoName}handle(t){const e=me({backgroundColor:this.getBackgroundColor(t),padding:this.getPadding(t),border:this.getBorder(t),width:this.getWidth(t),height:this.getHeight(t),textAlign:this.getTextAlign(t),verticalAlign:this.getVerticalAlign(t),minWidth:this.getMinWidth(t),boxSizing:this.getBoxSizing(t)});return Object.keys(e).length>0?{tableCell:e}:{}}getMinWidth(t){return t.style.minWidth?t.style.minWidth:null}getBoxSizing(t){return t.style.boxSizing?t.style.boxSizing:null}getPadding(t){return t.style.padding?t.style.padding:null}getTextAlign(t){if(t.style.textAlign){const e=t.style.textAlign;if(["left","center","right","justify"].includes(e))return e}const e=t.getAttribute("align");return e&&["left","center","right","justify"].includes(e)?e:null}getVerticalAlign(t){if(t.style.verticalAlign){const e=t.style.verticalAlign;if(["top","middle","bottom"].includes(e))return e}return null}}class Si extends Ci{canHandle(t){return"RTETableHeadCellBlock"===t.dtoName}}class ki extends H{handleAction(t,e){const n=t.toAnnotation(),i=this.getDOMByEntity(e);if(i){const t=i.closest(".v-rte--extension-table-container"),{backgroundColorAnnotation:r,width:a,height:s}=n;i.style.backgroundColor=r.renderStyle().color,i.style.border=n.borderStr,i.style.width=a,i.style.height=s;const o=n.renderAlignmentStyle().margin;i.style.margin=o,t&&(t.style.width=a,t.style.height=s,t.style.margin=o),this.updateCustomStyleAnnotation(e,["backgroundColor","border","width","height","margin"])}}}class Ti extends H{handleAction(t,e){const n=t.toAnnotation(),i=this.getDOMByEntity(e);if(i){const{width:t,height:r,borderStr:a,padding:s,textAlign:o,verticalAlign:l}=n,c=n.renderStyle().backgroundColor||"";i.style.backgroundColor=c,i.style.border=a,i.style.width=t,i.style.height=r,i.style.padding=s,i.style.textAlign=o,i.style.verticalAlign=l,this.updateCustomStyleAnnotation(e,["backgroundColor","border","width","height","padding","textAlign","verticalAlign"])}}}class Ai extends H{handleAction(t,e){const n=e.parent,i=n.parent,r=Rt(n,Tt),a=Bt(r),s=a.indexOf(n),{colSpan:o,rowSpan:l}=zt(e),c=Gt(e,a),h=Math.ceil(l/2),d=Math.max(1,l-h),u=1===l;Dt(e,o,h,r);const p=s+h,f=$t(e.type);if(Dt(f,o,d,r),u){const t=this.createNewRowWithCell(i,f),s=i.children.indexOf(n);i.apply(new V(i.children[s],t)),a.splice(p,0,t),this.updateCellsSpanningThroughInsertionPoint(a,p,e,r)}else{const t=a[p],e=this.findInsertPosition(t,c,a,p);t.children.splice(e,0,f),f.parent=t}}findInsertPosition(t,e,n,i){let r=0;for(let t=0;t<i;t++){const a=n[t];for(const s of a.children){const{colSpan:a,rowSpan:o}=zt(s);t+o>i&&Gt(s,n)<e&&(r+=a)}}let a=r;for(let n=0;n<t.children.length;n++){if(a>=e)return n;const i=t.children[n],{colSpan:r}=zt(i);a+=r}return t.children.length}createNewRowWithCell(e,n){const i={id:t(),type:"table-row",children:[]},r=Wt.from(i);return r.parent=e,r.children.push(n),n.parent=r,r}updateCellsSpanningThroughInsertionPoint(t,e,n,i){for(let r=0;r<e;r++){const a=t[r];for(const t of a.children){if(t===n)continue;const{colSpan:a,rowSpan:s}=zt(t);r+s>=e&&Dt(t,a,s+1,i)}}}}class Ei extends H{handleAction(t,e){const n=e.parent,i=Rt(n,Tt),r=Bt(i),a=r.indexOf(n),{colSpan:s,rowSpan:o}=zt(e),l=Gt(e,r),c=l+s-1,h=Math.ceil(s/2),d=Math.floor(s/2);Dt(e,h,o,i);const u=$t(e.type);Dt(u,d,o,i),n.apply(new V(e,u));const p=1===s?1:0;p>0&&this.updateOtherRowsCells(r,a,l,c,o,p,i)}updateOtherRowsCells(t,e,n,i,r,a,s){for(let o=0;o<t.length;o++){const l=t[o];if(!(o>=e&&o<e+r))for(const e of l.children){const r=Gt(e,t),{colSpan:o,rowSpan:l}=zt(e);if(r+o-1>=n&&r<=i){Dt(e,o+a,l,s);break}}}}}class Oi extends ni{handleAction(e,n){const{selectedRows:i}=e,r=i[i.length-1];let a=n.children.find((t=>t instanceof It));const s={id:t(),type:"table-row",children:[]};let o=0,l=null;a?(l=a.children[0],o=this.getHeadCellLength(l)):(a=It.from({id:t(),type:"table-body",children:[]}),n.apply(new P([a])));const c=r.parent.children,h=this.getRowsMaxCellCount(c);if(this.getRowsMaxCellCount([r])<h){const t=c.indexOf(r),e=this.getRowCellStartCols(c),n=new Map;for(let i=0;i<h;i++){const r=i<o?"table-head-cell":"table-cell",{cell:a}=this.getTheStartSpanCell(c,e,t,i);if(a){const t=a.colSpan;n.set(i,this.getDefaultCellBlockTemplate(r,t)),i+=t-1}}s.children=this.getSortedValuesByNumericKey(n)}else s.children=this.createTableCells(r,o);const d=l?new F(l,Wt.from(s)):new P([Wt.from(s)]);a.apply(d)}createTableCells(t,e){const n=[];let i=0;for(const r of t.children)n.push(this.getDefaultCellBlockTemplate(i<e?"table-head-cell":"table-cell",r.colSpan)),i+=r.colSpan;return n}}class Ii extends ni{handleAction(e){const{insertDirection:n,selectedRows:i}=e,r=n===Ut.ABOVE?i[0]:i[i.length-1],a={id:t(),type:"table-row",children:[]},s=r.parent.children,o=this.getRowsMaxCellCount(s),l=s.indexOf(r),c=this.getRowCellStartCols(s),h=new Map;for(let t=0;t<o;t++){const{cell:e,rowIndex:i}=this.getTheStartSpanCell(s,c,l,t);if(e){const{colSpan:r,rowSpan:a}=e;if(n===Ut.ABOVE?i!==l:i+a>l+1){this.updateCellSpan(e,"rowspan",a+1),t+=r-1;continue}h.set(t,this.getDefaultCellBlockTemplate(e.type,r)),t+=r-1}}a.children=this.getSortedValuesByNumericKey(h);const d=Wt.from(a),u=n===Ut.ABOVE?new F(r,d):new V(r,d);r.parent.apply(u)}}class Ri extends un{canIntercept(t,e){return Boolean(e.parent)}intercept(t,e,n){const i=this.createNewParagraph("");i&&(n.parent.apply(0===e.startOffset?new F(n,i):new V(n,i)),e.newBlock=i)}createNewParagraph(e){const n=N.getRTEBlockClass("paragraph");if(n)return n.from({id:t(),type:"paragraph",nodes:[{id:t(),type:"text",text:e}]})}}class Ni extends J{constructor(){super(...arguments),this.stylesToBeFiltered=mt.getDefaultStyles(),this.elementTagName="table"}canFilter(t){return this.isTableBlock(t.dtoName)}canRefill(t,e){return this.isTableBlock(t)&&e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}isTableBlock(t){return"RTETableBlock"===t}}class ji extends J{constructor(){super(...arguments),this.stylesToBeFiltered=Cn.getDefaultStyles(),this.elementTagName="table caption"}canFilter(t){return this.isTableCaption(t.dtoName)}canRefill(t,e){return this.isTableCaption(t)&&"CAPTION"===e.nodeName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}isTableCaption(t){return"RTETableCaptionBlock"===t}}class Bi extends J{constructor(t="td"){super(),this.stylesToBeFiltered=vt.getDefaultStyles(),this.elementTagName="",this.stylesWithRGBColor=vt.getDefaultStyles(!1),this.cellBlockClassName="",this.elementTagName=t,this.cellBlockClassName="td"===t?"RTETableCellBlock":"RTETableHeadCellBlock"}canFilter(t){return this.isTableCell(t.dtoName)}filterAndDeleteStyles(t,e){return this.convertDefaultBorderColorFromRGBToHex(t),super.filterAndDeleteStyles(t,e)}canRefill(t,e){return this.isTableCell(t)&&e.nodeName===this.elementTagName.toUpperCase()}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}isTableCell(t){return t===this.cellBlockClassName}convertDefaultBorderColorFromRGBToHex(t){t&&t.border&&t.border===this.stylesWithRGBColor.border&&(t.border=this.stylesToBeFiltered.border)}}class _i extends Ue{constructor(t=Zt){super(),this.toolbarButtonRenderer=new Jn,this.tableBlockRenderer=new Fn,this.tableRowBlockRenderer=new $n,this.tableCellRenderer=new qn,this.tableHeadCellRenderer=new Gn,this.tableSelection=new ri,kt.setTableColors(t),this.registerToolbarButtonRenderer("table",this.toolbarButtonRenderer),this.registerBlockBasicStrategies(Tt.name),this.registerBlockBasicStrategies(Ot.name),this.registerBlockBasicStrategies(yt.name),this.registerBlockBasicStrategies(Wt.name),this.registerBlockBasicStrategies(Et.name),this.registerBlockBasicStrategies(It.name),this.registerRenderer("table-block",this.tableBlockRenderer),this.registerRenderer("table-head",new zn),this.registerRenderer("table-head-cell",this.tableHeadCellRenderer),this.registerRenderer("table-row",this.tableRowBlockRenderer),this.registerRenderer("table-cell",this.tableCellRenderer),this.registerRenderer("table-body",new Wn),this.registerRenderer("table-caption",new ei),this.registerNode("table-block",Tt),this.registerNode("table-head",Ot),this.registerNode("table-head-cell",yt),this.registerNode("table-row",Wt),this.registerNode("table-cell",Et),this.registerNode("table-body",It),this.registerNode("table-caption",Sn),this.registerElementToBlockDTOClassStrategy(new wi),this.registerElementToBlockDTOClassStrategy(new gi),this.registerElementToBlockDTOClassStrategy(new bi),this.registerElementToBlockDTOClassStrategy(new mi),this.registerElementToBlockDTOClassStrategy(new vi),this.registerElementToBlockDTOClassStrategy(new yi),this.registerAnnotationHandler(new Li),this.registerAnnotationHandler(new Ci),this.registerAnnotationHandler(new Si)}initialExtensionAfterLoad(t){this.tableSelection.init(t);const e=Object.assign(Object.assign({},t),{tableSelection:this.tableSelection});super.initialExtensionAfterLoad(e)}destroyExtension(){this.tableBlockRenderer.destroy(),this.tableSelection.destroy()}}(()=>{const t=new Qn,e=new Yn;Ue.registerActionHandleStrategy(v.name,"INSERT_TABLE_BLOCK",t),Ue.registerActionHandleStrategy(v.name,"DELETE_TABLE_BLOCK",e),Ue.registerActionHandleStrategy(Et.name,"DELETE_TABLE_BLOCK",e),Ue.registerActionHandleStrategy(yt.name,"DELETE_TABLE_BLOCK",e),Ue.registerActionHandleStrategy(D.name,"INSERT_TABLE_BLOCK",t),Ue.registerActionHandleStrategy(C.name,"INSERT_TABLE_BLOCK",t),Ue.registerActionHandleStrategy(Tt.name,Jt,new Oi),Ue.registerActionHandleStrategy(Tt.name,Qt,new Ii),Ue.registerActionHandleStrategy(Tt.name,Xt,new ii),Ue.registerActionHandleStrategy(Tt.name,Yt,new ai),Ue.registerActionHandleStrategy(Tt.name,te,new si),Ue.registerActionHandleStrategy(Tt.name,ee,new oi),Ue.registerActionHandleStrategy(Tt.name,ne,new ie),Ue.registerActionHandleStrategy(Wt.name,re,new di),Ue.registerActionHandleStrategy(Wt.name,"CREATE_SEGMENT_TABLE_CELL",new ci),Ue.registerActionHandleStrategy(Wt.name,ae,new hi),Ue.registerActionHandleStrategy(Et.name,se,new Ai),Ue.registerActionHandleStrategy(Et.name,oe,new Ei),Ue.registerActionHandleStrategy(yt.name,se,new Ai),Ue.registerActionHandleStrategy(yt.name,oe,new Ei),Ue.registerActionHandleStrategy(Tt.name,le,new ui),Ue.registerActionHandleStrategy(Tt.name,ce,new fi),Ue.registerActionHandleStrategy(Tt.name,En.name,new ki),Ue.registerActionHandleStrategy(Et.name,Nn.name,new Ti),Ue.registerActionHandleStrategy(yt.name,jn.name,new Ti),Ue.registerActionHandlerInterceptor(D.name,$.DELETE_BLOCK_CONTENT,new Xn),Ue.registerActionHandlerInterceptor(Wt.name,$.INSERT_CHILDREN_BEFORE,new pi),Ue.registerActionHandlerInterceptor(Et.name,$.DELETE_CHILDREN,new ti),Ue.registerActionHandlerInterceptor(yt.name,$.DELETE_CHILDREN,new ti),Ue.registerActionHandlerInterceptor(Tt.name,$.INSERT_NEW_PARAGRAPH,new Ri),Ue.registerFilterStylesStrategy(Tt.dtoName,new Ni),Ue.registerFilterStylesStrategy(Sn.dtoName,new ji),Ue.registerFilterStylesStrategy(Et.dtoName,new Bi),Ue.registerFilterStylesStrategy(yt.dtoName,new Bi("th"))})();class Di extends Q{constructor(t,e,n){super(t,n),this.type="horizontal-line",this.parent=e}toJSON(){return{id:this.id,type:"horizontal-line"}}clone(t){return new Di(this.id,t,super.cloneAnnotations())}toHtml(){return"<hr>"}}const Mi={display:"inline-block",width:"100%",height:"4px",backgroundColor:"rgb(222, 222, 222)",borderWidth:"0px"};class Hi extends J{constructor(){super(...arguments),this.stylesToBeFiltered=Mi,this.elementTagName="hr"}canFilter(t){return class{static isHorizontalLineBlock(t){return"RTEHorizontalLineBlock"===t}}.isHorizontalLineBlock(t.dtoName)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}var Vi;!function(t){t.HORIZONTAL_LINE="HORIZONTAL_LINE"}(Vi||(Vi={}));class Pi extends q{constructor(){super(...arguments),this.type=Vi.HORIZONTAL_LINE}static from(){return[Vi.HORIZONTAL_LINE,new Pi]}static getDefaultStyles(){return Mi}toJSON(){return null}clone(){return new Pi}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte-horizontal-line-hr"}renderStyle(t){return(null==t?void 0:t.standalone)?Pi.getDefaultStyles():null}}class Ki extends _{constructor(t,e){super(t),this.dtoName=Ki.dtoName,this.type="horizontal-line",this.children=[];const{autoMatchFormat:n=!0}=null!=e?e:{};n&&(this.annotationMap=new Map([Pi.from()]))}static from(e,n={autoMatchFormat:!0}){var i,r;const a=new Ki(e.id,n),s=(null===(r=null===(i=e.children)||void 0===i?void 0:i[0])||void 0===r?void 0:r.id)||t(),o=new Di(s,a);return a.children=[o],e.annotations&&_.convertAnnotationsToMap(a.annotationMap,e.annotations),a}static create(e,n={autoMatchFormat:!0}){const i=new Ki(t(),n),r=new Di(t(),i);return i.children=[r],e&&_.convertAnnotationsToMap(i.annotationMap,e),i}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"horizontal-line",children:this.children.map((t=>t.toJSON()))})}toHtml(t){return`<hr${super.generateAttributeString(t)}>`}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1]}clone(t){const e=new Ki(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}Ki.dtoName="RTEHorizontalLineBlock";class Fi extends qe{doRender(t,e,n){const i=e.children[0],r=e.getStyles(n),a=e.getClasses(n),s=[Q.DECORATOR_NODE_CLASS,a].filter(Boolean).join(" ");return t("div",{key:e.id,class:`v-rte-horizontal-line ${Q.DECORATOR_CONTAINER_CLASS}`,ref:this.useRef(e)},[t("hr",{key:(null==i?void 0:i.id)||e.id+"-hr",class:s,style:Object.keys(r).length>0?r:void 0,ref:i?this.useRef(i):void 0})])}injectRTEScopeStyles(){return".v-rte-horizontal-line{padding:8px 0;overflow:hidden}.v-rte-horizontal-line .v-rte-horizontal-line-hr{display:inline-block;width:100%;height:4px;border-width:0px;background-color:rgb(222, 222, 222)}"}}class zi extends j{constructor(t,e=0){super(),this.type="INSERT_HORIZONTAL_LINE_BLOCK",this.splitPointNode=t,this.startOffsetOfNode=e}}class $i extends Ze{render(t,e){return this.renderButton(t,e,{icon:"horizontal-line",tooltip:{text:f.t("Horizontal line")}})}isDisabled(t){const e=this.getExtensionContext(t.host);if(e){const{host:t,getSelectedNodes:n}=e,[i]=n();return i?t.disabled||!O.canHandle("INSERT_HORIZONTAL_LINE_BLOCK",i.parent):t.disabled}return!1}handleButtonClick(t){if(this.isDisabled(t))return;const e=this.getExtensionContext(t.host);if(e){const{host:n,getSelectedNodes:i,flushValue:r}=e,a=i()[0],s=new zi(a,t.rteRange.startOffset);a?a.parent&&a.parent.apply(s):n.value.apply(s),s.nextFocusNode&&n.value.apply(new m(s.nextFocusNode,0)),r(n.value)}}handleDropdownClick(){}}st.register({"horizontal-line":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M0 224H32 608h32v64H608 32 0V224z"/></svg>'}});class qi extends x{canHandle(t,e){return"HR"===t[e].tagName?1:0}handle(t,e){const n=b.generate(Ki,t[0],e);return Ki.create(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Wi extends H{handleAction(t,e){const n=Ki.create();if(t.splitPointNode instanceof B){const i=t.splitPointNode,r=t.startOffsetOfNode;if(this.isCaretPositionAtBlockEnd(e,i,r))this.insertAfterWithFocus(t,e,n);else if(this.isCaretPositionAtBlockStart(e,i,r))e.parent.apply(new F(e,n)),t.nextFocusNode=e.getFirstNode();else{const a=new X(i,r);e.apply(a);const s=this.getNextSiblingBlock(e);e.parent.apply(new V(e,n)),t.nextFocusNode=s.getFirstNode()}}else if(t.splitPointNode)this.insertAfterWithFocus(t,e,n);else{const i=super.createNewParagraph("");e.apply(new P([n,i])),t.nextFocusNode=i.children[0]}}insertAfterWithFocus(t,e,n){const i=this.getNextSiblingBlock(e),r=null==i?void 0:i.getFirstNode();if(r instanceof B)e.parent.apply(new V(e,n)),t.nextFocusNode=r;else{const i=super.createNewParagraph("");e.parent.apply(new V(e,n,i)),t.nextFocusNode=i.children[0]}}getNextSiblingBlock(t){const e=t.parent.children,n=e.indexOf(t);return e[n+1]}}class Gi extends Ue{constructor(){super(),this.blockRenderer=new Fi,this.toolbarButtonRenderer=new $i,this.registerBlockBasicStrategies(Ki.name),this.registerNode("horizontal-line",Ki),this.registerRenderer("horizontal-line",this.blockRenderer),this.registerToolbarButtonRenderer("horizontalLine",this.toolbarButtonRenderer),this.registerElementToBlockDTOClassStrategy(new qi),Ue.registerFilterStylesStrategy(Ki.dtoName,new Hi)}}(()=>{const t=new Wi;Ue.registerActionHandleStrategy(v.name,"INSERT_HORIZONTAL_LINE_BLOCK",t),Ue.registerActionHandleStrategy(D.name,"INSERT_HORIZONTAL_LINE_BLOCK",t),Ue.registerActionHandleStrategy(C.name,"INSERT_HORIZONTAL_LINE_BLOCK",t),Ue.registerActionHandleStrategy(Ki.name,"INSERT_HORIZONTAL_LINE_BLOCK",t)})();const Ui={key:"latin",label:"Latin",characters:[{character:"Ā",title:"Latin capital letter a with macron"},{character:"ā",title:"Latin small letter a with macron"},{character:"Ă",title:"Latin capital letter a with breve"},{character:"ă",title:"Latin small letter a with breve"},{character:"Ą",title:"Latin capital letter a with ogonek"},{character:"ą",title:"Latin small letter a with ogonek"},{character:"Ć",title:"Latin capital letter c with acute"},{character:"ć",title:"Latin small letter c with acute"},{character:"Ĉ",title:"Latin capital letter c with circumflex"},{character:"ĉ",title:"Latin small letter c with circumflex"},{character:"Ċ",title:"Latin capital letter c with dot above"},{character:"ċ",title:"Latin small letter c with dot above"},{character:"Č",title:"Latin capital letter c with caron"},{character:"č",title:"Latin small letter c with caron"},{character:"Ď",title:"Latin capital letter d with caron"},{character:"ď",title:"Latin small letter d with caron"},{character:"Đ",title:"Latin capital letter d with stroke"},{character:"đ",title:"Latin small letter d with stroke"},{character:"Ē",title:"Latin capital letter e with macron"},{character:"ē",title:"Latin small letter e with macron"},{character:"Ĕ",title:"Latin capital letter e with breve"},{character:"ĕ",title:"Latin small letter e with breve"},{character:"Ė",title:"Latin capital letter e with dot above"},{character:"ė",title:"Latin small letter e with dot above"},{character:"Ę",title:"Latin capital letter e with ogonek"},{character:"ę",title:"Latin small letter e with ogonek"},{character:"Ě",title:"Latin capital letter e with caron"},{character:"ě",title:"Latin small letter e with caron"},{character:"Ĝ",title:"Latin capital letter g with circumflex"},{character:"ĝ",title:"Latin small letter g with circumflex"},{character:"Ğ",title:"Latin capital letter g with breve"},{character:"ğ",title:"Latin small letter g with breve"},{character:"Ġ",title:"Latin capital letter g with dot above"},{character:"ġ",title:"Latin small letter g with dot above"},{character:"Ģ",title:"Latin capital letter g with cedilla"},{character:"ģ",title:"Latin small letter g with cedilla"},{character:"Ĥ",title:"Latin capital letter h with circumflex"},{character:"ĥ",title:"Latin small letter h with circumflex"},{character:"Ħ",title:"Latin capital letter h with stroke"},{character:"ħ",title:"Latin small letter h with stroke"},{character:"Ĩ",title:"Latin capital letter i with tilde"},{character:"ĩ",title:"Latin small letter i with tilde"},{character:"Ī",title:"Latin capital letter i with macron"},{character:"ī",title:"Latin small letter i with macron"},{character:"Ĭ",title:"Latin capital letter i with breve"},{character:"ĭ",title:"Latin small letter i with breve"},{character:"Į",title:"Latin capital letter i with ogonek"},{character:"į",title:"Latin small letter i with ogonek"},{character:"İ",title:"Latin capital letter i with dot above"},{character:"ı",title:"Latin small letter dotless i"},{character:"IJ",title:"Latin capital ligature ij"},{character:"ij",title:"Latin small ligature ij"},{character:"Ĵ",title:"Latin capital letter j with circumflex"},{character:"ĵ",title:"Latin small letter j with circumflex"},{character:"Ķ",title:"Latin capital letter k with cedilla"},{character:"ķ",title:"Latin small letter k with cedilla"},{character:"ĸ",title:"Latin small letter kra"},{character:"Ĺ",title:"Latin capital letter l with acute"},{character:"ĺ",title:"Latin small letter l with acute"},{character:"Ļ",title:"Latin capital letter l with cedilla"},{character:"ļ",title:"Latin small letter l with cedilla"},{character:"Ľ",title:"Latin capital letter l with caron"},{character:"ľ",title:"Latin small letter l with caron"},{character:"Ŀ",title:"Latin capital letter l with middle dot"},{character:"ŀ",title:"Latin small letter l with middle dot"},{character:"Ł",title:"Latin capital letter l with stroke"},{character:"ł",title:"Latin small letter l with stroke"},{character:"Ń",title:"Latin capital letter n with acute"},{character:"ń",title:"Latin small letter n with acute"},{character:"Ņ",title:"Latin capital letter n with cedilla"},{character:"ņ",title:"Latin small letter n with cedilla"},{character:"Ň",title:"Latin capital letter n with caron"},{character:"ň",title:"Latin small letter n with caron"},{character:"ʼn",title:"Latin small letter n preceded by apostrophe"},{character:"Ŋ",title:"Latin capital letter eng"},{character:"ŋ",title:"Latin small letter eng"},{character:"Ō",title:"Latin capital letter o with macron"},{character:"ō",title:"Latin small letter o with macron"},{character:"Ŏ",title:"Latin capital letter o with breve"},{character:"ŏ",title:"Latin small letter o with breve"},{character:"Ő",title:"Latin capital letter o with double acute"},{character:"ő",title:"Latin small letter o with double acute"},{character:"Œ",title:"Latin capital ligature oe"},{character:"œ",title:"Latin small ligature oe"},{character:"Ŕ",title:"Latin capital letter r with acute"},{character:"ŕ",title:"Latin small letter r with acute"},{character:"Ŗ",title:"Latin capital letter r with cedilla"},{character:"ŗ",title:"Latin small letter r with cedilla"},{character:"Ř",title:"Latin capital letter r with caron"},{character:"ř",title:"Latin small letter r with caron"},{character:"Ś",title:"Latin capital letter s with acute"},{character:"ś",title:"Latin small letter s with acute"},{character:"Ŝ",title:"Latin capital letter s with circumflex"},{character:"ŝ",title:"Latin small letter s with circumflex"},{character:"Ş",title:"Latin capital letter s with cedilla"},{character:"ş",title:"Latin small letter s with cedilla"},{character:"Š",title:"Latin capital letter s with caron"},{character:"š",title:"Latin small letter s with caron"},{character:"Ţ",title:"Latin capital letter t with cedilla"},{character:"ţ",title:"Latin small letter t with cedilla"},{character:"Ť",title:"Latin capital letter t with caron"},{character:"ť",title:"Latin small letter t with caron"},{character:"Ŧ",title:"Latin capital letter t with stroke"},{character:"ŧ",title:"Latin small letter t with stroke"},{character:"Ũ",title:"Latin capital letter u with tilde"},{character:"ũ",title:"Latin small letter u with tilde"},{character:"Ū",title:"Latin capital letter u with macron"},{character:"ū",title:"Latin small letter u with macron"},{character:"Ŭ",title:"Latin capital letter u with breve"},{character:"ŭ",title:"Latin small letter u with breve"},{character:"Ů",title:"Latin capital letter u with ring above"},{character:"ů",title:"Latin small letter u with ring above"},{character:"Ű",title:"Latin capital letter u with double acute"},{character:"ű",title:"Latin small letter u with double acute"},{character:"Ų",title:"Latin capital letter u with ogonek"},{character:"ų",title:"Latin small letter u with ogonek"},{character:"Ŵ",title:"Latin capital letter w with circumflex"},{character:"ŵ",title:"Latin small letter w with circumflex"},{character:"Ŷ",title:"Latin capital letter y with circumflex"},{character:"ŷ",title:"Latin small letter y with circumflex"},{character:"Ÿ",title:"Latin capital letter y with diaeresis"},{character:"Ź",title:"Latin capital letter z with acute"},{character:"ź",title:"Latin small letter z with acute"},{character:"Ż",title:"Latin capital letter z with dot above"},{character:"ż",title:"Latin small letter z with dot above"},{character:"Ž",title:"Latin capital letter z with caron"},{character:"ž",title:"Latin small letter z with caron"},{character:"ſ",title:"Latin small letter long s"}]},Zi={key:"mathematical",label:"Mathematical",characters:[{character:"<",title:"Less-than sign"},{character:">",title:"Greater-than sign"},{character:"≤",title:"Less-than or equal to"},{character:"≥",title:"Greater-than or equal to"},{character:"–",title:"En dash"},{character:"—",title:"Em dash"},{character:"¯",title:"Macron"},{character:"‾",title:"Overline"},{character:"°",title:"Degree sign"},{character:"−",title:"Minus sign"},{character:"±",title:"Plus-minus sign"},{character:"÷",title:"Division sign"},{character:"⁄",title:"Fraction slash"},{character:"×",title:"Multiplication sign"},{character:"ƒ",title:"Latin small letter f with hook"},{character:"∫",title:"Integral"},{character:"∑",title:"N-ary summation"},{character:"∞",title:"Infinity"},{character:"√",title:"Square root"},{character:"∼",title:"Tilde operator"},{character:"≅",title:"Approximately equal to"},{character:"≈",title:"Almost equal to"},{character:"≠",title:"Not equal to"},{character:"≡",title:"Identical to"},{character:"∈",title:"Element of"},{character:"∉",title:"Not an element of"},{character:"∋",title:"Contains as member"},{character:"∏",title:"N-ary product"},{character:"∧",title:"Logical and"},{character:"∨",title:"Logical or"},{character:"¬",title:"Not sign"},{character:"∩",title:"Intersection"},{character:"∪",title:"Union"},{character:"∂",title:"Partial differential"},{character:"∀",title:"For all"},{character:"∃",title:"There exists"},{character:"∅",title:"Empty set"},{character:"∇",title:"Nabla"},{character:"∗",title:"Asterisk operator"},{character:"∝",title:"Proportional to"},{character:"∠",title:"Angle"},{character:"¼",title:"Vulgar fraction one quarter"},{character:"½",title:"Vulgar fraction one half"},{character:"¾",title:"Vulgar fraction three quarters"}]},Ji={key:"arrows",label:"Arrows",characters:[{character:"←",title:"leftwards simple arrow"},{character:"→",title:"rightwards simple arrow"},{character:"↑",title:"upwards simple arrow"},{character:"↓",title:"downwards simple arrow"},{character:"⇐",title:"leftwards double arrow"},{character:"⇒",title:"rightwards double arrow"},{character:"⇑",title:"upwards double arrow"},{character:"⇓",title:"downwards double arrow"},{character:"⇠",title:"leftwards dashed arrow"},{character:"⇢",title:"rightwards dashed arrow"},{character:"⇡",title:"upwards dashed arrow"},{character:"⇣",title:"downwards dashed arrow"},{character:"⇤",title:"leftwards arrow to bar"},{character:"⇥",title:"rightwards arrow to bar"},{character:"⤒",title:"upwards arrow to bar"},{character:"⤓",title:"downwards arrow to bar"},{character:"↨",title:"up down arrow with base"},{character:"🔙",title:"back with leftwards arrow above"},{character:"🔚",title:"end with leftwards arrow above"},{character:"🔛",title:"on with exclamation mark with left right arrow above"},{character:"🔜",title:"soon with rightwards arrow above"},{character:"🔝",title:"top with upwards arrow above"}]},Qi={key:"currency",label:"Currency",characters:[{character:"$",title:"Dollar sign"},{character:"€",title:"Euro sign"},{character:"¥",title:"Yen sign"},{character:"£",title:"Pound sign"},{character:"¢",title:"Cent sign"},{character:"₠",title:"Euro-currency sign"},{character:"₡",title:"Colon sign"},{character:"₢",title:"Cruzeiro sign"},{character:"₣",title:"French franc sign"},{character:"₤",title:"Lira sign"},{character:"¤",title:"Currency sign"},{character:"₿",title:"Bitcoin sign"},{character:"₥",title:"Mill sign"},{character:"₦",title:"Naira sign"},{character:"₧",title:"Peseta sign"},{character:"₨",title:"Rupee sign"},{character:"₩",title:"Won sign"},{character:"₪",title:"New sheqel sign"},{character:"₫",title:"Dong sign"},{character:"₭",title:"Kip sign"},{character:"₮",title:"Tugrik sign"},{character:"₯",title:"Drachma sign"},{character:"₰",title:"German penny sign"},{character:"₱",title:"Peso sign"},{character:"₲",title:"Guarani sign"},{character:"₳",title:"Austral sign"},{character:"₴",title:"Hryvnia sign"},{character:"₵",title:"Cedi sign"},{character:"₶",title:"Livre tournois sign"},{character:"₷",title:"Spesmilo sign"},{character:"₸",title:"Tenge sign"},{character:"₹",title:"Indian rupee sign"},{character:"₺",title:"Turkish lira sign"},{character:"₻",title:"Nordic mark sign"},{character:"₼",title:"Manat sign"},{character:"₽",title:"Ruble sign"}]},Xi={key:"text",label:"Text",characters:[{character:"‹",title:"Single left-pointing angle quotation mark"},{character:"›",title:"Single right-pointing angle quotation mark"},{character:"«",title:"Left-pointing double angle quotation mark"},{character:"»",title:"Right-pointing double angle quotation mark"},{character:"‘",title:"Left single quotation mark"},{character:"’",title:"Right single quotation mark"},{character:"“",title:"Left double quotation mark"},{character:"”",title:"Right double quotation mark"},{character:"‚",title:"Single low-9 quotation mark"},{character:"„",title:"Double low-9 quotation mark"},{character:"¡",title:"Inverted exclamation mark"},{character:"¿",title:"Inverted question mark"},{character:"‥",title:"Two dot leader"},{character:"…",title:"Horizontal ellipsis"},{character:"‡",title:"Double dagger"},{character:"‰",title:"Per mille sign"},{character:"‱",title:"Per ten thousand sign"},{character:"‼",title:"Double exclamation mark"},{character:"⁈",title:"Question exclamation mark"},{character:"⁉",title:"Exclamation question mark"},{character:"⁇",title:"Double question mark"},{character:"©",title:"Copyright sign"},{character:"®",title:"Registered sign"},{character:"™",title:"Trade mark sign"},{character:"§",title:"Section sign"},{character:"¶",title:"Paragraph sign"},{character:"⁋",title:"Reversed paragraph sign"}]},Yi=[Qi,Xi,Zi,Ji,Ui];class tr extends Ze{constructor(t){super(),this.panelRef=null,this.categories=t}render(t,e){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,isScreenPosition:!0,ref:t=>{t&<.addUniqueObserverToNode(t,pt,(()=>{this.handlePopoverShow()}))}},[t("div",{slot:"popover"},[t("vega-rich-text-special-characters-panel",{categories:this.categories,ref:t=>{t&&(this.panelRef=t,lt.addUniqueObserverToNode(t,dt,(t=>{this.insertCharacter(e,t.detail)})))}})]),t("div",{slot:"popover-content"},this.renderButton(t,e,{icon:"rte-special-characters",tooltip:{text:"Special Characters"}}))])}handleButtonClick(){}handleDropdownClick(){}handlePopoverShow(){this.panelRef&&this.panelRef.resetPanel()}insertCharacter(t,e){const n=t.rteRange,i=n.startNode;if(!i)return;const r=this.isCaretOnLineBreak(i,n)?this.insertAtLineBreak(i,e,n):this.insertAtTextNode(i,e,n);t.host.value.apply(new m(r.node,r.offset))}isCaretOnLineBreak(t,e){return t instanceof B&&"\n"===t.text&&e.startOffset===e.endOffset}insertAtTextNode(t,e,n){const i=new ye(e,n);return i.isFlushable=!0,t.apply(i),{node:t,offset:Math.min(n.startOffset+e.length,t.getRangeEndOffset())}}insertAtLineBreak(t,e,n){return{node:this.insertTextToLineBreakNode(t,e,n),offset:e.length}}insertTextToLineBreakNode(t,e,n){const i=t.parent,r=i.children.indexOf(t);if(0===n.startOffset&&i.children[r+1]){const n=t.cloneWithText(e),r=new F(t,n);return r.isFlushable=!0,i.apply(r),n}const a=new Y(e);return a.isFlushable=!0,t.apply(a),t}}st.register({"rte-special-characters":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M224 80C126.8 80 48 158.8 48 256c0 63.7 33.8 119.5 84.6 150.4c11.4 7 19.4 19.6 19.4 34.2c0 21.8-17.6 39.4-39.4 39.4H24c-13.3 0-24-10.7-24-24s10.7-24 24-24H85.4C33.4 391 0 327.4 0 256C0 132.3 100.3 32 224 32s224 100.3 224 224c0 71.4-33.4 135-85.4 176H424c13.3 0 24 10.7 24 24s-10.7 24-24 24H335.4c-21.8 0-39.4-17.6-39.4-39.4c0-14.6 8-27.2 19.4-34.2C366.2 375.5 400 319.7 400 256c0-97.2-78.8-176-176-176z"/></svg>'}});class er extends Ue{constructor(t){super(),this.categories=this.buildCategories(t)}prepareBeforeLoad(t){this.registerToolbarButtonRenderer("special-characters",new tr(this.categories),t)}buildCategories(t){const e=!1!==(null==t?void 0:t.includeDefaults)?Yi:[];return(null==t?void 0:t.categories)?[...e,...t.categories]:e}}const nr=[{title:"0.5",value:"0.5"},{title:"1",value:"1"},{title:"1.5",value:"1.5"},{title:"2",value:"2"},{title:"2.5",value:"2.5"}];var ir;!function(t){t.LINE_HEIGHT="LINE_HEIGHT"}(ir||(ir={}));class rr extends q{constructor(t){super(),this.type=ir.LINE_HEIGHT,this.lineHeight=t}static from(t){return[ir.LINE_HEIGHT,new rr(t)]}static getDefaultStyles(t){return{lineHeight:t}}toJSON(){return{lineHeight:this.lineHeight}}renderClass(){return null}clone(){return new rr(this.lineHeight)}renderStyle(){return rr.getDefaultStyles(this.lineHeight)}}class ar extends W{constructor(t){super(),this.isFlushable=!0,this.lineHeight=t}toAnnotation(){return new rr(this.lineHeight)}}class sr extends H{handleAction(t,e){this.updateCustomStyleAnnotation(e,["lineHeight"])}}class or extends Ze{constructor(t){super(),this.options=t}render(t,e){const n=this.options.map((t=>{var e;return{key:t.value,label:null!==(e=t.title)&&void 0!==e?e:t.value}}));return this.renderDropdown(t,e,{selectType:"single",selectedSourceKey:this.getSelectedSourceValue(e)},[this.renderButton(t,e,{icon:"line-height",showArrowIcon:!0,tooltip:{text:f.t("Line Height")}}),this.renderDropdownListTemplate(t,n)])}isSelected(){return!1}isDisabled(t){var e;if(t.host.disabled)return!0;const n=this.getExtensionContext(t.host);return!!(null!==(e=null==n?void 0:n.getSelectedNodes())&&void 0!==e?e:[]).some((t=>{var e;return(null===(e=t.getAnnotationByType(tt.CODE))||void 0===e?void 0:e.code)||t.parent instanceof et}))||this.getSelectedBlocks(t).some((t=>t instanceof et||t instanceof C||!O.canHandle(ar.name,t)))}handleDropdownClick(t,e){const n=t;this.getSelectedBlocks(e).forEach((t=>{t.apply(new ar(n))}))}handleButtonClick(){}getSelectedSourceValue(t){const e=this.getSelectedBlocks(t);if(0===e.length)return"";const n=e[0].getAnnotationByType(ir.LINE_HEIGHT);return e.every((t=>{const e=t.getAnnotationByType(ir.LINE_HEIGHT);return(null==e?void 0:e.lineHeight)===(null==n?void 0:n.lineHeight)}))&&n?n.lineHeight:""}getSelectedBlocks(t){var e,n;const i=this.getExtensionContext(t.host),r=null!==(e=null==i?void 0:i.getSelectedNodes())&&void 0!==e?e:[],a=[];return r.forEach((t=>{t.parent instanceof _&&!a.includes(t.parent)&&a.push(t.parent)})),0===a.length&&(null===(n=t.rteRange.startNode)||void 0===n?void 0:n.parent)instanceof _&&a.push(t.rteRange.startNode.parent),a}}st.register({"line-height":{icon:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">\x3c!--! Font Awesome Pro 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e<path fill="currentColor" d="M113.8 39.9c-4.6-5.1-11-7.9-17.8-7.9s-13.3 2.9-17.8 7.9l-72 80c-8.9 9.9-8.1 25 1.8 33.9s25 8.1 33.9-1.8L72 118.5V393.5L41.8 359.9c-8.9-9.9-24-10.7-33.9-1.8s-10.7 24-1.8 33.9l72 80c4.6 5.1 11 7.9 17.8 7.9s13.3-2.9 17.8-7.9l72-80c8.9-9.9 8.1-25-1.8-33.9s-25-8.1-33.9 1.8L120 393.5V118.5l30.2 33.5c8.9 9.9 24 10.7 33.9 1.8s10.7-24 1.8-33.9l-72-80zM248 72c-13.3 0-24 10.7-24 24s10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H248zm0 160c-13.3 0-24 10.7-24 24s10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H248zM224 416c0 13.3 10.7 24 24 24H552c13.3 0 24-10.7 24-24s-10.7-24-24-24H248c-13.3 0-24 10.7-24 24z"/></svg>'}});const lr=new Set([D.name,A.name]);class cr extends T{constructor(t=nr){super(),this.allowedLineHeights=new Set(t.map((t=>t.value)))}canHandle(t){return lr.has(t.name)}handle(t){var e,n;const i=null!==(n=null===(e=null==t?void 0:t.style.lineHeight)||void 0===e?void 0:e.trim())&&void 0!==n?n:"";return i&&this.allowedLineHeights.has(i)?{lineHeight:i}:{}}}class hr extends J{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.lineHeight,i=e.customStyle;return n&&i&&i.lineHeight===n&&delete i.lineHeight,i&&0===Object.keys(i).length&&delete e.customStyle,t}}const dr=new WeakMap,ur=new WeakSet;class pr extends Ue{constructor(t=nr){super(),this.options=t,this.toolbarButtonRenderer=null,this.registerAnnotationHandler(new cr(this.options)),[D,A].forEach((t=>{!function(t,e){dr.set(t,new Set(e.map((t=>t.value))))}(t,this.options)}))}prepareBeforeLoad(t){this.toolbarButtonRenderer=new or(this.options),this.registerToolbarButtonRenderer("lineHeight",this.toolbarButtonRenderer,t)}}[D,A].forEach((t=>{Ue.registerActionHandleStrategy(t.name,ar.name,new sr),R.register(t.name,new hr),function(t){ur.has(t)||(ur.add(t),Ue.attachAnnotationFromJson(t,"lineHeight",((e,n)=>{if("string"!=typeof n||""===n)return;e.annotationMap.set(...rr.from(n));const i=dr.get(t);i&&i.size>0&&function(t,e){const n=t.annotationMap.get(ir.LINE_HEIGHT);if(!n||e.has(n.lineHeight))return;const i=n.lineHeight;t.annotationMap.delete(ir.LINE_HEIGHT);const r=t.annotationMap.get(U.CUSTOM_STYLE);r?r.customStyle=Object.assign(Object.assign({},r.customStyle),{lineHeight:i}):t.annotationMap.set(...nt.from({lineHeight:i}))}(e,i)})))}(t)}));class fr extends j{constructor(t,e){super(),this.type=$.INSERT_NODE_TO_NEAREST_ROOT,this.rteRange=t,this.nodeToBeInserted=e}}class wr extends H{handleAction(e,n){const{rteRange:i,token:r}=e;if(i&&i.startNode){const{key:a,label:s,customAttrs:o={wrapped:"true"}}=r,l=new Xe(t(),a,s,n);l.annotationMap.set("CUSTOM_ATTRIBUTE",new Z(o)),n.apply(new fr(i,l)),e.actionHandleResult=!0}}}const gr=new class extends x{canHandle(t,e){const n=t[e];return"SPAN"===n.nodeName&&n.classList.contains("token")&&n.hasAttribute("token-key")?1:0}handle(e){const n=e[0],i=n.getAttribute("token-key"),r=n.textContent,a=b.generate(B,n),{customAttribute:s}=a,o=function(t,e){var n={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(t);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(t,i[r])&&(n[i[r]]=t[i[r]])}return n}(a,["customAttribute","customClass"]);return{id:t(),type:"token",token:i,text:r,annotations:Object.assign(Object.assign({},o),{customAttribute:this.createCustomAttrs(s)})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}createCustomAttrs(t){const e=Object.assign(Object.assign({},t),{contenteditable:null,"template-token-key":null,"token-key":null,wrapped:"false"===t.wrapped?"false":"true"});return me(e)}};class br extends Ue{constructor(t=[]){super(),this.tokenRenderer=new Ye,this.tokenList=t,this.registerNode("token",Xe),this.registerRenderer("token",this.tokenRenderer),this.registerElementToNodeDTOClassStrategy(gr)}prepareBeforeLoad(t){this.registerToolbarButtonRenderer("token",new Qe(this.tokenList),t)}}(()=>{const t=new wr;Ue.registerActionHandleStrategy(D.name,"INSERT_TOKEN_NODE",t),Ue.registerActionHandleStrategy(A.name,"INSERT_TOKEN_NODE",t)})();export{un as A,fr as I,Qe as R,Ce as V,Ae as a,Ie as b,je as c,Pe as d,ze as e,br as f,en as g,nr as h,xn as i,_i as j,Gi as k,er as l,Yi as m,Ui as n,Zi as o,Ji as p,Qi as q,Xi as r,pr as s,Ue as t,qe as u,Ze as v,Me as w,Xe as x,Ye as y,tn as z}
|
package/dist/vega/p-8a3d12e6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as o}from"./p-b2488adb.js";import{R as i}from"./p-94a064a3.js";function r(r,f,a,s){return o(r)?{flex:`${i.formatCustom(r)}`}:{flexGrow:o(f)?`${i.formatCustom(f)}`:void 0,flexShrink:o(a)?`${i.formatCustom(a)}`:void 0,flexBasis:o(s)?`${i.formatCustom(s)}`:void 0}}export{r as f}
|
package/dist/vega/p-a18d280f.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{g as t,e,c as n,h as s,A as r,T as i,u as a,H as o,v as l,l as c,w as h,x as u,y as d,z as w,D as p,I as m,n as f,E as g,j as x,B as T,F as b,d as O,t as y,G as E,o as A,r as k,s as H,J as N,N as j,q as C,K as B,L as v,m as S,O as I,M as R,S as L,P as $,Q as D,U as M,W as P,X as F,Y as z,Z as U,_ as V,$ as W,a0 as G,a1 as J,a2 as K,R as Y,a3 as X,p as Q,a4 as Z,a5 as _,a6 as q,b as tt,a7 as et,a8 as nt,a9 as st,aa as rt}from"./p-50e7020c.js";import{g as it}from"./p-8b5d3a52.js";import{i as at}from"./p-b2488adb.js";import{C as ot}from"./p-2d0d575f.js";import{d as lt}from"./p-526e3634.js";import{c as ct,d as ht}from"./p-3a93730e.js";import{r as ut,i as dt}from"./p-528748fa.js";import{c as wt}from"./p-a841cf13.js";import{L as pt}from"./p-6e1ab235.js";class mt extends e{constructor(t,e,n){super(t,"list-item",n),this.dtoName=mt.dtoName,this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new mt(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=gt.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);at(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(t){return[`<li${super.generateAttributeString(t)}>`,this.getChildrenHtml(t),"</li>"].join("")}cloneWithNodes(t){const e=new mt(it());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new mt(it())}clone(t){var e;const n=new mt(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(i.name,mt.name,new a),r.register(o.name,mt.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,mt.name,new h),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,mt.name,new u),r.register(c.DELETE_NEST_LIST,mt.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,mt.name,new d),r.register(c.REPLACE_CHILD_NODES,mt.name,new w),r.register(c.REPLACE_NEST_LIST,mt.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,mt.name,new p),r.register(c.INSERT_IMAGE_TO_BLOCK,mt.name,new class extends t{handleAction(t,e){e.parent.apply(t)}}),mt.dtoName="RTEListItemBlock";class ft extends T{constructor(){super(...arguments),this.type=b.LIST}static getDefaultStyles(){return{paddingLeft:"8px",marginLeft:"16px"}}renderStyle(t){return(null==t?void 0:t.standalone)?ft.getDefaultStyles():null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new ft}toJSON(){}}class gt extends O{constructor(t,e,n){super(t),this.dtoName=gt.dtoName,this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(b.LIST,new ft)}static from(t,e={autoMatchFormat:!0}){const n=new gt(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);at(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=mt.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return A.from(e);case"customClass":return E.from(e);case"customStyle":return y.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString(t)}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new gt(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,gt.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new m(e,r)),e.parent.apply(new f(e)),n.forEach((t=>t.children.map((t=>t.apply(new g)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new m(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new f(t))})),0===e.children.length&&e.parent.apply(new f(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,gt.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const i=t.selectedBlocks,a=i.map((t=>(t.children.map((t=>t.apply(new g))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new x(e,...a));else if(r)e.parent.apply(new m(e,...a));else{const t=e.children.indexOf(i[0]),n=e.children.indexOf(i[i.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const o=e.parent.createList(e.type);o.apply(new s(e.children.slice(n+1))),e.parent.apply(new x(e,r,...a,o)),e.parent.apply(new f(e))}i.map((t=>{e.apply(new f(t))})),0===e.children.length&&e.parent.apply(new f(e))}toParagraph(t){const n=new e(it(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,gt.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new m(e,t.imageBlockToBeInserted):t)}}),gt.dtoName="RTEListBlock";class xt{}class Tt{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter(at)),e}}const bt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},Ot=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r],e))continue;let i=0;for(const a of n)if(i=a.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),o=new Tt(a,n);1===i&&a.shouldProceedToElementChildren()&&o.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(o),r+=i-1;break}if(0===i&&r<t.length){const n=Array.from(t[r].childNodes),i=this.process(Array.from(n),e);i.length>0&&s.push(...i)}}return s}isInvalidElement(t,e){return t.nodeType===Node.COMMENT_NODE||!1!==e.autoMatchFormat&&["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return bt.getElementToBlockStrategies()}};class yt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class Et extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class At extends Et{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class kt extends N{constructor(t,e){super(),this.type=j.IMAGE,this.size=t,this.alt=e}static from(t,e){return[j.IMAGE,new kt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return at(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new kt(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e=kt.getDefaultStyles();switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}kt.BASE_STYLES={verticalAlign:"bottom"};class Ht extends C{constructor(t,e,n,s){super(t,s),this.dtoName=Ht.dtoName,this.type=B.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Ht(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:a}=i,o=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(i,["size"]),l=Object.assign(Object.assign({},o),{size:null!=a?a:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?kt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(at)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof kt||t instanceof v)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new Ht(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(j.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${e.alt}"`:null,`src="${this.url}"`,e&&e.size?`data-size="${e.size}"`:null].filter(at))}>`}doAnnotationActionApply(t){const e=r.get(S.name,Ht.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,Ht.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(S.name,Ht.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}}),Ht.dtoName="RTEImageNode";class Nt extends R{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class jt extends O{constructor(t){super(t),this.dtoName=jt.dtoName,this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new jt(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Ht.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=super.generateAttributeString(t),n=this.children.map((e=>e.toHtml(t))).join("");return super.shouldRenderAsInternalWrapper()?n:[`<div${e}>`,n,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new jt(it())}clone(t){const e=new jt(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,jt.name,new p),r.register(c.REPLACE_CHILD_NODES,jt.name,new w),r.register(c.SPLIT_BLOCK_WITH_NODE,jt.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new I(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new m(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,jt.name,new class extends t{handleAction(t,e){const n=new Nt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,jt.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const i=e.from({id:it(),type:"paragraph",nodes:[{id:it(),type:"text",text:"\n"}]});r.parent.apply(new m(r,i));const a=this.concatBlocksNodes(t.slice(1));return(0===a.length||a[0]&&""===a[0].text)&&a.push(new n(it(),"\n",i)),i.apply(new s(a)),i.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new f(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,jt.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new m(e,i)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new x(e,i)):(e.apply(new L(n,r)),e.parent.apply(new m(e,i)))}}),r.register(o.name,jt.name,new l),jt.dtoName="RTEImageBlock";class Ct extends O{constructor(t,e){super(t),this.dtoName=Ct.dtoName,this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new Ct(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new Ct(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return!0}toHtml(t){const e=this.htmlTag,n=super.generateAttributeString(t);return $.has(this.htmlTag)?`<${e}${n}>`:[`<${e}${n}>`,this.children.map((e=>e.toHtml(t))).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}Ct.dtoName="RTEHtmlBlock";class Bt extends R{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class vt extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new f(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new f(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(e.children.length&&s&&s.parent!==e)i&&e.apply(new f(n)),e.type===s.parent.type&&s.parent.apply(new Bt(e));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&e.apply(new f(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new f(t)),s||i||(r=n)}0===e.children.length&&e.parent.apply(new f(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===t.children.length?t.parent.apply(new f(t)):t.apply(new f(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new f(e)),r||(t.nextNode=n))}r?t.previousNode=r:i&&(t.nextNode=i)}}class St extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new m(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new L(t,e);return n.apply(s),s.newBlock}n.parent.apply(new x(n,s))}return s}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(j.LINK),e.apply(new s([n]))),e}}}class It extends R{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class Rt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:i}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const e=r.text.substring(0,i),n=r.text.substring(i),a=r.cloneWithText(e),o=r.cloneWithText(n),l=[a,s];n&&l.push(o),t.apply(new x(r,...l)),t.apply(new f(r))}else t.apply(new x(r,s));else t.apply(0!==i?new m(r,s):new x(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new It(t))}}class Lt extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,i=this.createNewParagraph(n);if(i){const t=i.children[0];e.apply(0!==s?new m(r,t):new x(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new It(t))}}class $t extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new L(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new x(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],i=1===n.children.length&&n.children[0].isEmpty();if(n===r&&i){const r=n.parent.parent;if("list-item"!==r.type){const i=e.from({id:it(),type:"paragraph",nodes:[]});return i.apply(new s(t.children)),r.apply(new m(n.parent,i)),n.parent.apply(new f(n)),i}r.parent.apply(new m(r,t)),n.parent.apply(new f(n))}else n.parent.apply(new m(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(j.LINK),e}}class Dt extends R{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class Mt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Dt(e):new f(e))}}class Pt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let i=e;if(s===e.children[0]&&0===r)e.parent.apply(new x(e,...n));else{const t=new L(s,r);e.apply(t),e.parent.apply(new m(e,...n)),i=t.newBlock}t.futureFocusBlock=i}}}const Ft=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===gt.name?new Mt:new P),r.register(c.APPEND_CHILDREN,t,new yt),r.register(c.INSERT_CHILDREN_BEFORE,t,new Et),r.register(c.INSERT_CHILDREN_AFTER,t,new At),r.register(c.DELETE_BLOCK_CONTENT,t,new vt),r.register(c.INSERT_NEW_PARAGRAPH,t,t===mt.name?new $t:new St),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new Lt),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new Rt),r.register(c.PASTE_CONTENT,t,new Pt)}};class zt{}class Ut extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===F||t.style.fontWeight===z||t.classList.contains("v-rte--bold")}}class Vt extends zt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class Wt extends zt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class Gt extends zt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=U(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class Jt extends zt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Kt extends zt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.dtoName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Yt extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Xt extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ut(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=V.filter((t=>t.key!==W.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of V)if(t.style.color.includes(e.key))return e.key;return null}}class Qt extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===G||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Zt extends zt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.dtoName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class _t{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=_t.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}_t.textStyleHandler=new Zt;class qt extends zt{constructor(){super(...arguments),this.handlers=[new Vt,new Wt,new Gt]}canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return e.link?{link:e.link}:_t.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:it()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class te extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(J)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class ee extends zt{canHandle(t){return"RTETextNode"===t.dtoName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(K)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class ne extends zt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class se extends zt{canHandle(t){return"RTEImageNode"===t.dtoName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const re=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),ie=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ae=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),oe=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),le=new Set(["ABBR","B","BDI","BDO","CITE","DEL","DFN","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]);function ce(t){return re.has(t.parentElement.nodeName)}class he extends zt{constructor(){super(...arguments),this.customAttributeHandler=new Vt,this.customStyleAnnotationHandler=new Gt,this.customClassAnnotationHandler=new Wt}canHandle(t,e){return"RTETextNode"===t.dtoName&&!1===e.autoMatchFormat}handle(t,e){if(ie.has(t.nodeName)&&!ae.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;const r=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||r){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},r?{groupId:it()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});s=s?this.appendToInlineHtmlChain(s,e,t.parentNode):e}return s?Object.assign({},s):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ue=new class{constructor(){this.handlers=[new Kt,new Jt,new Ut,new Qt,new ee,new te,new Xt,new qt,new Yt,new ne,new se,new Vt,new Wt,new Gt,new Zt,new he]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&Y.executeTheStrategyRefillAction(t.dtoName,e);const s=_t.isLinkElement(e)&&"RTETextNode"===t.dtoName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof qt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=Y.getStrategies(t.dtoName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=X.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class de extends xt{constructor(){super(...arguments),this.annotationHandler=new Zt}generateChildNodes(t,e,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),a=Object.assign({},e);return t.forEach((t=>{const o=bt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(o&&(l=o.handle([t],s,a)),l)r.push(l);else if(dt(t)&&t.childNodes.length>0){const o=ue.generate(n,t,Object.assign({parentAnnotations:i?{inlineHtml:a.inlineHtml,link:a.link,code:a.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),o,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class we extends de{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return k.from({id:it(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class pe extends de{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return jt.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:t.src,annotations:ue.generate(Ht,t,e)}],annotations:Object.assign(Object.assign({},ue.generate(jt,t.parentElement,e)),{internalWrapper:n})},e)}}class me extends xt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:it(),type:"text",text:t,annotations:e}}}class fe extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=_.getDefaultStyles(e),super.filterAnnotations(t)):t}}class ge extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return Z.isTextBlock(t.dtoName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return Z.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class xe extends ge{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class Te extends ge{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=X.getDefaultStyles(this.type)}}class be extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=be.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}canFilter(t){return Z.isTextNode(t.dtoName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return Z.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${be.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(be.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}be.BOLD_STYLES={fontWeight:"700"},be.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class Oe extends xe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class ye extends Te{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return Z.isListItemBlock(t.dtoName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}tt.registerRTEDTOClass("paragraph",e),tt.registerRTEDTOClass("title",e),tt.registerRTEDTOClass("subtitle",e),tt.registerRTEDTOClass("heading-1",e),tt.registerRTEDTOClass("heading-2",e),tt.registerRTEDTOClass("heading-3",e),tt.registerRTEDTOClass("heading-4",e),tt.registerRTEDTOClass("heading-5",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("heading-6",e),tt.registerRTEDTOClass("list-item",mt),tt.registerRTEDTOClass("bullet-list",gt),tt.registerRTEDTOClass("number-list",gt),tt.registerRTEDTOClass("image",jt),tt.registerRTEDTOClass("code-block",k),tt.registerRTEDTOClass("html-block",Ct),tt.registerRTEDTOClass("text",n),tt.registerRTEDTOClass("image",Ht),Ft.registerBlockBasicStrategies(e.name),Ft.registerBlockBasicStrategies(gt.name),Ft.registerBlockBasicStrategies(mt.name),Ft.registerBlockBasicStrategies(jt.name),Ft.registerBlockBasicStrategies(Ct.name),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,s){const r=t[0].parentElement,i=s&&s.autoMatchFormat,a=this.generateChildNodes(t,i?ue.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),o=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!i&&!o;return e.from(Object.assign({id:it(),type:o||"paragraph",nodes:a},l?{annotations:{internalWrapper:l}}:{annotations:ue.generate(e,r,s)}),s)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!!ae.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!ce(t))||this.isInlineLeafOrWrapper(t))}isDedicatedBlockTag(t){return ie.has(t)&&!ae.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?le.has(t.nodeName):this.isTextOnlyElement(t)?le.has(t.nodeName)||ae.has(t.nodeName):this.hasOnlyInlineDescendants(t)}isTextOnlyElement(t){const e=Array.from(t.childNodes);return!e.some((t=>t.nodeType===Node.ELEMENT_NODE))&&e.some((t=>t.nodeType===Node.TEXT_NODE))}hasOnlyInlineDescendants(t){for(let e=0;e<t.children.length;e++){const n=t.children[e];if(this.isDedicatedBlockTag(n.nodeName))return!1;if(!n.hasChildNodes())return!1;if(!this.hasOnlyInlineDescendants(n))return!1}return!0}}),bt.registerElementToBlockStrategy(new class extends pe{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends pe{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if(at(s))return jt.from({id:it(),type:"image",nodes:[{id:it(),type:"image",url:s.src,annotations:ue.generate(Ht,n,e)}],annotations:ue.generate(jt,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends pe{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:it(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:ue.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?mt.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return gt.from({id:it(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:it(),type:"list-item",annotations:ue.generate(mt,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ue.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=at(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return mt.from({id:it(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:gt.from({id:it(),type:"number-list",blocks:[],annotations:ue.generate(gt,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof mt)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:gt.from({id:it(),type:"bullet-list",blocks:[],annotations:ue.generate(gt,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof mt)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),bt.registerElementToBlockStrategy(new class extends de{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||ie.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||_t.isTitleOrSubtitle(s)?0:1}handle(t,e){return Ct.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(ae.has(t.nodeName)&&0===t.childNodes.length)return!0;if(ce(t))return!(0===t.childNodes.length&&""===t.textContent&&!ae.has(t.nodeName)&&!le.has(t.nodeName));const n=Array.from(t.childNodes);return!(n.some((t=>t.nodeType===Node.ELEMENT_NODE))||!n.some((t=>t.nodeType===Node.TEXT_NODE)))&&(!1!==e.autoMatchFormat||!oe.has(t.parentElement.nodeName)&&(le.has(t.nodeName)||ae.has(t.nodeName)))}shouldFallBackToHtmlBlock(t){const e=Array.from(t.childNodes);if(0===e.length)return!1;const n=t.parentElement.nodeName;return"UL"!==n&&"OL"!==n&&e.every((t=>t.nodeType===Node.ELEMENT_NODE&&""===t.textContent&&!ae.has(t.nodeName)&&!le.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:it(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ue.generate(Ct,t,e),children:[]}}}),
|
|
2
|
-
//!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
|
|
3
|
-
bt.registerElementToBlockStrategy(new we),bt.registerElementToBlockStrategy(new class extends we{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],n=e.querySelector("code");if(n)return super.handle([n]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}),bt.registerElementToNodeStrategy(new class extends me{canHandle(t,e){const n=t[e];return!dt(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),i=Object.assign({},s),a=t[0],o=ue.generate(n,a,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:s},e));if("BR"===a.nodeName){const{inlineHtml:t}=o,e=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(o,["inlineHtml"]);return this.generateTextNode("\n",t&&"br"===t.htmlTag?e:o)}if(0===a.childNodes.length){const t=r?wt(Object.assign(Object.assign({},n.supportsHtmlTag(a.nodeName.toLowerCase())?o:{}),{inlineHtml:o.inlineHtml})):o;return Object.assign({},this.generateTextNode("",t))}}}),bt.registerElementToNodeStrategy(new class extends me{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),i=!(!e||!1!==e.autoMatchFormat),a=t[0],o=a.parentNode.nodeName.toLowerCase(),l=i&&!n.supportsHtmlTag(o),c=this.generateTextNode(String(a.textContent),i?wt(Object.assign(Object.assign({},"span"===o?r:{link:r.link,code:"code"===o?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}}),Y.register(e.dtoName,new fe),Y.register(gt.dtoName,new fe),Y.register(mt.dtoName,new fe),Y.register(n.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.customStyle;if(!n)return t;e.bold&&n.fontWeight===z&&delete n.fontWeight,e.italic&&n.fontStyle===G&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==K&&t!==J))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(K),e.strikethrough&&n.push(J),0!==n.length&&t===n.sort().join(" ")}}),Y.register(e.dtoName,new ge),Y.register(e.dtoName,new xe(1)),Y.register(e.dtoName,new xe(2)),Y.register(e.dtoName,new xe(3)),Y.register(e.dtoName,new xe(4)),Y.register(e.dtoName,new xe(5)),Y.register(e.dtoName,new xe(6)),Y.register(e.dtoName,new Te("title")),Y.register(e.dtoName,new Te("subtitle")),Y.register(n.dtoName,new be),Y.register(n.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=q.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return Z.isCodeNode(t)}canRefill(t,e){return Z.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),Y.register(n.dtoName,new et),Y.register(Ht.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=kt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return Z.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),Y.register(k.dtoName,new nt),Y.register(st.dtoName,new rt),Y.register(gt.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=ft.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return Z.isListBlock(t.dtoName)}canRefill(t,e){return Z.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){return`${this.elementTagName.split(",").map((t=>`.${Q.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t.trim()}`)).join(", ")} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} }`}}),Y.register(mt.dtoName,new class extends Q{constructor(){super(...arguments),this.stylesToBeFiltered=X.getDefaultStyles("paragraph"),this.elementTagName="li",this.headingOrTitleClassNamePattern=/^v-rte-(h[1-6]|title|subtitle)$/}canFilter(t){const e=!t.getStyles().fontSize||this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"]);return Z.isListItemBlock(t.dtoName)&&e}canRefill(t,e){return Z.isListItemBlock(t)&&e.matches(this.elementTagName)&&this.isElementNotHeadingOrTitle(e)}toCssText(){return this.buildCssTextForStyles(this.elementTagName)}isElementNotHeadingOrTitle(t){return!t.className.split(" ").some((t=>this.headingOrTitleClassNamePattern.test(t.trim())))}}),Y.register(mt.dtoName,new Oe(1)),Y.register(mt.dtoName,new Oe(2)),Y.register(mt.dtoName,new Oe(3)),Y.register(mt.dtoName,new Oe(4)),Y.register(mt.dtoName,new Oe(5)),Y.register(mt.dtoName,new Oe(6)),Y.register(mt.dtoName,new ye("title")),Y.register(mt.dtoName,new ye("subtitle"));class Ee{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new Ae(e)}}class Ae{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(dt(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class ke{process(t){return t.replace(/(<[^>]+>)(\s+)(<[^>]+>)/g,((t,e,n,s)=>{const r=this.extractOpeningTagName(e),i=this.extractClosingTagName(s);return r&&i&&r===i?`${e}${n}${s}`:`${e}${s}`}))}extractOpeningTagName(t){const e=t.match(/<(\w[\w-]*)/);return e?e[1]:null}extractClosingTagName(t){const e=t.match(/<\/(\w[\w-]*)/);return e?e[1]:null}}class He{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Ne{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class je{constructor(){this.processors=[new ke,new He,new Ne]}clean(t){if(!t||0===t.trim().length)return t;let e,n=t;do{e=n;for(const t of this.processors)n=t.process(n)}while(n!==e);return n}}class Ce{constructor(t){this.dtoName=Ce.dtoName,t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=tt.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new Ce(n)}static createEmptyContent(t={autoMatchFormat:!0}){return Ce.fromJSON([{id:it(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:it(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new je).clean(t),s=Ee.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,a=Array.from(i.childNodes);s.restore(a);const o=Ot.process(a,e).filter(at).map((t=>t.toDto(e))).filter(at);return new Ce(o)}static generateContentStyles(t){return Y.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new Ce(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(at(t.autoMatchFormat)||at(t.skipCustomAnnotations))&&pt.warn("The 'options' parameter's properties 'autoMatchFormat' and 'skipCustomAnnotations' in toHtml method are deprecated and will be removed in the future."),this.isEmpty()?"":this.children.map((e=>e.toHtml({filterInlineStyles:null==t?void 0:t.filterInlineStyles}))).join("")}isEmpty(){return 0===this.children.length||1===this.children.length&&!this.children[0].isNotEmpty()}apply(t){if(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=H.getDOMByEntity(this);t&&ot.notify(lt.getSubject(t,ht),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new g)));const e=new mt(it());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new gt(it(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof mt&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof gt&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,Ce.name,new P),r.register(c.APPEND_CHILDREN,Ce.name,new yt),r.register(c.INSERT_CHILDREN_BEFORE,Ce.name,new Et),r.register(c.INSERT_CHILDREN_AFTER,Ce.name,new At),r.register(c.TRANSFORM_TO_CODE_BLOCK,Ce.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new k(it(),this.getCodeContent(n),"plainText");e.apply(new x(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new f(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,Ce.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,i=H.getDOMByEntity(e);i&&ot.notify(lt.getSubject(i,ct),{node:s,offset:n,updateDirectly:r})}}),Ce.dtoName="VegaRTEContent";export{zt as A,de as B,bt as E,Nt as I,Bt as M,Pt as P,Ft as R,Ee as S,It as U,Ce as V,xt as a,jt as b,Et as c,mt as d,gt as e,Ht as f,kt as g,ue as h,Ot as i}
|
package/dist/vega/p-a7b5f497.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
class s{}export{s as V}
|
package/dist/vega/p-b6c3ce6d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=new class{constructor(){this.RTE_DTO_RENDERER_MAP=new Map,this.RTE_TOOLBAR_BUTTON_RENDERER_MAP=new Map,this.hostToolbarButtonRendererMap=new WeakMap}registerRTEDTORenderer(e,r){const t=this.RTE_DTO_RENDERER_MAP.get(e);if(r&&t&&t.constructor.name!==r.constructor.name)throw new Error(`Renderer for type ${e} is already registered with a different class(${t.constructor.name}).`);this.RTE_DTO_RENDERER_MAP.set(e,r)}registerRTEToolbarButtonRenderer(e,r){this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.set(e,r)}registerRTEToolbarButtonRendererForHost(e,r,t){let n=this.hostToolbarButtonRendererMap.get(e);n||(n=new Map,this.hostToolbarButtonRendererMap.set(e,n)),n.set(r,t)}getRTERenderer(e){return this.RTE_DTO_RENDERER_MAP.get(e)}getRTEToolbarButtonRenderer(e,r){var t,n;if(r){const n=null===(t=this.hostToolbarButtonRendererMap.get(r))||void 0===t?void 0:t.get(e);if(n)return n}return null!==(n=this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.get(e))&&void 0!==n?n:null}};export{e as R}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as e,H as s,g as h}from"./p-6b2342e0.js";import{F as r}from"./p-dcf162e9.js";import{V as a,M as l,A as o,D as c,i as p}from"./p-b2488adb.js";import{R as n}from"./p-280cbcdb.js";import{V as d}from"./p-2abdca42.js";import{s as m}from"./p-519a7d55.js";import{I as v}from"./p-6e1ab235.js";import{V as f,I as u}from"./p-8ce9e214.js";import{F as g}from"./p-3a49089e.js";import{F as _}from"./p-cb378636.js";import{C as A}from"./p-2d0d575f.js";import{c as E}from"./p-d7790113.js";import{C as M}from"./p-328dbe8e.js";import{D as I}from"./p-526e3634.js";import{i as w,K as j,J as D}from"./p-fcefb62c.js";import{V as Z}from"./p-724df1f5.js";import{S as C}from"./p-363e453b.js";import"./p-982747ef.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-091fbc35.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-528748fa.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-3a93730e.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-a58cacca.js";import"./p-46cab60a.js";import"./p-5f377954.js";import"./p-1704ff25.js";import"./p-9a6bd32c.js";import"./p-76454c9a.js";const R=[{type:"visa",iconName:"visa",pattern:a,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:l,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],b=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];class N extends C{calculateCaretPosition(t,i){if(!p(i))return null;if(this.getCreditCardMaskConfig(t)){if(t.length>this.getLengthLimit())return i-(t.length-this.getLengthLimit());const e=t.substring(0,i);return i+(this.format(e).length-e.length)}return i}format(t,i){const e=this.getCreditCardMaskConfig(t);if(e){this.setMaskConfig(e.options);const s=null==i?void 0:i.caretPosition;if(t.length>this.getLengthLimit()&&p(s)){const i=[...t],e=t.length-this.getLengthLimit();return i.splice(s-e,e),i.join("")}return this.replaceMaskWithMatchedInputSlots(t,this.getMatchedInputSlotValue(t))}return t}getCreditCardType(t){return R.filter((i=>i.pattern.test(t)))[0]}}class y extends N{constructor(){super({mask:"",slot:"9",accept:/\d/,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")})}getCreditCardMaskConfig(t){let i;const e=this.getCreditCardType(t);return e&&(i=e.maskConfig),i}}class V extends N{constructor(t){super({mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}),this.hideCardNumberOnBlur=t}getCreditCardMaskConfig(t){let i;return this.getCreditCardType(t)&&this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(i=this.generateDynamicMask(t)),i}generateDynamicMask(t){const i={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},e=t.trim().split(" "),s=e.map(((t,i)=>(i===e.length-1?"9":"X").repeat(t.length))).join(" ");return i.options.mask=s,i}}var H=function(t,i,e,s){var h,r=arguments.length,a=r<3?i:null===s?s=Object.getOwnPropertyDescriptor(i,e):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,i,e,s);else for(var l=t.length-1;l>=0;l--)(h=t[l])&&(a=(r<3?h(a):r>3?h(i,e,a):h(i,e))||a);return r>3&&a&&Object.defineProperty(i,e,a),a};const T=class{constructor(s){t(this,s),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new g({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new n:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=E(T,w),this.blurEventEmitter=E(T,j),this.focusEventEmitter=E(T,D),this.inputCreditCardEventPrevent=new M([w,D,j],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new f(b),this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:Z.getIconKey(i),maskConfig:this.getMaskConfig(),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,I.addUniqueObserverToNode(t,w,(t=>{this.handleVegaChange(t)})),I.addUniqueObserverToNode(t,j,(()=>{this.handleVegaBlur()})),I.addUniqueObserverToNode(t,D,(()=>{this.handleVegaFocus()}))},"data-aria-label":this.label||"Input credit card"})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),A.notify(_,{host:this.host,detail:t})}componentDidLoad(){r.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return m(e(s,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return R.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(){return[{type:"custom",trigger:"input",strategy:()=>new y},{type:"custom",trigger:"blur",strategy:()=>new V(this.hideCardNumberOnBlur)}]}get host(){return h(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};Z.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" fill=\'rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path fill="rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" fill=\'rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),H([u()],T.prototype,"globalSlimmers",void 0),H([v()],T.prototype,"formFieldController",void 0),H([v()],T.prototype,"changeEventEmitter",void 0),H([v()],T.prototype,"blurEventEmitter",void 0),H([v()],T.prototype,"focusEventEmitter",void 0),H([v()],T.prototype,"inputCreditCardEventPrevent",void 0),H([v()],T.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),T.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{T as vega_input_credit_card}
|