@globalpayments/vega 2.103.0 → 2.104.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-85986306.js → app-globals-bc84b09b.js} +10 -10
- package/dist/cjs/{code-block-72de6c4d.js → code-block-7340d2b7.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-23d2b3d8.js → component-value-history-controller-slimmer.abstract-dd834f8d.js} +3 -3
- package/dist/cjs/{content-state-ff40bdc6.js → content-state-dde1253f.js} +2 -2
- package/dist/cjs/{date-required-rule-608e704b.js → date-required-rule-5e6777cf.js} +1 -1
- package/dist/cjs/{design-token-a101a8d0.js → design-token-b28d222d.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-b93cc564.js → element-appender-slimmer-a87bc0ce.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-124d54ea.js → form-field-controller-slimmer-007d10db.js} +1 -1
- package/dist/cjs/{image-annotation-action-1ee41bc7.js → image-annotation-action-715bece3.js} +2 -2
- package/dist/cjs/{image-extension-6a92c524.js → image-extension-cc8f36a1.js} +5 -5
- package/dist/cjs/index.cjs.js +17 -17
- package/dist/cjs/{inject-keyboard-manager-32d7dd0e.js → inject-keyboard-manager-1a113d04.js} +1 -1
- package/dist/cjs/{internal-calendar-period-factory-c3198ea7.js → internal-calendar-period-factory-bf5e8294.js} +1 -1
- package/dist/cjs/{internal-translation-controller-0d67ca4d.js → internal-translation-controller-b5bbefc9.js} +4 -0
- package/dist/cjs/{keyboard-manager-332eec89.js → keyboard-manager-d0271450.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-a2872981.js → keyboard-manager-slimmer-5a4c0e4c.js} +1 -1
- package/dist/cjs/{legend-input-processor-ce9b38f8.js → legend-input-processor-bd36a794.js} +28 -0
- package/dist/cjs/{link-extension-1b4ed437.js → link-extension-953fb2a0.js} +3 -3
- package/dist/cjs/loader.cjs.js +11 -11
- package/dist/cjs/{month-view-generator-b6a2b8be.js → month-view-generator-b68bcf4b.js} +1 -1
- package/dist/cjs/{public-rules-2066613c.js → public-rules-8bfc6de7.js} +7 -7
- package/dist/cjs/{range-712fe703.js → range-4060b238.js} +1 -1
- package/dist/cjs/{responsive-format-facade-44d33457.js → responsive-format-facade-fed434ed.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-1aa75d22.js → rich-text-editor-required-rule-16e74e91.js} +1 -1
- package/dist/cjs/{split-cell-operation-afc82323.js → split-cell-operation-430e9f27.js} +3 -3
- package/dist/cjs/{state-border-formatter-49984fd6.js → state-border-formatter-b469de2f.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-bd563c01.js → string-format-strategy.abstract-b3174863.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-4faebac9.js → string-input-formatter-slimmer-ceb678e9.js} +1 -1
- package/dist/cjs/{string-mask-strategy-624c4398.js → string-mask-strategy-5f84e2f6.js} +2 -2
- package/dist/cjs/{style-formatter-151d89a3.js → style-formatter-e98caf3c.js} +2 -2
- package/dist/cjs/{time-required-rule-8cd8f9b9.js → time-required-rule-249cb6b6.js} +1 -1
- package/dist/cjs/{token-extension-72d0cb08.js → token-extension-f074902b.js} +8 -8
- package/dist/cjs/{translation-slimmer-1771d01f.js → translation-slimmer-b60d598e.js} +1 -1
- package/dist/cjs/{type-guard-cce6fe1f.js → type-guard-8eb40609.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-b13c2fc4.js → valid-credit-card-number-rule-f5d2b2c6.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-bar-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-dialog_2.cjs.entry.js +10 -5
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +21 -12
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +6 -6
- package/dist/cjs/vega-input-numeric.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-passcode.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +6 -6
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-line-chart.cjs.entry.js +2 -2
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-pie-chart.cjs.entry.js +1 -1
- package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-bookmark-editor.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +6 -6
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +14 -14
- package/dist/cjs/vega-rich-text-find-replace-panel.cjs.entry.js +1 -1
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +4 -4
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +6 -6
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +11 -11
- package/dist/cjs/{y-axis-input-processor-d3a3839c.js → y-axis-input-processor-9ba96716.js} +1 -1
- package/dist/collection/components/vega-dialog/vega-dialog.js +7 -2
- package/dist/collection/components/vega-image-uploader/slimmers/controllers/vega-image-uploader-remove-controller.js +6 -3
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.js +6 -3
- package/dist/collection/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-uploading-content-renderer.js +4 -1
- package/dist/collection/helpers/translation/locales/en.js +4 -0
- package/dist/collection/polyfill/d3/d3-shape-polyfill.js +28 -0
- package/dist/esm/{app-globals-8cdfc5c9.js → app-globals-8541b3dc.js} +10 -10
- package/dist/esm/{code-block-9360c331.js → code-block-c16c69a5.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-9ea58806.js → component-value-history-controller-slimmer.abstract-1cea9add.js} +3 -3
- package/dist/esm/{content-state-67a12e74.js → content-state-73664d93.js} +2 -2
- package/dist/esm/{date-required-rule-66b5bf02.js → date-required-rule-14131e09.js} +1 -1
- package/dist/esm/{design-token-acd1efeb.js → design-token-4b81bae7.js} +3 -3
- package/dist/esm/{element-appender-slimmer-7e5bc1e9.js → element-appender-slimmer-9094aa07.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-d653c494.js → form-field-controller-slimmer-aaea8aaf.js} +1 -1
- package/dist/esm/{image-annotation-action-9525be48.js → image-annotation-action-86052c2e.js} +2 -2
- package/dist/esm/{image-extension-aea75132.js → image-extension-04843995.js} +5 -5
- package/dist/esm/index.js +17 -17
- package/dist/esm/{inject-keyboard-manager-f6522d2f.js → inject-keyboard-manager-1a950408.js} +1 -1
- package/dist/esm/{internal-calendar-period-factory-261df2f2.js → internal-calendar-period-factory-14c000cf.js} +1 -1
- package/dist/esm/{internal-translation-controller-3637e47e.js → internal-translation-controller-6eb30c39.js} +4 -0
- package/dist/esm/{keyboard-manager-53e8d8d0.js → keyboard-manager-e7add1f3.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-b3de042d.js → keyboard-manager-slimmer-ffe6588a.js} +1 -1
- package/dist/esm/{legend-input-processor-3b2de4b7.js → legend-input-processor-bd91524a.js} +28 -0
- package/dist/esm/{link-extension-57ba9520.js → link-extension-caabb7d8.js} +3 -3
- package/dist/esm/loader.js +11 -11
- package/dist/esm/{month-view-generator-15215a09.js → month-view-generator-0dad54d9.js} +1 -1
- package/dist/esm/{public-rules-c77a1550.js → public-rules-76247d91.js} +7 -7
- package/dist/esm/{range-3c74e1c8.js → range-c0aec697.js} +1 -1
- package/dist/esm/{responsive-format-facade-1b325d06.js → responsive-format-facade-1a9177b9.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-cfd32ba2.js → rich-text-editor-required-rule-65e18ef0.js} +1 -1
- package/dist/esm/{split-cell-operation-85a036f9.js → split-cell-operation-814641f5.js} +3 -3
- package/dist/esm/{state-border-formatter-ce3495b0.js → state-border-formatter-31f3145a.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-8ce04558.js → string-format-strategy.abstract-a8612297.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-0d60ba7d.js → string-input-formatter-slimmer-8f2aa95a.js} +1 -1
- package/dist/esm/{string-mask-strategy-cabc1d50.js → string-mask-strategy-e8bad1c6.js} +2 -2
- package/dist/esm/{style-formatter-00fe4f1c.js → style-formatter-42e87858.js} +2 -2
- package/dist/esm/{time-required-rule-57ceeae9.js → time-required-rule-fcab062e.js} +1 -1
- package/dist/esm/{token-extension-645a9520.js → token-extension-f001f08e.js} +8 -8
- package/dist/esm/{translation-slimmer-b69057eb.js → translation-slimmer-5fa762dc.js} +1 -1
- package/dist/esm/{type-guard-204094c6.js → type-guard-87bdc930.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-0874e19f.js → valid-credit-card-number-rule-5dc557f1.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-bar-chart.entry.js +2 -2
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_5.entry.js +7 -7
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +2 -2
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +8 -8
- package/dist/esm/vega-date-picker_2.entry.js +13 -13
- package/dist/esm/vega-dialog_2.entry.js +10 -5
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +7 -7
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +21 -12
- package/dist/esm/vega-input-credit-card.entry.js +6 -6
- package/dist/esm/vega-input-numeric.entry.js +5 -5
- package/dist/esm/vega-input-passcode.entry.js +5 -5
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +6 -6
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-line-chart.entry.js +2 -2
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-pie-chart.entry.js +1 -1
- package/dist/esm/vega-popover_2.entry.js +8 -8
- package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +5 -5
- package/dist/esm/vega-rich-text-bookmark-editor.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +6 -6
- package/dist/esm/vega-rich-text-editor_4.entry.js +14 -14
- package/dist/esm/vega-rich-text-find-replace-panel.entry.js +1 -1
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
- package/dist/esm/vega-selection-chip_2.entry.js +4 -4
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +6 -6
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +11 -11
- package/dist/esm/{y-axis-input-processor-c6b2a914.js → y-axis-input-processor-dd574c2e.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +338 -338
- package/dist/types/components/vega-dialog/vega-dialog.d.ts +2 -0
- package/dist/types/components/vega-image-uploader/slimmers/controllers/vega-image-uploader-remove-controller.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-actions-renderer.d.ts +1 -0
- package/dist/types/components/vega-image-uploader/slimmers/renderers/vega-image-uploader-uploading-content-renderer.d.ts +1 -0
- package/dist/types/helpers/translation/interface.d.ts +4 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-64eb05d3.entry.js → p-017f0314.entry.js} +1 -1
- package/dist/vega/{p-eb945d34.entry.js → p-06a0c795.entry.js} +1 -1
- package/dist/vega/p-09ed519b.entry.js +1 -0
- package/dist/vega/p-0a8e82f1.js +1 -0
- package/dist/vega/{p-76f4fdba.entry.js → p-0c8f8d88.entry.js} +1 -1
- package/dist/vega/{p-2ff659a1.entry.js → p-0cd81963.entry.js} +1 -1
- package/dist/vega/{p-0169f71c.entry.js → p-0cda0b10.entry.js} +1 -1
- package/dist/vega/{p-4043508a.js → p-146abbc7.js} +1 -1
- package/dist/vega/{p-9fcfd738.js → p-1c7dc9c6.js} +1 -1
- package/dist/vega/{p-ebe1dd2b.entry.js → p-1ccf0a96.entry.js} +1 -1
- package/dist/vega/{p-0b33753f.entry.js → p-1f0b99ac.entry.js} +1 -1
- package/dist/vega/{p-d5a75228.js → p-24b6f3ee.js} +1 -1
- package/dist/vega/p-25d8b416.js +1 -0
- package/dist/vega/{p-ac98c189.entry.js → p-26fdf04e.entry.js} +1 -1
- package/dist/vega/{p-3283fa2f.js → p-2a501c55.js} +1 -1
- package/dist/vega/p-2e847194.js +1 -0
- package/dist/vega/{p-f9d09b0c.js → p-3040c091.js} +1 -1
- package/dist/vega/{p-17f6dc94.entry.js → p-3437ff39.entry.js} +1 -1
- package/dist/vega/p-347d664e.js +1 -0
- package/dist/vega/{p-7874055b.entry.js → p-35de277a.entry.js} +1 -1
- package/dist/vega/{p-322da1eb.entry.js → p-377a5330.entry.js} +1 -1
- package/dist/vega/{p-08bf08d2.js → p-37eb020f.js} +1 -1
- package/dist/vega/{p-1f1f93bf.entry.js → p-3a153581.entry.js} +1 -1
- package/dist/vega/p-46d34326.js +1 -0
- package/dist/vega/{p-ca1fe571.entry.js → p-48470109.entry.js} +1 -1
- package/dist/vega/p-4a2e040f.entry.js +1 -0
- package/dist/vega/{p-6e16bb3a.js → p-4ad6da8f.js} +1 -1
- package/dist/vega/{p-b3a1cd22.js → p-4cd198b9.js} +1 -1
- package/dist/vega/{p-ba67eb96.js → p-4f24f262.js} +1 -1
- package/dist/vega/{p-fee080b9.entry.js → p-5025f7b6.entry.js} +1 -1
- package/dist/vega/{p-b63a90b3.entry.js → p-53838cd1.entry.js} +1 -1
- package/dist/vega/{p-1b2e5898.js → p-53c1b195.js} +1 -1
- package/dist/vega/{p-cb68a43a.entry.js → p-54c21aa8.entry.js} +1 -1
- package/dist/vega/{p-cc9fc36a.entry.js → p-568d4da6.entry.js} +1 -1
- package/dist/vega/{p-28acbe42.entry.js → p-5bdc1ff3.entry.js} +1 -1
- package/dist/vega/{p-92411f56.entry.js → p-5ccdfd46.entry.js} +1 -1
- package/dist/vega/{p-2171b571.entry.js → p-5cd6b840.entry.js} +1 -1
- package/dist/vega/{p-f981cf2c.js → p-5cfe82e7.js} +1 -1
- package/dist/vega/{p-e5fc6583.entry.js → p-5f04fb23.entry.js} +1 -1
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-df9585f6.js → p-68e70f75.js} +1 -1
- package/dist/vega/{p-608d3559.entry.js → p-6902bcaf.entry.js} +1 -1
- package/dist/vega/{p-1a4d1991.entry.js → p-6a13ba24.entry.js} +1 -1
- package/dist/vega/{p-69eadbd8.entry.js → p-6c0d4f69.entry.js} +1 -1
- package/dist/vega/{p-7f9ad7bc.js → p-6c46ea86.js} +1 -1
- package/dist/vega/{p-6096ffc3.js → p-6d0947e2.js} +1 -1
- package/dist/vega/{p-36b795c6.entry.js → p-6ec65f72.entry.js} +1 -1
- package/dist/vega/{p-94d65dcf.entry.js → p-701ac71a.entry.js} +1 -1
- package/dist/vega/{p-abe5f7f0.entry.js → p-70659d97.entry.js} +1 -1
- package/dist/vega/{p-018bb83b.entry.js → p-7157dd20.entry.js} +1 -1
- package/dist/vega/{p-3b911043.entry.js → p-74b54dcc.entry.js} +1 -1
- package/dist/vega/{p-ba050d63.entry.js → p-776123f8.entry.js} +1 -1
- package/dist/vega/{p-261cf764.js → p-78a2802f.js} +1 -1
- package/dist/vega/{p-c7ec97d1.entry.js → p-7e262cb3.entry.js} +1 -1
- package/dist/vega/{p-27e77ea1.entry.js → p-88ada88b.entry.js} +1 -1
- package/dist/vega/{p-e6b0a292.entry.js → p-892f3e98.entry.js} +1 -1
- package/dist/vega/{p-dcfce26e.entry.js → p-8a9e80ac.entry.js} +1 -1
- package/dist/vega/{p-fdbdf12f.js → p-8e3c1c81.js} +1 -1
- package/dist/vega/{p-7d3d24f6.entry.js → p-8e59892d.entry.js} +1 -1
- package/dist/vega/{p-564110ba.entry.js → p-9960ffde.entry.js} +1 -1
- package/dist/vega/{p-e84c2589.js → p-9b571551.js} +1 -1
- package/dist/vega/{p-6c4edee8.entry.js → p-a50b8c9f.entry.js} +1 -1
- package/dist/vega/{p-8c61db9d.entry.js → p-a54a2def.entry.js} +1 -1
- package/dist/vega/{p-e33a954f.js → p-a6346186.js} +1 -1
- package/dist/vega/p-a7ed55d8.js +1 -0
- package/dist/vega/{p-c08ac33f.entry.js → p-ab6c13d9.entry.js} +1 -1
- package/dist/vega/{p-3567dc55.entry.js → p-afa8a9af.entry.js} +1 -1
- package/dist/vega/p-b4e4b938.entry.js +1 -0
- package/dist/vega/{p-e2c8a470.entry.js → p-b63af0ae.entry.js} +1 -1
- package/dist/vega/{p-ade903b3.entry.js → p-ba971f6a.entry.js} +1 -1
- package/dist/vega/{p-3b4e2ba0.js → p-c0eddde0.js} +1 -1
- package/dist/vega/{p-dc83fa6b.entry.js → p-c11b20c0.entry.js} +1 -1
- package/dist/vega/{p-4cdc064d.entry.js → p-c3532738.entry.js} +1 -1
- package/dist/vega/{p-1fb953f8.js → p-c576f76b.js} +1 -1
- package/dist/vega/{p-8193f4ef.entry.js → p-c6cfaa2f.entry.js} +1 -1
- package/dist/vega/{p-a60d75d9.js → p-c73cce9b.js} +1 -1
- package/dist/vega/{p-8197d172.entry.js → p-c8c2e940.entry.js} +1 -1
- package/dist/vega/{p-f818bb20.entry.js → p-c968f8cf.entry.js} +1 -1
- package/dist/vega/{p-2fc2299f.js → p-cef58d27.js} +1 -1
- package/dist/vega/p-d5ab92a5.entry.js +1 -0
- package/dist/vega/{p-d044d54f.entry.js → p-d9c2aa77.entry.js} +1 -1
- package/dist/vega/{p-1537b1e4.js → p-da94bcda.js} +1 -1
- package/dist/vega/{p-8ac0b1b2.entry.js → p-dcdd7098.entry.js} +1 -1
- package/dist/vega/{p-66bf209b.entry.js → p-dcf4f31f.entry.js} +1 -1
- package/dist/vega/{p-4503f5b9.entry.js → p-e11987d3.entry.js} +1 -1
- package/dist/vega/{p-a2dcde12.js → p-e1aa78db.js} +1 -1
- package/dist/vega/{p-8ea41806.js → p-e2168481.js} +1 -1
- package/dist/vega/{p-4e4b50f3.entry.js → p-e67ef7a1.entry.js} +1 -1
- package/dist/vega/{p-8de29082.entry.js → p-ea97ec60.entry.js} +1 -1
- package/dist/vega/{p-8e59606f.entry.js → p-ebc1e0da.entry.js} +1 -1
- package/dist/vega/{p-45af801f.js → p-f2193656.js} +1 -1
- package/dist/vega/{p-9a96fb05.entry.js → p-f5f78884.entry.js} +1 -1
- package/dist/vega/p-f839e009.entry.js +1 -0
- package/dist/vega/{p-9153c2f5.entry.js → p-fa970e96.entry.js} +1 -1
- package/dist/vega/{p-a2c7a3bc.js → p-fc07ed1e.js} +1 -1
- package/dist/vega/{p-3e270b65.entry.js → p-fdb6f4f0.entry.js} +1 -1
- package/dist/vega/{p-a9fc4043.js → p-fffc1f47.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/vega/p-255fe20b.js +0 -1
- package/dist/vega/p-2acc600a.entry.js +0 -1
- package/dist/vega/p-37714a3a.js +0 -1
- package/dist/vega/p-4151d4a8.js +0 -1
- package/dist/vega/p-48c2150b.entry.js +0 -1
- package/dist/vega/p-4b253f74.entry.js +0 -1
- package/dist/vega/p-7b9ed949.js +0 -1
- package/dist/vega/p-9a0e17b2.entry.js +0 -1
- package/dist/vega/p-affb40e8.js +0 -1
- package/dist/vega/p-d3a9355c.entry.js +0 -1
- package/dist/vega/p-e668cf11.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as a,I as i}from"./p-5c8e4e8f.js";import{c as l,V as c,I as h}from"./p-6e1ab235.js";import{s as d}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-8387896e.js";import{i as p}from"./p-29584bb5.js";import{c as v}from"./p-3b6a6f08.js";import{b as w}from"./p-a83cef5a.js";import{T as
|
|
1
|
+
import{h as r,r as e,c as t,H as o,g as s}from"./p-6b2342e0.js";import{V as a,I as i}from"./p-5c8e4e8f.js";import{c as l,V as c,I as h}from"./p-6e1ab235.js";import{s as d}from"./p-519a7d55.js";import{T as n}from"./p-fb5ea4b2.js";import{c as b}from"./p-8387896e.js";import{i as p}from"./p-29584bb5.js";import{c as v}from"./p-3b6a6f08.js";import{b as w}from"./p-a83cef5a.js";import{T as m}from"./p-a7ed55d8.js";import"./p-6a334573.js";import"./p-2d0d575f.js";import"./p-36a57431.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-b75ee3ba.js";import"./p-347d664e.js";import"./p-cb378636.js";var f=function(r,e,t,o){var s,a=arguments.length,i=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};class g extends c{constructor(){super(...arguments),this.handleClick=r=>{this.disabled?r.stopPropagation():("vega"!==p.getSemantics(this.host).namespace&&r.stopPropagation(),this.clickEventEmitter.emit())}}render(){const e="clear"===this.variant,t=!e&&!!this.color;return r("div",{class:{"vega-color-swatch-container":!0,[`size-${this.size}`]:!0,[`shape-${this.shape}`]:!0,"swatch-clear":e},role:"button",part:"swatch-container","aria-label":this.getAriaLabel(),"aria-disabled":this.disabled?"true":"false",tabIndex:this.disabled?-1:0,onClick:this.handleClick,onKeyDown:b({composed:!0})},r("div",{class:"swatch",part:"swatch"},t&&r("span",{class:"color-fill",style:this.getFillColorStyles()}),e&&r("span",{class:"clear-line"}),this.selected&&!e&&r("vega-icon",{class:"check-icon",icon:"checkmark",size:"size-16",color:this.getCheckMarkColor()})),this.label&&this.renderLabel())}renderLabel(){return r("vega-font",{class:"swatch-label",variant:"font-field-value",color:this.disabled?"text-disabled":"text-primary"},this.label)}getAriaLabel(){return this.label?this.label:"clear"===this.variant?this.translationSlimmer.t("Clear color"):this.color?this.translationSlimmer.t("Color {0}",this.color):this.translationSlimmer.t("Color swatch")}getFillColorStyles(){const r={};return this.color&&(r.backgroundColor=this.color),r}getCheckMarkColor(){return this.color?new n(this.color).isDark()?"text-white":"text-black":"text-primary"}}f([l()],g.prototype,"host",void 0),f([l()],g.prototype,"variant",void 0),f([l()],g.prototype,"label",void 0),f([l()],g.prototype,"color",void 0),f([l()],g.prototype,"selected",void 0),f([l()],g.prototype,"size",void 0),f([l()],g.prototype,"disabled",void 0),f([l()],g.prototype,"shape",void 0),f([l()],g.prototype,"clickEventEmitter",void 0),f([l()],g.prototype,"translationSlimmer",void 0);var u=function(r,e,t,o){var s,a=arguments.length,i=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(r,e,t,o);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,t,i):s(e,t))||i);return a>3&&i&&Object.defineProperty(e,t,i),i};const x=class{constructor(r){e(this,r),this.vegaClick=t(this,"vegaClick",7),this.click=t(this,"click",7),this.globalSlimmers=new Map,this.vegaComponentUsageRuntimeMetricsSlimmer=new a,this.translationSlimmer=new m,this.vegaColorSwatchRenderer=new g,this.clickEventEmitter=v(x,w),this.color="",this.selected=!1,this.label="",this.size="small",this.disabled=!1,this.variant="swatch",this.shape="basket"}render(){return d(r(o,{class:{disabled:this.disabled}},this.vegaColorSwatchRenderer.render()),this.host)}get host(){return s(this)}};u([i()],x.prototype,"globalSlimmers",void 0),u([h()],x.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u([h()],x.prototype,"translationSlimmer",void 0),u([h()],x.prototype,"vegaColorSwatchRenderer",void 0),u([h()],x.prototype,"clickEventEmitter",void 0),x.style=":host{display:inline-block;vertical-align:middle}.vega-color-swatch-container{display:flex;flex-direction:row;align-items:center;border-radius:4px}.swatch{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));position:relative;flex-shrink:0;overflow:hidden}.shape-basket .swatch{border-radius:8px}.shape-block .swatch{border-radius:0px}.check-icon{position:relative;z-index:1}.swatch-clear .swatch{background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));border-width:1px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1))}.swatch-clear .swatch .clear-line{position:absolute;width:141%;height:0;border-top-width:1px;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;border-style:solid;border-color:rgba(var(--v-border-color-danger, 230, 50, 87, 1));transform:rotate(-45deg);transform-origin:center}.color-fill{position:absolute;display:block;top:0;left:0;width:100%;height:100%}.size-extra-small .swatch{width:24px;height:24px;min-width:24px}.size-extra-small.shape-basket .swatch{border-radius:4px}.size-small .swatch{width:40px;height:40px;min-width:40px}.size-small.shape-basket{border-radius:8px}.size-medium .swatch{width:48px;height:48px;min-width:48px}.size-medium.shape-basket{border-radius:8px}@media (hover: hover){:host(:not(.disabled)) .swatch:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .swatch-clear .swatch:hover .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}}.vega-color-swatch-container:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible .swatch{border-width:1px;border-style:solid;border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-color-swatch-container:focus-visible.swatch-clear{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-color-swatch-container:focus-visible.swatch-clear .swatch{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}.vega-color-swatch-container:focus-visible.swatch-clear .swatch .clear-line{border-color:rgba(var(--v-border-color-danger-hover, 255, 87, 114, 1))}:host(:not(.disabled)) .vega-color-swatch-container{cursor:pointer}:host(.disabled) .vega-color-swatch-container{cursor:not-allowed}:host(.disabled) .swatch{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1));pointer-events:none}:host(.disabled) .swatch .color-fill,:host(.disabled) .swatch .check-icon{opacity:0.5}:host(.disabled) .swatch .label-container{color:rgba(var(--v-text-disabled, 176, 180, 181, 1))}:host(.disabled) .swatch .clear-line{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.swatch-label{margin-left:8px}";export{x as vega_color_swatch}
|
package/dist/vega/p-5f377954.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.
|
|
1
|
+
var t;!function(t){t.Angular="angular",t.Vue="vue",t.React="react",t.Next="next",t.VanillaJs="vanilla-js"}(t||(t={}));const s=new class{constructor(){this.vegaVersion="2.104.0",this.framework=t.VanillaJs}getVegaEnv(){return{version:this.vegaVersion,framework:this.framework}}setVegaFramework(t){this.framework=t}};export{t as F,s as v}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{f as t,q as e,h as n,l as s,s as r,E as i,N as a,p as o,F as l,G as c,J as h,A as u,k as d,j as w,K as p,I as f,g,M as m,c as T,R as x,S as b,b as O,L as y,O as E,P as A,Q as v,T as k,U as C,W as B,X as H,r as j,Y as N,Z as I,_ as S,$ as R,a0 as L,a1 as D,a2 as M,a3 as $,a4 as P,a5 as F,v as z,a6 as U,a7 as V,d as W,o as G,a8 as J,a9 as K,aa as Y,ab as _,ac as X,n as Q,ad as Z,ae as q,t as tt,af as et,ag as nt}from"./p-f9d09b0c.js";import{g as st}from"./p-8b5d3a52.js";import{i as rt}from"./p-fdbdf12f.js";import{C as it}from"./p-2d0d575f.js";import{d as at}from"./p-36a57431.js";import{c as ot,d as lt,e as ct}from"./p-53e3f259.js";import{r as ht,i as ut}from"./p-aa135628.js";import{c as dt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";import{D as pt}from"./p-5c285374.js";class ft{}class gt{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter(rt)),e}}const mt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},Tt=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r],e))continue;let i=0;for(const a of n)if(i=a.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),o=new gt(a,n);1===i&&a.shouldProceedToElementChildren()&&o.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(o),r+=i-1;break}if(0===i&&r<t.length){const n=Array.from(t[r].childNodes),i=this.process(Array.from(n),e);i.length>0&&s.push(...i)}}return s}isInvalidElement(t,e){return t.nodeType===Node.COMMENT_NODE||!1!==e.autoMatchFormat&&["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return mt.getElementToBlockStrategies()}};class xt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class bt extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class Ot extends bt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class yt extends i{constructor(t,e){super(),this.type=a.IMAGE,this.size=t,this.alt=e}static from(t,e){return[a.IMAGE,new yt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return rt(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new yt(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e=yt.getDefaultStyles();switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}yt.BASE_STYLES={verticalAlign:"bottom"};class Et extends o{constructor(t,e,n,s){super(t,s),this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Et(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:a}=i,o=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(i,["size"]),l=Object.assign(Object.assign({},o),{size:null!=a?a:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?yt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(rt)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof yt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new Et(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(a.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${h(e.alt)}"`:null,`src="${h(this.url)}"`,e&&e.size?`data-size="${e.size}"`:null].filter(rt))}>`}doAnnotationActionApply(t){const e=u.get(d.typeName,Et.typeName);e&&e.execute(t,this)}doModifyActionApply(t){u.executeTheStrategy(t,this)}}Et.typeName="RTEImageNode",u.register(w.UPDATE_IMAGE_NODE_URL,Et.typeName,new class extends t{handleAction(t,e){e.url=t.url}}),u.register(d.typeName,Et.typeName,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class At extends m{constructor(t,e){super(),this.type=w.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class vt extends O{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new vt(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Et.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=super.generateAttributeString(t),n=this.children.map((e=>e.toHtml(t))).join("");return super.shouldRenderAsInternalWrapper()?n:[`<div${e}>`,n,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new vt(st())}clone(t){const e=new vt(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}vt.typeName="RTEImageBlock",u.register(w.MERGE_TWO_BLOCKS_NODES,vt.typeName,new y),u.register(w.REPLACE_CHILD_NODES,vt.typeName,new E),u.register(w.SPLIT_BLOCK_WITH_NODE,vt.typeName,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new p(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new f(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new g(t)),n}}),u.register(w.LINE_BREAK_SINGLE_BLOCK,vt.typeName,new class extends t{handleAction(t,e){const n=new At(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),u.register(w.LINE_BREAK_MULTIPLE_BLOCKS,vt.typeName,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=T.from({id:st(),type:"paragraph",nodes:[{id:st(),type:"text",text:"\n"}]});e.parent.apply(new f(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new x(st(),"\n",n)),n.apply(new g(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),u.register(w.INSERT_IMAGE_TO_BLOCK,vt.typeName,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new g(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new f(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new b(s,r)),e.parent.apply(new f(e,i)))}}),u.register(A.typeName,vt.typeName,new v);class kt extends m{constructor(t){super(),this.type=w.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ct extends k{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],a=this.getPreviousNode(n);return a&&a.parent===e&&"\n"===a.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==a?void 0:a.parent)!==e?t.nextNode=i:t.previousNode=a))}}{let r=this.getPreviousNode(n),i=null;const a=n.isEmpty();if(e.children.length&&r&&r.parent!==e)a&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new kt(e));else if(this.isContentFirstNode(n)&&a&&(i=this.getNextNode(n)),a&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||a||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),a=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(a=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new kt(e))}i?t.previousNode=i:a&&(t.nextNode=a)}}class Bt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new f(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new b(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(a.LINK),e.apply(new g([n]))),e}}}class Ht extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=w.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class jt extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:a,startOffset:o}=r;if(a){const t=e;if(a.isContentEditable()&&a.isTextNode())if("\n"!==a.text&&a.text&&0!==o){const e=a.text.substring(0,o),r=a.text.substring(o),l=a.cloneWithText(e),c=a.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(a,...h)),t.apply(new s(a))}else t.apply(new n(a,i));else t.apply(0!==o?new f(a,i):new n(a,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ht(t))}}class Nt extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,a=this.createNewParagraph(s);if(a){const t=a.children[0];e.apply(0!==r?new f(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ht(t))}}class It extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new g([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new b(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=T.from({id:st(),type:"paragraph",nodes:[]});return r.apply(new g(t.children)),n.apply(new f(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new f(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new f(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(a.LINK),e}}class St extends B{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof j?t.entityToBeRemoved:null,a=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&a>=0&&this.promoteNestListsToUpperLevel(i,e,a),super.handleAction(t,e);const o=e.parent;if(0===e.children.length&&o)if("list-item"===o.type){const t=o;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new H(e))}else o.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const a=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let o=s+1;const l=[];a.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(o,0,...n),o+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof j){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new N(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new f(e,...l));t.apply(new N([]))}}class Rt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let a=e;const o=s[0],l=1===s.length&&r instanceof x&&!["RTEListBlock","RTEHtmlBlock"].includes(o.typeName)&&o.children.length>0&&o.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new b(r,i);e.apply(n),e.parent.apply(new f(e,...s)),a=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=a}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],a=i.children,o=s,l=e.children.indexOf(o);if(-1===l){const a=new b(s,r);return e.apply(a),e.parent.apply(new f(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=o.text.slice(0,r),h=o.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(o.cloneWithText(c)),h&&d.unshift(o.cloneWithText(h)),e.apply(new p([...u,...a,...d]));const w=a[a.length-1];t.futureFocusBlock=e,t.futureFocusNode=w,w.isTextNode()&&(t.futureFocusNodeOffset=w.text.length)}}const Lt=new class{registerBlockBasicStrategies(t){u.register(w.DELETE_CHILDREN,t,t===I.typeName?new St:new B),u.register(w.APPEND_CHILDREN,t,new xt),u.register(w.INSERT_CHILDREN_BEFORE,t,new bt),u.register(w.INSERT_CHILDREN_AFTER,t,new Ot),u.register(w.DELETE_BLOCK_CONTENT,t,new Ct),u.register(w.INSERT_NEW_PARAGRAPH,t,t===j.typeName?new It:new Bt),u.register(w.INSERT_TEXT_TO_DECORATOR_NODE,t,new Nt),u.register(w.INSERT_NODE_TO_NEAREST_ROOT,t,new jt),u.register(w.PASTE_CONTENT,t,new Rt)}};class Dt{}class Mt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===S||t.style.fontWeight===R||t.classList.contains("v-rte--bold")}}class $t extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class Pt extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class Ft extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=L(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends Dt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.typeName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ut extends Dt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.typeName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Vt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Wt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ht(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=D.filter((t=>t.key!==M.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of D)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends Dt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.typeName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByClassName(t);if(n)return n;const s=this.getElementTypeByNodeName(t);if(s)return s;return this.getElementTypeByFontSize(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class Kt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Kt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Kt.textStyleHandler=new Jt;class Yt extends Dt{constructor(){super(...arguments),this.handlers=[new $t,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return e.link?{link:e.link}:Kt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:st()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class _t extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Xt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(F)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Qt extends Dt{canHandle(t){return"RTEImageNode"===t.typeName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Zt extends Dt{canHandle(t){return"RTEImageNode"===t.typeName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),te=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ee=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),ne=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),se=new Set(["ABBR","B","BDI","BDO","CITE","DEL","DFN","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]);function re(t){return qt.has(t.parentElement.nodeName)}class ie extends Dt{constructor(){super(...arguments),this.customAttributeHandler=new $t,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.typeName&&!1===e.autoMatchFormat}handle(t,e){if(te.has(t.nodeName)&&!ee.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!x.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:st()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ae=new class{constructor(){this.handlers=[new Ut,new zt,new Mt,new Gt,new Xt,new _t,new Wt,new Yt,new Vt,new Qt,new Zt,new $t,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&z.executeTheStrategyRefillAction(t.typeName,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.typeName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Yt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=z.getStrategies(t.typeName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=U.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class oe extends ft{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=mt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let o=null;if(a&&(o=a.handle([t],n,i)),o)s.push(o);else if(ut(t)&&t.childNodes.length>0){const a=ae.generate(x,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),a,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends oe{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||te.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Kt.isTitleOrSubtitle(s)?0:1}handle(t,e){return V.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(ee.has(t.nodeName)&&0===t.childNodes.length)return!0;if(re(t))return!(0===t.childNodes.length&&""===t.textContent&&!ee.has(t.nodeName)&&!se.has(t.nodeName));const n=Array.from(t.childNodes);return!(n.some((t=>t.nodeType===Node.ELEMENT_NODE))||!n.some((t=>t.nodeType===Node.TEXT_NODE)))&&(!1!==e.autoMatchFormat||!ne.has(t.parentElement.nodeName)&&(se.has(t.nodeName)||ee.has(t.nodeName)))}shouldFallBackToHtmlBlock(t){const e=Array.from(t.childNodes);if(0===e.length)return!1;const n=t.parentElement.nodeName;return"UL"!==n&&"OL"!==n&&e.every((t=>t.nodeType===Node.ELEMENT_NODE&&""===t.textContent&&!ee.has(t.nodeName)&&!se.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:st(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ae.generate(V,t,e),children:[]}}}class ce extends oe{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:st(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class he extends oe{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return vt.from({id:st(),type:"image",nodes:[{id:st(),type:"image",url:t.src,annotations:ae.generate(Et,t,e)}],annotations:Object.assign(Object.assign({},ae.generate(vt,t.parentElement,e)),{internalWrapper:n})},e)}}class ue extends ft{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:st(),type:"text",text:t,annotations:e}}}class de extends G{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=Y.getDefaultStyles(e),super.filterAnnotations(t)):t}}class we extends G{constructor(){super(...arguments),this.stylesToBeFiltered=U.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return J.isTextBlock(t.typeName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return J.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class pe extends we{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=U.getDefaultStyles(this.type)}}class fe extends we{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=U.getDefaultStyles(this.type)}}class ge extends G{constructor(){super(...arguments),this.stylesToBeFiltered=ge.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}filterAndDeleteStyles(t,e,n){var s;const r=super.filterAndDeleteStyles(t,e);return this.isExplicitlyNonBold(n)&&void 0===(null===(s=r.styles)||void 0===s?void 0:s.fontWeight)&&(r.styles=Object.assign(Object.assign({},r.styles),{fontWeight:ge.NON_BOLD_FONT_WEIGHT})),r}canFilter(t){return J.isTextNode(t.typeName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return J.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ge.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}isExplicitlyNonBold(t){var e;const n=null===(e=t)||void 0===e?void 0:e.getAnnotationByType(a.BOLD);return!1===(null==n?void 0:n.bold)}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(ge.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ge.BOLD_STYLES={fontWeight:"700"},ge.NON_BOLD_FONT_WEIGHT=X,ge.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class me extends pe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return J.isListItemBlock(t.typeName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class Te extends fe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return J.isListItemBlock(t.typeName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Q.registerRTEDTOClass("paragraph",T),Q.registerRTEDTOClass("title",T),Q.registerRTEDTOClass("subtitle",T),Q.registerRTEDTOClass("heading-1",T),Q.registerRTEDTOClass("heading-2",T),Q.registerRTEDTOClass("heading-3",T),Q.registerRTEDTOClass("heading-4",T),Q.registerRTEDTOClass("heading-5",T),Q.registerRTEDTOClass("heading-6",T),Q.registerRTEDTOClass("heading-6",T),Q.registerRTEDTOClass("list-item",j),Q.registerRTEDTOClass("bullet-list",I),Q.registerRTEDTOClass("number-list",I),Q.registerRTEDTOClass("image",vt),Q.registerRTEDTOClass("code-block",e),Q.registerRTEDTOClass("html-block",V),Q.registerRTEDTOClass("text",x),Q.registerRTEDTOClass("image",Et),Lt.registerBlockBasicStrategies(T.typeName),Lt.registerBlockBasicStrategies(I.typeName),Lt.registerBlockBasicStrategies(j.typeName),Lt.registerBlockBasicStrategies(vt.typeName),Lt.registerBlockBasicStrategies(V.typeName),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ae.generate(x,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),a=!s&&!i;return T.from(Object.assign({id:st(),type:i||"paragraph",nodes:r},a?{annotations:{internalWrapper:a}}:{annotations:ae.generate(T,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!this.isBlockBoundaryElement(t,e)&&(!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(t)))}isBlockBoundaryElement(t,e){var n;return!!t.hasAttribute(W)||!!(null===(n=e.blockBoundaryRegistry)||void 0===n?void 0:n.isBoundary(t))}isDedicatedBlockTag(t){return te.has(t)&&!ee.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?se.has(t.nodeName):this.isTextOnlyElement(t)?se.has(t.nodeName)||ee.has(t.nodeName):this.hasOnlyInlineDescendants(t)}isTextOnlyElement(t){const e=Array.from(t.childNodes);return!e.some((t=>t.nodeType===Node.ELEMENT_NODE))&&e.some((t=>t.nodeType===Node.TEXT_NODE))}hasOnlyInlineDescendants(t){for(let e=0;e<t.children.length;e++){const n=t.children[e];if(this.isDedicatedBlockTag(n.nodeName))return!1;if(!n.hasChildNodes())return!1;if(!this.hasOnlyInlineDescendants(n))return!1}return!0}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if(rt(s))return vt.from({id:st(),type:"image",nodes:[{id:st(),type:"image",url:s.src,annotations:ae.generate(Et,n,e)}],annotations:ae.generate(vt,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:T.from({id:st(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ae.generate(T,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?j.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return I.from({id:st(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:st(),type:"list-item",annotations:ae.generate(j,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ae.generate(x,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=rt(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return j.from({id:st(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:I.from({id:st(),type:"number-list",blocks:[],annotations:ae.generate(I,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof j)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:I.from({id:st(),type:"bullet-list",blocks:[],annotations:ae.generate(I,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof j)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),mt.registerElementToBlockStrategy(new le),
|
|
1
|
+
import{f as t,q as e,h as n,l as s,s as r,E as i,N as a,p as o,F as l,G as c,J as h,A as u,k as d,j as w,K as p,I as f,g,M as m,c as T,R as x,S as b,b as O,L as y,O as E,P as A,Q as v,T as k,U as C,W as B,X as H,r as j,Y as N,Z as I,_ as S,$ as R,a0 as L,a1 as D,a2 as M,a3 as $,a4 as P,a5 as F,v as z,a6 as U,a7 as V,d as W,o as G,a8 as J,a9 as K,aa as Y,ab as _,ac as X,n as Q,ad as Z,ae as q,t as tt,af as et,ag as nt}from"./p-3040c091.js";import{g as st}from"./p-8b5d3a52.js";import{i as rt}from"./p-8e3c1c81.js";import{C as it}from"./p-2d0d575f.js";import{d as at}from"./p-36a57431.js";import{c as ot,d as lt,e as ct}from"./p-53e3f259.js";import{r as ht,i as ut}from"./p-aa135628.js";import{c as dt}from"./p-a841cf13.js";import{L as wt}from"./p-6e1ab235.js";import{D as pt}from"./p-5c285374.js";class ft{}class gt{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter(rt)),e}}const mt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},Tt=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r],e))continue;let i=0;for(const a of n)if(i=a.canHandle(t,r,e),i>0){const n=t.slice(r,r+i),o=new gt(a,n);1===i&&a.shouldProceedToElementChildren()&&o.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(o),r+=i-1;break}if(0===i&&r<t.length){const n=Array.from(t[r].childNodes),i=this.process(Array.from(n),e);i.length>0&&s.push(...i)}}return s}isInvalidElement(t,e){return t.nodeType===Node.COMMENT_NODE||!1!==e.autoMatchFormat&&["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return mt.getElementToBlockStrategies()}};class xt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class bt extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class Ot extends bt{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class yt extends i{constructor(t,e){super(),this.type=a.IMAGE,this.size=t,this.alt=e}static from(t,e){return[a.IMAGE,new yt(t,e)]}static getDefaultStyles(){return{verticalAlign:"bottom"}}toJSON(){return rt(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new yt(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e=yt.getDefaultStyles();switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}yt.BASE_STYLES={verticalAlign:"bottom"};class Et extends o{constructor(t,e,n,s){super(t,s),this.type=l.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new Et(t.id,t.url,e),r=!!n.autoMatchFormat,i=Object.assign({},t.annotations),{size:a}=i,o=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(i,["size"]),l=Object.assign(Object.assign({},o),{size:null!=a?a:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?yt.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter(rt)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof yt||t instanceof c)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new Et(this.id,this.url,t,super.cloneAnnotations())}toHtml(t){const e=this.getAnnotationByType(a.IMAGE);return`<img${super.generateAttributeString(t,...[e&&e.alt?`alt="${h(e.alt)}"`:null,`src="${h(this.url)}"`,e&&e.size?`data-size="${e.size}"`:null].filter(rt))}>`}doAnnotationActionApply(t){const e=u.get(d.typeName,Et.typeName);e&&e.execute(t,this)}doModifyActionApply(t){u.executeTheStrategy(t,this)}}Et.typeName="RTEImageNode",u.register(w.UPDATE_IMAGE_NODE_URL,Et.typeName,new class extends t{handleAction(t,e){e.url=t.url}}),u.register(d.typeName,Et.typeName,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class At extends m{constructor(t,e){super(),this.type=w.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class vt extends O{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new vt(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>Et.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(t){const e=super.generateAttributeString(t),n=this.children.map((e=>e.toHtml(t))).join("");return super.shouldRenderAsInternalWrapper()?n:[`<div${e}>`,n,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new vt(st())}clone(t){const e=new vt(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}vt.typeName="RTEImageBlock",u.register(w.MERGE_TWO_BLOCKS_NODES,vt.typeName,new y),u.register(w.REPLACE_CHILD_NODES,vt.typeName,new E),u.register(w.SPLIT_BLOCK_WITH_NODE,vt.typeName,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new p(t));const i=this.cloneWithNodes(r,n);return n.parent.apply(new f(n,i)),i}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new g(t)),n}}),u.register(w.LINE_BREAK_SINGLE_BLOCK,vt.typeName,new class extends t{handleAction(t,e){const n=new At(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),u.register(w.LINE_BREAK_MULTIPLE_BLOCKS,vt.typeName,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const n=T.from({id:st(),type:"paragraph",nodes:[{id:st(),type:"text",text:"\n"}]});e.parent.apply(new f(e,n));const s=this.concatBlocksNodes(t.slice(1));return(0===s.length||s[0]&&""===s[0].text)&&s.push(new x(st(),"\n",n)),n.apply(new g(s)),n.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new s(t)))})),e}}),u.register(w.INSERT_IMAGE_TO_BLOCK,vt.typeName,new class extends t{handleAction(t,e){const s=t.splitPointNode,r=t.startOffsetOfNode,i=t.imageBlockToBeInserted;e.children.length<1?e.apply(new g(i.children)):this.isCaretPositionAtBlockEnd(e,s,r)?e.parent.apply(new f(e,i)):this.isCaretPositionAtBlockStart(e,s,r)?e.parent.apply(new n(e,i)):(e.apply(new b(s,r)),e.parent.apply(new f(e,i)))}}),u.register(A.typeName,vt.typeName,new v);class kt extends m{constructor(t){super(),this.type=w.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class Ct extends k{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const r=e.parent;r&&e.isListItemBlock()&&0===r.children.length&&r.parent.apply(new s(r))}deleteTextNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;if(0!==r&&!n.isEmpty()){const i=n.text.slice(0,r-1)+n.text.slice(r);if(n.apply(new C(i)),i)return void(t.previousNode=n);{const r=e.children.indexOf(n),i=e.children[r+1],a=this.getPreviousNode(n);return a&&a.parent===e&&"\n"===a.text||1===e.children.length?void(t.previousNode=n):(e.apply(new s(n)),void(i&&(null==a?void 0:a.parent)!==e?t.nextNode=i:t.previousNode=a))}}{let r=this.getPreviousNode(n),i=null;const a=n.isEmpty();if(e.children.length&&r&&r.parent!==e)a&&e.apply(new s(n)),e.type===r.parent.type&&r.parent.apply(new kt(e));else if(this.isContentFirstNode(n)&&a&&(i=this.getNextNode(n)),a&&e.apply(new s(n)),r&&r.isTextNode()&&(r.isEmpty()||!r.isContentEditable()&&r.parent===e)){const t=r;r=this.getPreviousNode(r),t.parent.apply(new s(t)),r||a||(i=n)}0===e.children.length&&e.parent.apply(new s(e)),r?t.previousNode=r:i&&(t.nextNode=i)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,r=t.startOffset;let i=this.getPreviousNode(n),a=null;if(0!==r){const t=e;this.isContentFirstNode(n)&&(a=this.getNextNode(n)),1===t.children.length?t.parent.apply(new s(t)):t.apply(new s(n))}else{const r=i;r&&!r.isContentEditable()&&r.parent===e?(i=this.getPreviousNode(r),r.parent.apply(new s(r)),i||(t.nextNode=n)):i&&i.parent!==e&&e.type===i.parent.type&&i.parent.apply(new kt(e))}i?t.previousNode=i:a&&(t.nextNode=a)}}class Bt extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,s){const r=this.getNewParagraph(t);if(r){if(this.isCaretPositionAtBlockEnd(s,t,e))s.parent.apply(new f(s,r));else{if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new b(t,e);return s.apply(n),n.newBlock}s.parent.apply(new n(s,r))}return r}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(a.LINK),e.apply(new g([n]))),e}}}class Ht extends m{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=w.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class jt extends t{handleAction(t,e){const{rteRange:r,nodeToBeInserted:i}=t,{startNode:a,startOffset:o}=r;if(a){const t=e;if(a.isContentEditable()&&a.isTextNode())if("\n"!==a.text&&a.text&&0!==o){const e=a.text.substring(0,o),r=a.text.substring(o),l=a.cloneWithText(e),c=a.cloneWithText(r),h=[l,i];r&&h.push(c),t.apply(new n(a,...h)),t.apply(new s(a))}else t.apply(new n(a,i));else t.apply(0!==o?new f(a,i):new n(a,i));this.updateCursorPosition(i)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ht(t))}}class Nt extends t{handleAction(t,e){const{text:s,offset:r,decoratorNode:i}=t,a=this.createNewParagraph(s);if(a){const t=a.children[0];e.apply(0!==r?new f(i,t):new n(i,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new Ht(t))}}class It extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,s){const r=s.createNewListItem(),i=this.copyInlineStyleToNewNode(t);if(r.apply(new g([i])),this.isCaretPositionAtBlockEnd(s,t,e))return this.breakListItemAtEnd(r,s);if(!this.isCaretPositionAtBlockStart(s,t,e)){const n=new b(t,e);return s.apply(n),n.newBlock}return s.parent.apply(new n(s,r)),r}breakListItemAtEnd(t,e){const n=e.parent.children[e.parent.children.length-1],r=1===e.children.length&&e.children[0].isEmpty();if(e===n&&r){const n=e.parent.parent;if("list-item"!==n.type){const r=T.from({id:st(),type:"paragraph",nodes:[]});return r.apply(new g(t.children)),n.apply(new f(e.parent,r)),e.parent.apply(new s(e)),r}n.parent.apply(new f(n,t)),e.parent.apply(new s(e))}else e.parent.apply(new f(e,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(a.LINK),e}}class St extends B{handleAction(t,e){var n,r;const i=t.entityToBeRemoved instanceof j?t.entityToBeRemoved:null,a=i?e.children.indexOf(i):-1;(null===(n=null==i?void 0:i.nestList)||void 0===n?void 0:n.length)&&a>=0&&this.promoteNestListsToUpperLevel(i,e,a),super.handleAction(t,e);const o=e.parent;if(0===e.children.length&&o)if("list-item"===o.type){const t=o;(null===(r=t.nestList)||void 0===r?void 0:r.includes(e))&&t.apply(new H(e))}else o.apply(new s(e))}promoteNestListsToUpperLevel(t,e,s){var r,i;const a=[...null!==(r=t.nestList)&&void 0!==r?r:[]];let o=s+1;const l=[];a.forEach((t=>{if(t.type===e.type){const n=[...t.children];n.length>0&&(n.forEach((t=>{t.parent=e})),e.children.splice(o,0,...n),o+=n.length)}else l.push(t)}));const c=e.parent;if(l.length>0&&c instanceof j){const t=[...null!==(i=c.nestList)&&void 0!==i?i:[]],n=t.indexOf(e);n>=0?t.splice(0===s?n:n+1,0,...l):t.push(...l),c.apply(new N(t))}else l.length>0&&c.apply(0===s?new n(e,...l):new f(e,...l));t.apply(new N([]))}}class Rt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:s,startNode:r,startOffset:i}=t;let a=e;const o=s[0],l=1===s.length&&r instanceof x&&!["RTEListBlock","RTEHtmlBlock"].includes(o.typeName)&&o.children.length>0&&o.children.every((t=>{var e,n;return!0===(null===(n=(e=t).isTextNode)||void 0===n?void 0:n.call(e))}));if(r===e.children[0]&&0===i)e.parent.apply(new n(e,...s));else{if(l)return void this.inlineMergeSingleBlock(t,e);{const n=new b(r,i);e.apply(n),e.parent.apply(new f(e,...s)),a=s[s.length-1],t.futureFocusAtEnd=!0}}t.futureFocusBlock=a}}inlineMergeSingleBlock(t,e){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t,i=n[0],a=i.children,o=s,l=e.children.indexOf(o);if(-1===l){const a=new b(s,r);return e.apply(a),e.parent.apply(new f(e,...n)),t.futureFocusBlock=i,void(t.futureFocusAtEnd=!0)}const c=o.text.slice(0,r),h=o.text.slice(r),u=e.children.slice(0,l),d=e.children.slice(l+1);c&&u.push(o.cloneWithText(c)),h&&d.unshift(o.cloneWithText(h)),e.apply(new p([...u,...a,...d]));const w=a[a.length-1];t.futureFocusBlock=e,t.futureFocusNode=w,w.isTextNode()&&(t.futureFocusNodeOffset=w.text.length)}}const Lt=new class{registerBlockBasicStrategies(t){u.register(w.DELETE_CHILDREN,t,t===I.typeName?new St:new B),u.register(w.APPEND_CHILDREN,t,new xt),u.register(w.INSERT_CHILDREN_BEFORE,t,new bt),u.register(w.INSERT_CHILDREN_AFTER,t,new Ot),u.register(w.DELETE_BLOCK_CONTENT,t,new Ct),u.register(w.INSERT_NEW_PARAGRAPH,t,t===j.typeName?new It:new Bt),u.register(w.INSERT_TEXT_TO_DECORATOR_NODE,t,new Nt),u.register(w.INSERT_NODE_TO_NEAREST_ROOT,t,new jt),u.register(w.PASTE_CONTENT,t,new Rt)}};class Dt{}class Mt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||t.style.fontWeight===S||t.style.fontWeight===R||t.classList.contains("v-rte--bold")}}class $t extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class Pt extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class Ft extends Dt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=L(t);return Object.keys(e).length>0?{customStyle:e}:{}}}class zt extends Dt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.typeName)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ut extends Dt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.typeName)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Vt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Wt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=ht(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=D.filter((t=>t.key!==M.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of D)if(t.style.color.includes(e.key))return e.key;return null}}class Gt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||t.style.fontStyle===$||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class Jt extends Dt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.typeName}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByClassName(t);if(n)return n;const s=this.getElementTypeByNodeName(t);if(s)return s;return this.getElementTypeByFontSize(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"P":return"paragraph";case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte-(?:-text-style-)?(title|subtitle|heading-1|heading-2|heading-3|heading-4|heading-5|heading-6|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class Kt{static isTitleOrSubtitle(t){if("DIV"===t.nodeName){const e=Kt.textStyleHandler.getTextStyle(t);return"title"===e||"subtitle"===e}return!1}static isLinkElement(t){return"A"===t.nodeName}}Kt.textStyleHandler=new Jt;class Yt extends Dt{constructor(){super(...arguments),this.handlers=[new $t,new Pt,new Ft]}canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return e.link?{link:e.link}:Kt.isLinkElement(t)?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:st()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class _t extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes(P)||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class Xt extends Dt{canHandle(t){return"RTETextNode"===t.typeName}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes(F)||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Qt extends Dt{canHandle(t){return"RTEImageNode"===t.typeName}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class Zt extends Dt{canHandle(t){return"RTEImageNode"===t.typeName}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}const qt=new Set(["P","H1","H2","H3","H4","H5","H6","LI"]),te=new Set(["P","H1","H2","H3","H4","H5","H6","LI","UL","OL","IMG","CODE"]),ee=new Set(["BR","VEGA-RICH-TEXT-LINK-EDITOR","CODE","A"]),ne=new Set(["TABLE","THEAD","TBODY","TFOOT","TR","DL"]),se=new Set(["ABBR","B","BDI","BDO","CITE","DEL","DFN","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SAMP","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR"]);function re(t){return qt.has(t.parentElement.nodeName)}class ie extends Dt{constructor(){super(...arguments),this.customAttributeHandler=new $t,this.customStyleAnnotationHandler=new Ft,this.customClassAnnotationHandler=new Pt}canHandle(t,e){return"RTETextNode"===t.typeName&&!1===e.autoMatchFormat}handle(t,e){if(te.has(t.nodeName)&&!ee.has(t.nodeName))return{};const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));return n?{inlineHtml:n}:{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:n}=e;const s=Array.from(t.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE));if(!x.supportsHtmlTag(t.nodeName.toLowerCase())||s){const e=Object.assign(Object.assign({htmlTag:t.nodeName.toLowerCase()},s?{groupId:st()}:{}),{customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass});n=n?this.appendToInlineHtmlChain(n,e,t.parentNode):e}return n?Object.assign({},n):null}appendToInlineHtmlChain(t,e,n){return t.child&&n&&t.child.htmlTag===n.nodeName.toLowerCase()?Object.assign(Object.assign({},t),{child:this.appendToInlineHtmlChain(t.child,e,n)}):Object.assign(Object.assign({},t),{child:e})}}const ae=new class{constructor(){this.handlers=[new Ut,new zt,new Mt,new Gt,new Xt,new _t,new Wt,new Yt,new Vt,new Qt,new Zt,new $t,new Pt,new Ft,new Jt,new ie]}registerHandler(t){this.handlers.unshift(t)}generate(t,e,n={autoMatchFormat:!0}){n&&n.filterInlineStyles&&z.executeTheStrategyRefillAction(t.typeName,e);const s=Kt.isLinkElement(e)&&"RTETextNode"===t.typeName,r=this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof Yt)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{});this.removeTextStyleDefaultsFromCustomStyle(r);const i=z.getStrategies(t.typeName);for(const t of i)(n.autoMatchFormat||t.alwaysFilter)&&t.filterAnnotations(r);return r}removeTextStyleDefaultsFromCustomStyle(t){const e="textStyle"in t?t.textStyle:void 0,n=t.customStyle;if(!e||!n)return t;const s=U.getDefaultStyles(e);if(!s)return t;for(const t of Object.keys(s))n[t]===s[t]&&delete n[t];return 0===Object.keys(n).length&&delete t.customStyle,t}};class oe extends ft{constructor(){super(...arguments),this.annotationHandler=new Jt}generateChildNodes(t,e,n){const s=[],r=!(!n||!1!==n.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=mt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,n)>0));let o=null;if(a&&(o=a.handle([t],n,i)),o)s.push(o);else if(ut(t)&&t.childNodes.length>0){const a=ae.generate(x,t,Object.assign({parentAnnotations:r?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},n));s.push(...this.generateChildNodes(Array.from(t.childNodes),a,n))}})),s}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class le extends oe{canHandle(t,e,n){const s=t[e];return s.nodeType===Node.TEXT_NODE||this.isInlineTagWithoutBlockChildren(s,n)||te.has(s.nodeName)&&!this.shouldFallBackToHtmlBlock(s)||n.autoMatchFormat||!this.isCustomHtmlContainer(s)||Kt.isTitleOrSubtitle(s)?0:1}handle(t,e){return V.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}isInlineTagWithoutBlockChildren(t,e){if(ee.has(t.nodeName)&&0===t.childNodes.length)return!0;if(re(t))return!(0===t.childNodes.length&&""===t.textContent&&!ee.has(t.nodeName)&&!se.has(t.nodeName));const n=Array.from(t.childNodes);return!(n.some((t=>t.nodeType===Node.ELEMENT_NODE))||!n.some((t=>t.nodeType===Node.TEXT_NODE)))&&(!1!==e.autoMatchFormat||!ne.has(t.parentElement.nodeName)&&(se.has(t.nodeName)||ee.has(t.nodeName)))}shouldFallBackToHtmlBlock(t){const e=Array.from(t.childNodes);if(0===e.length)return!1;const n=t.parentElement.nodeName;return"UL"!==n&&"OL"!==n&&e.every((t=>t.nodeType===Node.ELEMENT_NODE&&""===t.textContent&&!ee.has(t.nodeName)&&!se.has(t.nodeName)))}isCustomHtmlContainer(t){return"DIV"!==t.nodeName||t.childNodes.length>0&&"IMG"!==t.childNodes[0].nodeName}generateHtmlBlock(t,e){return{id:st(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:ae.generate(V,t,e),children:[]}}}class ce extends oe{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const n=t[0];if(n){const t=n.textContent,s=n.dataset.language;return e.from({id:st(),type:"code-block",content:t,language:s})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class he extends oe{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return vt.from({id:st(),type:"image",nodes:[{id:st(),type:"image",url:t.src,annotations:ae.generate(Et,t,e)}],annotations:Object.assign(Object.assign({},ae.generate(vt,t.parentElement,e)),{internalWrapper:n})},e)}}class ue extends ft{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:st(),type:"text",text:t,annotations:e}}}class de extends G{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const{textAlign:e,customStyle:n}=t;return e&&n?(this.stylesToBeFiltered=Y.getDefaultStyles(e),super.filterAnnotations(t)):t}}class we extends G{constructor(){super(...arguments),this.stylesToBeFiltered=U.getDefaultStyles("paragraph"),this.type="paragraph",this.elementTagName="p"}filterAnnotations(t){return t}canFilter(t){return J.isTextBlock(t.typeName)&&t.type===this.type}canRefill(t,e){const n=this.classNameToBeAdded?`.${this.classNameToBeAdded}`:this.elementTagName;return J.isTextBlock(t)&&e.matches(n)}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}class pe extends we{constructor(t){super(),this.type="heading-1",this.elementTagName="h1",this.type=`heading-${t}`,this.elementTagName=`h${t}`,this.stylesToBeFiltered=U.getDefaultStyles(this.type)}}class fe extends we{constructor(t){super(),this.type="title",this.elementTagName="div",this.classNameToBeAdded="v-rte-title",this.type=t,this.classNameToBeAdded=`v-rte-${t}`,this.stylesToBeFiltered=U.getDefaultStyles(this.type)}}class ge extends G{constructor(){super(...arguments),this.stylesToBeFiltered=ge.BOLD_STYLES,this.elementTagName="span",this.parentBlockTypes=["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title"],this.parentElementSelectors=["h1","h2","h3","h4","h5","h6",".v-rte-title"],this.toBeCheckedSelector=this.parentElementSelectors.join(",")}filterAnnotations(t){return t}filterAndDeleteStyles(t,e,n){var s;const r=super.filterAndDeleteStyles(t,e);return this.isExplicitlyNonBold(n)&&void 0===(null===(s=r.styles)||void 0===s?void 0:s.fontWeight)&&(r.styles=Object.assign(Object.assign({},r.styles),{fontWeight:ge.NON_BOLD_FONT_WEIGHT})),r}canFilter(t){return J.isTextNode(t.typeName)&&this.parentBlockIsHeadingOrTitle(t)}canRefill(t,e){return J.isTextNode(t)&&"SPAN"===e.nodeName&&this.isHeadingOrTitleChild(e)}toCssText(){return`${this.parentElementSelectors.map((t=>`.${ge.RTE_CONTENT_CONTAINER_CLASS_NAME} ${t}`)).join(",")} { ${this.convertStylesMapToCssText()} }`}isExplicitlyNonBold(t){var e;const n=null===(e=t)||void 0===e?void 0:e.getAnnotationByType(a.BOLD);return!1===(null==n?void 0:n.bold)}parentBlockIsHeadingOrTitle(t){const e=t.parent;return!!e&&this.parentBlockTypes.includes(e.type)}isHeadingOrTitleChild(t){let e=t.parentElement;for(;e;){if(e.matches(this.toBeCheckedSelector))return!0;if(ge.NON_HEADING_TITLE_ELEMENT_TAGS.includes(e.tagName))return!1;e=e.parentElement}return!1}}ge.BOLD_STYLES={fontWeight:"700"},ge.NON_BOLD_FONT_WEIGHT=X,ge.NON_HEADING_TITLE_ELEMENT_TAGS=["TD","TH","TR","TABLE","THEAD","TBODY","DIV","BODY"];class me extends pe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-h${t}`,this.elementTagName="li"}canFilter(t){return J.isListItemBlock(t.typeName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}class Te extends fe{constructor(t){super(t),this.classNameToBeAdded=`v-rte-${t}`,this.elementTagName="li"}canFilter(t){return J.isListItemBlock(t.typeName)&&this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"])}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&e.classList.contains(this.classNameToBeAdded)}}Q.registerRTEDTOClass("paragraph",T),Q.registerRTEDTOClass("title",T),Q.registerRTEDTOClass("subtitle",T),Q.registerRTEDTOClass("heading-1",T),Q.registerRTEDTOClass("heading-2",T),Q.registerRTEDTOClass("heading-3",T),Q.registerRTEDTOClass("heading-4",T),Q.registerRTEDTOClass("heading-5",T),Q.registerRTEDTOClass("heading-6",T),Q.registerRTEDTOClass("heading-6",T),Q.registerRTEDTOClass("list-item",j),Q.registerRTEDTOClass("bullet-list",I),Q.registerRTEDTOClass("number-list",I),Q.registerRTEDTOClass("image",vt),Q.registerRTEDTOClass("code-block",e),Q.registerRTEDTOClass("html-block",V),Q.registerRTEDTOClass("text",x),Q.registerRTEDTOClass("image",Et),Lt.registerBlockBasicStrategies(T.typeName),Lt.registerBlockBasicStrategies(I.typeName),Lt.registerBlockBasicStrategies(j.typeName),Lt.registerBlockBasicStrategies(vt.typeName),Lt.registerBlockBasicStrategies(V.typeName),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e,n){let s=0;for(let r=e;r<t.length&&this.isInlineCandidate(t[r],n);r++)s++;return s}handle(t,e){const n=t[0].parentElement,s=e&&e.autoMatchFormat,r=this.generateChildNodes(t,s?ae.generate(x,n,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})):{},e),i=s?super.matchTextBlockType(n):this.matchTextBlockTypeByTagName(n),a=!s&&!i;return T.from(Object.assign({id:st(),type:i||"paragraph",nodes:r},a?{annotations:{internalWrapper:a}}:{annotations:ae.generate(T,n,e)}),e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}isInlineCandidate(t,e){return t.nodeType===Node.TEXT_NODE||!this.isBlockBoundaryElement(t,e)&&(!!ee.has(t.nodeName)||!this.isDedicatedBlockTag(t.nodeName)&&(!(!1!==e.autoMatchFormat||!re(t))||this.isInlineLeafOrWrapper(t)))}isBlockBoundaryElement(t,e){var n;return!!t.hasAttribute(W)||!!(null===(n=e.blockBoundaryRegistry)||void 0===n?void 0:n.isBoundary(t))}isDedicatedBlockTag(t){return te.has(t)&&!ee.has(t)}isInlineLeafOrWrapper(t){return 0===t.childNodes.length?se.has(t.nodeName):this.isTextOnlyElement(t)?se.has(t.nodeName)||ee.has(t.nodeName):this.hasOnlyInlineDescendants(t)}isTextOnlyElement(t){const e=Array.from(t.childNodes);return!e.some((t=>t.nodeType===Node.ELEMENT_NODE))&&e.some((t=>t.nodeType===Node.TEXT_NODE))}hasOnlyInlineDescendants(t){for(let e=0;e<t.children.length;e++){const n=t.children[e];if(this.isDedicatedBlockTag(n.nodeName))return!1;if(!n.hasChildNodes())return!1;if(!this.hasOnlyInlineDescendants(n))return!1}return!0}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if(rt(s))return vt.from({id:st(),type:"image",nodes:[{id:st(),type:"image",url:s.src,annotations:ae.generate(Et,n,e)}],annotations:ae.generate(vt,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends he{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,e){const n=this.generateChildNodes(Array.from(t[0].childNodes),{},e);return 0===n.length?null:T.from({id:st(),type:super.matchTextBlockType(t[0]),nodes:n,annotations:ae.generate(T,t[0],e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?j.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type))),t.nestList.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return I.from({id:st(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:st(),type:"list-item",annotations:ae.generate(j,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),ae.generate(x,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,i=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),a=rt(s)&&["UL","OL"].includes(s.nodeName);return r&&!i&&a?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return j.from({id:st(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:I.from({id:st(),type:"number-list",blocks:[],annotations:ae.generate(I,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof j)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),mt.registerElementToBlockStrategy(new class extends oe{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:I.from({id:st(),type:"bullet-list",blocks:[],annotations:ae.generate(I,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof j)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),mt.registerElementToBlockStrategy(new le),
|
|
2
2
|
//!important: Code block strategies must be registered after HtmlBlockStrategy because registerElementToBlockStrategy uses unshift, giving later registrations higher priority.
|
|
3
3
|
mt.registerElementToBlockStrategy(new ce),mt.registerElementToBlockStrategy(new class extends ce{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],n=e.querySelector("code");if(n)return super.handle([n]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}),mt.registerElementToNodeStrategy(new class extends ue{canHandle(t,e){const n=t[e];return!ut(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,n){const s=!(!e||!1!==e.autoMatchFormat),r=Object.assign({},n),i=t[0],a=ae.generate(x,i,Object.assign({parentAnnotations:s?{inlineHtml:r.inlineHtml,link:r.link,code:r.code}:n},e));if("BR"===i.nodeName){const{inlineHtml:t}=a,e=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(a,["inlineHtml"]);return this.generateTextNode("\n",t&&"br"===t.htmlTag?e:a)}if(0===i.childNodes.length){const t=s?dt(Object.assign(Object.assign({},x.supportsHtmlTag(i.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml})):a;return Object.assign({},this.generateTextNode("",t))}}}),mt.registerElementToNodeStrategy(new class extends ue{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,n){const s=Object.assign({},n),r=!(!e||!1!==e.autoMatchFormat),i=t[0],a=i.parentNode.nodeName.toLowerCase(),o=r&&!x.supportsHtmlTag(a),l=this.generateTextNode(String(i.textContent),r?dt(Object.assign(Object.assign({},"span"===a?s:{link:s.link,code:"code"===a?s.code:void 0}),{inlineHtml:s.inlineHtml,plainText:o||void 0})):s);return Object.assign({},l)}}),z.register(T.typeName,new de),z.register(I.typeName,new de),z.register(j.typeName,new de),z.register(x.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered={}}get alwaysFilter(){return!0}filterAnnotations(t){const e=t,n=e.customStyle;if(!n)return t;e.bold&&n.fontWeight===R&&delete n.fontWeight,e.italic&&n.fontStyle===$&&delete n.fontStyle;const s=this.normalizeTextDecoration(n.textDecoration);return s&&this.shouldRemoveTextDecoration(s,e)&&delete n.textDecoration,0===Object.keys(n).length&&delete e.customStyle,t}normalizeTextDecoration(t){if(!t)return;const e=t.trim().toLowerCase().split(/\s+/);return e.some((t=>t!==F&&t!==P))?void 0:Array.from(new Set(e)).sort().join(" ")}shouldRemoveTextDecoration(t,e){const n=[];return e.underline&&n.push(F),e.strikethrough&&n.push(P),0!==n.length&&t===n.sort().join(" ")}}),z.register(T.typeName,new we),z.register(T.typeName,new pe(1)),z.register(T.typeName,new pe(2)),z.register(T.typeName,new pe(3)),z.register(T.typeName,new pe(4)),z.register(T.typeName,new pe(5)),z.register(T.typeName,new pe(6)),z.register(T.typeName,new fe("title")),z.register(T.typeName,new fe("subtitle")),z.register(x.typeName,new ge),z.register(x.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=_.getDefaultStyles(),this.elementTagName="code"}filterAnnotations(t){const{code:e,customStyle:n}=t;return e&&n?super.filterAnnotations(t):t}canFilter(t){return J.isCodeNode(t)}canRefill(t,e){return J.isTextNode(t)&&e.matches(this.elementTagName)}toCssText(){return`.${G.RTE_CONTENT_CONTAINER_CLASS_NAME} ${this.elementTagName} { ${this.convertStylesMapToCssText(Object.assign(Object.assign({},this.stylesToBeFiltered),{fontWeight:"500"}))} }`}}),z.register(x.typeName,new Z),z.register(Et.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=yt.getDefaultStyles(),this.elementTagName="img"}get alwaysFilter(){return!0}canFilter(t){return J.isImageNode(t)}canRefill(t,e){return e.tagName.toLowerCase()===this.elementTagName}toCssText(){return this.buildCssTextForStyles(this.elementTagName,this.classNameToBeAdded)}}),z.register(e.typeName,new q),z.register(tt.typeName,new et),z.register(I.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=K.getDefaultStyles(),this.elementTagName="ol,ul"}canFilter(t){return J.isListBlock(t.typeName)}canRefill(t,e){return J.isListBlock(t)&&e.matches(this.elementTagName)}toCssText(){const t=G.RTE_CONTENT_CONTAINER_CLASS_NAME,e=this.elementTagName.split(",").map((t=>t.trim())),n=e.map((e=>`.${t} ${e}`)).join(", "),s=e.map((e=>`.${t} ${e} > li::marker`)).join(", "),r=this.convertStylesMapToCssText(K.getDefaultMarkerStyles());return`${n} { ${this.convertStylesMapToCssText(this.stylesToBeFiltered)} } ${s} { ${r} }`}}),z.register(j.typeName,new class extends G{constructor(){super(...arguments),this.stylesToBeFiltered=U.getDefaultStyles("paragraph"),this.elementTagName="li",this.headingOrTitleClassNamePattern=/^v-rte-(h[1-6]|title|subtitle)$/}canFilter(t){const e=!t.getStyles().fontSize||this.isBlockOrNodeStylesMatchFilterStyles(t,["fontSize","lineHeight"]);return J.isListItemBlock(t.typeName)&&e}canRefill(t,e){return J.isListItemBlock(t)&&e.matches(this.elementTagName)&&this.isElementNotHeadingOrTitle(e)}toCssText(){return this.buildCssTextForStyles(this.elementTagName)}isElementNotHeadingOrTitle(t){return!t.className.split(" ").some((t=>this.headingOrTitleClassNamePattern.test(t.trim())))}}),z.register(j.typeName,new me(1)),z.register(j.typeName,new me(2)),z.register(j.typeName,new me(3)),z.register(j.typeName,new me(4)),z.register(j.typeName,new me(5)),z.register(j.typeName,new me(6)),z.register(j.typeName,new Te("title")),z.register(j.typeName,new Te("subtitle"));class xe{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new be(e)}}class be{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(ut(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class Oe{process(t){return t.replace(/(<[^>]+>)(\s+)(<[^>]+>)/g,((t,e,n,s)=>{const r=this.extractOpeningTagName(e),i=this.extractClosingTagName(s);return r&&i&&r===i?`${e}${n}${s}`:`${e}${s}`}))}extractOpeningTagName(t){const e=t.match(/<(\w[\w-]*)/);return e?e[1]:null}extractClosingTagName(t){const e=t.match(/<\/(\w[\w-]*)/);return e?e[1]:null}}class ye{process(t){return t.replace(/(>)[\n\t]+(?=.)/g,"$1")}}class Ee{process(t){return t.replace(/(.?)[\n\t]+(?=<)/g,"$1")}}class Ae{constructor(){this.processors=[new Oe,new ye,new Ee]}clean(t){if(!t||0===t.trim().length)return t;let e,n=t;do{e=n;for(const t of this.processors)n=t.process(n)}while(n!==e);return n}}const ve="COMMIT_VALUE";class ke extends m{constructor(t,e,n){super(),this.candidate=t,this.previous=e,this.host=n,this.isFlushable=!1,this.type="COMMIT_VALUE"}}class Ce extends pt{constructor(t){super(),t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=Q.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new Ce(n)}static createEmptyContent(t={autoMatchFormat:!0}){return Ce.fromJSON([{id:st(),type:"paragraph",annotations:{internalWrapper:!t.autoMatchFormat},nodes:[{id:st(),annotations:{plainText:!t.autoMatchFormat},type:"text",text:""}]}],t)}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=(new Ae).clean(t),s=xe.preserve(n),r=s.getProcessedHtml(),i=(new DOMParser).parseFromString(r,"text/html").body,a=Array.from(i.childNodes);s.restore(a);const o=Tt.process(a,e).filter(rt).map((t=>t.toDto(e))).filter(rt);return new Ce(o)}static generateContentStyles(t){return z.generateAllStylesContent(null==t?void 0:t.enableFontImports)}clone(t=!1){return new Ce(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&(rt(t.autoMatchFormat)||rt(t.skipCustomAnnotations))&&wt.warn("The 'options' parameter's properties 'autoMatchFormat' and 'skipCustomAnnotations' in toHtml method are deprecated and will be removed in the future."),this.isEmpty()?"":this.children.map((e=>e.toHtml({filterInlineStyles:null==t?void 0:t.filterInlineStyles}))).join("")}isEmpty(){return 0===this.children.length||1===this.children.length&&!this.children[0].isNotEmpty()}apply(t){var e;if(u.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const n=r.getDOMByEntity(this);n&&it.notify(at.getSubject(n,ct),null!==(e=t.flushPayload)&&void 0!==e?e:{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}getPlainText(){return this.children.map((t=>t.getPlainText())).join("")}toListItem(t){var e;t.children.map((t=>t.apply(new nt)));const n=new j(st());return n.apply(new g(t.children)),n.annotationMap=t.annotationMap,t instanceof j&&(null===(e=t.nestList)||void 0===e?void 0:e.length)&&(n.apply(new N([...t.nestList])),t.apply(new N([]))),n}createList(t){return new I(st(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof j&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof I&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}Ce.typeName="VegaRTEContent",u.register(w.DELETE_CHILDREN,Ce.typeName,new B),u.register(w.APPEND_CHILDREN,Ce.typeName,new xt),u.register(w.INSERT_CHILDREN_BEFORE,Ce.typeName,new bt),u.register(w.INSERT_CHILDREN_AFTER,Ce.typeName,new Ot),u.register(w.TRANSFORM_TO_CODE_BLOCK,Ce.typeName,new class extends t{handleAction(t,s){const r=t.selectedBlocks,i=new e(st(),this.getCodeContent(r),"plainText");s.apply(new n(r[0],i)),t.newCodeBlock=i,this.removeSelectBlocks(r,s)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new s(t[n]))}}),u.register(w.UPDATE_CURSOR_POSITION,Ce.typeName,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:i}=t,a=r.getDOMByEntity(e);a&&it.notify(at.getSubject(a,ot),{node:s,offset:n,updateDirectly:i})}}),u.register(w.DELETE_SELECTED_CONTENT,Ce.typeName,new class extends t{handleAction(t){const{host:e,mergeFlag:n}=t;it.notify(at.getSubject(e,lt),{host:e,detail:n})}}),u.register("COMMIT_VALUE",Ce.typeName,new class extends t{handleAction(t){return t.candidate}}),u.register(w.SEQUENTIAL_COMPOSITION,Ce.typeName,new class extends t{handleAction(t){const e=new Map,n={getAction:t=>e.get(t)};t.steps.forEach((t=>{const s="function"==typeof t?t(n):t;s&&(Array.isArray(s)?s:[s]).forEach((t=>{t.action.isFlushable=!1,t.target.apply(t.action),e.set(t.action.type,t.action)}))}))}});export{Dt as A,oe as B,ve as C,ft as E,le as H,At as I,kt as M,Rt as P,vt as R,xe as S,Ht as U,Ce as V,bt as a,Et as b,Lt as c,mt as d,yt as e,ke as f,Tt as g,ae as h}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,H as
|
|
1
|
+
import{h as t,r as e,c as i,H as o,g as a}from"./p-6b2342e0.js";import{c as s,V as r,M as n,I as l}from"./p-6e1ab235.js";import{V as h,I as v}from"./p-5c8e4e8f.js";import{s as d}from"./p-519a7d55.js";import{D as c,d as m}from"./p-36a57431.js";import{a as p,V as u,b as f,c as g}from"./p-a83cef5a.js";import{a as b}from"./p-53e3f259.js";import{r as w}from"./p-77e64f26.js";import{c as y}from"./p-3b6a6f08.js";import{T as j}from"./p-a7ed55d8.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-aa135628.js";import"./p-6a334573.js";import"./p-29584bb5.js";import"./p-b75ee3ba.js";import"./p-347d664e.js";import"./p-cb378636.js";var k=function(t,e,i,o){var a,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(s<3?a(r):s>3?a(e,i,r):a(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class x extends r{constructor(){super(...arguments),this.handlePopoverRef=t=>{this.popoverRef=t,t&&(c.addUniqueObserverToNode(t,p,(()=>this.bookmarkEditorController.handlePopoverShow())),c.addUniqueObserverToNode(t,u,(()=>{this.bookmarkEditorController.handlePopoverHide()})))},this.handleNameInputRef=t=>{this.nameInputRef=t},this.handleFormRef=t=>{this.formRef=t},this.handleFieldKeyDown=t=>{this.bookmarkEditorController.handleKeyDown(t)},this.handleCancelButtonRef=t=>{c.addUniqueObserverToNode(t,f,(()=>{var t;null===(t=this.getPopoverRef())||void 0===t||t.hide()}))},this.handleSubmitButtonRef=t=>{c.addUniqueObserverToNode(t,f,(()=>{this.bookmarkEditorController.submit()}))},this.handleActionGroupRef=t=>{c.addUniqueObserverToNode(t,f,(t=>{var e;const i=null===(e=t)||void 0===e?void 0:e.detail;"remove"===i?this.bookmarkEditorController.remove():"edit"===i&&this.bookmarkEditorController.startEditing()}))}}getPopoverRef(){return this.popoverRef}getNameInputRef(){return this.nameInputRef}getFormRef(){return this.formRef}render(){return t("vega-popover",{trigger:"click",alignment:"start",placement:"bottom",showArrow:!1,isScreenPosition:!0,ref:this.handlePopoverRef},t("span",{slot:"popover-content"},t("slot",null)),t("div",{slot:"popover",style:{maxWidth:"320px"}},this.renderPreviewContent(),this.renderFormContent()))}renderPreviewContent(){return t("vega-box",{display:this.bookmarkEditorController.isPreviewVisible()?"block":"none"},t("vega-flex",{style:{width:"100%"},gap:"size-8",alignItems:"center"},t("vega-font",{style:{minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},variant:"font-p2-short",color:"text-primary"},this.name),t("vega-button-group",{style:{flexShrink:"0"},size:"small",variant:"tertiary",ref:this.handleActionGroupRef},t("vega-button-group-item",{icon:"edit-line",iconOnly:!0,label:this.translationSlimmer.t("Edit bookmark"),itemKey:"edit"}),t("vega-button-group-item",{icon:"delete-bin",iconOnly:!0,label:this.translationSlimmer.t("Remove bookmark"),itemKey:"remove"}))))}renderFormContent(){return t("vega-box",{display:this.bookmarkEditorController.isPreviewVisible()?"none":"block"},t("vega-flex",{style:{width:"320px"},direction:"col",gap:"size-16"},t("vega-form",{ref:this.handleFormRef},this.renderNameInput()),this.renderActionButtons()))}renderNameInput(){return t("vega-input",{size:"small","data-vega-form":"name",label:this.translationSlimmer.t("Bookmark name"),validationRules:this.bookmarkEditorController.getValidationRules(),ref:this.handleNameInputRef,onKeyDown:this.handleFieldKeyDown})}renderActionButtons(){return t("vega-flex",{style:{width:"100%"},gap:"size-8",alignItems:"center",justifyContent:"end"},t("vega-button",{variant:"secondary",label:this.translationSlimmer.t("Cancel"),ref:this.handleCancelButtonRef}),t("vega-button",{label:this.translationSlimmer.t("preview"===this.mode?"Save":"Insert"),ref:this.handleSubmitButtonRef}))}}k([s()],x.prototype,"host",void 0),k([s()],x.prototype,"mode",void 0),k([s()],x.prototype,"name",void 0),k([s()],x.prototype,"translationSlimmer",void 0),k([s()],x.prototype,"bookmarkEditorController",void 0);var R=function(t,e,i,o){var a,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(s<3?a(r):s>3?a(e,i,r):a(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class C extends r{componentDidLoad(){this.updatePopoverTarget()}watchTargetChange(){this.updatePopoverTarget()}getValidationRules(){return[{canEvaluate:()=>!0,evaluate:t=>{const e=this.validateName(t);return{isValid:!e,message:e?this.translationSlimmer.t(e):""}},shouldShowError:t=>t.touched||t.modified}]}async handlePopoverShow(){this.isPreviewVisible()||await this.populateAndFocusNameInput()}async startEditing(){this.isEditing=!0,await this.populateAndFocusNameInput()}isPreviewVisible(){return"preview"===this.mode&&!this.isEditing}handlePopoverHide(){var t;this.isEditing=!1,null===(t=this.renderer.getFormRef())||void 0===t||t.reset()}async submit(){var t,e;const i=this.renderer.getFormRef(),o=this.renderer.getNameInputRef();if(!i||!o)return;const{isValid:a}=await i.valid();a?(this.changeEventEmitter.emit({action:"save",name:(null!==(t=o.value)&&void 0!==t?t:"").trim()}),await(null===(e=this.renderer.getPopoverRef())||void 0===e?void 0:e.hide())):await o.doFocus()}async remove(){var t;this.changeEventEmitter.emit({action:"remove"}),await(null===(t=this.renderer.getPopoverRef())||void 0===t?void 0:t.hide())}handleKeyDown(t){var e;"Escape"!==t.key?"Enter"===t.key&&(t.preventDefault(),this.submit()):null===(e=this.renderer.getPopoverRef())||void 0===e||e.hide()}async populateAndFocusNameInput(){var t;const e=this.renderer.getNameInputRef();e&&(e.value=null!==(t=this.name)&&void 0!==t?t:"",e.isValid=null,await e.doFocus())}validateName(t){return t&&0!==t.trim().length?/\s/.test(t)?"Bookmark name cannot contain spaces":this.reservedNames.includes(t)?"Bookmark name already exists":null:"Bookmark name cannot be empty"}updatePopoverTarget(){w.call(m.getSubject(this.renderer.getPopoverRef(),b),this.target)}}R([s()],C.prototype,"host",void 0),R([s()],C.prototype,"mode",void 0),R([s({writable:!0})],C.prototype,"isEditing",void 0),R([s()],C.prototype,"name",void 0),R([s()],C.prototype,"reservedNames",void 0),R([s()],C.prototype,"target",void 0),R([s()],C.prototype,"renderer",void 0),R([s()],C.prototype,"translationSlimmer",void 0),R([s()],C.prototype,"changeEventEmitter",void 0),R([n("componentDidLoad")],C.prototype,"componentDidLoad",null),R([n("watchTargetChange")],C.prototype,"watchTargetChange",null);var E=function(t,e,i,o){var a,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var n=t.length-1;n>=0;n--)(a=t[n])&&(r=(s<3?a(r):s>3?a(e,i,r):a(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};const S=class{constructor(t){e(this,t),this.vegaChange=i(this,"vegaChange",7),this.globalSlimmers=new Map,this.translationSlimmer=new j,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.renderer=new x,this.bookmarkEditorController=new C,this.changeEventEmitter=y(S,g),this.isEditing=!1,this.mode="insert",this.name="",this.reservedNames=[]}watchTargetChange(){}async show(){var t;await(null===(t=this.renderer.getPopoverRef())||void 0===t?void 0:t.show())}async hide(){var t;await(null===(t=this.renderer.getPopoverRef())||void 0===t?void 0:t.hide())}render(){return d(t(o,null,this.renderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{target:["watchTargetChange"]}}};E([v()],S.prototype,"globalSlimmers",void 0),E([l()],S.prototype,"translationSlimmer",void 0),E([l()],S.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),E([l()],S.prototype,"renderer",void 0),E([l()],S.prototype,"bookmarkEditorController",void 0),E([l()],S.prototype,"changeEventEmitter",void 0),S.style=":host{display:inline-block}";export{S as vega_rich_text_bookmark_editor}
|