@globalpayments/vega 2.61.0 → 2.62.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-7e624dd0.js → app-globals-8f5fa42a.js} +23 -15
- package/dist/cjs/base-renderer-0a3b62b7.js +9 -0
- package/dist/cjs/{child-nodes-event-prevent-slimmer-184fe3b2.js → child-nodes-event-prevent-slimmer-4e96270e.js} +1 -1
- package/dist/cjs/{code-block-ecb2df41.js → code-block-eb66d852.js} +73 -22
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-58a0f64c.js → component-value-history-controller-slimmer.abstract-62cdf04c.js} +16 -182
- package/dist/cjs/{design-token-16f74439.js → design-token-76bb47bd.js} +1 -1
- package/dist/cjs/{dom-node-subject-factory-4eb1fec2.js → dom-node-subject-observer-factory-58e3c010.js} +41 -0
- package/dist/cjs/{content-state-d7b8e70b.js → dto-renderer-manager-f3894490.js} +1647 -1501
- package/dist/cjs/{element-appender-slimmer-c4816142.js → element-appender-slimmer-e8dac628.js} +7 -8
- package/dist/cjs/{event-emit-slimmer-2da7c9d6.js → event-emit-slimmer-428d8802.js} +3 -4
- package/dist/cjs/{form-field-controller-slimmer-dab30e5c.js → form-field-controller-slimmer-cc6e53a4.js} +4 -5
- package/dist/cjs/{image-annotation-action-7eaab3ce.js → image-annotation-action-a628ec9b.js} +24 -81
- package/dist/cjs/{index-da628bba.js → index-5505e8dd.js} +3 -3
- package/dist/cjs/index.cjs.js +49 -23
- package/dist/cjs/{icon-manager-9072356d.js → internal-icon-manager-32f9ed63.js} +51 -0
- package/dist/cjs/{internal-vega-event-manager-7b87c2f4.js → internal-vega-event-manager-28b957c8.js} +73 -73
- package/dist/cjs/language-extension-20a1dba5.js +207 -0
- package/dist/cjs/loader.cjs.js +14 -12
- package/dist/cjs/{public-rules-21622bd0.js → public-rules-5d0f3a5f.js} +5 -5
- package/dist/cjs/range-cfc45f9e.js +178 -0
- package/dist/cjs/{responsive-format-facade-0d22ff78.js → responsive-format-facade-7e933525.js} +4 -3
- package/dist/cjs/{rich-text-editor-required-rule-8d7e441a.js → rich-text-editor-required-rule-72170c10.js} +2 -2
- package/dist/cjs/{string-input-formatter-slimmer-5a744e71.js → string-input-formatter-slimmer-f6c7a255.js} +4 -4
- package/dist/cjs/{style-formatter-a66813a2.js → style-formatter-702df81e.js} +1 -1
- package/dist/cjs/{sub-state-notify-slimmer-9602b5bb.js → sub-state-notify-slimmer-bb64fcfc.js} +4 -4
- package/dist/cjs/{sub-state-observer-slimmer-df7df5bb.js → sub-state-observer-slimmer-84175d61.js} +4 -4
- package/dist/cjs/{vega-skeleton-loader-controller-9c54f3aa.js → token-extension-23ccff1d.js} +679 -3
- package/dist/cjs/vega-accordion.cjs.entry.js +15 -16
- package/dist/cjs/vega-app-header-button.cjs.entry.js +20 -21
- package/dist/cjs/vega-banner.cjs.entry.js +7 -9
- package/dist/cjs/vega-box.cjs.entry.js +13 -12
- package/dist/cjs/vega-brand-logo.cjs.entry.js +1 -2
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +8 -9
- package/dist/cjs/vega-button-circle.cjs.entry.js +16 -16
- package/dist/cjs/vega-button-group_2.cjs.entry.js +11 -12
- package/dist/cjs/vega-button-link.cjs.entry.js +7 -8
- package/dist/cjs/vega-button.cjs.entry.js +15 -15
- package/dist/cjs/vega-calendar_4.cjs.entry.js +22 -24
- package/dist/cjs/vega-card.cjs.entry.js +12 -11
- package/dist/cjs/vega-carousel.cjs.entry.js +13 -13
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +12 -13
- package/dist/cjs/vega-chip.cjs.entry.js +17 -17
- package/dist/cjs/vega-code-block.cjs.entry.js +16 -17
- package/dist/cjs/vega-color-picker.cjs.entry.js +6 -7
- package/dist/cjs/vega-combo-box.cjs.entry.js +14 -15
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +30 -31
- package/dist/cjs/vega-dialog_2.cjs.entry.js +27 -27
- package/dist/cjs/vega-divider.cjs.entry.js +12 -11
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +32 -32
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +6 -7
- package/dist/cjs/vega-file-uploader.cjs.entry.js +15 -17
- package/dist/cjs/vega-flag-icon.cjs.entry.js +13 -13
- package/dist/cjs/vega-flex.cjs.entry.js +12 -11
- package/dist/cjs/vega-font.cjs.entry.js +12 -11
- package/dist/cjs/vega-form.cjs.entry.js +13 -14
- package/dist/cjs/vega-grid.cjs.entry.js +12 -11
- package/dist/cjs/vega-icon.cjs.entry.js +15 -14
- package/dist/cjs/vega-image-uploader.cjs.entry.js +18 -18
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +14 -16
- package/dist/cjs/vega-input-numeric.cjs.entry.js +10 -11
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +20 -21
- package/dist/cjs/vega-input-range.cjs.entry.js +11 -12
- package/dist/cjs/vega-input-select.cjs.entry.js +27 -28
- package/dist/cjs/vega-input.cjs.entry.js +12 -13
- package/dist/cjs/vega-item-toggle.cjs.entry.js +5 -6
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +33 -34
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +13 -12
- package/dist/cjs/vega-page-notification_2.cjs.entry.js +2 -3
- package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +8 -9
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +3 -4
- package/dist/cjs/vega-pagination.cjs.entry.js +18 -18
- package/dist/cjs/vega-popover_2.cjs.entry.js +18 -18
- package/dist/cjs/vega-progress-tracker.cjs.entry.js +5 -6
- package/dist/cjs/vega-radio_2.cjs.entry.js +13 -14
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +53 -48
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +387 -261
- package/dist/cjs/vega-segment-control.cjs.entry.js +5 -6
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +20 -20
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +13 -14
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +24 -25
- package/dist/cjs/vega-signature-capture.cjs.entry.js +16 -17
- package/dist/cjs/vega-stepper.cjs.entry.js +12 -13
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -9
- package/dist/cjs/vega-table_8.cjs.entry.js +58 -59
- package/dist/cjs/vega-textarea.cjs.entry.js +9 -10
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +24 -24
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +7 -8
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +12 -12
- package/dist/cjs/vega.cjs.js +14 -12
- package/dist/collection/components/vega-rich-text-content/vega-rich-text-content.js +31 -0
- package/dist/collection/components/vega-rich-text-editor/constants/constant.js +10 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/apply-annotation-strategies/node-split-text-strategy.js +6 -3
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/block-delete-text-or-decorator-node-strategy.js +12 -6
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/code-block-remove-self-strategy.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-node-to-nearest-root-strategy.js +57 -0
- package/dist/collection/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/update-cursor-position-strategy.js +2 -1
- package/dist/collection/components/vega-rich-text-editor/dto/actions/insert-node-to-nearest-root-action.js +14 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.js +5 -2
- package/dist/collection/components/vega-rich-text-editor/dto/content-state.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/dto/nodes/text-node.js +36 -10
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +10 -4
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +145 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-extension.js +113 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +90 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/insert-token-node-action.js +16 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/insert-token-node-strategy.js +20 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.js +60 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-extension.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.js +67 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-node.js +55 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +88 -0
- package/dist/collection/components/vega-rich-text-editor/public-api.js +38 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/extension-controller.js +97 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/focus-controller.js +8 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.js +12 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +9 -3
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +43 -18
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/link-toolbar-button-slimmer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.js +6 -6
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.js +9 -9
- package/dist/collection/components/vega-rich-text-editor/test/dto/content-state.test.js +41 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +44 -11
- package/dist/collection/global/scripts/before-vega-load.js +9 -0
- package/dist/collection/helpers/code-format/test/code-formatter.test.js +1 -1
- package/dist/collection/helpers/public-api.js +1 -1
- package/dist/collection/helpers/rte-manager/dto-action-strategy-manager.js +2 -0
- package/dist/esm/{app-globals-ce54f0ac.js → app-globals-aaff0b25.js} +13 -5
- package/dist/esm/base-renderer-101f6d04.js +7 -0
- package/dist/esm/{child-nodes-event-prevent-slimmer-2a3115ae.js → child-nodes-event-prevent-slimmer-7fe3dc57.js} +1 -1
- package/dist/esm/{code-block-89a4dd13.js → code-block-68300b47.js} +67 -17
- package/dist/esm/{component-value-history-controller-slimmer.abstract-95b199df.js → component-value-history-controller-slimmer.abstract-ac2f1bfd.js} +13 -179
- package/dist/esm/{design-token-eaa7c221.js → design-token-1a36307e.js} +1 -1
- package/dist/esm/{dom-node-subject-factory-3c2e13f1.js → dom-node-subject-observer-factory-c7bc3035.js} +41 -1
- package/dist/esm/{content-state-fc47457c.js → dto-renderer-manager-af66bbd9.js} +1643 -1502
- package/dist/esm/{element-appender-slimmer-ce83db8a.js → element-appender-slimmer-fe68ec2d.js} +3 -4
- package/dist/esm/{event-emit-slimmer-4428ce26.js → event-emit-slimmer-3922d816.js} +2 -3
- package/dist/esm/{form-field-controller-slimmer-6e69ca4e.js → form-field-controller-slimmer-f7e8845b.js} +2 -3
- package/dist/esm/{image-annotation-action-53812eb7.js → image-annotation-action-f61c2693.js} +20 -76
- package/dist/esm/{index-1d479c88.js → index-7fe93427.js} +1 -1
- package/dist/esm/index.js +13 -10
- package/dist/esm/{icon-manager-2ee1c619.js → internal-icon-manager-f0486245.js} +51 -1
- package/dist/esm/{internal-vega-event-manager-a654cf8a.js → internal-vega-event-manager-cb06e987.js} +1 -1
- package/dist/esm/language-extension-1ada2a9d.js +204 -0
- package/dist/esm/loader.js +14 -12
- package/dist/esm/{public-rules-095284f6.js → public-rules-9f62069a.js} +5 -5
- package/dist/esm/range-c2eeb794.js +176 -0
- package/dist/esm/{responsive-format-facade-86b6de3b.js → responsive-format-facade-5711c77d.js} +4 -3
- package/dist/esm/{rich-text-editor-required-rule-4e8d2db8.js → rich-text-editor-required-rule-de738309.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-60897659.js → string-input-formatter-slimmer-69117deb.js} +2 -2
- package/dist/esm/{style-formatter-a0719a8f.js → style-formatter-2479dc61.js} +1 -1
- package/dist/esm/{sub-state-notify-slimmer-ee730968.js → sub-state-notify-slimmer-4252a90e.js} +1 -1
- package/dist/esm/{sub-state-observer-slimmer-d474634d.js → sub-state-observer-slimmer-baa8853a.js} +1 -1
- package/dist/esm/{vega-skeleton-loader-controller-394a6026.js → token-extension-6fc5e1f5.js} +672 -4
- package/dist/esm/vega-accordion.entry.js +13 -14
- package/dist/esm/vega-app-header-button.entry.js +14 -15
- package/dist/esm/vega-banner.entry.js +4 -6
- package/dist/esm/vega-box.entry.js +13 -12
- package/dist/esm/vega-brand-logo.entry.js +1 -2
- package/dist/esm/vega-breadcrumb.entry.js +4 -5
- package/dist/esm/vega-button-circle.entry.js +14 -14
- package/dist/esm/vega-button-group_2.entry.js +6 -7
- package/dist/esm/vega-button-link.entry.js +5 -6
- package/dist/esm/vega-button.entry.js +13 -13
- package/dist/esm/vega-calendar_4.entry.js +7 -9
- package/dist/esm/vega-card.entry.js +12 -11
- package/dist/esm/vega-carousel.entry.js +12 -12
- package/dist/esm/vega-checkbox_2.entry.js +6 -7
- package/dist/esm/vega-chip.entry.js +14 -14
- package/dist/esm/vega-code-block.entry.js +8 -9
- package/dist/esm/vega-color-picker.entry.js +5 -6
- package/dist/esm/vega-combo-box.entry.js +6 -7
- package/dist/esm/vega-date-picker_2.entry.js +16 -17
- package/dist/esm/vega-dialog_2.entry.js +15 -15
- package/dist/esm/vega-divider.entry.js +12 -11
- package/dist/esm/vega-dropdown_5.entry.js +15 -15
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +4 -5
- package/dist/esm/vega-file-uploader.entry.js +6 -8
- package/dist/esm/vega-flag-icon.entry.js +12 -12
- package/dist/esm/vega-flex.entry.js +12 -11
- package/dist/esm/vega-font.entry.js +12 -11
- package/dist/esm/vega-form.entry.js +7 -8
- package/dist/esm/vega-grid.entry.js +12 -11
- package/dist/esm/vega-icon.entry.js +12 -11
- package/dist/esm/vega-image-uploader.entry.js +12 -12
- package/dist/esm/vega-input-credit-card.entry.js +7 -9
- package/dist/esm/vega-input-numeric.entry.js +7 -8
- package/dist/esm/vega-input-phone-number.entry.js +12 -13
- package/dist/esm/vega-input-range.entry.js +7 -8
- package/dist/esm/vega-input-select.entry.js +14 -15
- package/dist/esm/vega-input.entry.js +7 -8
- package/dist/esm/vega-item-toggle.entry.js +3 -4
- package/dist/esm/vega-left-nav_5.entry.js +14 -15
- package/dist/esm/vega-loader-wrapper_2.entry.js +11 -10
- package/dist/esm/vega-page-notification_2.entry.js +1 -2
- package/dist/esm/vega-pagination-page-selector-mobile.entry.js +3 -4
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +1 -2
- package/dist/esm/vega-pagination.entry.js +10 -10
- package/dist/esm/vega-popover_2.entry.js +14 -14
- package/dist/esm/vega-progress-tracker.entry.js +3 -4
- package/dist/esm/vega-radio_2.entry.js +6 -7
- package/dist/esm/vega-rich-text-content.entry.js +24 -19
- package/dist/esm/vega-rich-text-editor_4.entry.js +342 -216
- package/dist/esm/vega-segment-control.entry.js +4 -5
- package/dist/esm/vega-selection-chip_2.entry.js +15 -15
- package/dist/esm/vega-selection-tile_2.entry.js +7 -8
- package/dist/esm/vega-sidenav_3.entry.js +16 -17
- package/dist/esm/vega-signature-capture.entry.js +14 -15
- package/dist/esm/vega-stepper.entry.js +6 -7
- package/dist/esm/vega-tab-group_2.entry.js +4 -5
- package/dist/esm/vega-table_8.entry.js +12 -13
- package/dist/esm/vega-textarea.entry.js +6 -7
- package/dist/esm/vega-time-picker_2.entry.js +14 -14
- package/dist/esm/vega-toggle-switch.entry.js +6 -7
- package/dist/esm/vega-tooltip_2.entry.js +12 -12
- package/dist/esm/vega.js +14 -12
- package/dist/types/components/vega-rich-text-content/vega-rich-text-content.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/constants/constant.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/action-handle-strategy-registry.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/dto/action-handle-strategies/modify-content-strategies/insert-node-to-nearest-root-strategy.d.ts +18 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/insert-node-to-nearest-root-action.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/dto/actions/modify-content-action.abstract.d.ts +2 -1
- package/dist/types/components/vega-rich-text-editor/dto/actions/update-cursor-position-action.d.ts +4 -2
- package/dist/types/components/vega-rich-text-editor/dto/blocks/block.abstract.d.ts +2 -3
- package/dist/types/components/vega-rich-text-editor/dto/content-state.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/dto/nodes/text-node.d.ts +11 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +3 -3
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +95 -2
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +82 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-extension.d.ts +50 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +54 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/insert-token-node-action.d.ts +16 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/insert-token-node-strategy.d.ts +12 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/span-to-token-node-strategy.d.ts +24 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-extension.d.ts +14 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node-renderer.d.ts +38 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-node.d.ts +39 -0
- package/dist/types/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.d.ts +47 -0
- package/dist/types/components/vega-rich-text-editor/interface.d.ts +52 -1
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +29 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/extension-controller.d.ts +44 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/element-to-dto-strategy.abstract.d.ts +10 -1
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +6 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/toolbar-button-slimmer.abstract.d.ts +4 -4
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/tools/visual-mode-toolbar-button-slimmer.abstract.d.ts +7 -7
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +10 -0
- package/dist/types/components.d.ts +21 -0
- package/dist/types/helpers/public-api.d.ts +1 -1
- package/dist/types/types/components.type.d.ts +1 -0
- package/dist/types/types/public-api.d.ts +11 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-03cc47b7.entry.js +1 -0
- package/dist/vega/p-07836d27.entry.js +1 -0
- package/dist/vega/p-079f5d94.entry.js +1 -0
- package/dist/vega/p-09cb98f3.entry.js +1 -0
- package/dist/vega/{p-fb232e29.entry.js → p-0b91bb73.entry.js} +1 -1
- package/dist/vega/p-15a78afd.entry.js +1 -0
- package/dist/vega/p-16075b30.entry.js +1 -0
- package/dist/vega/{p-67101f43.entry.js → p-1c08077c.entry.js} +1 -1
- package/dist/vega/{p-c5e862aa.js → p-1da54ff3.js} +1 -1
- package/dist/vega/p-20a180e4.js +1 -0
- package/dist/vega/p-25ddb070.entry.js +1 -0
- package/dist/vega/p-2788afe7.entry.js +1 -0
- package/dist/vega/p-2a1b3108.entry.js +1 -0
- package/dist/vega/p-2ee4def0.js +1 -0
- package/dist/vega/p-2f88ba36.entry.js +1 -0
- package/dist/vega/p-327cd6ec.entry.js +1 -0
- package/dist/vega/{p-f2a1fe6a.js → p-39c185a5.js} +1 -1
- package/dist/vega/p-3b1bedaf.entry.js +1 -0
- package/dist/vega/p-3c96bbe1.entry.js +1 -0
- package/dist/vega/p-3cdbee7e.js +1 -0
- package/dist/vega/p-3d0d8a21.entry.js +1 -0
- package/dist/vega/p-3d53858c.entry.js +1 -0
- package/dist/vega/{p-927cab0c.entry.js → p-3f3bbaaa.entry.js} +2 -2
- package/dist/vega/p-42c364e0.entry.js +1 -0
- package/dist/vega/p-4f56a427.entry.js +1 -0
- package/dist/vega/p-4f5a2b0c.entry.js +1 -0
- package/dist/vega/p-51d40b0d.entry.js +1 -0
- package/dist/vega/p-5420c1d4.entry.js +1 -0
- package/dist/vega/p-589b7ea3.entry.js +1 -0
- package/dist/vega/p-5d3c6a06.entry.js +1 -0
- package/dist/vega/p-5dec47da.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/p-6244b0ad.entry.js +1 -0
- package/dist/vega/p-63212cc1.js +1 -0
- package/dist/vega/p-6585cfd5.entry.js +1 -0
- package/dist/vega/p-6ba27010.js +1 -0
- package/dist/vega/{p-129f5938.js → p-6caa6bb2.js} +1 -1
- package/dist/vega/p-74ac2a48.js +1 -0
- package/dist/vega/p-76c7538a.entry.js +1 -0
- package/dist/vega/p-7d8eaca9.entry.js +1 -0
- package/dist/vega/p-7da6e7bd.js +1 -0
- package/dist/vega/p-81765b4b.entry.js +1 -0
- package/dist/vega/p-81fbf18f.entry.js +1 -0
- package/dist/vega/p-8682ee0a.entry.js +1 -0
- package/dist/vega/p-893d5dfa.js +1 -0
- package/dist/vega/p-8a484812.entry.js +1 -0
- package/dist/vega/p-8a6b820a.entry.js +1 -0
- package/dist/vega/p-8c9ea6f4.js +1 -0
- package/dist/vega/p-8e58d6cb.entry.js +1 -0
- package/dist/vega/p-8e812dca.entry.js +1 -0
- package/dist/vega/p-8f056ac2.js +1 -0
- package/dist/vega/{p-e66aef91.entry.js → p-9125ba84.entry.js} +1 -1
- package/dist/vega/p-92469fa1.entry.js +1 -0
- package/dist/vega/p-9ab3bb6f.entry.js +1 -0
- package/dist/vega/p-9ca0bdcc.js +1 -0
- package/dist/vega/p-a1362aa4.entry.js +1 -0
- package/dist/vega/p-a61e4bba.entry.js +1 -0
- package/dist/vega/p-a646b66d.js +1 -0
- package/dist/vega/p-a7b5f497.js +1 -0
- package/dist/vega/p-ac5c5221.entry.js +1 -0
- package/dist/vega/p-b1a5ff74.entry.js +1 -0
- package/dist/vega/p-b32f7aac.entry.js +1 -0
- package/dist/vega/{p-dc6f45af.entry.js → p-baafe7d9.entry.js} +1 -1
- package/dist/vega/{p-3a6abcd7.entry.js → p-bb51e020.entry.js} +1 -1
- package/dist/vega/{p-e764acd5.js → p-bb61f015.js} +1 -1
- package/dist/vega/p-bc0ae89a.entry.js +1 -0
- package/dist/vega/p-bd39af8a.entry.js +1 -0
- package/dist/vega/{p-cd18f0fe.js → p-bdd9ef3b.js} +1 -1
- package/dist/vega/{p-5f85811c.entry.js → p-c167fa41.entry.js} +1 -1
- package/dist/vega/{p-7ecf65ec.js → p-c2377afa.js} +1 -1
- package/dist/vega/p-c671f57e.js +1 -0
- package/dist/vega/p-c6a354b1.js +1 -0
- package/dist/vega/p-c7726252.js +1 -0
- package/dist/vega/p-ce1766fa.js +1 -0
- package/dist/vega/p-cfb2af9c.entry.js +1 -0
- package/dist/vega/{p-3bf95faf.entry.js → p-d2790023.entry.js} +2 -2
- package/dist/vega/p-d3bbfb1b.js +1 -0
- package/dist/vega/{p-5faa7313.entry.js → p-d9617358.entry.js} +1 -1
- package/dist/vega/p-d982babe.entry.js +1 -0
- package/dist/vega/p-dcae53cf.entry.js +1 -0
- package/dist/vega/p-ddfad815.entry.js +1 -0
- package/dist/vega/p-e00ed9bd.entry.js +1 -0
- package/dist/vega/p-e365aba9.entry.js +1 -0
- package/dist/vega/p-ebfc5739.entry.js +1 -0
- package/dist/vega/{p-aeccc7f8.js → p-f1436035.js} +1 -1
- package/dist/vega/p-fe2cb3a1.entry.js +1 -0
- package/dist/vega/p-ff3a8907.entry.js +1 -0
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/dom-node-subject-observer-factory-15130e50.js +0 -45
- package/dist/cjs/internal-icon-manager-f8677abb.js +0 -55
- package/dist/esm/dom-node-subject-observer-factory-1e456cd4.js +0 -43
- package/dist/esm/internal-icon-manager-7eac52c8.js +0 -53
- package/dist/vega/p-0070e970.entry.js +0 -1
- package/dist/vega/p-0169af6b.entry.js +0 -1
- package/dist/vega/p-03e9cbc8.js +0 -1
- package/dist/vega/p-04341cd4.entry.js +0 -1
- package/dist/vega/p-0664ca9c.js +0 -1
- package/dist/vega/p-074b73f8.js +0 -1
- package/dist/vega/p-08fb66a4.entry.js +0 -1
- package/dist/vega/p-0cf35281.entry.js +0 -1
- package/dist/vega/p-0e75ddb2.entry.js +0 -1
- package/dist/vega/p-13cb5a04.entry.js +0 -1
- package/dist/vega/p-18223240.js +0 -1
- package/dist/vega/p-19ce9ae6.js +0 -1
- package/dist/vega/p-27f922fe.entry.js +0 -1
- package/dist/vega/p-2c7b7dd6.entry.js +0 -1
- package/dist/vega/p-310f9e76.entry.js +0 -1
- package/dist/vega/p-330d7ba8.js +0 -1
- package/dist/vega/p-34fdbe7a.js +0 -1
- package/dist/vega/p-3d6c302d.js +0 -1
- package/dist/vega/p-42563036.entry.js +0 -1
- package/dist/vega/p-441a681b.js +0 -1
- package/dist/vega/p-4a357f30.entry.js +0 -1
- package/dist/vega/p-4e8b6eb6.entry.js +0 -1
- package/dist/vega/p-50dd3cf1.js +0 -1
- package/dist/vega/p-518722aa.js +0 -1
- package/dist/vega/p-5422fdc4.entry.js +0 -1
- package/dist/vega/p-5c36a6cb.entry.js +0 -1
- package/dist/vega/p-5d095f9b.entry.js +0 -1
- package/dist/vega/p-68806f9c.entry.js +0 -1
- package/dist/vega/p-6cf490d9.entry.js +0 -1
- package/dist/vega/p-6def20e1.js +0 -1
- package/dist/vega/p-78d3f99b.entry.js +0 -1
- package/dist/vega/p-792715f3.js +0 -1
- package/dist/vega/p-7a201c6e.entry.js +0 -1
- package/dist/vega/p-7c22a1c3.entry.js +0 -1
- package/dist/vega/p-7f329473.entry.js +0 -1
- package/dist/vega/p-80f1b680.js +0 -1
- package/dist/vega/p-82beb586.entry.js +0 -1
- package/dist/vega/p-84eb131b.entry.js +0 -1
- package/dist/vega/p-8c46e116.js +0 -1
- package/dist/vega/p-909820dd.entry.js +0 -1
- package/dist/vega/p-989e141d.entry.js +0 -1
- package/dist/vega/p-a29e5d32.js +0 -1
- package/dist/vega/p-a3942d0b.entry.js +0 -1
- package/dist/vega/p-a66533c1.entry.js +0 -1
- package/dist/vega/p-a9b831d8.entry.js +0 -1
- package/dist/vega/p-b1d0e4cb.entry.js +0 -1
- package/dist/vega/p-b34f9891.entry.js +0 -1
- package/dist/vega/p-b820e42f.entry.js +0 -1
- package/dist/vega/p-c4677b0c.entry.js +0 -1
- package/dist/vega/p-c467fe81.entry.js +0 -1
- package/dist/vega/p-c7762c86.entry.js +0 -1
- package/dist/vega/p-c9e57cf1.entry.js +0 -1
- package/dist/vega/p-d0b3e319.entry.js +0 -1
- package/dist/vega/p-d7b4ffed.entry.js +0 -1
- package/dist/vega/p-e4586f13.entry.js +0 -1
- package/dist/vega/p-e71c4a09.entry.js +0 -1
- package/dist/vega/p-ea66d9f7.entry.js +0 -1
- package/dist/vega/p-ebbaa112.entry.js +0 -1
- package/dist/vega/p-ec6819fe.entry.js +0 -1
- package/dist/vega/p-ec9a8f81.entry.js +0 -1
- package/dist/vega/p-ed01328c.entry.js +0 -1
- package/dist/vega/p-ed798cd4.entry.js +0 -1
- package/dist/vega/p-edb71a72.entry.js +0 -1
- package/dist/vega/p-f08a4adf.js +0 -1
- package/dist/vega/p-f4e23c23.entry.js +0 -1
- package/dist/vega/p-f825e8a2.entry.js +0 -1
- package/dist/vega/p-f9deb43e.entry.js +0 -1
- package/dist/vega/p-fdd930a9.entry.js +0 -1
- package/dist/vega/p-fe52c370.entry.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,d as t,a as n,e as s,A as r,b as i,B as o,f as a,g as c,h as l,i as d,I as u,j as h,S as w,k as p,l as m,m as g,n as f,C as T,o as b,p as x,q as O,r as E,t as A,s as y,N as k,u as N,v as C,w as B,x as j,y as R,z as I,M as H,D as S,H as v,E as L,R as D,F as M,U as P,G as F}from"./p-c6a354b1.js";import{g as U}from"./p-a4670e23.js";import{i as z}from"./p-b1faebe0.js";import{d as $}from"./p-02841589.js";import{r as G,i as V}from"./p-575235c8.js";import{C as J}from"./p-2d0d575f.js";import{d as W}from"./p-2ee4def0.js";import{a as K}from"./p-0e954b9b.js";import{c as X}from"./p-bf19682d.js";class Y extends t{constructor(e,t,n){super(e,"list-item",n),this.nestList=[],this.nestList=t}static from(e,t={autoMatchFormat:!0}){const s=new Y(e.id,void 0,t);s.children=e.nodes.map((e=>n.from(e,s,t))),e.children&&(s.nestList=e.children.map((e=>{const t=_.from(e);return t.parent=s,t})));const{annotations:r}=e;return r&&Object.entries(r).forEach((([e,t])=>{const n=this.createAnnotationEntity(e,t);z(n)&&s.annotationMap.set(...n)})),s}toJSON(){var e;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(e=this.nestList)||void 0===e?void 0:e.map((e=>e.toJSON()))})}toHtml(){return[`<li${super.generateAttributeString()}>`,this.children.map((e=>e.toHtml())).join(""),"</li>"].join("")}cloneWithNodes(e){const t=new Y(U());return t.children=[],t.apply(new s(e)),t}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new Y(U())}clone(){var e;const t=new Y(this.id);return t.children=this.children.map((e=>{const n=e.clone();return n.parent=t,n})),t.annotationMap=super.cloneAnnotations(),t.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((e=>{const n=e.clone();return n.parent=t,n})),t.parent=this.parent,t}}r.register(i.LINE_BREAK_SINGLE_BLOCK,Y.name,new o),r.register(i.LINE_BREAK_MULTIPLE_BLOCKS,Y.name,new a),r.register(i.DELETE_NEST_LIST,Y.name,new class extends e{handleAction(e,t){t.nestList&&(t.nestList=t.nestList.length>1?t.nestList.filter((t=>t!==e.nestListBlockToBeRemoved)):void 0)}}),r.register(i.SPLIT_BLOCK_WITH_NODE,Y.name,new c),r.register(i.REPLACE_CHILD_NODES,Y.name,new l),r.register(i.REPLACE_NEST_LIST,Y.name,new class extends e{handleAction(e,t){e.newList.forEach((e=>{e.parent=t})),t.nestList=e.newList}}),r.register(i.MERGE_TWO_BLOCKS_NODES,Y.name,new d),r.register(i.INSERT_IMAGE_TO_BLOCK,Y.name,new class extends e{handleAction(e,t){t.parent.apply(e)}});class Z extends m{constructor(){super(...arguments),this.type=g.LIST}renderStyle(e){return(null==e?void 0:e.standalone)?{paddingLeft:"8px",marginLeft:"16px"}:null}renderClass(e){return(null==e?void 0:e.standalone)?null:"v-rte--list"}clone(){return new Z}toJSON(){}}class _ extends f{constructor(e,t,n){super(e),this.type="bullet-list",this.children=[],this.type=t;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(g.LIST,new Z)}static from(e,t={autoMatchFormat:!0}){const n=new _(e.id,e.type,t),{annotations:s}=e;return s&&Object.entries(s).forEach((([e,t])=>{const s=this.createAnnotationEntity(e,t);z(s)&&n.annotationMap.set(...s)})),n.children=e.blocks.map((e=>{const s=Y.from(e,t);return s.parent=n,s})),n}static createAnnotationEntity(e,t){switch(e){case"customAttribute":return x.from(t);case"customClass":return b.from(t);case"customStyle":return T.from(t)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((e=>e.toJSON()))})}toHtml(){const e=this.getBlockTag();return[`<${e}${super.generateAttributeString()}>`,this.children.map((e=>e.toHtml())).join(""),`</${e}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(){const e=new _(this.id,this.type);return e.children=this.children.map((t=>{const n=t.clone();return n.parent=e,n})),e.annotationMap=super.cloneAnnotations(),e.parent=this.parent,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(i.TRANSFORM_LIST_BLOCK,_.name,new class extends e{handleAction(e,t){const n=e.selectedBlocks,r=t.parent.createList(e.listType);if(n.every((e=>e.parent===t)))r.apply(new s(t.children)),t.parent.apply(new u(t,r)),t.parent.apply(new h(t)),n.forEach((e=>e.children.map((e=>e.apply(new w)))));else{const n=e.selectedBlocks.map((e=>t.parent.toListItem(e)));r.apply(new s(n)),t.parent.apply(new u(t,r)),e.selectedBlocks.forEach((e=>{e.parent.apply(new h(e))})),0===t.children.length&&t.parent.apply(new h(t))}}}),r.register(i.TRANSFORM_PARAGRAPH_BLOCK,_.name,new class extends e{handleAction(e,t){let n=!1,r=!1;const i=e.selectedBlocks,o=i.map((e=>(e.children.map((e=>e.apply(new w))),e===t.children[0]&&(n=!0),e===t.children[t.children.length-1]&&(r=!0),this.toParagraph(e))));if(n)t.parent.apply(new p(t,...o));else if(r)t.parent.apply(new u(t,...o));else{const e=t.children.indexOf(i[0]),n=t.children.indexOf(i[i.length-1]),r=t.parent.createList(t.type);r.apply(new s(t.children.slice(0,e)));const a=t.parent.createList(t.type);a.apply(new s(t.children.slice(n+1))),t.parent.apply(new p(t,r,...o,a)),t.parent.apply(new h(t))}i.map((e=>{t.apply(new h(e))})),0===t.children.length&&t.parent.apply(new h(t))}toParagraph(e){const n=new t(U(),"paragraph");return n.apply(new s(e.children)),n.annotationMap=e.annotationMap,n}}),r.register(i.INSERT_IMAGE_TO_BLOCK,_.name,new class extends e{handleAction(e,t){t.parent.apply("list-item"!==t.parent.type?new u(t,e.imageBlockToBeInserted):e)}});class Q{}class q extends Q{canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){return this.isBold(e)||t.bold?{bold:!0}:{}}isBold(e){return"STRONG"===e.nodeName||"B"===e.nodeName||"bold"===e.style.fontWeight||"700"===e.style.fontWeight||e.classList.contains("v-rte--bold")}}class ee extends Q{canHandle(e,t){return!t.skipCustomAnnotations&&!!e}handle(e){const t=this.getAttributes(e);return Object.keys(t).length>0?{customAttribute:t}:{}}getAttributes(e){return e.getAttributeNames().filter((e=>"style"!==e&&"class"!==e&&this.isValidAttr(e))).reduce(((t,n)=>(t[n]=e.getAttribute(n),t)),{})}isValidAttr(e){return/^[a-zA-Z_][\w-]*$/.test(e)}}class te extends Q{canHandle(e,t){return!t.skipCustomAnnotations&&!!e}handle(e){const t=this.getCustomClass(e);return t.length>0?{customClass:t}:{}}getCustomClass(e){return e.classList.toString().split(" ").filter((e=>!e.includes("v-rte")&&""!==e))}}class ne extends Q{canHandle(e,t){return!t.skipCustomAnnotations&&!!e}handle(e){const t=this.generateCustomStyleAnnotations(e);return Object.keys(t).length>0?{customStyle:t}:{}}generateCustomStyleAnnotations(e){const t=e.getAttribute("style");return t?t.split(";").filter(Boolean).filter((e=>" "!==e)).map((e=>{const t=e.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[$(t[0].trim())]:t[1].trim().replace(";","")}})).reduce(((e,t)=>Object.assign(Object.assign({},e),t)),{}):{}}}class se extends Q{canHandle(e){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(e.name)}handle(e){const t=this.getIndent(e);return t?{indent:t}:{}}getIndent(e){const t=e.style;let n;if(t.marginLeft)n=t.marginLeft;else{if(!t.margin)return null;{const e=t.margin.split(" ");switch(e.length){case 4:n=e[3];break;case 2:case 3:n=e[1];break;default:n=e[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class re extends Q{canHandle(e){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(e.name)}handle(e){const t=this.getTextAlign(e);return t?{textAlign:t}:{}}getTextAlign(e){const t=e.classList;if(t.contains("v-rte--horizontal-alignment-left"))return"left";if(t.contains("v-rte--horizontal-alignment-center"))return"center";if(t.contains("v-rte--horizontal-alignment-right"))return"right";if(t.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(e.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class ie extends Q{canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){return this.isCode(e)||t.code?{code:!0}:{}}isCode(e){return e.classList.contains("v-rte--code")||"CODE"===e.nodeName||"PRE"===e.nodeName||"monospace"===e.style.fontFamily||"Roboto Mono"===e.style.fontFamily.replace(/["']/g,"")}}class oe extends Q{canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){const n=this.getColor(e)||t.textColor;return n?{textColor:n}:{}}getColor(e){var t;const n=null===(t=G(e.style.color))||void 0===t?void 0:t.toUpperCase();if(n){const e=E.filter((e=>e.key!==A.key)).find((e=>e.light===n||e.dark===n));return e?e.key:null}for(const t of E)if(e.style.color.includes(t.key))return t.key;return null}}class ae extends Q{canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){return this.isItalic(e)||t.italic?{italic:!0}:{}}isItalic(e){return"I"===e.nodeName||"italic"===e.style.fontStyle||"EM"===e.nodeName||e.classList.contains("v-rte--italic")}}class ce extends Q{constructor(){super(...arguments),this.handlers=[new ee,new te,new ne]}canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){return t.link?{link:t.link}:"A"===e.tagName?{link:this.generateLinkAnnotations(e)}:{}}generateLinkAnnotations(e){const t={href:e.getAttribute("href")||"",groupKey:U()};return this.handlers.forEach((n=>{Object.assign(t,n.handle(e))})),t}}class le extends Q{canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){return this.isStrikethrough(e)||t.strikethrough?{strikethrough:!0}:{}}isStrikethrough(e){return e.style.textDecoration.includes("line-through")||"S"===e.nodeName||"DEL"===e.nodeName||e.classList.contains("v-rte--strikethrough")}}class de extends Q{canHandle(e){return"RTETextNode"===e.name}handle(e,t={}){return this.isUnderline(e)||t.underline?{underline:!0}:{}}isUnderline(e){return e.style.textDecoration.includes("underline")||"U"===e.nodeName||"INS"===e.nodeName||e.classList.contains("v-rte--underline")}}class ue extends Q{canHandle(e,t){return!!t.autoMatchFormat&&"RTETextBlock"===e.name}handle(e){const t=this.getTextStyle(e);return t?{textStyle:t}:{}}getTextStyle(e){const t=this.getElementTypeByDataType(e);if(t)return t;const n=this.getElementTypeByNodeName(e);if(n)return n;const s=this.getElementTypeByFontSize(e);if(s)return s;return this.getElementTypeByClassName(e)||null}getElementTypeByDataType(e){return e.nodeType!==Node.TEXT_NODE&&e.hasAttribute("data-type")?e.getAttribute("data-type"):null}getElementTypeByFontSize(e){var t;switch(null===(t=e.style)||void 0===t?void 0:t.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(e){switch(e.nodeName){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(e){if(e.className){const t=/\bv-rte--text-style-(title|subtitle|heading-1|heading-2|heading-3|paragraph)\b/.exec(e.className);if(t)return t[1]}return null}}class he extends Q{canHandle(e){return"RTEImageNode"===e.name}handle(e){const t=this.getImageSize(e);return t?{size:t}:{}}getImageSize(e){return e.getAttribute("data-size")?e.getAttribute("data-size"):null}}class we extends Q{canHandle(e){return"RTEImageNode"===e.name}handle(e){return e.hasAttribute("alt")?{alt:e.getAttribute("alt")}:{}}}class pe extends Q{constructor(){super(...arguments),this.customAttributeHandler=new ee,this.customStyleAnnotationHandler=new ne,this.customClassAnnotationHandler=new te}canHandle(e,t){return"RTETextNode"===e.name&&!1===t.autoMatchFormat}handle(e,t){if(pe.canHandleTags.includes(e.nodeName)){const n=this.generateInlineHtmlAnnotation(e,Object.assign({},t));if(n)return{inlineHtml:n}}return{}}generateInlineHtmlAnnotation(e,t){let{inlineHtml:s}=t;if(!n.supportsHtmlTag(e.nodeName.toLowerCase())||1===e.childNodes.length&&e.childNodes[0].nodeType!==Node.TEXT_NODE){const t={htmlTag:e.nodeName.toLowerCase(),customAttribute:this.customAttributeHandler.handle(e).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(e).customStyle,customClass:this.customClassAnnotationHandler.handle(e).customClass};if(s){let n=s;for(;n.child&&e.parentNode&&n.child.htmlTag===e.parentNode.nodeName.toLowerCase();)n=n.child;n.child=t}else s=t}return s?Object.assign({},s):null}}pe.canHandleTags=["A","ABBR","AUDIO","B","BDI","BDO","CITE","CODE","DEL","DFN","EMBED","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR","VIDEO"];const me=new class{constructor(){this.handlers=[new re,new se,new q,new ae,new de,new le,new oe,new ce,new ie,new he,new we,new ee,new te,new ne,new ce,new ue,new pe]}generate(e,t,n={autoMatchFormat:!0}){const s="A"===t.tagName;return this.handlers.filter((e=>!(!n.autoMatchFormat&&s)||e instanceof ce)).filter((r=>t.nodeType!==Node.TEXT_NODE&&r.canHandle(e,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((e,s)=>{const r=s.handle(t,n.parentAnnotations);return Object.assign(Object.assign({},e),r)}),{})}};class ge{generateTextStyleAnnotations(e,t){return me.generate(n,e,t)}}class fe{constructor(e,t){this.childrenOutput=[],this.currentStrategy=e,this.currentElements=t}setChildrenOutput(e){this.childrenOutput=e}toDto(e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const t=this.currentStrategy.handle(this.currentElements,e);return this.childrenOutput.length>0&&t&&this.currentStrategy.appendChildBlocks(t,this.childrenOutput.map((t=>t.toDto(e))).filter(z)),t}}const Te=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(e){this.hasDuplicateStrategy(e,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(e)}registerElementToNodeStrategy(e){this.hasDuplicateStrategy(e,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(e)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(e,t){return t.includes(e)}},be=new class{process(e,t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<e.length;r++){if(this.isInvalidElement(e[r]))continue;let i=0;for(const o of n)if(i=o.canHandle(e,r,t),i>0){const n=e.slice(r,r+i),a=new fe(o,n);1===i&&o.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),t)),s.push(a),r+=i-1;break}if(0===i&&r<e.length){const n=Array.from(e[r].childNodes),i=this.process(Array.from(n),t);i.length>0&&s.push(...i)}}return s}isInvalidElement(e){return e.nodeType===Node.COMMENT_NODE||["META","STYLE"].includes(e.nodeName)}getElementToBlockStrategies(){return Te.getElementToBlockStrategies()}};class xe extends e{handleAction(e,t){const n=e.entityToBeAppended;t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.concat(n))}}class Oe extends e{handleAction(e,t){this.replaceElementWithElements(t,e.referChildren,[...e.childrenToBeInserted,e.referChildren])}replaceElementWithElements(e,t,n){e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.flatMap((e=>e===t?n:e)))}}class Ee extends Oe{handleAction(e,t){this.replaceElementWithElements(t,e.referChildren,[e.referChildren,...e.childrenToBeInserted])}}class Ae extends k{constructor(e,t){super(),this.type=N.IMAGE,this.size=e,this.alt=t}static from(e,t){return[N.IMAGE,new Ae(e,t)]}toJSON(){return z(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new Ae(this.size,this.alt)}renderClass(e){return(null==e?void 0:e.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(e){if(!(null==e?void 0:e.standalone))return null;const t={verticalAlign:"bottom"};switch(this.size){case"sm":return Object.assign(Object.assign({},t),{width:"25%"});case"md":return Object.assign(Object.assign({},t),{width:"50%"});case"lg":return Object.assign(Object.assign({},t),{width:"100%"})}}}class ye extends C{constructor(e,t,n,s){super(e,s),this.type=B.IMAGE,this.url=t,this.parent=n}static from(e,t,n={autoMatchFormat:!0}){const s=new ye(e.id,e.url,t),r=!!n.autoMatchFormat,i=Object.assign({},e.annotations),{size:o}=i,a=function(e,t){var n={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(n[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(e);r<s.length;r++)t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r])&&(n[s[r]]=e[s[r]])}return n}(i,["size"]),c=Object.assign(Object.assign({},a),{size:null!=o?o:r?"md":void 0});return s.annotationMap=new Map(Object.keys(c).map((e=>"size"===e||"alt"===e?Ae.from(c.size,c.alt):this.createAnnotationEntity(e,c[e]))).filter(z)),s}toJSON(){const e=Array.from(this.annotationMap.values()).filter((e=>e instanceof Ae||e instanceof j)).reduce(((e,t)=>Object.assign(Object.assign({},e),t.toJSON())),{});return""==e.alt&&delete e.alt,Object.assign(Object.assign({id:this.id},Object.keys(e).length>0?{annotations:e}:{}),{type:"image",url:this.url})}clone(){return new ye(this.id,this.url,this.parent,super.cloneAnnotations())}toHtml(){const e=this.getAnnotationByType(N.IMAGE);return`<img${super.generateAttributeString(...[e&&e.alt?`alt="${e.alt}"`:null,`src="${this.url}"`,e&&e.size?`data-size="${e.size}"`:null].filter(z))}>`}doAnnotationActionApply(e){const t=r.get(R.name,ye.name);t&&t.execute(e,this)}doModifyActionApply(e){r.executeTheStrategy(e,this)}}r.register(i.UPDATE_IMAGE_NODE_URL,ye.name,new class extends e{handleAction(e,t){t.url=e.url}}),r.register(R.name,ye.name,new class extends e{handleAction(e,t){const n=e.toAnnotation();t.annotationMap.set(n.type,n)}});class ke extends H{constructor(e,t){super(),this.type=i.INSERT_NEW_PARAGRAPH,this.startContainerNode=e,this.startOffset=t}}class Ne extends f{constructor(e){super(e),this.type="image",this.children=[]}static from(e,t={autoMatchFormat:!0}){const n=new Ne(e.id),{annotations:s}=e;return n.children=e.nodes.map((e=>ye.from(e,n,t))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((e=>e.toJSON()))})}toHtml(){const e=super.generateAttributeString(),t=this.children.map((e=>e.toHtml())).join("");return super.shouldRenderAsInternalWrapper()?t:[`<div${e}>`,t,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((e=>e.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new Ne(U())}clone(){const e=new Ne(this.id);return e.children=this.children.map((t=>{const n=t.clone();return n.parent=e,n})),e.annotationMap=super.cloneAnnotations(),e.parent=this.parent,e}}r.register(i.MERGE_TWO_BLOCKS_NODES,Ne.name,new d),r.register(i.REPLACE_CHILD_NODES,Ne.name,new l),r.register(i.SPLIT_BLOCK_WITH_NODE,Ne.name,new class extends e{handleAction(e,t){e.newBlock=this.splitImageNodes(e.splitPointNode,e.startOffsetOfNode,t)}splitImageNodes(e,t,n){const s=n.children.indexOf(e);if(s>-1){const e=n.children.slice(0,s+t),r=n.children.slice(s+t);n.apply(new I(e));const i=this.cloneWithNodes(r,n);return n.parent.apply(new u(n,i)),i}}cloneWithNodes(e,t){const n=t.createNewImageBlock();return n.children=[],n.apply(new s(e)),n}}),r.register(i.LINE_BREAK_SINGLE_BLOCK,Ne.name,new class extends e{handleAction(e,t){const n=new ke(e.startContainerNode,e.startOffset);t.apply(n);const s=n.newBlock;s&&(e.lineBreakNode=s.children[0])}}),r.register(i.LINE_BREAK_MULTIPLE_BLOCKS,Ne.name,new class extends e{handleAction(e,t){e.lineBreakNode=this.lineBreakMultipleBlocks(e.selectedBlocks,t)}lineBreakMultipleBlocks(e,r){const i=t.from({id:U(),type:"paragraph",nodes:[{id:U(),type:"text",text:"\n"}]});r.parent.apply(new u(r,i));const o=this.concatBlocksNodes(e.slice(1));return(0===o.length||o[0]&&""===o[0].text)&&o.push(new n(U(),"\n",i)),i.apply(new s(o)),i.children[0]}concatBlocksNodes(e){const t=[];return e.map((e=>{"image"!==e.type&&(t.push(...e.children),e.parent.apply(new h(e)))})),t}}),r.register(i.INSERT_IMAGE_TO_BLOCK,Ne.name,new class extends e{handleAction(e,t){const n=e.splitPointNode,r=e.startOffsetOfNode,i=e.imageBlockToBeInserted;t.children.length<1?t.apply(new s(i.children)):this.isCaretPositionAtBlockEnd(t,n,r)?t.parent.apply(new u(t,i)):this.isCaretPositionAtBlockStart(t,n,r)?t.parent.apply(new p(t,i)):(t.apply(new S(n,r)),t.parent.apply(new u(t,i)))}}),r.register(v.name,Ne.name,new L);class Ce extends f{constructor(e,t){super(e),this.type="html-block",this.children=[],this.htmlTag=t}static from(e,t){const n=new Ce(e.id,e.htmlTag),{annotations:s}=e;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=e.children.map((e=>{const s=D.getRTEBlockClass(e.type);if(s){const r=s.from(e,t);return r.parent=n,r}})).filter(z),n}clone(){const e=new Ce(this.id,this.htmlTag);return e.children=this.children.map((e=>e.clone())),e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(){const e=this.htmlTag;return[`<${e}${super.generateAttributeString()}>`,this.children.map((e=>e.toHtml())).join(""),`</${e}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((e=>e.toJSON()))})}}class Be extends H{constructor(e){super(),this.type=i.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=e}}class je extends M{handleAction(e,t){const{startContainerNode:n}=e;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(e,t):this.deleteDecoratorNodeContent(e,t);const s=t.parent;s&&t.isListItemBlock()&&0===s.children.length&&s.parent.apply(new h(s))}deleteTextNodeContent(e,t){const n=e.startContainerNode,s=e.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new P(r)),r)return void(e.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===t&&"\n"===s.text||1===t.children.length?void(e.previousNode=n):(t.apply(new h(n)),void(e.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const i=n.isEmpty();if(t.children.length&&s&&s.parent!==t)i&&t.apply(new h(n)),t.type===s.parent.type&&s.parent.apply(new Be(t));else if(this.isContentFirstNode(n)&&i&&(r=this.getNextNode(n)),i&&t.apply(new h(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===t)){const e=s;s=this.getPreviousNode(s),e.parent.apply(new h(e)),s||i||(r=n)}0===t.children.length&&t.parent.apply(new h(t)),s?e.previousNode=s:r&&(e.nextNode=r)}}deleteDecoratorNodeContent(e,t){const n=e.startContainerNode,s=e.startOffset;let r=this.getPreviousNode(n),i=null;if(0!==s){const e=t;this.isContentFirstNode(n)&&(i=this.getNextNode(n)),1===e.children.length?e.parent.apply(new h(e)):e.apply(new h(n))}else{const t=r;t&&!t.isContentEditable()&&(r=this.getPreviousNode(t),t.parent.apply(new h(t)),r||(e.nextNode=n))}r?e.previousNode=r:i&&(e.nextNode=i)}}class Re extends e{handleAction(e,t){const{startContainerNode:n}=e;e.newBlock=this.breakSingleBlock(n,e.startOffset,t)}breakSingleBlock(e,t,n){const s=this.getNewParagraph(e);if(s){if(this.isCaretPositionAtBlockEnd(n,e,t))n.parent.apply(new u(n,s));else{if(!this.isCaretPositionAtBlockStart(n,e,t)){const s=new S(e,t);return n.apply(s),s.newBlock}n.parent.apply(new p(n,s))}return s}}getNewParagraph(e){const t=this.createNewParagraph("");if(t){let n=t.children[0];return e.isTextNode()&&e.isContentEditable()&&(t.children=[],n=e.cloneWithText(""),n.annotationMap.delete(N.LINK),t.apply(new s([n]))),t}}}class Ie extends H{constructor(e,t,n=!1){super(),this.type=i.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=e,this.offset=t,this.immediatelyRun=n}}class He extends e{handleAction(e,t){const{rteRange:n,nodeToBeInserted:s}=e,{startNode:r,startOffset:i}=n;if(r){const e=t;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==i){const t=r.text.substring(0,i),n=r.text.substring(i),o=r.cloneWithText(t),a=r.cloneWithText(n),c=[o,s];n&&c.push(a),e.apply(new p(r,...c)),e.apply(new h(r))}else e.apply(new p(r,s));else e.apply(0!==i?new u(r,s):new p(r,s));this.updateCursorPosition(s)}}updateCursorPosition(e){const t=this.getRootContent(e.parent);t&&t.apply(new Ie(e))}}class Se extends e{handleAction(e,t){const{text:n,offset:s,decoratorNode:r}=e,i=this.createNewParagraph(n);if(i){const e=i.children[0];t.apply(0!==s?new u(r,e):new p(r,e)),this.setTheCursorPosition(e)}}setTheCursorPosition(e){const t=this.getRootContent(e.parent);t&&t.apply(new Ie(e))}}class ve extends e{handleAction(e,t){e.newBlock=this.breakSingleListItemBlock(e.startContainerNode,e.startOffset,t)}breakSingleListItemBlock(e,t,n){const r=n.createNewListItem(),i=this.copyInlineStyleToNewNode(e);if(r.apply(new s([i])),this.isCaretPositionAtBlockEnd(n,e,t))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,e,t)){const s=new S(e,t);return n.apply(s),s.newBlock}return n.parent.apply(new p(n,r)),r}breakListItemAtEnd(e,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=t.from({id:U(),type:"paragraph",nodes:[]});return i.apply(new s(e.children)),r.apply(new u(n.parent,i)),n.parent.apply(new h(n)),i}r.parent.apply(new u(r,e)),n.parent.apply(new h(n))}else n.parent.apply(new u(n,e));return e}copyInlineStyleToNewNode(e){const t=e.cloneWithText("");return t.annotationMap.delete(N.LINK),t}}class Le extends H{constructor(e){super(),this.type=i.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=e}}class De extends F{handleAction(e,t){super.handleAction(e,t);const n=t.parent;0===t.children.length&&n&&n.apply("list-item"===n.type?new Le(t):new h(t))}}const Me=new class{registerBlockBasicStrategies(e){r.register(i.DELETE_CHILDREN,e,e===_.name?new De:new F),r.register(i.APPEND_CHILDREN,e,new xe),r.register(i.INSERT_CHILDREN_BEFORE,e,new Oe),r.register(i.INSERT_CHILDREN_AFTER,e,new Ee),r.register(i.DELETE_BLOCK_CONTENT,e,new je),r.register(i.INSERT_NEW_PARAGRAPH,e,e===Y.name?new ve:new Re),r.register(i.INSERT_TEXT_TO_DECORATOR_NODE,e,new Se),r.register(i.INSERT_NODE_TO_NEAREST_ROOT,e,new He)}};class Pe extends ge{constructor(){super(...arguments),this.annotationHandler=new ue}generateChildNodes(e,t,s){const r=[],i=!(!s||!1!==s.autoMatchFormat),o=Object.assign({},t);return e.forEach((e=>{const a=Te.getElementToNodeStrategies().find((t=>t.canHandle([e],0,s)>0));let c=null;if(a&&(c=a.handle([e],s,o)),c)r.push(c);else if(V(e)&&e.childNodes.length>0){const a=me.generate(n,e,Object.assign({parentAnnotations:i?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:t},s));r.push(...this.generateChildNodes(Array.from(e.childNodes),a,s))}})),r}matchTextBlockType(e){var t;return null!==(t=this.annotationHandler.handle(e).textStyle)&&void 0!==t?t:"paragraph"}}class Fe extends Pe{canHandle(e,t,n){const s=e[t];return!n.autoMatchFormat&&("DIV"!==s.nodeName||s.childNodes.length>0&&"IMG"!==s.childNodes[0].nodeName)&&Fe.canHandleTags.includes(e[t].nodeName)?1:0}handle(e,t){return Ce.from(this.generateHtmlBlock(e[0],t),t)}appendChildBlocks(e,t){e.children=t.map((t=>(t.parent=e,t)))}shouldProceedToElementChildren(){return!0}generateHtmlBlock(e,t){return{id:U(),type:"html-block",htmlTag:e.nodeName.toLowerCase(),annotations:me.generate(Ce,e,t),children:[]}}}Fe.canHandleTags=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","BUTTON","CAPTION","COL","COLGROUP","DIV","DD","DETAILS","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","HEADER","HR","HX","INPUT","LEGEND","MAIN","NAV","PRE","SECTION","SUMMARY","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR"];class Ue extends Pe{canHandle(e,t){return"PRE"!==e[t].tagName&&"CODE"!==e[t].tagName||!e[t].hasAttribute("data-language")?0:1}handle(e){const t=e[0];if(t){const e=t.textContent,n=t.dataset.language;return O.from({id:U(),type:"code-block",content:e,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class ze extends Pe{createRTEImageBlock(e,t){const n=!(t&&t.autoMatchFormat||!e.parentNode||"DIV"===e.parentNode.nodeName);return Ne.from({id:U(),type:"image",nodes:[{id:U(),type:"image",url:e.src,annotations:me.generate(ye,e,t)}],annotations:Object.assign(Object.assign({},me.generate(Ne,e.parentElement,t)),{internalWrapper:n})},t)}}class $e extends Pe{canHandle(e,t){let n=0;for(let s=t;s<e.length;s++){const t=e[s];if(t.nodeType!==Node.TEXT_NODE&&(!$e.canHandleTags.includes(t.nodeName)||""===t.textContent&&t.querySelector("IMG")))break;n++}return n}handle(e,s){const r=e[0].parentElement,i=s&&s.autoMatchFormat,o=this.generateChildNodes(e,i?me.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=i?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),c=!i&&!a;return t.from(Object.assign({id:U(),type:a||"paragraph",nodes:o},c?{annotations:{internalWrapper:c}}:{annotations:me.generate(t,r,s)}),s)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(e){switch(e.nodeName){case"P":return"paragraph";default:return null}}}$e.canHandleTags=[...pe.canHandleTags,"CODE","A","VEGA-RICH-TEXT-LINK-EDITOR","BR"];class Ge extends ge{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(e,t){return{id:U(),type:"text",text:e,annotations:t}}}D.registerRTEDTOClass("paragraph",t),D.registerRTEDTOClass("title",t),D.registerRTEDTOClass("subtitle",t),D.registerRTEDTOClass("heading-1",t),D.registerRTEDTOClass("heading-2",t),D.registerRTEDTOClass("heading-3",t),D.registerRTEDTOClass("heading-4",t),D.registerRTEDTOClass("heading-5",t),D.registerRTEDTOClass("heading-6",t),D.registerRTEDTOClass("heading-6",t),D.registerRTEDTOClass("list-item",Y),D.registerRTEDTOClass("bullet-list",_),D.registerRTEDTOClass("number-list",_),D.registerRTEDTOClass("image",Ne),D.registerRTEDTOClass("code-block",O),D.registerRTEDTOClass("html-block",Ce),D.registerRTEDTOClass("text",n),D.registerRTEDTOClass("image",ye),Me.registerBlockBasicStrategies(t.name),Me.registerBlockBasicStrategies(_.name),Me.registerBlockBasicStrategies(Y.name),Me.registerBlockBasicStrategies(Ne.name),Me.registerBlockBasicStrategies(Ce.name),Te.registerElementToBlockStrategy(new $e),Te.registerElementToBlockStrategy(new class extends ze{canHandle(e,t){const n=e[t];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(e,t){const n=e[0].querySelector("img");return this.createRTEImageBlock(n,t)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Te.registerElementToBlockStrategy(new class extends ze{canHandle(e,t){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===e[t].tagName?1:0}handle(e,t){const n=e[0],s=n.querySelector("img");if(z(s))return Ne.from({id:U(),type:"image",nodes:[{id:U(),type:"image",url:s.src,annotations:me.generate(ye,n,t)}],annotations:me.generate(Ne,n.parentElement,t)},t)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Te.registerElementToBlockStrategy(new class extends ze{canHandle(e,t){return"IMG"===e[t].tagName?1:0}handle(e,t){return this.createRTEImageBlock(e[0],t)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Te.registerElementToBlockStrategy(new class extends Pe{canHandle(e,t){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(e[t]))?1:0}handle(e,n){const s=this.generateChildNodes(Array.from(e[0].childNodes),{},n);return 0===s.length?null:t.from({id:U(),type:super.matchTextBlockType(e[0]),nodes:s,annotations:me.generate(t,e[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Te.registerElementToBlockStrategy(new Ue),Te.registerElementToBlockStrategy(new class extends Ue{canHandle(e,t){return"VEGA-CODE-BLOCK"===e[t].tagName&&0==!!e[t].querySelector("vega-code-block")||this.isCodeBlockContainer(e[t])?1:0}handle(e){const t=this.isCodeBlockContainer(e[0])?e[0].querySelector("vega-code-block"):e[0],n=t.querySelector("code");if(n)return super.handle([n]);if(t.hasAttribute("data-content")){const e=document.createElement("code");return e.textContent=t.dataset.content,e.dataset.language=t.dataset.language,super.handle([e])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(e){return"PRE"===e.tagName&&e.classList.contains("code-block-container")&&1===e.querySelectorAll("vega-code-block").length}}),Te.registerElementToBlockStrategy(new class extends Pe{canHandle(e,t){if(!["UL","OL"].includes(e[t].parentElement.nodeName)&&e.some((e=>"LI"===e.nodeName))){let n=0;for(let s=t;s<e.length&&"LI"===e[s].nodeName;s++)n++;return n}return"LI"===e[t].tagName?1:0}handle(e,t){const n=e[0];return["UL","OL"].includes(n.parentElement.nodeName)?Y.from(this.generateListItemBlockDTO(n,t),t):this.generateWithListBlock(e,t)}appendChildBlocks(e,t){e.nestList=t.filter((e=>["bullet-list","number-list"].includes(e.type)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(e,t){return _.from({id:U(),type:"bullet-list",blocks:e.map((e=>this.generateListItemBlockDTO(e,t)))},t)}generateListItemBlockDTO(e,t){return{id:U(),type:"list-item",annotations:me.generate(Y,e,t),nodes:this.generateChildNodes(Array.from(e.childNodes.length?e.childNodes:[e]).filter((e=>!["UL","OL"].includes(e.nodeName))),me.generate(n,e,Object.assign(Object.assign({},t),{skipCustomAnnotations:!0})),t)}}}),Te.registerElementToBlockStrategy(new class extends Pe{canHandle(e,t){const n=e[t],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),o=z(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&o?1:0}handle(e,t){const n=this.generateChildNodes(e,{},t);return Y.from({id:U(),type:"list-item",nodes:n,annotations:{}},t)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),Te.registerElementToBlockStrategy(new class extends Pe{canHandle(e,t){return"OL"===e[t].tagName?1:0}handle(e,t){return 0===e[0].childNodes.length?null:_.from({id:U(),type:"number-list",blocks:[],annotations:me.generate(_,e[0],t)},t)}appendChildBlocks(e,t){e.children=t.filter((e=>e instanceof Y)),t.forEach((t=>t.parent=e))}shouldProceedToElementChildren(){return!0}}),Te.registerElementToBlockStrategy(new class extends Pe{canHandle(e,t){return"UL"===e[t].tagName?1:0}handle(e,t){return 0===e[0].childNodes.length?null:_.from({id:U(),type:"bullet-list",blocks:[],annotations:me.generate(_,e[0],t)},t)}appendChildBlocks(e,t){e.children=t.filter((e=>e instanceof Y)),t.forEach((t=>t.parent=e))}shouldProceedToElementChildren(){return!0}}),Te.registerElementToBlockStrategy(new Fe),Te.registerElementToNodeStrategy(new class extends Ge{canHandle(e,t){const n=e[t];return!V(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(e,t,s){const r=!(!t||!1!==t.autoMatchFormat),i=Object.assign({},s),o=e[0],a=me.generate(n,o,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:s},t));if("BR"===o.nodeName)return this.generateTextNode("\n",a);if(0===o.childNodes.length){const e=r?X(Object.assign(Object.assign({},n.supportsHtmlTag(o.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml,plainText:z(a.inlineHtml)})):a;return Object.assign({},this.generateTextNode("",e))}}}),Te.registerElementToNodeStrategy(new class extends Ge{canHandle(e,t){return e[t].nodeType===Node.TEXT_NODE?1:0}handle(e,t,s){const r=Object.assign({},s),i=!(!t||!1!==t.autoMatchFormat),o=e[0],a=o.parentNode.nodeName.toLowerCase(),c=i&&!n.supportsHtmlTag(a),l=this.generateTextNode(String(o.textContent),i?X(Object.assign(Object.assign({},"span"===a?r:{link:r.link,code:"code"===a?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:c||void 0})):r);return Object.assign({},l)}});class Ve{constructor(e){e.forEach((e=>{e.parent=this})),this.children=e}static fromJSON(e,t={autoMatchFormat:!0}){const n=e.map((e=>{const n=D.getRTEBlockClass(e.type);if(n)return n.from(e,t);throw new Error(`[Vega] Unknown block type: ${e.type}`)}));return new Ve(n)}static createEmptyContent(){return Ve.fromJSON([{id:U(),type:"paragraph",nodes:[{id:U(),type:"text",text:""}]}])}static fromHtml(e,t={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=e.replace(/>\s+<\/?/g,(e=>e.endsWith("</")?e:"><")).replace(/(>)[\n\t]+(?=[a-zA-Z0-9_\W])/g,"$1").replace(/([a-zA-Z0-9_\W])[\n\t]+(?=<)/g,"$1"),s=(new DOMParser).parseFromString(n,"text/html").body,r=be.process(Array.from(s.childNodes),t).filter(z).map((e=>e.toDto(t))).filter(z);return new Ve(r)}clone(e=!1){return new Ve(e?this.children.map((e=>e.clone())):[...this.children])}toJSON(){return this.children.map((e=>e.toJSON()))}toHtml(e){return this.children.map((t=>t.toHtml(e))).join("")}apply(e){r.executeTheStrategy(e,this)}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(e){e.children.map((e=>e.apply(new w)));const t=new Y(U());return t.apply(new s(e.children)),t.annotationMap=e.annotationMap,t}createList(e){return new _(U(),e)}findNodeById(e){return this.findNodeInBlocksById(e,this.children)}findNodeInBlocksById(e,t){for(const n of t){if("children"in n)for(const t of n.children)if(t.id===e)return t;if(n instanceof Y&&n.nestList)for(const t of n.nestList){const n=this.findNodeInBlocksById(e,t.children);if(n)return n}if(n instanceof _&&n.children){const t=this.findNodeInBlocksById(e,n.children);if(t)return t}}return null}}r.register(i.DELETE_CHILDREN,Ve.name,new F),r.register(i.APPEND_CHILDREN,Ve.name,new xe),r.register(i.INSERT_CHILDREN_BEFORE,Ve.name,new Oe),r.register(i.INSERT_CHILDREN_AFTER,Ve.name,new Ee),r.register(i.TRANSFORM_TO_CODE_BLOCK,Ve.name,new class extends e{handleAction(e,t){const n=e.selectedBlocks,s=new O(U(),this.getCodeContent(n),"plainText");t.apply(new p(n[0],s)),e.newCodeBlock=s,this.removeSelectBlocks(n,t)}getCodeContent(e){return e.filter((e=>"image"!==e.type&&"list-item"!==e.type)).map((e=>e.children.map((e=>e.text)).join(""))).join("\n")}removeSelectBlocks(e,t){for(let n=0;n<e.length;n++)t.apply(new h(e[n]))}}),r.register(i.UPDATE_CURSOR_POSITION,Ve.name,new class extends e{handleAction(e,t){const{offset:n,nextFocusNode:s,immediatelyRun:r}=e,i=y.getDOMByEntity(t);i&&J.notify(W.getSubject(i,K),{node:s,offset:n,updateDirectly:r})}});const Je=new class{constructor(){this.RTE_DTO_RENDERER_MAP=new Map,this.RTE_TOOLBAR_BUTTON_RENDERER_MAP=new Map}registerRTEDTORenderer(e,t){const n=this.RTE_DTO_RENDERER_MAP.get(e);if(t&&n&&n.constructor.name!==t.constructor.name)throw new Error(`Renderer for type ${e} is already registered with a different class(${n.constructor.name}).`);this.RTE_DTO_RENDERER_MAP.set(e,t)}registerRTEToolbarButtonRenderer(e,t){this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.set(e,t)}getRTERenderer(e){return this.RTE_DTO_RENDERER_MAP.get(e)}getRTEToolbarButtonRenderer(e){return this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.get(e)}};export{Te as E,Ae as I,Be as M,Je as R,Ie as U,Ve as V,Me as a,ge as b,Y as c,Ne as d,_ as e,ye as f,ke as g,be as h}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as t}from"./p-2d0d575f.js";import{d as e}from"./p-2ee4def0.js";import{b as n,c as s}from"./p-0e954b9b.js";import{c as r}from"./p-02841589.js";import{L as i}from"./p-6e1ab235.js";import{i as o}from"./p-b1faebe0.js";import{g as a}from"./p-a4670e23.js";import{V as c}from"./p-7e8f055d.js";import{c as l}from"./p-bf19682d.js";import{f as h}from"./p-575235c8.js";var u,d;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(u||(u={}));class p{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT",t.LIST="LIST",t.INTERNAL_WRAPPER="INTERNAL_WRAPPER"}(d||(d={}));class f extends p{}const g=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap,this.contentEntityToRootDom=new Map,this.rootDomToContentEntity=new WeakMap}register(t,e){this.isVegaRTEContent(e)?this.registerRootDomAndContentEntity(t,e):(this.domToEntity.set(t,e),this.entityToDOM.set(e,t))}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.isVegaRTEContent(t)?this.contentEntityToRootDom.get(t):this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}registerRootDomAndContentEntity(t,e){const n=this.rootDomToContentEntity.get(t);n&&n!==e&&this.contentEntityToRootDom.delete(n),this.rootDomToContentEntity.set(t,e),this.contentEntityToRootDom.set(e,t)}isVegaRTEContent(t){return t&&"VegaRTEContent"===t.constructor.name}};var x,m,w,A;!function(t){t.DELETE_CHILDREN="DELETE_CHILDREN",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILDREN="APPEND_CHILDREN",t.INSERT_CHILDREN_AFTER="INSERT_CHILDREN_AFTER",t.INSERT_CHILDREN_BEFORE="INSERT_CHILDREN_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.INSERT_NEW_PARAGRAPH="INSERT_NEW_PARAGRAPH",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK",t.UNLINK_LINK_GROUP="UNLINK_LINK_GROUP",t.LINK_GROUP_NODE_SPLIT="LINK_GROUP_NODE_SPLIT",t.DELETE_LINK_GROUP="DELETE_LINK_GROUP",t.UPDATE_CURSOR_POSITION="UPDATE_CURSOR_POSITION",t.INSERT_TEXT_TO_DECORATOR_NODE="INSERT_TEXT_TO_DECORATOR_NODE",t.INSERT_NODE_TO_NEAREST_ROOT="INSERT_NODE_TO_NEAREST_ROOT"}(x||(x={}));class y{constructor(){this.isFlushable=!1}}class E extends p{constructor(t){super(),this.type=u.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new E("");return this.linkGroups.forEach(((e,n)=>{t.linkGroups.set(n,e.map((t=>t.clone())))})),t}toString(t,e){const n=this.toJsx(t,e);return Object.entries(n).map((([t,e])=>{const n="string"==typeof e?e:this.formatStyleToString(e);return`${r(t)}="${n}"`})).join(" ")}toJsx(t,e){const n=this.getStyle(t,e),s=this.getClass(t,e),r=this.getAttribute(t,e);return s.length>0&&(r.class=s.join(" ")),n&&Object.keys(n).length>0&&(r.style=n),r}getClass(t,e){const n=[];return t.link.customClass&&n.push(...t.link.customClass),!(null==e?void 0:e.standalone)&&t.useInternalStyle&&n.push("v-rte--link"),n}getStyle(t,e){const n={};return t.link.customStyle&&Object.assign(n,t.link.customStyle),(null==e?void 0:e.standalone)&&t.useInternalStyle&&(n.color="rgba(var(--v-text-link, 19, 98, 226, 1))"),n}getAttribute(t,e){var n;const{href:s,customAttribute:r={}}=t.link,i=null===(n=null==e?void 0:e.autoMatchFormat)||void 0===n||n,o=r.target||(i?"_blank":"");return Object.assign(Object.assign(Object.assign({},r),s||i?{href:s}:{}),o?{target:o}:{})}formatStyleToString(t){return Object.entries(t).map((([t,e])=>`${r(t)}: ${e};`)).join(" ")}}class O extends f{constructor(t){super(),this.type=d.ALIGNMENT,this.textAlign=t}static from(t){return[d.ALIGNMENT,new O(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(t){if(null==t?void 0:t.standalone)return null;switch(this.textAlign){case"right":case"center":case"justify":return`v-rte--horizontal-alignment-${this.textAlign}`;case"left":default:return"v-rte--horizontal-alignment-left"}}clone(){return new O(this.textAlign)}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;switch(this.textAlign){case"right":case"center":case"justify":return{textAlign:this.textAlign};case"left":default:return{textAlign:"left"}}}}class S extends f{constructor(t){super(),this.type=d.INDENT,this.indent=Math.max(0,t)}static from(t){return[d.INDENT,new S(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new S(this.indent)}renderClass(){return null}renderStyle(){return this.indent>0?{marginLeft:16*this.indent+"px"}:null}}class T{static register(t,e,n){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,n)}static get(t,e){const n=this.registry.get(e);if(n)return n.get(t)}static executeTheStrategy(t,e){const n=t instanceof y?t.type:t.constructor.name,s=T.get(n,e.constructor.name);if(s)return s.execute(t,e);i.error(`Type ${n} action handle strategy is not registered in class ${e.constructor.name}`)}static canHandle(t,e){return!!T.get(t,e.constructor.name)}}T.registry=new Map,function(t){t.CUSTOM_ATTRIBUTE="CUSTOM_ATTRIBUTE",t.CUSTOM_CLASS="CUSTOM_CLASS",t.CUSTOM_STYLE="CUSTOM_STYLE"}(m||(m={}));class N extends p{}class C extends N{constructor(t){super(),this.type=m.CUSTOM_ATTRIBUTE,this.BOOLEAN_ATTRS=new Set(["controls","disabled","checked","readonly","multiple","required","autoplay","muted"]),this.customAttribute=t}static from(t){return[m.CUSTOM_ATTRIBUTE,new C(t)]}toJSON(){return{customAttribute:this.customAttribute}}clone(){return new C(this.customAttribute)}toString(t=[]){const e=t.map((t=>t.split("=")[0]));return Object.keys(this.customAttribute).map((t=>e.includes(t)?null:`${t}="${this.customAttribute[t]}"`)).filter(o)}render(t={}){var e;const n=Object.assign({},this.customAttribute);return null===(e=t.filterAttributes)||void 0===e||e.forEach((t=>delete n[t])),Object.keys(n).forEach((t=>{this.BOOLEAN_ATTRS.has(t)&&""===n[t]&&(n[t]="true")})),n}}class v extends N{constructor(t){super(),this.type=m.CUSTOM_CLASS,this.customClass=t}static from(t){return[m.CUSTOM_CLASS,new v(t)]}toJSON(){return{customClass:this.customClass}}clone(){return new v(this.customClass)}toString(){return`class="${this.customClass.join(" ")}"`}renderClass(){return this.customClass}}class b extends N{constructor(t){super(),this.type=m.CUSTOM_STYLE,this.customStyle=t}static from(t){return[m.CUSTOM_STYLE,new b(t)]}toJSON(){return{customStyle:this.customStyle}}clone(){return new b(this.customStyle)}renderStyle(){return this.customStyle}removeStyles(t){const e=Object.assign({},this.customStyle);return t.forEach((t=>delete e[t])),e}toString(){return`style="${Object.entries(this.customStyle).map((([t,e])=>`${t}: ${e};`)).join(" ")}"`}}class _ extends f{constructor(t){super(),this.type=d.INTERNAL_WRAPPER,this.internalWrapper=t}static from(t){return[d.INTERNAL_WRAPPER,new _(t)]}clone(){return new _(this.internalWrapper)}renderClass(){}renderStyle(){}toJSON(){return this.internalWrapper?{internalWrapper:this.internalWrapper}:void 0}}class L{constructor(t){this.annotationMap=new Map,this.id=t}static from(t,e){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"textAlign":return O.from(e);case"indent":return S.from(e);case"customAttribute":return C.from(e);case"customClass":return v.from(e);case"customStyle":return b.from(e);case"internalWrapper":return _.from(e)}}static convertAnnotationsToMap(t,e){Object.entries(e).forEach((([e,n])=>{const s=this.createAnnotationEntity(e,n);o(s)&&t.set(...s)}))}shouldRenderAsInternalWrapper(){const t=this.getAnnotationByType(d.INTERNAL_WRAPPER);return!!t&&t.internalWrapper&&0===Array.from(this.annotationMap.values()).filter((t=>!(t instanceof E||t instanceof _))).length}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof N)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(s){if(this.doApply(s),s.isFlushable){const s=g.getDOMByEntity(this);if(s){const r=e.getSubjectFromParentNodeByEventId(s,n);r&&t.notify(r,{})}}}isListItemBlock(){return"list-item"===this.type}getStyles(t={standalone:!1}){return Object.assign(Object.assign({},Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof b)).map((e=>e.renderStyle(t))).filter(o).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{})),this.shouldRenderAsInternalWrapper()?{display:"contents"}:{})}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof f||t instanceof v)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(m.CUSTOM_ATTRIBUTE)}generateAttributeString(...t){var e;const n=Object.entries(Object.assign({},this.getStyles({standalone:!0}))).map((([t,e])=>`${r(t)}: ${e};`)).join(""),s=this.annotationMap.get(m.CUSTOM_CLASS),i=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==s?void 0:s.toString(),n?`style="${n}"`:null,...t].filter(o);return i.length?` ${i.join(" ")}`:""}doApply(t){t instanceof y?T.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();e instanceof E||this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK",t.INLINE_HTML="INLINE_HTML",t.PLAIN_TEXT="PLAIN_TEXT"}(w||(w={}));class R extends p{}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(A||(A={}));class I{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}static from(t,e,n){throw new Error(`[Vega] ${this.constructor.name}.from(${JSON.stringify(t)}, ${e}, ${n}) is not implemented. Please implement this method in the subclass.`)}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return C.from(e);case"customClass":return v.from(e);case"customStyle":return b.from(e)}}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}getStyles(t={standalone:!1}){const e=Array.from(this.annotationMap.values()).filter((t=>t instanceof R||t instanceof b)).map((e=>e.renderStyle(t))).filter(Boolean);return this.mergeAnnotationStyles(e,["textDecoration"])}getClasses(t={standalone:!1}){return Array.from(this.annotationMap.values()).filter((t=>t instanceof R||t instanceof v)).map((e=>e.renderClass(t))).filter(o).reduce(((t,e)=>[t,e].join(" ").trim()),"")}getCustomAttributesAnnotation(){return this.annotationMap.get(m.CUSTOM_ATTRIBUTE)}isTextNode(){return!1}generateAttributeString(...t){var e;const n=Object.entries(Object.assign({},this.getStyles({standalone:!0}))).map((([t,e])=>`${r(t)}: ${e};`)).join(""),s=this.annotationMap.get(m.CUSTOM_CLASS),i=[...(null===(e=this.getCustomAttributesAnnotation())||void 0===e?void 0:e.toString(t))||[],null==s?void 0:s.toString(),n?`style="${n}"`:null,...t].filter(o);return i.length?` ${i.join(" ")}`:""}doApply(t){t instanceof y?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const s=g.getDOMByEntity(this);if(s){const r=e.getSubjectFromParentNodeByEventId(s,n);r&&t.notify(r,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}doAnnotationActionApply(t){}doModifyActionApply(t){}mergeAnnotationStyles(t,e){const n={};for(const s of t)for(const t in s){const r=s[t],i=n[t];n[t]="string"==typeof i&&"string"==typeof r&&e.includes(t)?Array.from(new Set(`${i} ${r}`.split(/\s+/).filter(Boolean))).join(" "):r}return n}}class ${}class B extends ${constructor(){super(...arguments),this.doSplit=!0}}class k extends p{constructor(t){super(),this.type=u.SELECTION_RANGE,this.range=t}clone(){return new k(this.range)}}class D extends R{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new D(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new D(this.strikethrough)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.strikethrough?"v-rte--strikethrough":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.strikethrough?{textDecoration:"line-through"}:null}}class M extends R{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.UNDERLINE,new M(t)]}toJSON(){return{underline:this.underline}}clone(){return new M(this.underline)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.underline?"v-rte--underline":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.underline?{textDecoration:"underline"}:null}}class j extends R{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new j(t)]}toJSON(){return{italic:this.italic}}clone(){return new j(this.italic)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.italic?"v-rte--italic":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.italic?{fontStyle:"italic"}:null}}class P extends R{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new P(t)]}toJSON(){return{bold:this.bold}}clone(){return new P(this.bold)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.bold?"v-rte--bold":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.bold?{fontWeight:"700"}:null}}class F extends R{constructor(t,e=!0){super(),this.type=w.CODE,this.code=t,this.useInternalStyle=e}static from(t,e){return[w.CODE,new F(t,e)]}toJSON(){return{code:this.code}}clone(){return new F(this.code,this.useInternalStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.code&&this.useInternalStyle?"v-rte--code":null}renderStyle(t){return(null==t?void 0:t.standalone)&&this.code&&this.useInternalStyle?{fontFamily:"Roboto Mono",whiteSpace:"pre-wrap"}:null}}const H={key:"black",light:"#111128",dark:"#E3E3E8"},W=[H,{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],K="",J=[["textStyles"],["bold","italic","underline","strikethrough","code"],["textColor"],["horizontalAlignment","bulletsNumbers"],["moreIndent","lessIndent"],["link"],["image"],["clearStyle"]];class U extends R{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new U(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new U(this.textColor.key)}renderClass(){return null}renderStyle(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return W.find((e=>e.key===t))||W[0]}}class G extends R{constructor(t,e=!0){super(),this.type=w.LINK,this.link=t,this.useInternalStyle=e}static from(t,e=!0){return[w.LINK,new G(t,e)]}toJSON(){return{link:this.link}}clone(){return new G(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}renderClass(){return null}renderStyle(){return null}}class z extends ${constructor(t,e,n){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e,this.type=n}toAnnotation(){return new E(this.groupKey)}}class X extends ${constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}const V=new class{constructor(){this.RTE_BLOCK_DTO_CLASS_MAP=new Map,this.RTE_NODE_DTO_CLASS_MAP=new Map}registerRTEDTOClass(t,e){if(e.prototype instanceof L)this.RTE_BLOCK_DTO_CLASS_MAP.set(t,e);else{if(!(e.prototype instanceof I))throw new Error(`Invalid RTE DTO class type: ${t}`);this.RTE_NODE_DTO_CLASS_MAP.set(t,e)}}getRTEBlockClass(t){return this.RTE_BLOCK_DTO_CLASS_MAP.get(t)}getRTENodeClass(t){return this.RTE_NODE_DTO_CLASS_MAP.get(t)}};class q{execute(t,e){return i.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}updateCustomStyleAnnotation(t,e){const n=t.annotationMap.get(m.CUSTOM_STYLE);n&&this.isCustomStyle(n,e)&&t.annotationMap.set(n.type,new b(n.removeStyles(e)))}createNewParagraph(t){const e=V.getRTEBlockClass("paragraph");if(e)return e.from({id:a(),type:"paragraph",nodes:[{id:a(),type:"text",text:t}]})}getRootContent(t){const e=t.parent;if(e)return"VegaRTEContent"===e.constructor.name?e:this.getRootContent(e)}isCaretPositionAtBlockStart(t,e,n){return e===t.children[0]&&0===n}isCaretPositionAtBlockEnd(t,e,n){return e.isContentEditable()?this.isCaretPositionAtTextBlockEnd(t,e,n):this.isCaretPositionAtDecoratorBlockEnd(t,e,n)}isCaretPositionAtTextBlockEnd(t,e,n){const s=t.children[t.children.length-1];return e===s&&(e.isEmpty()||n===s.text.length)}isCaretPositionAtDecoratorBlockEnd(t,e,n){return e===t.children[t.children.length-1]&&0!==n}isCustomStyle(t,e){return e.some((e=>Object.keys(t.customStyle).includes(e)))}}class Y extends y{constructor(t){super(),this.type=x.LINK_GROUP_NODE_SPLIT,this.splittedTextNodes=t}}class Q extends q{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const n=e.getAnnotationByType(u.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof B&&t.doSplit&&n){const{startContainer:t,endContainer:s,startOffset:r,endOffset:i}=n.range,o=t===s&&r===i;e.parent.children=e.parent.children.flatMap((t=>{if(t.id===e.id){if(o)return this.insertNewNode(r,e);if(this.shouldSplitSelection(n.range)&&e.isContentEditable()){const s=this.splitTextNode(n.range,e);return t.annotationMap.has("LINK")&&t.apply(new Y(s)),s}return this.setApplyTargetNode(e),e}return t}))}return this.applyTargetNode}insertNewNode(t,e){const n=e.cloneWithText("");this.setApplyTargetNode(n);const s=e.parent.children.findIndex((t=>t===e));return 0===t||!e.isContentEditable()&&t===s?[n,e]:t===e.text.length||!e.isContentEditable()&&t===s+1?[e,n]:[e.cloneWithText(e.text.substring(0,t)),n,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:n,startOffset:s,endOffset:r}=t;return e!==n||s>0||r<(n.textContent?n.textContent.length:0)}splitTextNode(t,e){const{startContainer:n,endContainer:s,startOffset:r}=t,i=n.parentElement,o=s.parentElement,a=(t,n,s)=>{const r=t.substring(0,n),i=t.substring(n,s),o=t.substring(s);return[e.cloneWithText(r),e.cloneWithText(i),e.cloneWithText(o)]},c=i&&g.getEntityByDOM(i),l=o&&g.getEntityByDOM(o);if(c&&c.id===e.id){const i=n===s?t.endOffset:e.text.length,[o,c,l]=a(e.text,r,i);return this.setApplyTargetNode(c),[o,c,l].filter((t=>!!t.text))}if(l&&l.id===e.id){const[n,s,r]=a(e.text,0,t.endOffset);return this.setApplyTargetNode(s),[n,s,r].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}class Z extends B{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new P(this.bold)}}class tt extends p{constructor(){super(...arguments),this.type=u.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE,m.CUSTOM_STYLE]}}class et extends B{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new tt}}class nt extends B{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new F(this.code)}}class st extends ${constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class rt extends B{constructor(t){super(),this.isFlushable=!0,this.italic=t}toAnnotation(){return new j(this.italic)}}class it extends B{constructor({link:t,newText:e,needMergeNode:n,doSplit:s,type:r}){super(),this.isFlushable=!0,this.link=t,this.needMergeNode=n,this.newText=e,this.type=r,o(s)&&(this.doSplit=s)}toAnnotation(){return new G(this.link)}}class ot extends B{constructor(t){super(),this.isFlushable=!0,this.strikethrough=t}toAnnotation(){return new D(this.strikethrough)}}class at extends B{constructor(t){super(),this.isFlushable=!0,this.underline=t}toAnnotation(){return new M(this.underline)}}class ct extends q{handleAction(t,e){const n=t.toAnnotation();if(t instanceof st)e.annotationMap.delete(t.annotationType);else{if(!(n instanceof tt))return n instanceof R||n instanceof k?(t instanceof it&&(o(t.newText)&&(e.text=t.newText),e.parent.apply(new z(t.link.groupKey,[e],t.type))),t instanceof nt&&this.handleAction(new et,e),t instanceof Z&&this.updateCustomStyleAnnotation(e,["fontWeight"]),t instanceof rt&&this.updateCustomStyleAnnotation(e,["fontStyle"]),(t instanceof at||t instanceof ot)&&this.updateCustomStyleAnnotation(e,["textDecoration"]),void e.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{e.deleteAnnotationByType(t)}))}}}class lt extends y{constructor(){super(...arguments),this.type=x.DELETE_LINK_GROUP}}class ht extends q{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.apply(new lt)}}class ut extends y{constructor(t){super(),this.type=x.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class dt extends q{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,n){if(e&&e.startContainer&&e.endContainer){const{startContainer:s,endContainer:r,startOffset:i,endOffset:o}=e;let a=n.text;if(s===r&&i===o&&t)a=n.text.slice(0,i)+t+n.text.slice(i);else{const e=s.parentElement,c=r.parentElement,l=e&&g.getEntityByDOM(e),h=c&&g.getEntityByDOM(c);let u=0,d=n.text.length;l&&l===n?(u=i,d=s===r?o:d):h&&h===n&&(d=o),a=n.text.slice(0,u)+t+n.text.slice(d)}n.apply(new ut(a))}}}class pt extends p{constructor(t){super(),this.type=w.INLINE_HTML,this.htmlTag=t}static from(t){const{htmlTag:e,child:n,customStyle:s,customClass:r,customAttribute:i}=t,o=new pt(e);return o.child=n?pt.from(n)[1]:void 0,o.customAttribute=i?C.from(i)[1]:void 0,o.customClass=r?v.from(r)[1]:void 0,o.customStyle=s?b.from(s)[1]:void 0,[w.INLINE_HTML,o]}clone(){var t,e,n,s;const r=new pt(this.htmlTag);return r.child=null===(t=this.child)||void 0===t?void 0:t.clone(),r.customAttribute=null===(e=this.customAttribute)||void 0===e?void 0:e.clone(),r.customClass=null===(n=this.customClass)||void 0===n?void 0:n.clone(),r.customStyle=null===(s=this.customStyle)||void 0===s?void 0:s.clone(),r}toJSON(){var t,e,n,s;return{inlineHtml:l({htmlTag:this.htmlTag,child:null===(t=this.child)||void 0===t?void 0:t.toJSON().inlineHtml,customAttribute:null===(e=this.customAttribute)||void 0===e?void 0:e.toJSON().customAttribute,customClass:null===(n=this.customClass)||void 0===n?void 0:n.toJSON().customClass,customStyle:null===(s=this.customStyle)||void 0===s?void 0:s.toJSON().customStyle})}}}class ft extends q{handleAction(t,e){const n=e.parent.getAnnotationByType(u.LINK_GROUP);if(n){const s=e.annotationMap.get("LINK").link.groupKey,r=n.linkGroups.get(s);if(r){const i=r.indexOf(e);-1!==i&&(r.splice(i,1,...Array.isArray(t.splittedTextNodes)?t.splittedTextNodes:[t.splittedTextNodes]),n.linkGroups.set(s,r))}}}}class gt extends q{handleAction(t,e){const n=e.parent.getAnnotationByType(u.LINK_GROUP);if(n){const t=e.annotationMap.get(w.LINK).link.groupKey,s=n.linkGroups.get(t);if(s){const r=s.indexOf(e);-1!==r&&s.splice(r,1),0===s.length&&n.linkGroups.delete(t),0===n.linkGroups.size&&e.parent.annotationMap.delete(u.LINK_GROUP)}}e.annotationMap.delete(w.LINK)}}class xt extends R{constructor(t){super(),this.type=w.PLAIN_TEXT,this.plainText=!0,this.plainText=t}static from(t){return[w.PLAIN_TEXT,new xt(t)]}clone(){return new xt(this.plainText)}renderClass(){}renderStyle(){}toJSON(){return{plainText:this.plainText}}}class mt extends I{constructor(t,e,n,s){super(t,s),this.type=A.TEXT,this.parent=n,this.text=e,this.registerModifyStrategy()}static supportsHtmlTag(t){return["span","code"].includes(t)}static from(t,e,n={autoMatchFormat:!0}){const s=new mt(t.id,t.text,e),{annotations:r}=t;return r&&(s.annotationMap=this.generateTextAnnotationMap(r,n,e,s)),s}static generateTextAnnotationMap(t,e,n,s){return new Map(Object.keys(t).map((r=>("link"===r&&t.link&&n&&s&&n.apply(new z(t.link.groupKey,[s],"link")),this.createAnnotationEntity(r,t[r],e)))).filter(o))}static createAnnotationEntity(t,e,n){const s=!(!n||!n.autoMatchFormat);switch(t){case"bold":return P.from(e);case"italic":return j.from(e);case"underline":return M.from(e);case"strikethrough":return D.from(e);case"code":return F.from(e,s);case"textColor":return U.from(e);case"link":return G.from(e,s);case"inlineHtml":return pt.from(e);case"plainText":return xt.from(e)}return I.createAnnotationEntity(t,e)}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof R||t instanceof N||t instanceof pt)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}toHtml(){const t=this.getAnnotationByType(w.INLINE_HTML);return t?this.renderWithWrapperStr(t):this.renderTextStr()}cloneWithText(t){return new mt(a(),t,this.parent,super.cloneAnnotations())}clone(){return new mt(this.id,this.text,this.parent,super.cloneAnnotations())}isEmpty(){return!this.text||""===this.text||"\n"===this.text}isTextNode(){return!0}getRangeEndOffset(){return!this.isContentEditable()&&this.parent?this.parent.children.indexOf(this)+1:"\n"===this.text?0:this.text.length}getRangeContainer(){const t=g.getDOMByEntity(this);if(t)return this.isContentEditable()?t.firstChild:t.parentElement}isContentEditable(){return!0}registerModifyStrategy(){const t=this.constructor.name;mt.registerActionStrategyStatus[t]||(this.isContentEditable()&&(T.register(x.UPDATE_TEXT,t,new ht),T.register(x.REPLACE_SELECTED_TEXT,t,new dt),T.register(x.LINK_GROUP_NODE_SPLIT,t,new ft),T.register(it.name,t,new ct)),T.register(B.name,t,new Q),T.register(x.DELETE_LINK_GROUP,t,new gt),T.register($.name,t,new ct),mt.registerActionStrategyStatus[t]=!0)}doAnnotationActionApply(t){const e=this.getAnnotationByType(u.SELECTION_RANGE);if(t instanceof B&&t.doSplit&&e){const e=T.get(B.name,this.constructor.name);if(e){const n=e.execute(t,this);n&&this.applyActionToNode(n,t)}}else this.applyActionToNode(this,t);"function"==typeof this.parent.mergeNodes&&this.parent.mergeNodes(t)}doModifyActionApply(t){T.executeTheStrategy(t,this)}applyActionToNode(t,e){const n=e.toAnnotation();if(e instanceof X)return void this.syncUpSelectedNodes(t);n instanceof k||this.syncUpSelectedNodes(t);const s=T.get(e.constructor.name,t.constructor.name);if(s)return void s.execute(e,t);const r=T.get($.name,mt.name);r&&r.execute(e,t)}syncUpSelectedNodes(n){const r=g.getDOMByEntity(this);if(r){const i=e.getSubjectFromParentNodeByEventId(r,s);i&&t.notify(i,{node:n})}}renderWithWrapperStr(t){const{htmlTag:e,customAttribute:n,customClass:s,customStyle:r,child:i}=t,a=[...(null==n?void 0:n.toString())||[],null==s?void 0:s.toString(),null==r?void 0:r.toString()].filter(o),c=a.length>0?` ${a.join(" ")}`:"";return i?`<${e}${c}>${this.renderWithWrapperStr(i)}</${e}>`:`<${e}${c}>${this.renderTextStr()}</${e}>`}renderTextStr(){var t;const e=(null===(t=this.getAnnotationByType(w.CODE))||void 0===t?void 0:t.code)?"code":"span",n=super.generateAttributeString();return"\n"===this.text?"<br>":this.shouldRenderAsPlainText()?this.text:`<${e}${n}>${this.text}</${e}>`}shouldRenderAsPlainText(){const t=super.getAnnotationByType(w.PLAIN_TEXT);return!!t&&t.plainText&&0===Array.from(this.annotationMap.values()).filter((t=>t instanceof R&&!(t instanceof G)&&!(t instanceof xt)||t instanceof N)).length}}mt.registerActionStrategyStatus={},mt.htmlTag="span";class wt extends y{constructor(t){super(),this.type=x.APPEND_CHILDREN,this.entityToBeAppended=t}}class At extends f{constructor(t){super(),this.type=d.TEXT_STYLE,this.textStyle=t}static from(t){return[d.TEXT_STYLE,new At(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new At(this.textStyle)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.textStyle?`v-rte--text-style-${this.textStyle}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};switch(this.textStyle){case"paragraph":return e;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-4":return{fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-5":return{fontFamily:"Inter",fontSize:"14px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"};case"heading-6":return{fontFamily:"Inter",fontSize:"12px",lineHeight:"22px",fontWeight:"500",marginTop:"0px",marginBottom:"0px"}}}}class yt extends ${constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new At(this.textStyle)}}class Et extends y{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_AFTER,this.referChildren=t,this.childrenToBeInserted=e}}class Ot extends y{constructor(t){super(),this.type=x.REPLACE_CHILD_NODES,this.newChildNodes=t}}class St extends q{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,n){if(t){const s=t.text.slice(0,e),r=t.text.slice(e),i=n.children.indexOf(t);if(i>-1){const e=n.children.slice(0,i),o=n.children.slice(i+1);s&&e.push(t.cloneWithText(s)),r&&o.unshift(t.cloneWithText(r)),n.apply(new Ot(e));const a=n.cloneWithNodes(o);return n.parent.apply(new Et(n,a)),a}}}}class Tt extends q{handleAction(t,e){e.children=[],e.apply(new wt(t.newChildNodes))}}class Nt extends y{constructor(t){super(),this.type=x.DELETE_CHILDREN,this.entityToBeRemoved=t}}class Ct extends q{handleAction(t,e){const n=t.blockNeedToBeMerged;if(e.type===n.type||"image"!==e.type&&"image"!==n.type){let t=n.children;"image"!==n.type&&(t=n.children.filter((t=>t.text))),e.apply(new wt(t)),n.parent.apply(new Nt(n))}}}class vt extends q{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,n){if(t){const s=new mt(a(),"\n",n),r=t.text.slice(0,e),i=t.text.slice(e),o=n.children.indexOf(t);if(o>-1){const e=n.children.slice(0,o),a=n.children.slice(o+1);r&&e.push(t.cloneWithText(r)),i&&a.unshift(t.cloneWithText(i)),this.mergeLineBreakNodes(e,s,a,n)}return s}}mergeLineBreakNodes(t,e,n,s){(0===n.length||n[0]&&""===n[0].text)&&n.push(new mt(a(),"\n",s,t[t.length-1]&&t[t.length-1].annotationMap)),s.apply(new Ot([...t,e,...n]))}}class bt extends q{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=e.children,s=new mt(a(),"\n",e),r=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(n,s,r,e),s}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new Nt(t)))})),e}mergeLineBreakNodes(t,e,n,s){(0===n.length||n[0]&&""===n[0].text)&&n.push(new mt(a(),"\n",s,t[t.length-1]&&t[t.length-1].annotationMap)),s.apply(new Ot([...t,e,...n]))}}class _t extends y{constructor(t,...e){super(),this.type=x.INSERT_CHILDREN_BEFORE,this.referChildren=t,this.childrenToBeInserted=e}}class Lt extends y{constructor(t,e){super(),this.type=x.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class Rt extends ${constructor(t){super(),this.isFlushable=!0,this.textAlign=t}toAnnotation(){return new O(this.textAlign)}}class It extends q{handleAction(t,e){this.updateCustomStyleAnnotation(e,["textAlign"])}}class $t extends ${constructor(t){super(),this.isFlushable=!0,this.indent=t}toAnnotation(){return new S(this.indent)}}class Bt extends L{constructor(t,e,n){super(t),this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&(this.annotationMap=Bt.isAcceptableTextStyle(e)?new Map([At.from(e)]):new Map([At.from("paragraph")]))}static from(t,e={autoMatchFormat:!0}){var n,s;const r=new Bt(t.id,t.type,e),i=e.autoMatchFormat?Object.assign(Object.assign({},t.annotations),{textStyle:null!==(s=null===(n=t.annotations)||void 0===n?void 0:n.textStyle)&&void 0!==s?s:r.type}):t.annotations;return r.children=t.nodes.map((t=>{const n=V.getRTENodeClass(t.type);if(n)return n.from(t,r,e)})).filter(o),i&&super.convertAnnotationsToMap(r.annotationMap,i),r}static createAnnotationEntity(t,e){return"textStyle"===t?At.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.children=this.children.reduce(((e,n)=>{const s=e.at(-1);if(t instanceof it&&t.needMergeNode){const t=null==s?void 0:s.getAnnotationByType(w.LINK),r=n.getAnnotationByType(w.LINK);if(t&&r&&t.toEqual(r))return e}return[...e,n]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=this.getBlockTag(),n=super.generateAttributeString(),s=this.getAnnotationByType(u.LINK_GROUP);let r=this.children.map((t=>t.toHtml())).join("");return s&&this.children.length>0&&(r=this.generateLinkHtml(s,r,t)),super.shouldRenderAsInternalWrapper()?r:[`<${e}${n}>`,r,`</${e}>`].join("")}cloneWithNodes(t){const e=new Bt(a(),this.type);return e.annotationMap=super.cloneAnnotations(),e.apply(new wt(t)),e}clone(){const t=new Bt(this.id,this.type);return t.children=this.children.map((e=>{const n=e.clone();return n.parent=t,n})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}isNotEmpty(){return this.children.length>0&&this.children.some((t=>!t.isEmpty()))}getLastNode(){return this.children[this.children.length-1]}getBlockTag(){switch(this.type){case"title":case"subtitle":return"div";case"heading-1":return"h1";case"heading-2":return"h2";case"heading-3":return"h3";case"heading-4":return"h4";case"heading-5":return"h5";case"heading-6":return"h6";case"paragraph":default:return"p"}}doAnnotationActionApply(t){const e=T.get(t.constructor.name,Bt.name);e&&e.execute(t,this)}generateLinkHtml(t,e,n){e="";let s=[];for(let r=0;r<this.children.length;r++){const i=this.children[r].getAnnotationByType(w.LINK),o=this.children[r+1]?this.children[r+1].getAnnotationByType(w.LINK):null;if(i){if(s.push(this.children[r]),!o||i.link.groupKey!==o.link.groupKey){const r=t.toString(i,{standalone:!0,autoMatchFormat:null==n?void 0:n.autoMatchFormat});e+=[`<a${r?` ${r}`:""}>`,s.map((t=>t.toHtml())).join(""),"</a>"].join(""),s=[]}}else e+=this.children[r].toHtml()}return e}}T.register(yt.name,Bt.name,new class extends q{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.children.forEach(t.bold?t=>{const e=new Z(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new st(w.BOLD))}),this.updateCustomStyleAnnotation(e,["fontFamily","lineHeight","fontWeight","fontSize"])}}),T.register(Rt.name,Bt.name,new It),T.register($t.name,Bt.name,new class extends q{handleAction(t,e){this.updateCustomStyleAnnotation(e,["marginLeft"])}}),T.register(z.name,Bt.name,new class extends q{handleAction(t,e){let n=e.getAnnotationByType(u.LINK_GROUP);if("update_link"===t.type){if(n){const e=n.linkGroups.get(t.groupKey);e&&n.linkGroups.set(t.groupKey,[e[0]])}}else{if(n){const e=n.linkGroups.get(t.groupKey)||[];n.linkGroups.set(t.groupKey,[...e,...t.nodes])}else n=t.toAnnotation(),n.linkGroups.set(t.groupKey,[...t.nodes]);e.annotationMap.set(u.LINK_GROUP,n)}}}),T.register(x.UNLINK_LINK_GROUP,Bt.name,new class extends q{handleAction(t,e){const n=e.getAnnotationByType(u.LINK_GROUP);n&&(n.linkGroups.size>1?n.linkGroups.delete(t.groupKey):e.annotationMap.delete(u.LINK_GROUP))}}),T.register(x.SPLIT_BLOCK_WITH_NODE,Bt.name,new St),T.register(x.REPLACE_CHILD_NODES,Bt.name,new Tt),T.register(x.MERGE_TWO_BLOCKS_NODES,Bt.name,new Ct),T.register(x.LINE_BREAK_SINGLE_BLOCK,Bt.name,new vt),T.register(x.LINE_BREAK_MULTIPLE_BLOCKS,Bt.name,new bt),T.register(x.INSERT_IMAGE_TO_BLOCK,Bt.name,new class extends q{handleAction(t,e){const n=t.splitPointNode,s=t.startOffsetOfNode,r=t.imageBlockToBeInserted;if(this.isCaretPositionAtBlockEnd(e,n,s))e.parent.apply(new Et(e,r));else if(this.isCaretPositionAtBlockStart(e,n,s))e.parent.apply(new _t(e,r));else{const t=new Lt(n,s);e.apply(t),e.parent.apply(new Et(e,r))}}}),T.register(x.TRANSFORM_LIST_BLOCK,Bt.name,new class extends q{handleAction(t,e){const n=e.parent,s=n.createList(t.listType),r=t.selectedBlocks,i=r.map((t=>n.toListItem(t)));s.apply(new wt(i)),n.apply(new Et(t.selectedBlocks[0],s)),r.forEach((t=>{t.parent.apply(new Nt(t))}))}});class kt extends q{getPreviousNode(t){const e=t.parent,n=e.children.indexOf(t);if(n>0)return e.children[n-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parent,n=e.children.indexOf(t);if(e.children[n+1])return e.children[n+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parent,n=e.children.indexOf(t),s=e.parent;if(e.isListItemBlock()){const t=s.parent;return 0===n&&Array.isArray(s.children)&&s.children[0]===e&&"list-item"!==t.type&&Array.isArray(t.children)&&t.children[0]===s}return 0===n&&Array.isArray(s.children)&&s.children[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(e>0)return t.parent.children[e-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){return t.getLastNode()}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.children)return this.getBlockFirstNode(t.children[0])}else if(t.children)return t.children[0]}getNextBlock(t){if(t&&t.parent&&t.parent.children){const e=t.parent.children.indexOf(t);if(t.parent.children[e+1])return t.parent.children[e+1];if("list-item"===t.type&&t.parent.children.length===e+1)return this.getNextBlock(t.parent)}}}class Dt extends y{constructor(t,e){super(),this.isFlushable=!0,this.type=x.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class Mt extends ${constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new k(this.range)}}class jt extends I{constructor(){super(...arguments),this.type="decorator-node",this.isSelected=!1}static isDecoratorNodeContainerElement(t){return t&&t.classList.contains(jt.DECORATOR_CONTAINER_CLASS)}static getDecoratorNodeElement(t){return t.querySelector(`.${jt.DECORATOR_NODE_CLASS}`)}getRangeEndOffset(){return 1}getRangeContainer(){const t=g.getDOMByEntity(this);if(t)return h(t,`.${jt.DECORATOR_CONTAINER_CLASS}`)}isContentEditable(){return!1}}jt.DECORATOR_CONTAINER_CLASS="v-internal-decorator-container",jt.DECORATOR_NODE_CLASS="v-internal-decorator-node";class Pt extends jt{constructor(t,e,n,s){super(t),this.type=A.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parent=s,this.language=n}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}toHtml(){return`<code style='box-sizing: border-box;color: rgba(var(--v-text-primary, 32, 54, 69, 1));text-align: left;font-family: "Roboto Mono";font-weight: 400;line-height: 22px;font-size: 16px;white-space: pre-wrap;min-height: 22px;tab-size: 2px;'>${this.text}</code>`}clone(){return new Pt(this.id,this.text,this.language,this.parent)}doAnnotationActionApply(t){T.executeTheStrategy(t,this)}doModifyActionApply(t){T.executeTheStrategy(t,this)}}T.register(x.UPDATE_CODE_BLOCK,Pt.name,new class extends q{handleAction(t,e){const{content:n,language:s}=t;e.language=s,e.text=n}}),T.register(Mt.name,Pt.name,new class extends q{handleAction(t,e){e.annotationMap.set(u.SELECTION_RANGE,t.toAnnotation())}});var Ft;!function(t){t.CSS="css",t.HTML="html",t.JavaScript="js",t.JSX="jsx",t["Plain Text"]="plainText",t.TypeScript="ts",t.TSX="tsx"}(Ft||(Ft={}));class Ht extends q{handleAction(t,e){e.children=e.children.filter((e=>e!==t.entityToBeRemoved)),0===e.children.length&&"parent"in e&&e.parent&&(e.isListItemBlock()&&e.nestList&&e.nestList.length||e.parent.apply(new Nt(e)))}}class Wt extends L{constructor(t,e,n){super(t),this.type="code-block",this.children=[new Pt(`${t}-1`,e,n,this)]}static from(t){return new Wt(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.children[0];return{id:this.id,type:"code-block",content:e,language:t}}toHtml(){const{language:t=Ft["Plain Text"]}=this.children[0];return`<pre data-language="${t}" style="background-color: rgba(var(--v-bg-secondary, 245, 247, 247, 1)); padding: 12px">${this.children.map((t=>t.toHtml()))}</pre>`}clone(){const t=Wt.from(this.toJSON());return t.parent=this.parent,t}apply(s){if(s instanceof y&&T.executeTheStrategy(s,this),s.isFlushable){const s=g.getDOMByEntity(this);if(s){const r=e.getSubjectFromParentNodeByEventId(s,n);r&&t.notify(r,{})}}}isNotEmpty(){return!!this.children.length}getLastNode(){return this.children[0]}isSelected(){return this.children[0].annotationMap.has(u.SELECTION_RANGE)}}T.register(x.DELETE_CODE_BLOCK,Wt.name,new class extends kt{handleAction(t,e){const n=e.children[0],s=e.parent;if(s){let t=this.getPreviousNode(n),r=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(n),r=0),s.apply(new Nt(e));const i=t?g.getDOMByEntity(t):null;if(0===s.children.length){const n=Bt.from({id:a(),type:"paragraph",nodes:[{id:a(),type:"text",text:""}]});e.parent.apply(new wt([n])),t=n.children[0],r=0}this.notifyUpdateSelection(t,i,r,e)}}notifyUpdateSelection(n,r,i,o){const a=g.getDOMByEntity(o);if(a){const o=e.getSubjectFromParentNodeByEventId(a,s);o&&t.notify(o,{node:n,updateDirectly:!!r,offset:i})}}getRTENodeEndOffset(t){return t?t.getRangeEndOffset():0}}),T.register(x.DELETE_CHILDREN,Wt.name,new Ht),T.register(x.SWITCH_OUT_FROM_CODE_BLOCK,Wt.name,new class extends q{handleAction(n,r){const{content:i,language:o}=n,c=i.split("\n"),l=new Dt(c.slice(0,c.length-2).join("\n"),o);l.isFlushable=!1,r.children[0].apply(l);const h=Bt.from({id:a(),type:"paragraph",nodes:[{id:a(),text:"",type:"text"}]});r.parent.apply(new Et(r,h));const u=g.getDOMByEntity(r);if(u){const n=e.getSubjectFromParentNodeByEventId(u,s);n&&t.notify(n,{node:h.children[0]})}}}),T.register(x.INSERT_IMAGE_TO_BLOCK,Wt.name,new class extends q{handleAction(t,e){e.parent.apply(new Et(e,t.imageBlockToBeInserted))}}),Wt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{rt as $,T as A,vt as B,b as C,Lt as D,It as E,kt as F,Ht as G,Rt as H,Et as I,I as J,Ft as K,it as L,y as M,R as N,u as O,m as P,Dt as Q,V as R,X as S,Mt as T,ut as U,J as V,B as W,U as X,Pt as Y,K as Z,Z as _,mt as a,at as a0,yt as a1,At as a2,P as a3,et as a4,nt as a5,ot as a6,$t as a7,x as b,q as c,Bt as d,wt as e,bt as f,St as g,Tt as h,Ct as i,Nt as j,_t as k,f as l,d as m,L as n,v as o,C as p,Wt as q,W as r,g as s,H as t,w as u,jt as v,A as w,N as x,$ as y,Ot as z}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{V as t,I as e,c as s,M as i}from"./p-6e1ab235.js";import{c as r}from"./p-02841589.js";import{C as o}from"./p-2d0d575f.js";import{O as n}from"./p-331a62d5.js";import{U as a,c as l,d as h,b as c,e as d,F as u,f,g as m}from"./p-8a877e12.js";import{f as p,d as v}from"./p-575235c8.js";import{i as b,g as R}from"./p-a4670e23.js";import{c as g}from"./p-6a334573.js";import{d as j,D as y}from"./p-2ee4def0.js";import{d as w,e as O}from"./p-0e954b9b.js";import{V as E}from"./p-bf0ced3c.js";import{P as V}from"./p-7d9cd9c8.js";import{I as F}from"./p-abd7aeaa.js";import{M as I}from"./p-78a57a17.js";import{A as C}from"./p-52b8f2d2.js";import{i as S}from"./p-d27ae9ff.js";import{S as A}from"./p-bdd9ef3b.js";class k{constructor(t){this.rule=t}getStatus(t,e,s){return{canEvaluate:this.rule.canEvaluate(t,e,s),isAsync:b(this.rule.evaluate)}}shouldShowError(t,e){try{return this.rule.shouldShowError?this.rule.shouldShowError(t,e):this.defaultShouldShowError(t)}catch(t){return!1}}handle(t){try{return this.rule.evaluate(t)}catch(t){return{isValid:!0,message:""}}}defaultShouldShowError(t){return!t.disabled&&t.visible&&(t.touched||t.modified)}}class T{constructor(){this.handlers=[],this.processId=""}checkIncludesAsyncRuleHandler(t,e,s){return!!this.handlers.find((i=>{const r=i.getStatus(t,e,s);return r.canEvaluate&&r.isAsync}))}setHandlersByRules(t){this.handlers=t&&t.length?t.map((t=>new k(t))):[]}async process(t,e,s,i,r){const o=this.preProcess();let n;for(const i of this.handlers){if(o!==this.processId)break;const r=i.getStatus(t,e,s);if(!r.canEvaluate)continue;let a;if(r.isAsync)try{a=await i.handle(t)}catch(t){}else a=i.handle(t);if(a&&!a.isValid){const t=i.shouldShowError(e,s);n=Object.assign(Object.assign({},a),{shouldShowError:t});break}}return this.postProcess(o,i,n,r),n?{isValid:!1,message:n.message}:{isValid:!0,message:""}}preProcess(){const t=R();return this.processId=t,t}postProcess(t,e,s,i){this.processId===t&&i(e,s)}}class L{run(t){const e=t.nextElementSibling;return e&&e.querySelector(".vega-error")?e.querySelector(".vega-error"):null}}class D{run(t){let e=t.nextElementSibling;return e&&!e.classList.contains("vega-error")&&(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class M{run(t){let e=t.nextElementSibling;return e||(e=document.createElement("label"),e.classList.add("vega-error"),e.setAttribute("part","field-error-message"),t.after(e)),e}}class B extends t{getTranslatedMessage(t){return"string"==typeof t?E.t(t):E.t(t.key,...t.args||[])}}var H=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class U extends t{constructor(){super(),this.formFieldMessageTranslatorSlimmer=new B,this.fieldErrorUiControllerStrategies=[new L,new D,new M],this.initTranslationObserver()}applyInputInvalidUI(t){const e=this.getInputElementContainer();if(o.notify(j.getSubject(this.host,w),{host:this.host,showError:!0}),e&&(e.classList.add("error"),t)){this.errorMessage=t;const s=this.getErrorContainer(e);s.innerHTML=this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(t),s.classList.remove("vega-hidden")}}resetInputInvalidUI(){this.errorMessage="";const t=this.getInputElementContainer();t&&(this.getErrorContainer(t).classList.add("vega-hidden"),t.classList.remove("error"),o.notify(j.getSubject(this.host,w),{host:this.host,showError:!1}))}getInputElementContainer(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}getErrorContainer(t){for(const e of this.fieldErrorUiControllerStrategies){const s=e.run(t);if(s)return s}}initTranslationObserver(){const t=new n(this.isAcceptableTranslationObserver.bind(this),(()=>{if(!this.errorMessage)return;const t=this.getInputElementContainer();if(t){const e=this.getErrorContainer(t);e&&(e.innerHTML=this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(this.errorMessage))}}));o.register(a,t)}isAcceptableTranslationObserver(){return!0}}H([e()],U.prototype,"formFieldMessageTranslatorSlimmer",void 0),H([s()],U.prototype,"host",void 0),H([s()],U.prototype,"options",void 0);var x=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class G{constructor(t,e,s,i){var r,n;this.formFieldMessageTranslatorSlimmer=new B,this.fieldErrorUIController=new U,this.resizeObserverSlimmer=g(G,V,[],[{mapFrom:"connectResizeObserver",mapTo:"connectResizeObserver"}],[{callback:t=>{const e=this.isVisible,s=t[0].contentRect.height>0;this.isVisible=s,this.isAutoValidationEnabled()&&p(this.host,"vega-form")&&e!==s&&this.valid(["visible"])},target:()=>this.host}]),this.defaultRules=[],this.additionalRules=[],this.listeners=[],this.isTouched=!1,this.isModified=!1,this.isVisible=!1,this.formFieldValidationRuleHandlerChain=new T,this.hostChildAddedBlurEventMap=new WeakMap,this.handleValidationResult=(t,e)=>{let s=!0;return e?("rule"===t?e.shouldShowError?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI():t?this.fieldErrorUIController.applyInputInvalidUI(e.message):this.fieldErrorUIController.resetInputInvalidUI(),s=!1):this.fieldErrorUIController.resetInputInvalidUI(),this.invokeListeners(s),o.notify(l,{host:this.host,detail:s}),s},this.setupTouchedListener=()=>{this.getTouchableAreaElements().filter((t=>t&&!0!==this.hostChildAddedBlurEventMap.get(t))).forEach((t=>{t.addEventListener("blur",(()=>{this.updateIsTouched(!0)})),this.hostChildAddedBlurEventMap.set(t,!0)}))},this.defaultRules=t||[],this.host=e,this.defaultValue=s,this.options=i,this.initDisabledAttrObserver(),this.connectResizeObserver(),this.initFormResetObserver(),null===(n=(r=this.host).componentOnReady)||void 0===n||n.call(r).then((()=>{this.didRender()})),this.setupModifiedListener(),this.listenHostElementKeydown(),this.updateValidationHandlers()}async validate(t){return await this.valid([],t)}addListener(t){this.listeners.push(t)}getRules(){const t=[...this.additionalRules];return[...this.defaultRules.map((e=>this.overrideDefaultRuleByAdditionalRule(e,t))),...t]}setDefaultRules(t){this.defaultRules=t,this.updateValidationHandlers()}setAdditionalRules(t){this.additionalRules=t,this.updateValidationHandlers()}destroy(){o.notify(h,{host:this.host}),this.unregisterFormResetObserver(),o.unregister(c,this.hostValueChangeObserver),this.hostChildrenObserver&&this.hostChildrenObserver.disconnect()}connectResizeObserver(){}updateDisableBlurValidation(t){this.disableBlurValidation=t}updateValidationHandlers(){this.formFieldValidationRuleHandlerChain.setHandlersByRules(this.getRules())}async valid(t,e="rule"){const s=this.getStatus(),i=this.host.value;this.formFieldValidationRuleHandlerChain.checkIncludesAsyncRuleHandler(i,s,t)&&o.notify(l,{host:this.host,detail:null});const{isValid:r,message:n}=await this.formFieldValidationRuleHandlerChain.process(i,s,t,e,this.handleValidationResult);return{isValid:r,message:this.formFieldMessageTranslatorSlimmer.getTranslatedMessage(n)}}invokeListeners(t){this.listeners.forEach((e=>e.callback(t)))}getStatus(){return{touched:this.isTouched,modified:this.isModified,disabled:this.host.disabled,visible:this.isVisible}}updateIsTouched(t){const e=this.isTouched;this.isTouched=t,!this.disableBlurValidation&&this.isAutoValidationEnabled()&&this.valid(e===t?[]:["touched"])}updateIsModified(t){const e=this.isModified;this.isModified=t,this.isAutoValidationEnabled()&&this.valid(e===t?[]:["modified"])}initDisabledAttrObserver(){this.disabledAttrObserver=new MutationObserver((()=>{this.isAutoValidationEnabled()&&this.valid(["disabled"])})),this.disabledAttrObserver.observe(this.host,{attributes:!0,attributeFilter:["disabled"]})}canAcceptFormResetOperation(t){return p(this.host,"vega-form")===t.host}unregisterFormResetObserver(){o.unregister(d,this.formResetTriggeredObserver)}monitorTouchedListener(){const t=this.getInputContainerElements();t&&(this.hostChildrenObserver=new MutationObserver((()=>{this.setupTouchedListener()})),this.hostChildrenObserver.observe(t,{childList:!0,subtree:!0})),this.setupTouchedListener()}getTouchableAreaElements(){return this.options&&this.options.touchableAreaGetter?this.options.touchableAreaGetter():[]}getInputContainerElements(){return this.options&&this.options.inputContainerGetter?this.options.inputContainerGetter():null}setupModifiedListener(){this.hostValueChangeObserver=new n(this.isCurrentTarget.bind(this),(()=>this.updateIsModified(!0))),o.register(c,this.hostValueChangeObserver)}isCurrentTarget(t){return this.host===t.host}async reset(t){var e,s;if(this.shouldVisitElement(this.host,null===(e=t.option)||void 0===e?void 0:e.skipDisabled,null===(s=t.option)||void 0===s?void 0:s.skipInvisible)){const e=t.defaultValueMap,s=this.host.dataset.vegaForm,i=null==e[s]?this.getDefaultValue():e[s];"function"==typeof this.host.setValue?await this.host.setValue(i):this.host.value=i,this.isTouched=!1,this.isModified=!1,this.fieldErrorUIController.resetInputInvalidUI()}}getDefaultValue(){return this.defaultValue instanceof Function?this.defaultValue(this.host):this.defaultValue}didRender(){this.monitorTouchedListener()}initFormResetObserver(){this.formResetTriggeredObserver=new n(this.canAcceptFormResetOperation.bind(this),this.reset.bind(this)),o.register(d,this.formResetTriggeredObserver)}isAutoValidationEnabled(){return!1!==this.host.autoValidation}shouldVisitElement(t,e,s){return!(!t.dataset.vegaForm||e&&t.disabled||s&&!v(t))}listenHostElementKeydown(){this.host.addEventListener("keydown",(t=>{this.canSubmitFormByEvent(t)&&o.notify(u,{host:this.host})}))}canSubmitFormByEvent(t){const e="Enter"===t.key||13===t.keyCode,s=e&&t.shiftKey;switch(this.host.tagName){case"VEGA-TEXTAREA":case"VEGA-DATE-PICKER":case"VEGA-TIME-PICKER":return s&&t.preventDefault(),s;case"VEGA-RICH-TEXT-EDITOR":return!1;default:return e}}overrideDefaultRuleByAdditionalRule(t,e){if(t&&e){const s=e.findIndex((e=>e instanceof F&&e instanceof t.constructor&&e.overrideDefault));if(s>-1)return e.splice(s,1)[0]}return t}}x([e()],G.prototype,"formFieldMessageTranslatorSlimmer",void 0),x([e()],G.prototype,"fieldErrorUIController",void 0),x([e()],G.prototype,"resizeObserverSlimmer",void 0);var P=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class W extends t{constructor(){super(...arguments),this.fieldErrorUIController=new U,this.handleFieldErrorMessageUpdate=t=>{const{message:e,isValid:s}=t;s?this.fieldErrorUIController.resetInputInvalidUI():this.fieldErrorUIController.applyInputInvalidUI(e)}}handleComponentWillLoadByFieldErrorSlimmer(){this.fieldErrorMessageChangeObserver=new n(this.canAcceptFieldErrorMessageUpdate.bind(this),this.handleFieldErrorMessageUpdate),o.register(f,this.fieldErrorMessageChangeObserver)}handleUnregisterObserver(){o.unregister(f,this.fieldErrorMessageChangeObserver)}canAcceptFieldErrorMessageUpdate(t){const{host:e}=t,s=this.host.parentElement;return s&&s===e&&"VEGA-FIELD-ERROR"===s.tagName||this.host===e}}P([s()],W.prototype,"host",void 0),P([s()],W.prototype,"options",void 0),P([e()],W.prototype,"fieldErrorUIController",void 0),P([i("setInjectFormFieldHelper")],W.prototype,"handleComponentWillLoadByFieldErrorSlimmer",null),P([i("disconnectedCallback")],W.prototype,"handleUnregisterObserver",null);var z=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class K extends t{constructor(){super(...arguments),this.handleValidInvocation=async t=>{if(this.validator){void 0!==t.timerId&&clearTimeout(t.timerId);const e=await this.validator.validate(t.message);if(e){const{isValid:s,message:i}=e;"function"==typeof t.promiseResolve&&t.promiseResolve({isValid:s,message:i})}}}}registerValidInvocationObserver(){y.addUniqueObserverToNode(this.host,O,this.handleValidInvocation)}handleUnregisterObserver(){y.removeUniqueObserverFromNode(this.host,O)}}z([s()],K.prototype,"host",void 0),z([s()],K.prototype,"validator",void 0),z([i("setInjectFormFieldHelper")],K.prototype,"registerValidInvocationObserver",null),z([i("disconnectedCallback")],K.prototype,"handleUnregisterObserver",null);var N=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class X extends A{constructor(){super({parent:"vega-form",subStates:[{subStateName:"disableBlurValidation",parentStateName:"disableBlurValidation",callback:t=>{var e;null===(e=this.validator)||void 0===e||e.updateDisableBlurValidation(t)}}]})}componentWillLoad(){super.componentWillLoad()}}N([s()],X.prototype,"host",void 0),N([s()],X.prototype,"validator",void 0),N([i("setInjectFormFieldHelper")],X.prototype,"componentWillLoad",null);var q=function(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n};class J extends t{constructor(t){super(),this.fieldErrorSlimmer=new W,this.formFieldValidInvokeSlimmer=new K,this.formFormStateController=new X,this.mutationObserverCallBack=()=>{this.validator&&(this.setDefaultRules(),this.internalValidate())},this.options=t,this.setMutationObserverSlimmer()}connectedCallback(){null===this.validator&&this.setInjectFormFieldHelper()}disconnectedCallback(){this.validator&&(this.validator.destroy(),this.validator=null)}componentDidLoad(){}static isValidFormField(t){return t&&Boolean(t.getAttribute("data-vega-form"))}watchValidationRulesByFormControllerSlimmer(t,e){S(t,e,!1,((t,e)=>t===e?0:-1))||(this.setAdditionalRules(),this.internalValidate())}setInjectFormFieldHelper(){if(J.isValidFormField(this.host)){const{defaultValue:t}=this.options,e=new G(this.getPropertyRules(),this.host,t,this.options);e.addListener({callback:t=>{this.isValid!=t&&(this.isValid=t,o.notify(m,{host:this.host,detail:t}))}}),this.validator=e,this.setAdditionalRules()}}setAdditionalRules(){this.options.validationRulesName&&"validationRules"===this.options.validationRulesName&&this.validator&&this.validator.setAdditionalRules(this.validationRules||[])}setDefaultRules(){this.validator&&this.validator.setDefaultRules(this.getPropertyRules())}getPropertyRules(){const{propertyRules:t,attributeGetter:e}=this.options;return t.map((t=>{const s=t.dependence&&"string"==typeof t.dependence?[e(t.dependence)]:Array.isArray(t.dependence)?t.dependence.map((t=>e(t))):[null];return t.ruleFactory(e(t.propertyName),...s)})).filter(Boolean)}internalValidate(){!this.disabled&&this.validator&&this.validator.validate()}setMutationObserverSlimmer(){this.mutationObserverSlimmer=new I({options:{attributeFilter:this.options.propertyRules.map((t=>r(t.propertyName))),attributeOldValue:!0},mutationFilter:C(),callback:this.mutationObserverCallBack})}}q([s()],J.prototype,"host",void 0),q([s({writable:!0})],J.prototype,"validationRules",void 0),q([s()],J.prototype,"disabled",void 0),q([s()],J.prototype,"autoValidation",void 0),q([s({writable:!0})],J.prototype,"isValid",void 0),q([e()],J.prototype,"fieldErrorSlimmer",void 0),q([e()],J.prototype,"formFieldValidInvokeSlimmer",void 0),q([e()],J.prototype,"mutationObserverSlimmer",void 0),q([e()],J.prototype,"formFormStateController",void 0),q([i("connectedCallback")],J.prototype,"connectedCallback",null),q([i("disconnectedCallback")],J.prototype,"disconnectedCallback",null),q([i("componentDidLoad")],J.prototype,"componentDidLoad",null),q([i("watchValidationRules")],J.prototype,"watchValidationRulesByFormControllerSlimmer",null),q([i("componentWillLoad")],J.prototype,"setInjectFormFieldHelper",null);export{J as F}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{J as t,v as s,s as i}from"./p-c6a354b1.js";import{i as h}from"./p-575235c8.js";class e{constructor(t,s,i=0,h=0,e,n,r){this._startOffset=0,this._endOffset=0,this._startContainer=t,this._endContainer=s,this._startOffset=i,this._endOffset=h,this._startNode=e,this._endNode=n,r&&(this._oldNativeRange=r)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(s,i){const{startOffset:h,endOffset:n}=s;this._startOffset=h,this._endOffset=n;const r=s.startNode,o=s.endNode;if(r instanceof t){this._startNode=r,this._endNode=o;const t=this._startNode.getRangeContainer(),s=this._startNode===this._endNode?t:this._endNode.getRangeContainer();t&&(this._startContainer=t,this._endContainer=s)}else this._startContainer=r,this._endContainer=o,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),i&&(this._oldNativeRange=i);return new e(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new e(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){let t=null;if(this._startNode){const s=this._startNode.getRangeContainer(),i=this._startNode===this._endNode?s:this._endNode.getRangeContainer();if(s&&i)return t=new Range,t.setStart(s,this._startOffset),t.setEnd(i,this._endOffset),this._startContainer=s,this._endContainer=i,this._oldNativeRange=t,t}if(!t&&this._oldNativeRange)return this._oldNativeRange}getRTENodeByElement(t){if(t){const e=t.nodeType===Node.TEXT_NODE?t.parentElement:h(t)&&s.isDecoratorNodeContainerElement(t)?s.getDecoratorNodeElement(t):t;return i.getEntityByDOM(e)}}}export{e as R}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as e,F as t,r as i,c as n,H as s,g as o}from"./p-48a58baf.js";import{s as a}from"./p-519a7d55.js";import{c as r,V as l,M as c,I as d}from"./p-6e1ab235.js";import{V as h,I as g}from"./p-d849e0f5.js";import{c as m}from"./p-3cdbee7e.js";import{f as p}from"./p-2ee4def0.js";import{P as f}from"./p-7d9cd9c8.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-f1436035.js";import"./p-b75ee3ba.js";import"./p-331a62d5.js";import"./p-575235c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";var v=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class x extends l{render(){var t;return e("div",{class:"vega-segment-control-container"},null===(t=this.segments)||void 0===t?void 0:t.map((e=>this.segmentRenderer.render(e))))}}v([r()],x.prototype,"segments",void 0),v([r()],x.prototype,"segmentRenderer",void 0);var b=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class u extends l{componentWillLoad(){this.setDefaultSelected()}watchSegments(){this.setDefaultSelected()}watchSelected(){this.changeEventEmitter.emit(this.selected)}setSelected(e){this.selected=e.key}setDefaultSelected(){var e;(null===(e=this.segments)||void 0===e?void 0:e.length)>0&&!this.segments.find((e=>e.key===this.selected))&&(this.selected=this.segments[0].key)}}b([r({writable:!0})],u.prototype,"selected",void 0),b([r()],u.prototype,"segments",void 0),b([r()],u.prototype,"changeEventEmitter",void 0),b([c("componentWillLoad")],u.prototype,"componentWillLoad",null),b([c("watchSegments")],u.prototype,"watchSegments",null),b([c("watchSelected")],u.prototype,"watchSelected",null);var w=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class j extends l{watchSegments(){this.setIsOverflowBlockSegments()}watchBlock(){this.setIsOverflowBlockSegments()}watchSize(){this.setIsOverflowBlockSegments()}setIsOverflowBlockSegments(){this.isOverflowBlockSegments=this.isExceedContainerWidth()}isExceedContainerWidth(){if(this.block){const e=this.host.shadowRoot.querySelector(".vega-segment-control-container");return e.clientWidth<e.children.length*j.SEGMENTS_OVERFLOW_THRESHOLD[this.size]+4*(e.children.length-1)+5}return!1}}j.SEGMENTS_OVERFLOW_THRESHOLD={medium:101.9,small:82},w([r()],j.prototype,"host",void 0),w([r()],j.prototype,"block",void 0),w([r()],j.prototype,"size",void 0),w([r({writable:!0})],j.prototype,"isOverflowBlockSegments",void 0),w([c("watchSegments")],j.prototype,"watchSegments",null),w([c("watchBlock")],j.prototype,"watchBlock",null),w([c("watchSize")],j.prototype,"watchSize",null);var y=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};class S extends l{render(t){return e("button",{key:t.key,class:{"vega-segment":!0,selected:this.selected===t.key,disabled:t.disabled,[`${this.size}`]:!0},onClick:()=>this.selectedController.setSelected(t),disabled:t.disabled},this.renderSegments(t))}renderSegments(i){return e(t,null,(this.isOverflowBlockSegments||!this.isOverflowBlockSegments&&"text-only"!==this.variant)&&i.icon&&this.renderIcon(i),(this.isOverflowBlockSegments&&!i.icon||!this.isOverflowBlockSegments&&"icon-only"!==this.variant)&&i.text&&this.renderText(i))}renderIcon(t){return e("vega-tooltip",{text:t.text,trigger:t.text&&(this.isOverflowBlockSegments||!this.isOverflowBlockSegments&&"icon-only"===this.variant)?"hover":"none",placement:["bottom","top"],disableInteractive:!1},e("vega-icon",{icon:t.icon,size:"size-16"}))}renderText(t){return e("vega-text",{overflow:"ellipsis",tooltip:{placement:["bottom","top"]}},t.text)}}y([r()],S.prototype,"host",void 0),y([r()],S.prototype,"size",void 0),y([r()],S.prototype,"selected",void 0),y([r()],S.prototype,"variant",void 0),y([r()],S.prototype,"block",void 0),y([r()],S.prototype,"isOverflowBlockSegments",void 0),y([r()],S.prototype,"selectedController",void 0);var k=function(e,t,i,n){var s,o=arguments.length,a=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,n);else for(var r=e.length-1;r>=0;r--)(s=e[r])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const R=class{constructor(e){i(this,e),this.vegaChange=n(this,"vegaChange",7),this.change=n(this,"change",7),this.globalSlimmers={},this.segmentControlRenderer=new x,this.segmentOverflowController=new j,this.segmentRenderer=new S,this.selectedController=new u,this.changeEventEmitter=m(R,p),this.pageResizeObserverSlimmer=new f({callback:()=>{this.segmentControlWidth=this.host.clientWidth,this.segmentOverflowController.setIsOverflowBlockSegments()},shouldTrigger:()=>this.host.clientWidth!==this.segmentControlWidth}),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.segmentControlWidth=0,this.isOverflowBlockSegments=!1,this.block=!1,this.size="medium",this.segments=[],this.variant="default"}watchBlock(){}watchSize(){}watchSegments(){}watchSelected(){}componentWillLoad(){}render(){return a(e(s,{class:{"vega-segment-control-block":this.block}},this.segmentControlRenderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{block:["watchBlock"],size:["watchSize"],segments:["watchSegments"],selected:["watchSelected"]}}};k([g()],R.prototype,"globalSlimmers",void 0),k([d()],R.prototype,"segmentControlRenderer",void 0),k([d()],R.prototype,"segmentOverflowController",void 0),k([d()],R.prototype,"segmentRenderer",void 0),k([d()],R.prototype,"selectedController",void 0),k([d()],R.prototype,"changeEventEmitter",void 0),k([d()],R.prototype,"pageResizeObserverSlimmer",void 0),k([d()],R.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),R.style=':host{display:inline-block}.vega-segment-control-container{display:flex;gap:4px;border-radius:9999px;background-color:rgba(var(--v-bg-segment-control, 89, 96, 99, 0.1));padding:3px}:host(.vega-segment-control-block){display:block}:host(.vega-segment-control-block) .vega-segment{flex-basis:0;flex-grow:1}.vega-segment{display:flex;align-items:center;justify-content:center;gap:8px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));border-radius:9999px;cursor:pointer;text-align:center;border-width:1px;border-style:solid;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-color:transparent}.vega-segment vega-icon{vertical-align:middle}.vega-segment.medium{padding-left:24px;padding-right:24px;padding-top:8px;padding-bottom:8px;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-segment.medium{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-segment.medium{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-segment.medium{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}.vega-segment.small{padding-left:16px;padding-right:16px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;padding-top:3px;padding-bottom:3px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-segment.small{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-segment.small{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-segment.small{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px}}.vega-segment.disabled{color:rgba(var(--v-text-disabled, 176, 180, 181, 1));pointer-events:none}.vega-segment:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-segment:hover{background-color:rgba(var(--v-bg-segment-hover, 205, 209, 211, 1))}.vega-segment.selected{background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1))}';export{R as vega_segment_control}
|