@heartlandone/vega 2.103.0 → 2.105.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-fde2b355.js} +16 -2
- 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 +12 -12
- 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-footer.cjs.entry.js +20 -25
- 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 +63 -19
- 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 +12 -12
- package/dist/cjs/{y-axis-input-processor-d3a3839c.js → y-axis-input-processor-9ba96716.js} +1 -1
- package/dist/collection/components/vega-app-footer/vega-app-footer.js +38 -35
- 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/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-renderer.js +2 -2
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-source-view-renderer.js +45 -2
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.css +16 -0
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +3 -0
- package/dist/collection/constants/misc.js +2 -4
- package/dist/collection/helpers/slimmers/form/form-field-controller-slimmer.js +12 -1
- package/dist/collection/helpers/translation/locales/en.js +4 -0
- package/dist/collection/helpers/validator/form-field-controller.js +4 -1
- 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-6f0f083f.js} +16 -2
- 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 +12 -12
- 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-footer.entry.js +20 -25
- 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 +63 -19
- 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 +12 -12
- package/dist/esm/{y-axis-input-processor-c6b2a914.js → y-axis-input-processor-dd574c2e.js} +1 -1
- package/dist/sri/vega-sri-manifest.json +339 -339
- package/dist/types/components/vega-app-footer/vega-app-footer.d.ts +14 -12
- 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/components/vega-rich-text-editor/slimmers/renderers/vega-rich-text-editor-source-view-renderer.d.ts +11 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +3 -2
- package/dist/types/components.d.ts +26 -22
- package/dist/types/constants/misc.d.ts +0 -2
- package/dist/types/helpers/slimmers/form/form-field-controller-slimmer.d.ts +7 -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-8de29082.entry.js → p-09c5aae6.entry.js} +1 -1
- 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-9a96fb05.entry.js → p-185a24ed.entry.js} +1 -1
- package/dist/vega/{p-dcfce26e.entry.js → p-1acaccd6.entry.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-8e59606f.entry.js → p-27c0c41f.entry.js} +1 -1
- package/dist/vega/{p-3283fa2f.js → p-2a501c55.js} +1 -1
- package/dist/vega/p-2dbdd1bf.entry.js +1 -0
- package/dist/vega/p-2e847194.js +1 -0
- package/dist/vega/{p-f9d09b0c.js → p-3040c091.js} +1 -1
- package/dist/vega/{p-e6b0a292.entry.js → p-313ccf96.entry.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-322da1eb.entry.js → p-377a5330.entry.js} +1 -1
- package/dist/vega/{p-08bf08d2.js → p-37eb020f.js} +1 -1
- package/dist/vega/p-3831f00d.entry.js +1 -0
- 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-4a2e040f.entry.js +1 -0
- package/dist/vega/{p-6e16bb3a.js → p-4ad6da8f.js} +1 -1
- package/dist/vega/{p-8ac0b1b2.entry.js → p-4b5591fb.entry.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-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-7874055b.entry.js → p-593a4af3.entry.js} +1 -1
- package/dist/vega/{p-eb945d34.entry.js → p-5a60c1ed.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-5f589bdb.entry.js +1 -0
- 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-3b911043.entry.js → p-6b2da3bc.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-70a08fe5.js +1 -0
- 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-fee080b9.entry.js → p-8a303571.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-c08ac33f.entry.js → p-9e51b1a8.entry.js} +1 -1
- package/dist/vega/{p-1a4d1991.entry.js → p-a222639f.entry.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-b63a90b3.entry.js → p-a6467be2.entry.js} +1 -1
- package/dist/vega/p-a7ed55d8.js +1 -0
- package/dist/vega/{p-3567dc55.entry.js → p-afa8a9af.entry.js} +1 -1
- package/dist/vega/{p-9153c2f5.entry.js → p-b015a970.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-dc83fa6b.entry.js → p-bc8bc41e.entry.js} +1 -1
- package/dist/vega/{p-ac98c189.entry.js → p-c07039d8.entry.js} +1 -1
- package/dist/vega/{p-3b4e2ba0.js → p-c0eddde0.js} +1 -1
- package/dist/vega/{p-abe5f7f0.entry.js → p-c26c979f.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-ca1fe571.entry.js → p-c75c14e4.entry.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-27e77ea1.entry.js → p-d1b8fb1d.entry.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-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-018bb83b.entry.js → p-e22a00ec.entry.js} +1 -1
- package/dist/vega/{p-4e4b50f3.entry.js → p-e67ef7a1.entry.js} +1 -1
- package/dist/vega/{p-4cdc064d.entry.js → p-ee2bd1e8.entry.js} +1 -1
- package/dist/vega/{p-45af801f.js → p-f2193656.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/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-38c551a9.entry.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-a9fc4043.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.105.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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as t,F as e,r as i,c as s,H as a,g as n}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as o,V as p,I as l}from"./p-6e1ab235.js";import{V as h,I as c}from"./p-5c8e4e8f.js";import{V as f}from"./p-d1f47512.js";import{B as d}from"./p-b3420fcf.js";import{c as g}from"./p-3b6a6f08.js";import{f as m}from"./p-a83cef5a.js";import"./p-cb378636.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-cc569b54.js";import"./p-6a334573.js";import"./p-36a57431.js";import"./p-aa135628.js";import"./p-29584bb5.js";const x=`© ${(new Date).getFullYear()} Heartland Payment Systems, LLC – a Global Payments company. All rights reserved.`,v="https://noticesandpolicies.globalpayments.com/software-terms/global-payments-software-terms-of-service",u="https://noticesandpolicies.globalpayments.com/genius-product-privacy-notice-for-merchant-users",b=`© ${(new Date).getFullYear()} Global Payments Inc. All rights reserved.`;var w=function(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class y extends p{render(){return this.additionalLinks.length>0&&t(e,null,this.hideDefaultLinks?null:t("span",{class:"v-separator"}),this.additionalLinks.map(((t,e)=>this.renderAdditionalLink(t,e))))}renderAdditionalLink(i,s){return i.URL&&i.label&&t(e,null,t("a",{id:i.id,target:i.target,href:i.URL,onClick:t=>this.onAdditionalLinkClick(t,i)},i.label),this.additionalLinks.length===s+1?null:t("span",{class:"v-separator"}))}onAdditionalLinkClick(t,e){this.additionalLinkClickEventEmitter.emit(e).defaultPrevented&&t.preventDefault()}}w([o()],y.prototype,"additionalLinks",void 0),w([o()],y.prototype,"hideDefaultLinks",void 0),w([o()],y.prototype,"additionalLinkClickEventEmitter",void 0);var k=function(t,e,i,s){var a,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(a=t[o])&&(r=(n<3?a(r):n>3?a(e,i,r):a(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};const j=class{constructor(t){i(this,t),this.vegaAdditionalLinkClick=s(this,"vegaAdditionalLinkClick",7),this.additionalLinkClick=s(this,"additionalLinkClick",7),this.globalSlimmers=new Map,this.additionalLinkClickEventEmitter=g(j,m),this.additionalLinksRenderer=new y,this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.brandSwitchControllerSlimmer=new d,this.googlePrivacyPolicyUrl="https://policies.google.com/privacy",this.googleTermsOfServiceUrl="https://policies.google.com/terms",this.currentBranding=f.getBranding(),this.content=this.getDefaultContent(),this.termOfUseLabel="Terms of Service",this.termOfUseUrl=this.getDefaultTermsOfUseUrl(),this.termOfUseUrlTarget="_self",this.privacyPolicyLabel="Privacy Notice",this.privacyPolicyUrl=this.getDefaultPrivacyPolicyUrl(),this.privacyPolicyUrlTarget="_self",this.hideDefaultLinks=!1,this.additionalLinks=[],this.showDisclaimer=!1,this.disclaimerUrlTarget="_self"}render(){return r(t(a,{class:"v-text-center"},this.renderContent(),this.renderLinks(),this.renderDisclaimer()),this.host)}getDefaultContent(){return"heartland"===f.getBranding()?x:b}getDefaultTermsOfUseUrl(){return v}getDefaultPrivacyPolicyUrl(){return u}renderContent(){return t("div",{class:"vega-app-footer-content"},this.content!==b&&this.content!==x?this.content:this.getDefaultContent())}renderLinks(){return t("div",{class:"vega-link"},this.hideDefaultLinks?null:this.renderDefaultLinks(),this.additionalLinksRenderer.render())}renderDefaultLinks(){return t(e,null,t("a",{id:this.termOfUseUrlId,target:this.termOfUseUrlTarget,href:this.getTermsOfUseUrl()},this.termOfUseLabel),t("span",{class:"v-separator"}),t("a",{id:this.privacyPolicyUrlId,target:this.privacyPolicyUrlTarget,href:this.getPrivacyPolicyUrl()},this.privacyPolicyLabel))}getTermsOfUseUrl(){return this.termOfUseUrl!==v?this.termOfUseUrl:this.getDefaultTermsOfUseUrl()}getPrivacyPolicyUrl(){return this.privacyPolicyUrl!==u?this.privacyPolicyUrl:this.getDefaultPrivacyPolicyUrl()}renderDisclaimer(){return this.showDisclaimer&&t("div",{class:"vega-app-footer-disclaimer"},t("div",{class:"h-separator"}),t("div",{class:"vega-app-footer-disclaimer-content vega-link"},"This site is protected by reCAPTCHA and the"," ",t("a",{target:this.disclaimerUrlTarget,href:this.googlePrivacyPolicyUrl}," ","Google Privacy Policy"," ")," ","and"," ",t("a",{target:this.disclaimerUrlTarget,href:this.googleTermsOfServiceUrl}," ","Google Terms of Service"," "),"apply."))}get host(){return n(this)}};k([c()],j.prototype,"globalSlimmers",void 0),k([l()],j.prototype,"additionalLinkClickEventEmitter",void 0),k([l()],j.prototype,"additionalLinksRenderer",void 0),k([l()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),k([l()],j.prototype,"brandSwitchControllerSlimmer",void 0),j.style=':host{display:block;padding-left:0px;padding-right:0px}:host .h-separator{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));margin-top:20px;margin-bottom:20px}:host .v-separator{display:inline-block;width:1px;margin-left:8px;margin-right:8px;background-color:rgba(70, 71, 101, 0.8)}:host>.vega-link{display:flex;align-items:stretch;justify-content:center;flex-wrap:wrap}:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host>.vega-link a{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));margin-bottom:8px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-content{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-app-footer-disclaimer-content{font-family:"Inter", sans-serif;font-size:12px;font-weight:400;line-height:16px;letter-spacing:0px}}:host(.v-text-center){text-align:center}:host .vega-link a{color:rgba(var(--v-text-link, 19, 98, 226, 1));border-radius:4px;text-decoration:none}:host .vega-link a:visited{color:rgba(var(--v-text-link-visited, 95, 56, 206, 1))}:host .vega-link a:hover{color:rgba(var(--v-text-link-hover, 4, 112, 236, 1));text-decoration:underline}:host .vega-link a:focus{color:rgba(var(--v-text-link-focus, 4, 112, 236, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .vega-link a:active{color:rgba(var(--v-text-link-active, 29, 65, 195, 1));text-decoration:underline}';export{j as vega_app_footer}
|
|
@@ -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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as r,g as s}from"./p-6b2342e0.js";import{R as o}from"./p-8bc15ed0.js";import{c as a}from"./p-8387896e.js";import{s as n}from"./p-519a7d55.js";import{a as p,h as l,d as h}from"./p-aa135628.js";import{F as d}from"./p-
|
|
1
|
+
import{r as e,c as t,h as i,H as r,g as s}from"./p-6b2342e0.js";import{R as o}from"./p-8bc15ed0.js";import{c as a}from"./p-8387896e.js";import{s as n}from"./p-519a7d55.js";import{a as p,h as l,d as h}from"./p-aa135628.js";import{F as d}from"./p-70a08fe5.js";import{I as c}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-5c8e4e8f.js";import{F as g}from"./p-cb378636.js";import{c as x}from"./p-3b6a6f08.js";import{C as b}from"./p-2d0d575f.js";import{c as v}from"./p-a83cef5a.js";import"./p-abd7aeaa.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-36a57431.js";import"./p-53e3f259.js";import"./p-347d664e.js";import"./p-cc569b54.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-71909102.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-7d3419c7.js";import"./p-29584bb5.js";const u=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!1===e.autoValidation}];var w=function(e,t,i,r){var s,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(s=e[n])&&(a=(o<3?s(a):o>3?s(t,i,a):s(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a};const j=class{constructor(r){e(this,r),this.vegaChange=t(this,"vegaChange",7),this.change=t(this,"change",7),this.globalSlimmers=new Map,this.formFieldController=new d({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new o:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.colorPickerContainerRef,touchableAreaGetter:()=>[this.colorPickerTouchableAreaRef]}),this.changeEventEmitter=x(j,v),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(u),this.value="",this.hint="",this.disabled=!1,this.required=!1,this.optional=!1,this.name="",this.label="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.isInline=!1,this.columns=8,this.renderColorPickerContainer=()=>{const e=this.getValidColumns();return i("div",{class:p([this.isInline?null:"color-picker-inline"]),ref:e=>this.colorPickerContainerRef=e},i("vega-flex",{direction:"row",gap:"size-8",alignItems:"center",style:{maxWidth:34*e-8+"px"}},this.colors.map((e=>{const t=this.value===e;return i("div",{id:e,class:{"color-picker-inline-items":!0,selected:t},ref:e=>this.colorPickerTouchableAreaRef=e,style:{backgroundColor:e},onClick:this.updateValueProp,role:"button",tabIndex:0,"aria-label":"color",onKeyDown:a()},t?i("vega-icon",{icon:"checkmark",size:"size-16",class:{"v-text-black":this.isDarkColorCheckmark(this.value),"v-text-white":!this.isDarkColorCheckmark(this.value)}}):null)}))))},this.renderHintMessage=()=>i("vega-text",{text:this.hint}),this.updateValueProp=async e=>{this.disabled||(this.value=String(e.currentTarget.getAttribute("id")))}}watchValue(){this.resetValueIfInvalid(),this.changeEventEmitter.emit(this.value),b.notify(g,{host:this.host,detail:this.value})}watchValidationRules(){}connectedCallback(){this.resetValueIfInvalid()}render(){return n(i(r,{class:{disabled:this.disabled}},this.renderLabelDom(),this.renderColorPickerContainer(),this.hint&&this.renderHintMessage()),this.host)}renderLabelDom(){return i("vega-field-label",{"is-field-required":this.required,optional:this.optional,disabled:this.disabled,label:this.label})}getValidColumns(){const e=Math.floor(this.columns);return Number.isFinite(e)&&e>0?e:1}isDarkColorCheckmark(e,t="#fcfcfc",i="#203645"){const r=this.getLuminance(e),s=this.getLuminance(t),o=this.getLuminance(i);return r>Math.sqrt((s+.05)*(o+.05))-.05}getLuminance(e){const t=[l(e).r/255,l(e).g/255,l(e).b/255].map((e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4));return.2126*t[0]+.7152*t[1]+.0722*t[2]}resetValueIfInvalid(){this.colors.some((e=>h(e).toUpperCase()==h(this.value).toUpperCase()))||(this.value="")}get host(){return s(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};w([f()],j.prototype,"globalSlimmers",void 0),w([c()],j.prototype,"formFieldController",void 0),w([c()],j.prototype,"changeEventEmitter",void 0),w([c()],j.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),j.style=':host{display:inline-block;text-align:left;line-height:normal}:host vega-field-label{margin-bottom:8px}:host(.disabled) .color-picker-inline{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.disabled) .color-picker-inline-items:hover{box-shadow:none}:host(.disabled) .color-picker-inline-items:focus-within{box-shadow:none}:host .color-picker-inline{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding:12px;max-width:max-content}:host .color-picker-inline-items{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));border-radius:4px;width:24px;height:24px;cursor:pointer;align-items:center;justify-content:center}:host .color-picker-inline-items.selected{border-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1))}:host .color-picker-inline-items:hover{box-shadow:0 0 0 4px rgba(var(--v-ring-input-focus, 19, 98, 226, 0.25))}:host .color-picker-inline-items:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));box-shadow:0px 0px 0px 1px rgba(var(--v-bg-primary, 252, 252, 252, 1)) inset;border:1px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}:host .checkmark-black{color:rgba(var(--v-text-black, 32, 54, 69, 1))}:host .checkmark-white{color:rgba(var(--v-text-white, 252, 252, 252, 1))}:host vega-text{padding-left:8px;padding-right:8px;padding-top:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .color-picker-inline.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-hidden{display:none}:host vega-flex{flex-wrap:wrap}';export{j as vega_color_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,F as t,r as o,c as n,H as e,g as a}from"./p-6b2342e0.js";import{c as r,V as s,M as c,I as d}from"./p-6e1ab235.js";import{s as l}from"./p-6bd5c49b.js";import{V as p,I as h}from"./p-5c8e4e8f.js";import{s as m}from"./p-519a7d55.js";import{f}from"./p-
|
|
1
|
+
import{h as i,F as t,r as o,c as n,H as e,g as a}from"./p-6b2342e0.js";import{c as r,V as s,M as c,I as d}from"./p-6e1ab235.js";import{s as l}from"./p-6bd5c49b.js";import{V as p,I as h}from"./p-5c8e4e8f.js";import{s as m}from"./p-519a7d55.js";import{f}from"./p-4f24f262.js";import{a as b}from"./p-aa135628.js";import{D as v}from"./p-36a57431.js";import{b as x,e as g}from"./p-a83cef5a.js";import{c as u}from"./p-1ec763ab.js";import{c as j}from"./p-613ddaab.js";import{V as k}from"./p-44245a36.js";import{O as w}from"./p-331a62d5.js";import{C as y}from"./p-2d0d575f.js";import{A as E}from"./p-cb378636.js";import{a0 as I}from"./p-8e3c1c81.js";import{c as L}from"./p-3b6a6f08.js";import{T as z}from"./p-a7ed55d8.js";import"./p-ed45b3b6.js";import"./p-fc07ed1e.js";import"./p-d4ea8e22.js";import"./p-49a2e141.js";import"./p-262ec334.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-87a4d75f.js";import"./p-982747ef.js";import"./p-b438e68b.js";import"./p-25d8b416.js";import"./p-d1d91f1a.js";import"./p-5c285374.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-347d664e.js";import"./p-29584bb5.js";import"./p-b75ee3ba.js";var S=function(i,t,o,n){var e,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(i,t,o,n);else for(var s=i.length-1;s>=0;s--)(e=i[s])&&(r=(a<3?e(r):a>3?e(t,o,r):e(t,o))||r);return a>3&&r&&Object.defineProperty(t,o,r),r};class O extends s{render(){return i("div",{class:{accordion:!0,background:this.drawsBackground,"has-title-bg":!!this.titleBackgroundColor,expanded:this.expand,collapsed:!this.expand,"icon-position-center":"center"===this.iconPosition}},this.renderHeader(),this.renderContent())}renderHeader(){const o=i(t,null,this.renderPrefixIcon(),this.accordionTitle?this.renderTitle():this.renderTitleSlot()),n=i("vega-flex",{gap:"size-8","align-items":"start"},"left"===this.expandIconAlign&&this.renderExpandIcon(),o,"right"===this.expandIconAlign&&this.renderExpandIcon());return this.titleBackgroundColor?i("vega-box",{class:"accordion-header","background-color":this.titleBackgroundColor},n):i("div",{class:"accordion-header"},n)}renderPrefixIcon(){return this.prefixIcon&&i("div",{class:"accordion-prefix-icon"},i("vega-icon",{icon:this.prefixIcon,size:"size-24"}))}renderTitle(){return i("div",{class:"accordion-title"},this.accordionTitle)}renderExpandIcon(){const t=["accordion-expand-icon",`accordion-expand-icon-align-${this.expandIconAlign}`,f(this.showExpandIcon,"display")];return i("div",{class:`${b(t)}`},i("vega-button-circle",{size:"small","icon-color":"text-link",variant:"icon-only","data-aria-label":this.getExpandIconAriaLabel(),"data-aria-expanded":`${this.expand}`,icon:k.getIconKey("left"===this.expandIconAlign?"chevron-down":"chevron-up"),ref:i=>{v.addUniqueObserverToNode(i,x,(()=>{this.expandController.flipExpand()}))}}))}renderContent(){return i("div",{class:"accordion-content"},i("slot",{name:"content"}),i("slot",{name:"accordion-content"}))}renderTitleSlot(){return i("div",{class:"accordion-title-slot"},i("slot",{name:"title"}),i("slot",{name:"accordion-title"}))}getExpandIconAriaLabel(){const i=this.accordionTitle||this.getSlottedTitleText();return i?this.translationSlimmer.t(this.expand?"Collapse {0} accordion":"Expand {0} accordion",i):this.translationSlimmer.t(this.expand?"Collapse accordion":"Expand accordion")}getSlottedTitleText(){const i=this.host.querySelector('[slot="title"], [slot="accordion-title"]');return i?(i.textContent||"").trim():""}}k.register({"chevron-up":u,"chevron-down":j}),S([r()],O.prototype,"drawsBackground",void 0),S([r()],O.prototype,"prefixIcon",void 0),S([r()],O.prototype,"accordionTitle",void 0),S([r()],O.prototype,"titleBackgroundColor",void 0),S([r()],O.prototype,"expandIconAlign",void 0),S([r()],O.prototype,"expand",void 0),S([r()],O.prototype,"iconPosition",void 0),S([r()],O.prototype,"showExpandIcon",void 0),S([r()],O.prototype,"expandController",void 0),S([r()],O.prototype,"translationSlimmer",void 0),S([r()],O.prototype,"host",void 0);var C=function(i,t,o,n){var e,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(i,t,o,n);else for(var s=i.length-1;s>=0;s--)(e=i[s])&&(r=(a<3?e(r):a>3?e(t,o,r):e(t,o))||r);return a>3&&r&&Object.defineProperty(t,o,r),r};class R extends s{flipExpand(){this.expand=!this.expand}onExpand(){this.groupId&&this.expand&&y.notify(E,{groupId:this.groupId,element:this.host}),this.expandEventEmitter.emit(this.expand)}registerObserver(){this.observer=new w(I,this.shouldCollapseSelfIfOtherExpand.bind(this)),y.register(E,this.observer)}unregisterObserver(){this.observer&&(y.unregister(E,this.observer),this.observer=null)}shouldCollapseSelfIfOtherExpand(i){this.groupId===i.groupId&&this.host!==i.element&&(this.expand=!1)}}C([r()],R.prototype,"host",void 0),C([r()],R.prototype,"groupId",void 0),C([r({writable:!0})],R.prototype,"expand",void 0),C([r()],R.prototype,"expandEventEmitter",void 0),C([c("watchExpand")],R.prototype,"onExpand",null),C([c("componentWillLoad")],R.prototype,"registerObserver",null),C([c("disconnectedCallback")],R.prototype,"unregisterObserver",null);var M=function(i,t,o,n){var e,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(i,t,o,n);else for(var s=i.length-1;s>=0;s--)(e=i[s])&&(r=(a<3?e(r):a>3?e(t,o,r):e(t,o))||r);return a>3&&r&&Object.defineProperty(t,o,r),r};const T=class{constructor(i){o(this,i),this.vegaExpand=n(this,"vegaExpand",7),this.accordionExpand=n(this,"accordionExpand",7),this.globalSlimmers=new Map,this.renderer=new O,this.expandController=new R,this.translationSlimmer=new z,this.expandEventEmitter=L(T,g,"accordionExpand"),this.vegaComponentUsageRuntimeMetricsSlimmer=new p,this.drawsBackground=!0,this.expandIconAlign="right",this.expand=!0,this.iconPosition="top",this.showExpandIcon=!0}watchExpand(){}render(){return l(i("slot",null)),m(i(e,null,this.renderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{expand:["watchExpand"]}}};M([h()],T.prototype,"globalSlimmers",void 0),M([d()],T.prototype,"renderer",void 0),M([d()],T.prototype,"expandController",void 0),M([d()],T.prototype,"translationSlimmer",void 0),M([d()],T.prototype,"expandEventEmitter",void 0),M([d()],T.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),T.style=':host(.v-block),.v-block{display:block}:host(.v-inline-block),.v-inline-block{display:inline-block}:host(.v-hidden),.v-hidden{display:none}@media (min-width: 320px){:host(.S\\:v-block),.S\\:v-block{display:block}:host(.S\\:v-inline-block),.S\\:v-inline-block{display:inline-block}:host(.S\\:v-hidden),.S\\:v-hidden{display:none}}@media (min-width: 768px){:host(.M\\:v-block),.M\\:v-block{display:block}:host(.M\\:v-inline-block),.M\\:v-inline-block{display:inline-block}:host(.M\\:v-hidden),.M\\:v-hidden{display:none}}@media (min-width: 1024px){:host(.L\\:v-block),.L\\:v-block{display:block}:host(.L\\:v-inline-block),.L\\:v-inline-block{display:inline-block}:host(.L\\:v-hidden),.L\\:v-hidden{display:none}}@media (min-width: 1440px){:host(.XL\\:v-block),.XL\\:v-block{display:block}:host(.XL\\:v-inline-block),.XL\\:v-inline-block{display:inline-block}:host(.XL\\:v-hidden),.XL\\:v-hidden{display:none}}:host{display:block;text-align:left;line-height:normal}.accordion{display:block;border-radius:16px}.accordion-title,.accordion-title-slot{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));overflow:hidden;flex-basis:0;flex-grow:1;padding-top:2px;padding-bottom:2px}@media screen and (min-width: 768px) and (max-width: 1023px){.accordion-title,.accordion-title-slot{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.accordion-title,.accordion-title-slot{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.accordion-title,.accordion-title-slot{font-family:"Inter", sans-serif;font-size:20px;font-weight:700;line-height:28px;letter-spacing:0px}}.accordion-prefix-icon{width:24px;height:32px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));box-sizing:border-box;padding-top:4px;padding-bottom:4px;min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;flex-shrink:0}.icon-position-center .accordion-prefix-icon{align-self:center}.accordion-content{transition-property:all;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms}.accordion.background{padding:24px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1))}.accordion.has-title-bg{overflow:hidden}.accordion.has-title-bg.background{padding:0}.accordion.has-title-bg .accordion-header{padding:24px}.accordion.has-title-bg.expanded .accordion-content{padding:24px;margin-top:0}.accordion.expanded .accordion-content{margin-top:24px}.accordion.collapsed .accordion-content{max-height:0px;overflow:hidden;display:none}.accordion.collapsed .accordion-expand-icon-align-left{transform:rotate(-90deg)}.accordion.collapsed .accordion-expand-icon-align-right{transform:rotate(180deg)}.accordion-expand-icon{transition-property:transform;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;min-width:-webkit-min-content;min-width:-moz-min-content;min-width:min-content;flex-shrink:0}.icon-position-center .accordion-expand-icon{align-self:center}.hidden{display:none}';export{T as vega_accordion}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,p as s,s as i}from"./p-
|
|
1
|
+
import{a as t,p as s,s as i}from"./p-3040c091.js";import{i as h}from"./p-aa135628.js";class e{constructor(t,s,i=0,h=0,e,n,r){this._startOffset=0,this._endOffset=0,this._startContainer=t,this._endContainer=s,this._startOffset=i,this._endOffset=h,this._startNode=e,this._endNode=n,r&&(this._oldNativeRange=r)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(s,i){const{startOffset:h,endOffset:n}=s;this._startOffset=h,this._endOffset=n;const r=s.startNode,o=s.endNode;if(r instanceof t){this._startNode=r,this._endNode=o;const t=this._startNode.getRangeContainer(),s=this._startNode===this._endNode?t:this._endNode.getRangeContainer();t&&(this._startContainer=t,this._endContainer=s)}else this._startContainer=r,this._endContainer=o,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),i&&(this._oldNativeRange=i);return new e(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new e(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){let t=null;if(this._startNode){const s=this._startNode.getRangeContainer(),i=this._startNode===this._endNode?s:this._endNode.getRangeContainer();if(s&&i)return t=new Range,t.setStart(s,this.clampOffsetToContainer(s,this._startOffset)),t.setEnd(i,this.clampOffsetToContainer(i,this._endOffset)),this._startContainer=s,this._endContainer=i,this._oldNativeRange=t,t}if(!t&&this._oldNativeRange)return this._oldNativeRange}clampOffsetToContainer(t,s){var i,h;const e=t.nodeType===Node.TEXT_NODE?null!==(h=null===(i=t.textContent)||void 0===i?void 0:i.length)&&void 0!==h?h:0:t.childNodes.length;return Math.max(0,Math.min(s,e))}getRTENodeByElement(t){if(t){const e=t.nodeType===Node.TEXT_NODE?t.parentElement:h(t)&&s.isDecoratorNodeContainerElement(t)?s.getDecoratorNodeElement(t):t;return i.getEntityByDOM(e)}}}export{e as R}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as t}from"./p-
|
|
1
|
+
import{B as t}from"./p-46d34326.js";import{f as e}from"./p-d27ae9ff.js";class s{constructor(){this._domain=[0,1],this._range=[0,1]}call(t){const e=Number(t),s=this._domain[0],n=this._domain[1],i=this._range[0],r=this._range[1];return n===s?(i+r)/2:i+(e-s)/(n-s)*(r-i)}domain(t){return void 0===t?[...this._domain]:(this._domain=t.map(Number),this)}range(t){return void 0===t?[...this._range]:(this._range=[...t],this)}ticks(t=10){const[e,s]=this._domain,i=n(e,s,t);if(0===i||!isFinite(i))return[e];const r=Math.ceil(e/i)*i,o=Math.floor(s/i)*i,a=[];for(let t=r;t<=o+i/2;t+=i)a.push(Math.round(1e12*t)/1e12);return a}tickFormat(t=10){const[e,s]=this._domain,r=n(e,s,t),o=r>0?Math.max(0,-Math.floor(Math.log10(r))):0;return t=>function(t,e){const s=Math.abs(t);let n;if(e<=0)n=i(String(Math.round(s)));else{const t=s.toFixed(e),r=t.indexOf(".");n=i(t.substring(0,r))+t.substring(r)}return t<0?"−"+n:n}(Number(t),o)}copy(){const t=new s;return t._domain=[...this._domain],t._range=[...this._range],t}}function n(t,e,s){const n=Math.abs(e-t);let i=Math.pow(10,Math.floor(Math.log10(n/s)));const r=n/s/i;return r>=7.5?i*=10:r>=3.5?i*=5:r>=1.5&&(i*=2),e<t?-i:i}function i(t){const e=t.length;if(e<=3)return t;let s="";for(let n=0;n<e;n++)n>0&&(e-n)%3==0&&(s+=","),s+=t[n];return s}function r(){const t=new s,e=Object.assign((e=>t.call(e)),{domain:s=>void 0===s?t.domain():(t.domain(s),e),range:s=>void 0===s?t.range():(t.range(s),e),ticks:e=>t.ticks(e),tickFormat:(...e)=>t.tickFormat(e[0]),copy:()=>o(t.copy()),bandwidth:()=>0});return e}function o(t){const e=Object.assign((e=>t.call(e)),{domain:s=>void 0===s?t.domain():(t.domain(s),e),range:s=>void 0===s?t.range():(t.range(s),e),ticks:e=>t.ticks(e),tickFormat:(...e)=>t.tickFormat(e[0]),copy:()=>o(t.copy()),bandwidth:()=>0});return e}function a(t,e,s){const n=new Date(t);switch(e){case"second":n.setSeconds(n.getSeconds()+s);break;case"minute":n.setMinutes(n.getMinutes()+s);break;case"hour":n.setHours(n.getHours()+s);break;case"day":n.setDate(n.getDate()+s);break;case"week":n.setDate(n.getDate()+7*s);break;case"month":n.setMonth(n.getMonth()+s);break;case"year":n.setFullYear(n.getFullYear()+s)}return n}class c{constructor(){this._domain=[new Date(2e3,0,1),new Date(2e3,0,2)],this._range=[0,1]}call(t){const e=t instanceof Date?t.getTime():Number(t),s=this._domain[0].getTime(),n=this._domain[1].getTime(),i=this._range[0];return n===s?i:i+(e-s)/(n-s)*(this._range[1]-i)}domain(t){return void 0===t?[...this._domain]:(this._domain=t.map((t=>new Date(t))),this)}range(t){return void 0===t?[...this._range]:(this._range=[...t],this)}ticks(t=10){const e=this._domain[0].getTime(),s=this._domain[1].getTime(),n=Math.abs(s-e);if(0===n)return[new Date(e)];const i=36e5,r=[{unit:"second",ms:1e3,steps:[1,5,15,30]},{unit:"minute",ms:6e4,steps:[1,5,15,30]},{unit:"hour",ms:i,steps:[1,3,6,12]},{unit:"day",ms:864e5,steps:[1,2]},{unit:"week",ms:6048e5,steps:[1]},{unit:"month",ms:2630016e3,steps:[1,3]},{unit:"year",ms:315576e5,steps:[1,5,10,25,50,100]}];let o="month",c=1,h=1/0;for(const e of r)for(const s of e.steps){const i=Math.abs(n/(e.ms*s)-t);i<h&&(h=i,o=e.unit,c=s)}const u=[],d=new Date(e),l=new Date(s);let f=function(t,e,s){const n=new Date(t);switch(e){case"second":n.setMilliseconds(0),n.setSeconds(Math.ceil(n.getSeconds()/s)*s),n.getTime()<=t.getTime()&&n.setSeconds(n.getSeconds()+s);break;case"minute":n.setSeconds(0,0),n.setMinutes(Math.ceil(n.getMinutes()/s)*s),n.getTime()<=t.getTime()&&n.setMinutes(n.getMinutes()+s);break;case"hour":n.setMinutes(0,0,0),n.setHours(Math.ceil(n.getHours()/s)*s),n.getTime()<=t.getTime()&&n.setHours(n.getHours()+s);break;case"day":n.setHours(0,0,0,0),n.getTime()<=t.getTime()&&n.setDate(n.getDate()+s);break;case"week":n.setHours(0,0,0,0),n.setDate(n.getDate()-n.getDay()),n.getTime()<=t.getTime()&&n.setDate(n.getDate()+7*s);break;case"month":n.setDate(1),n.setHours(0,0,0,0),n.getTime()<=t.getTime()&&n.setMonth(n.getMonth()+s);break;case"year":n.setMonth(0,1),n.setHours(0,0,0,0),n.getTime()<=t.getTime()&&n.setFullYear(n.getFullYear()+s)}return n}(d,o,c);for(;f.getTime()<=l.getTime()&&u.length<200;)u.push(new Date(f)),f=a(f,o,c);return u}tickFormat(){return t=>t instanceof Date?t.toLocaleDateString():String(t)}}function h(){const t=new c,e=Object.assign((e=>t.call(e)),{domain:s=>void 0===s?t.domain():(t.domain(s),e),range:s=>void 0===s?t.range():(t.range(s),e),ticks:()=>t.ticks(),tickFormat:()=>t.tickFormat(),copy:()=>h(),bandwidth:()=>0});return e}class u{constructor(t,e){this._domain=[],this._range=[0,1],this._padding=0,t&&(this._domain=[...new Set(t)]),e&&(this._range=[...e])}call(t){const e=this._domain.indexOf(t);if(-1===e)return;const s=(this._range[1]-this._range[0])/(this._domain.length+this._padding);return this._range[0]+s*this._padding+e*s}domain(t){return void 0===t?[...this._domain]:(this._domain=[...new Set(t)],this)}range(t){return void 0===t?[...this._range]:(this._range=[...t],this)}padding(t){return this._padding=t,this}bandwidth(){const t=this._domain.length;return 0===t?0:(this._range[1]-this._range[0])/(t+this._padding)*(1-this._padding)}}function d(t){let e,s;for(const n of t)null!=n&&n>=n&&((void 0===e||n<e)&&(e=n),(void 0===s||n>s)&&(s=n));return void 0===e||void 0===s?[void 0,void 0]:[e,s]}function l(t,e){return t.map(e)}class f extends t{addInteractionSupport(){}draw(){this.renderer.drawXAxis(this.options.renderOptions,this.getColorFromToken("bg-tertiary"),this.getStyleTextFromToken("v-font-field-label-sm v-text-secondary"))}}class m extends t{addInteractionSupport(){}draw(){this.renderer.drawYAxis(this.options.renderOptions,this.getColorFromToken("bg-tertiary"),this.getStyleTextFromToken("v-font-field-label-sm v-text-secondary"))}}class v{process(t,e){const{dataSource:s,xAxis:n,container:i}=t,{innerWidth:r,innerHeight:o}=e;return{start:{x:0,y:o},end:{x:r,y:o},tickSize:4,scale:this.getScale(s,r,(null==n?void 0:n.type)||"value","VEGA-LINE-CHART"===i.tagName?1:.1,null==n?void 0:n.sorter),labelFormatter:null==n?void 0:n.labelFormatter,width:r,height:o}}getScale(t,s,n,i=.1,o){const a=e(t).map((t=>t.x));let c;if("time"===n){const t=d(a);c=h().domain(void 0!==t[0]?t:[new Date,new Date]).range([0,s])}else if("category"===n)c=function(t,e){const s=new u(t,e),n=Object.assign((t=>s.call(t)),{domain:t=>void 0===t?s.domain():(s.domain(t),n),range:t=>void 0===t?s.range():(s.range(t),n),padding:t=>(s.padding(t),n),bandwidth:()=>s.bandwidth()});return n}("function"==typeof o?a.sort(o):a,[0,s]).padding(i);else{const t=d(a);c=r().domain(void 0!==t[0]?t:[0,0]).range([0,s])}return c}}class b{process(t,e){const{dataSource:s,yAxis:n}=t,{innerWidth:i,innerHeight:r}=e,{scale:o,ticks:a}=this.getScale(s,[r,0],4);return{start:{x:0,y:0},end:{x:0,y:r},tickSize:a,scale:o,labelFormatter:null==n?void 0:n.labelFormatter,width:i,height:r}}getScale(t,s,n){var i,o;const a=e(t).map((t=>t.y)).concat(0);let c=null!==(i=function(t){let e;for(let s=0;s<t.length;s++){const n=Number(t[s]);null==n||Number.isNaN(n)||(void 0===e||n>e)&&(e=n)}return e}(a))&&void 0!==i?i:0,h=null!==(o=function(t){let e;for(let s=0;s<t.length;s++){const n=Number(t[s]);null==n||Number.isNaN(n)||(void 0===e||n<e)&&(e=n)}return e}(a))&&void 0!==o?o:0,u=r().domain([h,c]);const l=u.ticks?u.ticks(n):[],f=Math.abs(l[l.length-1]-l[l.length-2]),m=d(l),[v,b]=void 0!==m[0]?m:[0,0];return h<v&&(h=v-f,n+=1),c>b&&(c=b+f,n+=1),u=r().domain([h,c]).range(s),{scale:u,ticks:n}}}export{v as X,b as Y,f as a,m as b,l as m}
|