@heartlandone/vega 2.89.0 → 2.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-4872f4e6.js → app-globals-08924736.js} +9 -7
- package/dist/cjs/{code-block-7c49d175.js → code-block-89850671.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-aae22ddf.js → component-value-history-controller-slimmer.abstract-a8da4087.js} +3 -3
- package/dist/cjs/{content-state-76b81780.js → content-state-e1c3efe6.js} +2 -2
- package/dist/cjs/{date-required-rule-71f71b32.js → date-required-rule-3437acbc.js} +1 -1
- package/dist/cjs/{design-token-c80d3f32.js → design-token-939bf72c.js} +3 -3
- package/dist/cjs/{element-appender-slimmer-e95427b5.js → element-appender-slimmer-14e85a91.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-430b4f02.js → form-field-controller-slimmer-c4ebee27.js} +1 -1
- package/dist/cjs/{image-annotation-action-7959fd77.js → image-annotation-action-f86690fd.js} +26 -2
- package/dist/cjs/index.cjs.js +19 -19
- package/dist/cjs/{inject-keyboard-manager-3ccf1cb6.js → inject-keyboard-manager-743de047.js} +1 -1
- package/dist/cjs/{internal-translation-controller-5582d789.js → internal-translation-controller-9785d4e8.js} +4 -0
- package/dist/cjs/{keyboard-manager-5babfda8.js → keyboard-manager-5396083a.js} +1 -1
- package/dist/cjs/{keyboard-manager-slimmer-a73354ca.js → keyboard-manager-slimmer-eedcfbc8.js} +1 -1
- package/dist/cjs/link-extension-dafeeed0.js +583 -0
- package/dist/cjs/loader.cjs.js +11 -12
- package/dist/cjs/{month-view-generator-43e75062.js → month-view-generator-c7492e06.js} +1 -1
- package/dist/cjs/{public-rules-b23ab52d.js → public-rules-b032050f.js} +7 -7
- package/dist/cjs/{range-abe1b989.js → range-efdf6f78.js} +1 -1
- package/dist/cjs/{replace-selected-text-action-ef079fed.js → replace-selected-text-action-0f7b7c78.js} +1 -1
- package/dist/cjs/{responsive-format-facade-cc368403.js → responsive-format-facade-d112aa9f.js} +1 -1
- package/dist/cjs/{rich-text-editor-required-rule-bbd727a2.js → rich-text-editor-required-rule-86d9cd4d.js} +1 -1
- package/dist/cjs/{split-cell-operation-b1fe91b5.js → split-cell-operation-b41344bd.js} +3 -3
- package/dist/cjs/{state-border-formatter-398134c1.js → state-border-formatter-c3c9b90d.js} +1 -1
- package/dist/cjs/{string-format-strategy.abstract-67421e2b.js → string-format-strategy.abstract-d51050cd.js} +1 -1
- package/dist/cjs/{string-input-formatter-slimmer-e84530b9.js → string-input-formatter-slimmer-23fdb50e.js} +1 -1
- package/dist/cjs/{string-mask-strategy-f9806f9b.js → string-mask-strategy-10fe0f6d.js} +2 -2
- package/dist/cjs/{style-formatter-da3a556b.js → style-formatter-11c95331.js} +2 -2
- package/dist/cjs/{time-required-rule-618109fa.js → time-required-rule-2fd7c828.js} +1 -1
- package/dist/cjs/{token-extension-dfee303a.js → token-extension-2e3e1631.js} +125 -498
- package/dist/cjs/{translation-slimmer-1a7a2b6d.js → translation-slimmer-e8549aff.js} +17 -1
- package/dist/cjs/{type-guard-474dec0d.js → type-guard-9917b11f.js} +1 -1
- package/dist/cjs/{valid-credit-card-number-rule-00c18527.js → valid-credit-card-number-rule-8c541bcd.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +6 -6
- package/dist/cjs/vega-app-header-button.cjs.entry.js +5 -5
- package/dist/cjs/vega-box.cjs.entry.js +6 -6
- package/dist/cjs/vega-button-circle.cjs.entry.js +5 -5
- package/dist/cjs/vega-button.cjs.entry.js +3 -3
- package/dist/cjs/vega-calendar_4.cjs.entry.js +6 -6
- package/dist/cjs/vega-card.cjs.entry.js +5 -5
- package/dist/cjs/vega-carousel.cjs.entry.js +3 -3
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +14 -7
- package/dist/cjs/vega-chip.cjs.entry.js +5 -5
- package/dist/cjs/vega-code-block.cjs.entry.js +8 -8
- package/dist/cjs/vega-color-picker.cjs.entry.js +2 -2
- package/dist/cjs/vega-color-swatch-picker.cjs.entry.js +3 -3
- package/dist/cjs/vega-color-swatch.cjs.entry.js +2 -2
- package/dist/cjs/vega-combo-box.cjs.entry.js +8 -8
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +13 -13
- package/dist/cjs/vega-dialog_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-divider.cjs.entry.js +5 -5
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-field-label.cjs.entry.js +3 -3
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-flex.cjs.entry.js +6 -6
- package/dist/cjs/vega-font.cjs.entry.js +5 -5
- package/dist/cjs/vega-form.cjs.entry.js +3 -3
- package/dist/cjs/vega-grid.cjs.entry.js +5 -5
- package/dist/cjs/vega-icon.cjs.entry.js +5 -5
- package/dist/cjs/vega-image-uploader.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +17 -7
- package/dist/cjs/vega-input-numeric.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-passcode.cjs.entry.js +5 -5
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +5 -5
- package/dist/cjs/vega-input.cjs.entry.js +6 -6
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +7 -7
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +4 -4
- package/dist/cjs/vega-popover_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-progress-tracker_2.cjs.entry.js +3 -3
- package/dist/cjs/vega-radio_2.cjs.entry.js +17 -10
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +63 -31
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +65 -22
- package/dist/cjs/vega-rich-text-special-characters-panel.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-table-properties_3.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +18 -5
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +3 -3
- package/dist/cjs/vega-signature-capture.cjs.entry.js +7 -7
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -5
- package/dist/cjs/vega-table_11.cjs.entry.js +4 -4
- package/dist/cjs/vega-textarea.cjs.entry.js +2 -2
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +6 -6
- package/dist/cjs/vega.cjs.js +11 -12
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.css +8 -11
- package/dist/collection/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.js +35 -7
- package/dist/collection/components/vega-field-label/vega-field-label.js +2 -2
- package/dist/collection/components/vega-input-credit-card/vega-input-credit-card.js +35 -1
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.css +8 -11
- package/dist/collection/components/vega-radio/vega-radio-group/vega-radio-group.js +35 -7
- package/dist/collection/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.js +36 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.js +15 -12
- package/dist/collection/components/vega-rich-text-editor/extensions/extension.abstract.js +11 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.js +30 -16
- package/dist/collection/components/vega-rich-text-editor/extensions/line-height/line-height-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/link/link-extension.js +34 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/link/type.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/link/utils.js +22 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/rte-extension-state-store.js +37 -0
- package/dist/collection/components/vega-rich-text-editor/extensions/tokens/token-toolbar-button-renderer.js +1 -1
- package/dist/collection/components/vega-rich-text-editor/public-api.js +1 -0
- package/dist/collection/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.js +5 -3
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-editor.js +39 -1
- package/dist/collection/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.js +13 -4
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/slimmers/renderers/vega-selection-chip-group-renderer.js +4 -1
- package/dist/collection/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.js +34 -0
- package/dist/collection/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.js +4 -2
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +5 -4
- package/dist/collection/global/scripts/before-vega-load.js +2 -0
- package/dist/collection/helpers/slimmers/translation/translation-slimmer.js +16 -0
- package/dist/collection/helpers/translation/locales/en.js +4 -0
- package/dist/esm/{app-globals-081bbfd9.js → app-globals-a4134d21.js} +9 -7
- package/dist/esm/{code-block-17f596fc.js → code-block-9a17d89b.js} +2 -2
- package/dist/esm/{component-value-history-controller-slimmer.abstract-21e9126a.js → component-value-history-controller-slimmer.abstract-a64c3678.js} +3 -3
- package/dist/esm/{content-state-96741bb0.js → content-state-d59b4560.js} +3 -3
- package/dist/esm/{date-required-rule-d6ce832c.js → date-required-rule-cb960229.js} +1 -1
- package/dist/esm/{design-token-0a575bf2.js → design-token-f73ebce9.js} +3 -3
- package/dist/esm/{element-appender-slimmer-44bbb5c6.js → element-appender-slimmer-c62cf540.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-03894a51.js → form-field-controller-slimmer-514a3195.js} +1 -1
- package/dist/esm/{image-annotation-action-e8ab7b64.js → image-annotation-action-f4ea265c.js} +26 -3
- package/dist/esm/index.js +16 -17
- package/dist/esm/{inject-keyboard-manager-e5874185.js → inject-keyboard-manager-6522df5c.js} +1 -1
- package/dist/esm/{internal-translation-controller-84958bc9.js → internal-translation-controller-653bd7e3.js} +4 -0
- package/dist/esm/{keyboard-manager-404b9c17.js → keyboard-manager-9615fa9b.js} +1 -1
- package/dist/esm/{keyboard-manager-slimmer-c8fcfe60.js → keyboard-manager-slimmer-21bdc3a4.js} +1 -1
- package/dist/esm/link-extension-be164793.js +576 -0
- package/dist/esm/loader.js +11 -12
- package/dist/esm/{month-view-generator-d341fa5a.js → month-view-generator-1b7c9bb8.js} +1 -1
- package/dist/esm/{public-rules-09387dcf.js → public-rules-58f31834.js} +7 -7
- package/dist/esm/{range-47d9f95e.js → range-1c1c20fa.js} +1 -1
- package/dist/esm/{replace-selected-text-action-a217dc89.js → replace-selected-text-action-1abc5200.js} +1 -1
- package/dist/esm/{responsive-format-facade-51c0c2e1.js → responsive-format-facade-12697af2.js} +1 -1
- package/dist/esm/{rich-text-editor-required-rule-cca16fd0.js → rich-text-editor-required-rule-050d292b.js} +1 -1
- package/dist/esm/{split-cell-operation-ddde4106.js → split-cell-operation-8251d2a1.js} +3 -3
- package/dist/esm/{state-border-formatter-50394e9c.js → state-border-formatter-55cee24d.js} +1 -1
- package/dist/esm/{string-format-strategy.abstract-de17b899.js → string-format-strategy.abstract-14c1e874.js} +1 -1
- package/dist/esm/{string-input-formatter-slimmer-c3d483ef.js → string-input-formatter-slimmer-ec297247.js} +1 -1
- package/dist/esm/{string-mask-strategy-87efdb9e.js → string-mask-strategy-18760123.js} +2 -2
- package/dist/esm/{style-formatter-c20c1988.js → style-formatter-6073ae27.js} +2 -2
- package/dist/esm/{time-required-rule-026c17a1.js → time-required-rule-9b775d24.js} +1 -1
- package/dist/esm/{token-extension-76323d76.js → token-extension-6cb7dcb2.js} +58 -429
- package/dist/esm/{translation-slimmer-7f195ba8.js → translation-slimmer-d32eb861.js} +17 -1
- package/dist/esm/{type-guard-30eec79c.js → type-guard-fd1f4760.js} +1 -1
- package/dist/esm/{valid-credit-card-number-rule-1ac471e8.js → valid-credit-card-number-rule-dfd3e0a6.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +6 -6
- package/dist/esm/vega-app-header-button.entry.js +5 -5
- package/dist/esm/vega-box.entry.js +6 -6
- package/dist/esm/vega-button-circle.entry.js +5 -5
- package/dist/esm/vega-button.entry.js +3 -3
- package/dist/esm/vega-calendar_4.entry.js +6 -6
- package/dist/esm/vega-card.entry.js +5 -5
- package/dist/esm/vega-carousel.entry.js +3 -3
- package/dist/esm/vega-checkbox_2.entry.js +14 -7
- package/dist/esm/vega-chip.entry.js +5 -5
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-color-swatch-picker.entry.js +3 -3
- package/dist/esm/vega-color-swatch.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +8 -8
- package/dist/esm/vega-date-picker_2.entry.js +13 -13
- package/dist/esm/vega-dialog_2.entry.js +3 -3
- package/dist/esm/vega-divider.entry.js +5 -5
- package/dist/esm/vega-dropdown_5.entry.js +7 -7
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-field-label.entry.js +3 -3
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +5 -5
- package/dist/esm/vega-flex.entry.js +6 -6
- package/dist/esm/vega-font.entry.js +5 -5
- package/dist/esm/vega-form.entry.js +3 -3
- package/dist/esm/vega-grid.entry.js +5 -5
- package/dist/esm/vega-icon.entry.js +5 -5
- package/dist/esm/vega-image-uploader.entry.js +5 -5
- package/dist/esm/vega-input-credit-card.entry.js +17 -7
- package/dist/esm/vega-input-numeric.entry.js +5 -5
- package/dist/esm/vega-input-passcode.entry.js +5 -5
- package/dist/esm/vega-input-phone-number.entry.js +4 -4
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +5 -5
- package/dist/esm/vega-input.entry.js +6 -6
- package/dist/esm/vega-left-nav_5.entry.js +7 -7
- package/dist/esm/vega-loader-wrapper_2.entry.js +3 -3
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +4 -4
- package/dist/esm/vega-popover_2.entry.js +8 -8
- package/dist/esm/vega-progress-tracker_2.entry.js +3 -3
- package/dist/esm/vega-radio_2.entry.js +17 -10
- package/dist/esm/vega-rich-text-content.entry.js +40 -8
- package/dist/esm/vega-rich-text-editor_4.entry.js +64 -21
- package/dist/esm/vega-rich-text-special-characters-panel.entry.js +5 -5
- package/dist/esm/vega-rich-text-table-properties_3.entry.js +8 -8
- package/dist/esm/vega-selection-chip_2.entry.js +18 -5
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +3 -3
- package/dist/esm/vega-signature-capture.entry.js +7 -7
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +8 -5
- package/dist/esm/vega-table_11.entry.js +4 -4
- package/dist/esm/vega-textarea.entry.js +2 -2
- package/dist/esm/vega-time-picker_2.entry.js +9 -9
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +6 -6
- package/dist/esm/vega.js +11 -12
- package/dist/sri/vega-sri-manifest.json +302 -306
- package/dist/types/components/vega-checkbox/vega-checkbox-group/vega-checkbox-group.d.ts +10 -1
- package/dist/types/components/vega-input-credit-card/vega-input-credit-card.d.ts +10 -0
- package/dist/types/components/vega-radio/vega-radio-group/vega-radio-group.d.ts +10 -1
- package/dist/types/components/vega-rich-text-editor/dto/renderers/blocks/link-wrapper-renderer.d.ts +3 -1
- package/dist/types/components/vega-rich-text-editor/extensions/base-toolbar-button-renderer.d.ts +8 -5
- package/dist/types/components/vega-rich-text-editor/extensions/extension.abstract.d.ts +9 -0
- package/dist/types/components/vega-rich-text-editor/extensions/languages/language-toolbar-button-renderer.d.ts +16 -12
- package/dist/types/components/vega-rich-text-editor/extensions/link/link-extension.d.ts +27 -0
- package/dist/types/components/vega-rich-text-editor/extensions/link/type.d.ts +15 -0
- package/dist/types/components/vega-rich-text-editor/extensions/link/utils.d.ts +8 -0
- package/dist/types/components/vega-rich-text-editor/extensions/rte-extension-state-store.d.ts +30 -0
- package/dist/types/components/vega-rich-text-editor/public-api.d.ts +2 -0
- package/dist/types/components/vega-rich-text-editor/slimmers/renderers/toolbar-renderer.d.ts +1 -1
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-editor.d.ts +22 -0
- package/dist/types/components/vega-rich-text-editor/vega-rich-text-link-editor/slimmers/renderers/vega-rich-text-link-editor-renderer.d.ts +1 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/slimmers/renderers/vega-selection-chip-group-renderer.d.ts +1 -0
- package/dist/types/components/vega-selection-chip/vega-selection-chip-group/vega-selection-chip-group.d.ts +10 -0
- package/dist/types/components/vega-tab-group/slimmers/vega-tab-group/controllers/vega-tab-group-pages-controller.d.ts +3 -2
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +4 -3
- package/dist/types/components.d.ts +50 -2
- package/dist/types/helpers/slimmers/translation/translation-slimmer.d.ts +11 -0
- package/dist/types/helpers/translation/interface.d.ts +4 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/p-02492864.entry.js +1 -0
- package/dist/vega/{p-df3a649c.entry.js → p-0278cd2b.entry.js} +1 -1
- package/dist/vega/{p-630cd479.js → p-0542b8ac.js} +1 -1
- package/dist/vega/p-0a1c7f80.js +1 -0
- package/dist/vega/{p-b9bd85d6.entry.js → p-0cc4a052.entry.js} +1 -1
- package/dist/vega/{p-976536c7.entry.js → p-1b4abd76.entry.js} +1 -1
- package/dist/vega/{p-efe6e4e6.entry.js → p-1ee185d9.entry.js} +1 -1
- package/dist/vega/{p-c3be0c29.entry.js → p-203f4ce9.entry.js} +1 -1
- package/dist/vega/p-2620a164.js +1 -0
- package/dist/vega/{p-2abdca42.js → p-277c306b.js} +1 -1
- package/dist/vega/{p-2c5352fe.entry.js → p-285e5e52.entry.js} +1 -1
- package/dist/vega/p-2c7e1bcb.js +1 -0
- package/dist/vega/{p-1ab4c08d.js → p-30487f0e.js} +1 -1
- package/dist/vega/{p-c016b230.entry.js → p-30a6b7aa.entry.js} +1 -1
- package/dist/vega/p-350d1b75.entry.js +1 -0
- package/dist/vega/{p-4c6baf92.entry.js → p-355ea330.entry.js} +1 -1
- package/dist/vega/{p-50e7020c.js → p-35d617d5.js} +1 -1
- package/dist/vega/{p-6c484462.entry.js → p-3755d8d3.entry.js} +1 -1
- package/dist/vega/{p-61536fcf.entry.js → p-3e956269.entry.js} +1 -1
- package/dist/vega/{p-fae4d64e.js → p-3ed6a602.js} +1 -1
- package/dist/vega/{p-a0705cd0.entry.js → p-4386625c.entry.js} +1 -1
- package/dist/vega/{p-b66d46ce.js → p-44f39eee.js} +1 -1
- package/dist/vega/{p-df71c830.entry.js → p-44f81987.entry.js} +1 -1
- package/dist/vega/{p-d93574dd.entry.js → p-456890f5.entry.js} +1 -1
- package/dist/vega/p-465590d1.entry.js +1 -0
- package/dist/vega/{p-f764b62e.entry.js → p-47ffdc0f.entry.js} +1 -1
- package/dist/vega/p-4fdd0a71.js +1 -0
- package/dist/vega/{p-9a562813.entry.js → p-54141828.entry.js} +1 -1
- package/dist/vega/{p-35e800ac.js → p-566ba295.js} +1 -1
- package/dist/vega/{p-baef217a.entry.js → p-581d89bb.entry.js} +1 -1
- package/dist/vega/p-5f048811.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-8ce92f5f.entry.js → p-616d7096.entry.js} +1 -1
- package/dist/vega/{p-dbb02b32.entry.js → p-6528739f.entry.js} +1 -1
- package/dist/vega/{p-b3b22e36.entry.js → p-667c980d.entry.js} +1 -1
- package/dist/vega/{p-f597b65e.entry.js → p-6845ed5c.entry.js} +1 -1
- package/dist/vega/p-6cedb325.js +1 -0
- package/dist/vega/{p-78a6e741.entry.js → p-6d99a0b3.entry.js} +1 -1
- package/dist/vega/{p-43af604c.entry.js → p-6fec4d46.entry.js} +1 -1
- package/dist/vega/{p-337440ce.entry.js → p-716a393e.entry.js} +1 -1
- package/dist/vega/p-73ce8fef.js +1 -0
- package/dist/vega/p-788a7a5a.js +1 -0
- package/dist/vega/{p-ed0cc518.entry.js → p-7fe292af.entry.js} +1 -1
- package/dist/vega/{p-ad89f499.js → p-820ff54c.js} +1 -1
- package/dist/vega/p-82c133aa.js +1 -0
- package/dist/vega/{p-f7e8081e.js → p-844b7826.js} +1 -1
- package/dist/vega/{p-93cbc231.entry.js → p-850ea38b.entry.js} +1 -1
- package/dist/vega/p-85dcd07b.js +3 -0
- package/dist/vega/{p-3a49089e.js → p-881622fd.js} +1 -1
- package/dist/vega/{p-6a3ea3f0.entry.js → p-88c29aae.entry.js} +1 -1
- package/dist/vega/{p-a9b6ce74.js → p-8a054a13.js} +1 -1
- package/dist/vega/{p-bd5566e3.entry.js → p-8d9c4338.entry.js} +1 -1
- package/dist/vega/{p-26a54a73.entry.js → p-939c486f.entry.js} +1 -1
- package/dist/vega/{p-76454c9a.js → p-97e7da55.js} +1 -1
- package/dist/vega/{p-89d55444.entry.js → p-99545fd7.entry.js} +1 -1
- package/dist/vega/{p-157a2459.entry.js → p-99ea0fa0.entry.js} +1 -1
- package/dist/vega/{p-be6c1415.js → p-a809b33a.js} +1 -1
- package/dist/vega/{p-8865613a.entry.js → p-a9a70696.entry.js} +1 -1
- package/dist/vega/{p-9cb92fa3.entry.js → p-aae71499.entry.js} +1 -1
- package/dist/vega/{p-b2488adb.js → p-b0f55f5f.js} +1 -1
- package/dist/vega/{p-09deb867.entry.js → p-b5c08306.entry.js} +1 -1
- package/dist/vega/{p-c91e0a43.js → p-b7c90543.js} +1 -1
- package/dist/vega/{p-fc0ce3b5.entry.js → p-bcd3bd79.entry.js} +1 -1
- package/dist/vega/{p-8457b6b7.entry.js → p-bce9f489.entry.js} +1 -1
- package/dist/vega/{p-57b34bf9.entry.js → p-c0a6ed53.entry.js} +1 -1
- package/dist/vega/{p-48ea74b5.entry.js → p-c1c5bd2c.entry.js} +1 -1
- package/dist/vega/{p-f7cab150.entry.js → p-c5621f60.entry.js} +1 -1
- package/dist/vega/{p-94a064a3.js → p-c596bb49.js} +1 -1
- package/dist/vega/{p-dd529875.js → p-c9c42a07.js} +1 -1
- package/dist/vega/{p-d1cc3544.entry.js → p-d0e7c14b.entry.js} +1 -1
- package/dist/vega/{p-cdde6e64.entry.js → p-d6422004.entry.js} +1 -1
- package/dist/vega/{p-1e68e217.entry.js → p-d76cb9da.entry.js} +1 -1
- package/dist/vega/{p-c4bd6cf8.entry.js → p-d871e8eb.entry.js} +1 -1
- package/dist/vega/p-d905159c.entry.js +1 -0
- package/dist/vega/{p-285b161c.entry.js → p-dfda6e01.entry.js} +1 -1
- package/dist/vega/{p-3390bb20.js → p-e30a4f3e.js} +1 -1
- package/dist/vega/{p-059ba5f5.entry.js → p-e8c5a446.entry.js} +1 -1
- package/dist/vega/{p-091fbc35.js → p-eb927e2b.js} +1 -1
- package/dist/vega/{p-fbde6153.js → p-ecea4d24.js} +1 -1
- package/dist/vega/{p-44d2f9e7.entry.js → p-ed1dbc98.entry.js} +1 -1
- package/dist/vega/p-f0b99c3a.entry.js +1 -0
- package/dist/vega/{p-363e453b.js → p-f0d6e2f2.js} +1 -1
- package/dist/vega/{p-4b34df4c.entry.js → p-f251a907.entry.js} +1 -1
- package/dist/vega/{p-9a35a34f.entry.js → p-f5c8024e.entry.js} +1 -1
- package/dist/vega/{p-fa398acc.entry.js → p-f70cfac5.entry.js} +1 -1
- package/dist/vega/p-f830deb8.js +1 -0
- package/dist/vega/{p-2f2201d6.entry.js → p-f9ae396b.entry.js} +1 -1
- package/dist/vega/{p-e80e7cd9.entry.js → p-fd2a49be.entry.js} +1 -1
- package/dist/vega/{p-3ef9c69d.entry.js → p-fe573f85.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/base-renderer-0a3b62b7.js +0 -9
- package/dist/cjs/dto-renderer-manager-7eb5c5ce.js +0 -98
- package/dist/esm/base-renderer-101f6d04.js +0 -7
- package/dist/esm/dto-renderer-manager-abc7eb5f.js +0 -96
- package/dist/vega/p-2e86aee5.js +0 -1
- package/dist/vega/p-3a5737fa.js +0 -1
- package/dist/vega/p-5f09aba8.js +0 -1
- package/dist/vega/p-5fd29f29.entry.js +0 -1
- package/dist/vega/p-66b2a285.entry.js +0 -1
- package/dist/vega/p-73508c24.js +0 -1
- package/dist/vega/p-7fbd11b0.js +0 -1
- package/dist/vega/p-894fb9c9.entry.js +0 -1
- package/dist/vega/p-89947a43.js +0 -1
- package/dist/vega/p-8a3d12e6.js +0 -1
- package/dist/vega/p-a18d280f.js +0 -3
- package/dist/vega/p-a7b5f497.js +0 -1
- package/dist/vega/p-b6c3ce6d.js +0 -1
- package/dist/vega/p-ca4773c3.entry.js +0 -1
- package/dist/vega/p-efe48ed5.entry.js +0 -1
- package/dist/vega/p-f7c6af07.js +0 -1
- package/dist/vega/p-ff24b342.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as a,g as r}from"./p-6b2342e0.js";import{M as s,a as p}from"./p-f0ff4463.js";import{s as o}from"./p-519a7d55.js";import{c as n,n as h}from"./p-262ec334.js";import{I as l}from"./p-6e1ab235.js";import{V as d,I as c}from"./p-8ce9e214.js";import{F as m}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,H as a,g as r}from"./p-6b2342e0.js";import{M as s,a as p}from"./p-f0ff4463.js";import{s as o}from"./p-519a7d55.js";import{c as n,n as h}from"./p-262ec334.js";import{I as l}from"./p-6e1ab235.js";import{V as d,I as c}from"./p-8ce9e214.js";import{F as m}from"./p-881622fd.js";import{C as u}from"./p-328dbe8e.js";import{D as f}from"./p-526e3634.js";import{i as b,K as g,a as v}from"./p-fcefb62c.js";import{F as x}from"./p-cb378636.js";import{C as y}from"./p-2d0d575f.js";import{c as j}from"./p-d7790113.js";import{a as w}from"./p-528748fa.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-8b5d3a52.js";import"./p-6a334573.js";import"./p-3a93730e.js";import"./p-eb927e2b.js";import"./p-f0e828d8.js";import"./p-b75ee3ba.js";import"./p-81dd00d0.js";import"./p-49a2e141.js";import"./p-d4ea8e22.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-a58cacca.js";import"./p-46cab60a.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";const I=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the stepper component",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the stepper component",payloadValue:t=>!1===t.autoValidation},{payloadKey:"BUTTON_VARIANT_IS_PRIMARY",payloadDescription:"Specifies the style variant for the stepper buttons.",payloadValue:t=>"primary"===t.buttonVariant},{payloadKey:"BUTTON_VARIANT_IS_SECONDARY",payloadDescription:"Specifies the style variant for the stepper buttons.",payloadValue:t=>"secondary"===t.buttonVariant}];var A=function(t,e,i,a){var r,s=arguments.length,p=s<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(t,e,i,a);else for(var o=t.length-1;o>=0;o--)(r=t[o])&&(p=(s<3?r(p):s>3?r(e,i,p):r(e,i))||p);return s>3&&p&&Object.defineProperty(e,i,p),p};const V=class{constructor(i){t(this,i),this.vegaChange=e(this,"vegaChange",7),this.change=e(this,"change",7),this.globalSlimmers={},this.formFieldController=new m({propertyRules:[{propertyName:"min",ruleFactory:t=>"number"==typeof t?new s({minValue:t}):null},{propertyName:"max",ruleFactory:t=>"number"==typeof t?new p({maxValue:t}):null}],defaultValue:0,attributeGetter:t=>this[t],touchableAreaGetter:()=>this.touchableAreaGetter(),inputContainerGetter:()=>this.stepperContainerRef}),this.changeEventEmitter=j(V,b),this.inputEventPrevent=new u([g,b],(()=>this.stepperContainerRef)),this.vegaComponentUsageRuntimeMetricsSlimmer=new d(I),this.max=9999,this.min=0,this.value=0,this.label="",this.inputDisabled=null,this.disabled=!1,this.isValid=null,this.autoValidation=!0,this.buttonVariant="primary",this.onDecrease=()=>{this.value>this.max?this.value=this.max:this.value>this.min&&(this.value-=1)},this.onIncrease=()=>{this.value<this.max&&(this.value+=1)},this.onChildInputChange=t=>{""!==t.detail&&(this.value=n(t.detail))},this.handleInputBlur=t=>{""===t.host.value&&(this.value=this.min)},this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValue(){const t=h(n(this.value,0),this.min,this.max);this.value=t,this.inputRef.value=t.toString(),this.changeEventEmitter.emit(this.value),y.notify(x,{host:this.host,detail:this.value})}render(){return o(i(a,{class:w(["vega-flex-shrink-0",this.inputDisabled||this.disabled?"disabled":""])},this.renderLabelDom(),i("div",{class:{"vega-stepper-container":!0,"vega-stepper-container-edited":this.inputDisabled},ref:t=>this.stepperContainerRef=t},i("vega-button-circle",{label:"Decrease",showTooltip:!1,icon:"minus-sign",ref:t=>{f.addUniqueObserverToNode(t,v,(()=>this.onDecrease()))},disabled:this.value<=this.min||this.disabled,size:"small",variant:"secondary"==this.buttonVariant?"secondary":"primary"}),i("vega-input",{size:"small",type:"number",max:this.max,min:this.min,value:`${this.value}`,disabled:this.inputDisabled||this.disabled,showClearIcon:!1,ref:t=>(f.addUniqueObserverToNode(t,g,(t=>this.handleInputBlur(t))),f.addUniqueObserverToNode(t,b,(t=>this.onChildInputChange(t))),this.inputRef=t),"data-aria-label":this.label||"stepper"}),i("vega-button-circle",{label:"Increase",showTooltip:!1,ref:t=>{f.addUniqueObserverToNode(t,v,(()=>this.onIncrease()))},icon:"plus-sign",disabled:this.value>=this.max||this.disabled,size:"small",variant:"secondary"==this.buttonVariant?"secondary":"primary"})),i("div",{class:"aria-announcement","aria-live":"polite","aria-atomic":"true"},`${this.label||"stepper"}: ${this.value}`)),this.host)}renderLabelDom(){return this.label?i("label",{class:"v-text-center v-text-medium-typeset-1",htmlFor:this.stepperId},this.label):null}get host(){return r(this)}static get watchers(){return{value:["watchValue"]}}};A([c()],V.prototype,"globalSlimmers",void 0),A([l()],V.prototype,"formFieldController",void 0),A([l()],V.prototype,"changeEventEmitter",void 0),A([l()],V.prototype,"inputEventPrevent",void 0),A([l()],V.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),V.style=':host{display:inline-block;line-height:normal}:host>label{display:block;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:center}@media screen and (min-width: 768px) and (max-width: 1023px){:host>label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host>label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host>label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host>div{display:inline-flex;justify-content:center;align-items:center}:host>label+div{margin-top:8px}:host div.vega-stepper-container-edited vega-input::part(container-wrapper){padding-left:0px;padding-right:0px}:host(.disabled) vega-input::part(input-container){text-align:center;background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));padding:0px;border:0;box-shadow:unset}:host(.disabled) vega-input::part(input-container):hover{border:0}:host(.disabled) vega-input::part(input){background-color:rgba(var(--v-bg-transparent, 0, 0, 0, 0));color:rgba(var(--v-text-primary, 32, 54, 69, 1));border:0}:host vega-input::part(input){width:48px;text-align:center;-moz-appearance:textfield}:host vega-input::part(input)::-webkit-inner-spin-button{-webkit-appearance:none}:host vega-input::part(input)::-webkit-outer-spin-button{-webkit-appearance:none}:host vega-input::part(error){display:none}:host vega-input::part(container-wrapper){padding-left:8px;padding-right:8px}:host .vega-error{display:none}:host .vega-stepper-container.error vega-input::part(input-container){border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-stepper-container.error vega-input::part(input-container):hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}:host .vega-stepper-container.error vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-danger-focus, 233, 71, 104, 1))}.aria-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0}';export{V as vega_stepper}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,F as e,r as n,c as o,H as i,g as r}from"./p-6b2342e0.js";import{c as s,V as a,M as c,I as l}from"./p-6e1ab235.js";import{V as d,I as p}from"./p-8ce9e214.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-724df1f5.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-526e3634.js";import{i as g,a as m,q as y}from"./p-fcefb62c.js";import{ab as x}from"./p-50e7020c.js";import{a as C}from"./p-528748fa.js";import{C as w}from"./p-2d0d575f.js";import{y as j,x as k}from"./p-3a93730e.js";import{c as R}from"./p-d7790113.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-7fbd11b0.js";import{S,a as F,C as $}from"./p-630cd479.js";import{A as L}from"./p-4d65756f.js";import{d as A}from"./p-1bc5b3bc.js";import{C as T}from"./p-328dbe8e.js";import{C as D}from"./p-2bb5a232.js";import"./p-1704ff25.js";import"./p-9a6bd32c.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-b2488adb.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-091fbc35.js";import"./p-cb378636.js";import"./p-3e09aeed.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-46cab60a.js";import"./p-f7e8081e.js";import"./p-3a5737fa.js";import"./p-dd529875.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";var H=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class P extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),H([s()],P.prototype,"readOnly",void 0),H([s()],P.prototype,"host",void 0),H([s()],P.prototype,"disabled",void 0),H([s()],P.prototype,"showCopyButton",void 0),H([s()],P.prototype,"value",void 0),H([s()],P.prototype,"contentRenderer",void 0),H([s()],P.prototype,"valueController",void 0),H([s()],P.prototype,"removeEventEmitter",void 0),H([s()],P.prototype,"translationSlimmer",void 0),H([s()],P.prototype,"copyButtonRenderer",void 0);var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}N([s()],_.prototype,"host",void 0),N([s()],_.prototype,"readOnly",void 0),N([s()],_.prototype,"disabled",void 0),N([s()],_.prototype,"value",void 0),N([s()],_.prototype,"contentParseController",void 0),N([c("componentDidLoad")],_.prototype,"registerEventListener",null),N([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class B extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}z([s({writable:!0})],B.prototype,"value",void 0),z([s()],B.prototype,"changeEventEmitter",void 0),z([s()],B.prototype,"historyController",void 0),z([c("connectedCallback")],B.prototype,"initialValue",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class M extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}I([s()],M.prototype,"prismCodeHighlightParser",void 0),I([s()],M.prototype,"defaultCodeHighlightParser",void 0);class V{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new V(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var Z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class U extends L{constructor(){super(1),this.handleSelectionWithDebounce=A(this.handleSelectionChange,U.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new V(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}U.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),Z([s()],U.prototype,"host",void 0),Z([s()],U.prototype,"contentRenderer",void 0),Z([s()],U.prototype,"contentParseController",void 0),Z([s()],U.prototype,"insertCompositionTextController",void 0),Z([c("componentDidLoad")],U.prototype,"addSelectionChangeEventListener",null),Z([c("disconnectedCallback")],U.prototype,"removeSelectionChangeEventListener",null);class Y extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var q=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class G extends Y{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}q([s()],G.prototype,"selectionController",void 0),q([s()],G.prototype,"contentRenderer",void 0),q([s()],G.prototype,"valueController",void 0),q([s()],G.prototype,"contentParseController",void 0),q([s()],G.prototype,"insertCompositionTextController",void 0),q([s()],G.prototype,"value",void 0),q([c("componentDidLoad")],G.prototype,"registerInputEvent",null),q([c("disconnectedCallback")],G.prototype,"unregisterEventListener",null);var W=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class X extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}W([s()],X.prototype,"host",void 0),W([s()],X.prototype,"value",void 0),W([s()],X.prototype,"readOnly",void 0),W([s()],X.prototype,"disabled",void 0),W([s()],X.prototype,"contentRenderer",void 0),W([s()],X.prototype,"selectionController",void 0),W([c("doFocus")],X.prototype,"focusAndUpdateSelection",null),W([c("watchEditableChange")],X.prototype,"removeFocusAfterDisabled",null);var J=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class K extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=this.translationSlimmer.t("Copy Code");t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),K.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function Q(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=Q(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)tt(t,e,n)}(n,e),n}function tt(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=et(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function et(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=Q(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><g clip-path="url(#clip0_70002_574)"><path fill="currentColor" d="M11.7794 1.65539L10.3439 0.219844C10.2044 0.0790078 10.0122 0 9.81303 0H5.97865C5.15014 0 4.47865 0.671719 4.47865 1.5L4.47911 7.5C4.49975 8.32969 5.1724 9 5.99975 9H10.4997C11.3247 9 11.9997 8.325 11.9997 7.5V2.18555C11.9997 1.9868 11.9201 1.79602 11.7794 1.65539ZM10.8747 7.5C10.8747 7.70709 10.7068 7.875 10.4997 7.875H5.97865C5.77151 7.875 5.60365 7.70709 5.60365 7.5V1.50305C5.60365 1.29595 5.77156 1.12805 5.97865 1.12805H8.97865L8.99975 2.25C8.99975 2.66414 9.33561 3 9.74975 3H10.8537V7.5H10.8747ZM6.37475 10.5C6.37475 10.7071 6.20684 10.875 5.99975 10.875H1.47865C1.27151 10.875 1.10365 10.7071 1.10365 10.5L1.12428 4.50234C1.12428 4.29525 1.29218 4.12734 1.49928 4.12734H3.74975V3H1.49951C0.670996 3 -0.000488281 3.67148 -0.000488281 4.5L-0.000258594 10.5C-0.000207031 11.3273 0.671465 12 1.49975 12H5.99975C6.82475 12 7.49975 11.325 7.49975 10.5V9.75H6.39584L6.37475 10.5Z"/></g><defs><clipPath id="clip0_70002_574"><rect width="12" height="12" fill="currentColor"/></clipPath></defs></svg>'}}),K.RESET_TOOLTIP_TIME=1e3,J([s()],K.prototype,"value",void 0),J([s()],K.prototype,"readOnly",void 0),J([s()],K.prototype,"showCopyButton",void 0),J([s()],K.prototype,"translationSlimmer",void 0);const nt={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},ot={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:it,punctuation:rt}=ot,st=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(ot,["keyword","function","operator","punctuation"]),at=Object.assign(Object.assign({},st),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:it,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:rt}),ct=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:ot}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},ot),{entity:nt.entity}),lt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:nt,markup:nt,javascript:ot,js:ot,typescript:at,ts:at,jsx:ct,tsx:Object.assign(Object.assign({tag:ct.tag},at),{entity:ct.entity}),c:ot,clike:ot};const dt=Object.values(x);class pt extends a{splitTag(t){if(!this.hasSpecialCharacter(t)||t.length<2)return[t];{const e=[],n=t.split("");let o=0;return n.forEach((t=>{"<"===t||">"===t||"/"===t?(e.push(t),o=e.length):e[o]=e[o]?e[o]+t:t})),e}}isHighlightLanguage(t){return"plainText"!==t&&dt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<|>|\\/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],pt.prototype,"value",void 0);class ut extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=Q(t,function(t){return lt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ht extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var ft=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class vt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}ft([s()],vt.prototype,"selectionController",void 0),ft([s()],vt.prototype,"contentRenderer",void 0),ft([s()],vt.prototype,"valueController",void 0),ft([s()],vt.prototype,"contentParseController",void 0),ft([s()],vt.prototype,"value",void 0),ft([c("componentDidLoad")],vt.prototype,"registerInputEvent",null),ft([c("disconnectedCallback")],vt.prototype,"unregisterEventListener",null);var bt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class gt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}bt([s()],gt.prototype,"contentRenderer",void 0),bt([s()],gt.prototype,"value",void 0),bt([s()],gt.prototype,"valueController",void 0),bt([s()],gt.prototype,"selectionController",void 0),bt([c("componentDidLoad")],gt.prototype,"initialHistory",null);var mt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class yt extends Y{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}mt([s()],yt.prototype,"host",void 0),mt([s()],yt.prototype,"valueController",void 0),mt([s()],yt.prototype,"contentRenderer",void 0),mt([s()],yt.prototype,"value",void 0),mt([s()],yt.prototype,"selectionController",void 0),mt([s()],yt.prototype,"contentParseController",void 0),mt([s()],yt.prototype,"inputController",void 0),mt([c("componentDidLoad")],yt.prototype,"registerInputEvent",null),mt([c("disconnectedCallback")],yt.prototype,"unregisterEventListener",null);var xt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const Ct=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new D(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new P,this.contentRenderer=new _,this.copyButtonRenderer=new K,this.valueController=new B,this.contentParseController=new M,this.prismCodeHighlightParser=new ut,this.defaultCodeHighlightParser=new ht,this.selectionController=new U,this.inputController=new G,this.insertCompositionTextController=new vt,this.focusController=new X,this.historyController=new gt,this.changeEventEmitter=R(Ct,g),this.removeEventEmitter=R(Ct,y),this.codeBlockPasteController=new yt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};xt([p()],Ct.prototype,"globalSlimmers",void 0),xt([l()],Ct.prototype,"componentGlobalStyleSlimmer",void 0),xt([l()],Ct.prototype,"translationSlimmer",void 0),xt([l()],Ct.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),xt([l()],Ct.prototype,"codeBlockRenderer",void 0),xt([l()],Ct.prototype,"contentRenderer",void 0),xt([l()],Ct.prototype,"copyButtonRenderer",void 0),xt([l()],Ct.prototype,"valueController",void 0),xt([l()],Ct.prototype,"contentParseController",void 0),xt([l()],Ct.prototype,"prismCodeHighlightParser",void 0),xt([l()],Ct.prototype,"defaultCodeHighlightParser",void 0),xt([l()],Ct.prototype,"selectionController",void 0),xt([l()],Ct.prototype,"inputController",void 0),xt([l()],Ct.prototype,"insertCompositionTextController",void 0),xt([l()],Ct.prototype,"focusController",void 0),xt([l()],Ct.prototype,"historyController",void 0),xt([l()],Ct.prototype,"changeEventEmitter",void 0),xt([l()],Ct.prototype,"removeEventEmitter",void 0),xt([l()],Ct.prototype,"codeBlockPasteController",void 0),xt([l()],Ct.prototype,"eventPreventSlimmer",void 0),Ct.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{Ct as vega_code_block}
|
|
1
|
+
import{h as t,F as e,r as n,c as o,H as i,g as r}from"./p-6b2342e0.js";import{c as s,V as a,M as c,I as l}from"./p-6e1ab235.js";import{V as d,I as p}from"./p-8ce9e214.js";import{s as u}from"./p-519a7d55.js";import{V as h}from"./p-724df1f5.js";import{t as f}from"./p-aacf6920.js";import{D as v,d as b}from"./p-526e3634.js";import{i as g,a as m,q as y}from"./p-fcefb62c.js";import{ab as x}from"./p-35d617d5.js";import{a as C}from"./p-528748fa.js";import{C as w}from"./p-2d0d575f.js";import{y as j,x as k}from"./p-3a93730e.js";import{c as R}from"./p-d7790113.js";import{d as O}from"./p-a841cf13.js";import{T as E}from"./p-0a1c7f80.js";import{S,a as F,C as $}from"./p-0542b8ac.js";import{A as L}from"./p-4d65756f.js";import{d as A}from"./p-1bc5b3bc.js";import{C as T}from"./p-328dbe8e.js";import{C as D}from"./p-2bb5a232.js";import"./p-1704ff25.js";import"./p-9a6bd32c.js";import"./p-6a334573.js";import"./p-8b5d3a52.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-b0f55f5f.js";import"./p-ed45b3b6.js";import"./p-d4ea8e22.js";import"./p-d884c644.js";import"./p-eb927e2b.js";import"./p-cb378636.js";import"./p-3e09aeed.js";import"./p-fb5ea4b2.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-f0e828d8.js";import"./p-46cab60a.js";import"./p-844b7826.js";import"./p-6cedb325.js";import"./p-c9c42a07.js";import"./p-1fb56e14.js";import"./p-5f377954.js";import"./p-dcf162e9.js";import"./p-982747ef.js";var H=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class P extends a{constructor(){super(...arguments),this.languageDropdownProps={searchable:!1},this.languageOptions=Object.keys(x).map((t=>({id:x[t],displayName:t}))),this.handleLanguageChange=t=>{v.addUniqueObserverToNode(t,g,(t=>{var e;this.valueController.updateValue(null===(e=this.value)||void 0===e?void 0:e.code,t.detail)}))},this.handleDeleteClick=t=>{v.addUniqueObserverToNode(t,m,(()=>{this.removeEventEmitter.emit().defaultPrevented||this.host.remove()}))}}getToolbarContainerRef(){return this.toolbarContainerRef}render(){return t(e,null,t("div",{part:"editor-toolbar",contenteditable:!1,class:{"editor-toolbar":!this.readOnly,"copy-button-container":this.showCopyButton&&this.readOnly},ref:t=>this.toolbarContainerRef=t},this.renderEditorToolbar(),this.copyButtonRenderer.render()),this.contentRenderer.render())}renderEditorToolbar(){var n,o;if(!this.readOnly)return t(e,null,t("vega-input-select",{source:this.languageOptions,value:null!==(o=null===(n=this.value)||void 0===n?void 0:n.language)&&void 0!==o?o:"",disabled:this.disabled,placeholder:this.translationSlimmer.t("Select Language"),size:"small",vegaDropdownProps:this.languageDropdownProps,exportparts:"select-container, selected-box, placeholder, toggle-icon-container, toggle-icon",ref:this.handleLanguageChange}),t("vega-button-circle",{key:"delete-button",disabled:this.disabled,label:this.translationSlimmer.t("Delete Code"),icon:h.getIconKey("trash-can"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleDeleteClick}))}}h.register({"trash-can":f}),H([s()],P.prototype,"readOnly",void 0),H([s()],P.prototype,"host",void 0),H([s()],P.prototype,"disabled",void 0),H([s()],P.prototype,"showCopyButton",void 0),H([s()],P.prototype,"value",void 0),H([s()],P.prototype,"contentRenderer",void 0),H([s()],P.prototype,"valueController",void 0),H([s()],P.prototype,"removeEventEmitter",void 0),H([s()],P.prototype,"translationSlimmer",void 0),H([s()],P.prototype,"copyButtonRenderer",void 0);var N=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class _ extends a{constructor(){super(...arguments),this.handleFocus=()=>{this.readOnly||this.disabled||this.host.classList.add("focus")},this.handleBlur=()=>{this.host.classList.remove("focus"),w.notify(b.getSubject(this.host,j),null)}}getCodeContentContainerRef(){return this.codeContentContainerRef}registerEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.addEventListener("focusin",this.handleFocus),this.codeContentContainerRef.addEventListener("focusout",this.handleBlur))}unregisterEventListener(){this.codeContentContainerRef&&(this.codeContentContainerRef.removeEventListener("focusin",this.handleFocus),this.codeContentContainerRef.removeEventListener("focusout",this.handleBlur))}render(){var n;const o=this.contentParseController.parseCode(),i=(null===(n=this.value)||void 0===n?void 0:n.language)||"";return t(e,null,t("style",null,this.getLineNumberStyleVariable(o)),t("code",{role:"textbox",tabIndex:0,spellcheck:!1,ref:t=>this.codeContentContainerRef=t,contenteditable:!this.readOnly&&!this.disabled,"data-language":i,innerHTML:o.map((t=>this.renderCodeNode(t))).join("")}))}renderCodeNode(t){const{key:e,className:n,mark:o,text:i}=t;return`<span key='${e}' class='${n}' data-mark='${o}' data-index='${e}'>${i}</span>`}getLineNumberStyleVariable(t){const e=10*(t.filter((t=>"\n"===t.text)).length+1).toString().length;return`code{--v-code-line-number-width:${e}px;--v-code-line-number-ml:-${e+16}px;--v-code-block-pl:${e+16}px}`}}N([s()],_.prototype,"host",void 0),N([s()],_.prototype,"readOnly",void 0),N([s()],_.prototype,"disabled",void 0),N([s()],_.prototype,"value",void 0),N([s()],_.prototype,"contentParseController",void 0),N([c("componentDidLoad")],_.prototype,"registerEventListener",null),N([c("disconnectedCallback")],_.prototype,"unregisterEventListener",null);var z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class B extends a{updateValue(t,e,n){this.value&&this.value.code===t&&this.value.language===e||(this.value={language:e,code:t},this.changeEventEmitter.emit(this.value),n&&n.recordHistory&&this.historyController.registerHistory({value:this.value,offset:n.offset}))}initialValue(){this.value||(this.value={code:"",language:"plainText"})}}z([s({writable:!0})],B.prototype,"value",void 0),z([s()],B.prototype,"changeEventEmitter",void 0),z([s()],B.prototype,"historyController",void 0),z([c("connectedCallback")],B.prototype,"initialValue",null);var I=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class M extends a{constructor(){super(...arguments),this.codeNodes=[]}getCurrentCodeNodes(){return this.codeNodes}parseCode(){const t=[this.prismCodeHighlightParser,this.defaultCodeHighlightParser];let e=[];for(const n of t)if(n.canParse()){e=n.parse();break}return this.codeNodes=e,e}}I([s()],M.prototype,"prismCodeHighlightParser",void 0),I([s()],M.prototype,"defaultCodeHighlightParser",void 0);class V{constructor(t){this.contentOffset=0,this.selectedText="",this.codeContainerRef=t}updateRange(t,e,n,o=""){const i=new V(this.codeContainerRef);return i.selectedText=o,i.contentOffset=i.getContentOffset(t,e,n),i}updateContentOffset(t){return this.contentOffset=Math.max(0,t),this.selectedText="",this.contentOffset}createNativeRange(t){const{nodeIndex:e,offset:n}=this.getFocusNodeState(t,this.contentOffset),o=new Range,i=this.codeContainerRef.querySelector(`span[data-index="${e}"]`);if(i){const t=Math.min(i.firstChild.textContent.length,n);return o.setStart(i.firstChild,t),o.setEnd(i.firstChild,t),o}}getContentOffset(t,e,n){let o=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if("CODE"===o.nodeName&&o.childNodes&&o.childNodes.length&&(o=o.childNodes[Math.min(e,o.childNodes.length-1)],e=0),o&&o.hasAttribute("data-index")){const t=Number(o.dataset.index);let i="";for(let e=0;e<t;e++)i+=n[e].text;return i.length+e}return 0}getFocusNodeState(t,e){const n=this.getCodeContent(t),o={nodeIndex:0,offset:0};if(!n||e>=n.length)o.nodeIndex=t.length-1,o.offset=t[o.nodeIndex].text.length;else{let n="";for(let i=0;i<t.length;i++)if(n+=t[i].text,n.length>=e){o.offset=Math.max(0,t[i].text.length-(n.length-e)),o.nodeIndex=i;break}}return"\n"===t[o.nodeIndex].text&&o.offset>0&&t[o.nodeIndex+1]&&(o.nodeIndex+=1,o.offset=0),o}getCodeContent(t){return t.map((t=>t.text)).join("")}}var Z=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class U extends L{constructor(){super(1),this.handleSelectionWithDebounce=A(this.handleSelectionChange,U.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.doTask=async()=>{await Promise.resolve();const t=this.getSelection(),e=this.codeBlockRange.createNativeRange(this.contentParseController.getCurrentCodeNodes());t&&e&&(t.removeAllRanges(),t.addRange(e))}}getCurrentRange(){return this.codeBlockRange}setNextCodeBlockRange(t,e=!1){this.codeBlockRange.updateContentOffset(t),super.enqueueTheTaskIntoQueue(e)}addSelectionChangeEventListener(){this.codeBlockRange=new V(this.contentRenderer.getCodeContentContainerRef()),document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}removeSelectionChangeEventListener(){document.removeEventListener("selectionchange",this.handleSelectionWithDebounce)}getSelection(){return S.getSelection(this.host.shadowRoot)}handleSelectionChange(){const t=this.getSelection();t&&t.rangeCount>0?(this.syncCodeRangeByNativeRange(),w.notify(b.getSubject(this.host,k),{detail:!0})):w.notify(b.getSubject(this.host,k),{detail:!1})}syncCodeRangeByNativeRange(){const t=this.getSelection();if(this.isCodeBlockActive()&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:n,startOffset:o}=e;this.codeBlockRange=this.codeBlockRange.updateRange(n,o,this.contentParseController.getCurrentCodeNodes(),e.toString())}}isCodeBlockActive(){return this.host&&this.host.classList.contains("focus")}}U.SELECTION_CHANGE_DEBOUNCE_TIME=Math.min(F.SELECTION_CHANGE_DEBOUNCE_TIME,40),Z([s()],U.prototype,"host",void 0),Z([s()],U.prototype,"contentRenderer",void 0),Z([s()],U.prototype,"contentParseController",void 0),Z([s()],U.prototype,"insertCompositionTextController",void 0),Z([c("componentDidLoad")],U.prototype,"addSelectionChangeEventListener",null),Z([c("disconnectedCallback")],U.prototype,"removeSelectionChangeEventListener",null);class Y extends a{deleteSelectedText(t,e,n){return n>=t.length?"":t.slice(0,e)+t.slice(e+n)}getCodeNodesContent(t){return t.map((t=>t.text)).join("")}stopEventPropagation(t){t&&"function"==typeof t.stopPropagation&&t.stopPropagation()}reCalculateRangeAndContent(t,e,n){let o=t.contentOffset,i=e;return t&&(t.selectedText.length&&(i=this.deleteSelectedText(i,t.contentOffset,t.selectedText.length)),i=i.slice(0,t.contentOffset)+n+i.slice(t.contentOffset),o=t.contentOffset+n.length),{nextOffset:o,updatedContent:i}}}var q=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class G extends Y{constructor(){super(...arguments),this.handleInputEvent=t=>{this.stopEventPropagation(t),this.updateCodeContent()},this.handleBeforeInput=t=>{switch(t.stopPropagation(),t.inputType){case"deleteContentBackward":return void(this.value&&this.value.code&&""!==this.value.code?this.handleDeleteAction(t):t.preventDefault());case"historyUndo":case"historyRedo":return void t.preventDefault()}this.updateCodeBlockRange(t)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("beforeinput",this.handleBeforeInput),t.addEventListener("input",this.handleInputEvent))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("beforeinput",this.handleBeforeInput),t.removeEventListener("input",this.handleInputEvent))}handleDeleteAction(t){const e=this.selectionController.getCurrentRange();if(e){t.preventDefault();const n=e.contentOffset,o=this.contentParseController.getCurrentCodeNodes();let i=this.getCodeNodesContent(o),r=n;e.selectedText.length?i=this.deleteSelectedText(i,n,e.selectedText.length):n>0&&(i=i.slice(0,n-1)+i.slice(n),r-=1),this.selectionController.setNextCodeBlockRange(r),this.valueController.updateValue(i,this.value.language,{recordHistory:!0,offset:r})}}updateCodeBlockRange(t){const e=this.selectionController.getCurrentRange();!this.insertCompositionTextController.isComposing()&&e&&this.selectionController.setNextCodeBlockRange(e.contentOffset+this.getInsertDataLength(t))}getInsertDataLength(t){const{data:e,inputType:n}=t;switch(n){case"insertText":return e.length;case"insertParagraph":case"insertLineBreak":return 1;default:return 0}}updateCodeContent(){var t;if(!this.insertCompositionTextController.isComposing()){let e=this.contentRenderer.getCodeContentContainerRef().innerText;this.isInsertLineBreakInLowVersionFirefox(e)&&(e+="\n"),this.valueController.updateValue(e,null===(t=this.value)||void 0===t?void 0:t.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}}isInsertLineBreakInLowVersionFirefox(t){var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";return!n.endsWith("\n")&&t===n+"\n"}}q([s()],G.prototype,"selectionController",void 0),q([s()],G.prototype,"contentRenderer",void 0),q([s()],G.prototype,"valueController",void 0),q([s()],G.prototype,"contentParseController",void 0),q([s()],G.prototype,"insertCompositionTextController",void 0),q([s()],G.prototype,"value",void 0),q([c("componentDidLoad")],G.prototype,"registerInputEvent",null),q([c("disconnectedCallback")],G.prototype,"unregisterEventListener",null);var W=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class X extends a{focusAndUpdateSelection(){if(!this.disabled&&!this.readOnly){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.focus(),this.selectionController.setNextCodeBlockRange(this.value&&this.value.code&&" "!==this.value.code?this.value.code.length:0,!0))}}removeFocusAfterDisabled(){(this.disabled||this.readOnly)&&this.host.classList.remove("focus")}}W([s()],X.prototype,"host",void 0),W([s()],X.prototype,"value",void 0),W([s()],X.prototype,"readOnly",void 0),W([s()],X.prototype,"disabled",void 0),W([s()],X.prototype,"contentRenderer",void 0),W([s()],X.prototype,"selectionController",void 0),W([c("doFocus")],X.prototype,"focusAndUpdateSelection",null),W([c("watchEditableChange")],X.prototype,"removeFocusAfterDisabled",null);var J=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class K extends a{constructor(){super(...arguments),this.handleCopyClick=t=>{v.addUniqueObserverToNode(t,m,(async()=>{var e;const n=(null===(e=this.value)||void 0===e?void 0:e.code)||"";if(n&&globalThis.navigator&&globalThis.navigator.clipboard){clearTimeout(this.updateLabelTimer),await globalThis.navigator.clipboard.writeText(n);const e=this.translationSlimmer.t("Copy Code");t.label=this.translationSlimmer.t("Copied"),this.updateLabelTimer=setTimeout((()=>{t&&(t.label=e)}),K.RESET_TOOLTIP_TIME)}}))}}render(){if(this.showCopyButton&&this.readOnly)return t("vega-button-circle",{key:"copy-button",label:this.translationSlimmer.t("Copy Code"),class:"copy-code-button",icon:h.getIconKey("copy"),iconColor:"text-secondary",variant:"icon-only",size:"extra-small",ref:this.handleCopyClick})}}function Q(t,e){if(!t||!e)return[t];const n=[t];return function(t,e){const n=[],o=[];for(const t of Object.keys(e)){const i=e[t],r=Array.isArray(i)?i:[i];for(const e of r)e.greedy?n.push({tokenType:t,patternDef:e}):o.push({tokenType:t,patternDef:e})}n.length>0&&function(t,e){for(let n=0;n<t.length;n++){const o=t[n];if("string"!=typeof o)continue;const i=o;let r=i;const s=[];for(const{tokenType:t,patternDef:n}of e){const{pattern:e,lookbehind:o,inside:a}=n,c=new RegExp(e.source,e.flags.replace(/g/g,"")+"g");let l;for(;null!==(l=c.exec(r));){let e=l.index,n=l[0];if(0===n.length){c.lastIndex++;continue}if(-1!==n.indexOf("\0GREEDY_PLACEHOLDER\0"))continue;if(o&&l[1]){const t=l[1].length;e+=t,n=n.slice(t)}const d=e+n.length;s.push({tokenType:t,matchStart:e,matchEnd:d,matchText:i.slice(e,d),inside:a}),r=r.slice(0,e)+"\0GREEDY_PLACEHOLDER\0".repeat(n.length).slice(0,n.length)+r.slice(d)}}if(0===s.length)continue;s.sort(((t,e)=>t.matchStart-e.matchStart));const a=[];let c=0;for(const t of s){t.matchStart>c&&a.push(i.slice(c,t.matchStart));let e=t.matchText;if(t.inside){const n=Q(t.matchText,t.inside);e=1===n.length?n[0]:n}a.push({type:t.tokenType,content:e}),c=t.matchEnd}c<i.length&&a.push(i.slice(c)),t.splice(n,1,...a),n+=a.length-1}}(t,n);for(const{tokenType:e,patternDef:n}of o)tt(t,e,n)}(n,e),n}function tt(t,e,n){for(let o=0;o<t.length;o++){const i=t[o];if("string"!=typeof i)continue;const r=et(i,e,n);1===r.length&&"string"==typeof r[0]||(t.splice(o,1,...r),o+=r.length-1)}}function et(t,e,n){const{pattern:o,lookbehind:i,inside:r}=n,s=new RegExp(o.source,o.flags.replace(/g/g,"")+"g"),a=[];let c,l=0;for(;null!==(c=s.exec(t));){let n=c.index,o=c[0];if(0===o.length){s.lastIndex++;continue}if(i&&c[1]){const t=c[1].length;n+=t,o=o.slice(t)}n>l&&a.push(t.slice(l,n));let d=o;if(r){const t=Q(o,r);d=1===t.length?t[0]:t}a.push({type:e,content:d}),l=n+o.length}return l<t.length&&a.push(t.slice(l)),0===a.length?[t]:a}h.register({copy:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"><g clip-path="url(#clip0_70002_574)"><path fill="currentColor" d="M11.7794 1.65539L10.3439 0.219844C10.2044 0.0790078 10.0122 0 9.81303 0H5.97865C5.15014 0 4.47865 0.671719 4.47865 1.5L4.47911 7.5C4.49975 8.32969 5.1724 9 5.99975 9H10.4997C11.3247 9 11.9997 8.325 11.9997 7.5V2.18555C11.9997 1.9868 11.9201 1.79602 11.7794 1.65539ZM10.8747 7.5C10.8747 7.70709 10.7068 7.875 10.4997 7.875H5.97865C5.77151 7.875 5.60365 7.70709 5.60365 7.5V1.50305C5.60365 1.29595 5.77156 1.12805 5.97865 1.12805H8.97865L8.99975 2.25C8.99975 2.66414 9.33561 3 9.74975 3H10.8537V7.5H10.8747ZM6.37475 10.5C6.37475 10.7071 6.20684 10.875 5.99975 10.875H1.47865C1.27151 10.875 1.10365 10.7071 1.10365 10.5L1.12428 4.50234C1.12428 4.29525 1.29218 4.12734 1.49928 4.12734H3.74975V3H1.49951C0.670996 3 -0.000488281 3.67148 -0.000488281 4.5L-0.000258594 10.5C-0.000207031 11.3273 0.671465 12 1.49975 12H5.99975C6.82475 12 7.49975 11.325 7.49975 10.5V9.75H6.39584L6.37475 10.5Z"/></g><defs><clipPath id="clip0_70002_574"><rect width="12" height="12" fill="currentColor"/></clipPath></defs></svg>'}}),K.RESET_TOOLTIP_TIME=1e3,J([s()],K.prototype,"value",void 0),J([s()],K.prototype,"readOnly",void 0),J([s()],K.prototype,"showCopyButton",void 0),J([s()],K.prototype,"translationSlimmer",void 0);const nt={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"']|"[^"]*"|'[^']*')+(?:>|$)/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0},punctuation:{pattern:/^<!|>$|[[\]]/},"doctype-tag":{pattern:/^DOCTYPE/i},name:{pattern:/[^\s<>'"/]+/},string:{pattern:/("|')[\s\S]*?\1/,greedy:!0}}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>/=$<%]+(?:\s(?:\s*[^\s>/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]+/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:{pattern:/\/?>/},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}}}},entity:[{pattern:/&[\da-z]{1,8};/i},{pattern:/&#x?[\da-f]{1,8};/i}]},ot={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:[{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\\r\n])*\1/,greedy:!0}],"template-string":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/},interpolation:{pattern:/\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/}}},string:{pattern:/[\s\S]+/}}},regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[.\r\n,;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0},"regex-delimiter":{pattern:/^\/|\/$/},"regex-flags":{pattern:/^[a-z]+$/}}},"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,lookbehind:!0,inside:{punctuation:{pattern:/[.\\]/}}}],keyword:[{pattern:/\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/}],boolean:{pattern:/\b(?:false|true)\b/},number:{pattern:/\b(?:(?:0[xX][\dA-Fa-f](?:_[\dA-Fa-f])*|0[bB][01](?:_[01])*|0[oO][0-7](?:_[0-7])*)n?|(?:\d(?:_\d)*\.?\d*|\.\d+)(?:[Ee][+-]?\d(?:_\d)*)?n?|NaN|Infinity)\b/},function:{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/},punctuation:{pattern:/[{}[\];(),.:]/},constant:{pattern:/\b[A-Z](?:[A-Z_]|\dx)*\b/}};const{function:it,punctuation:rt}=ot,st=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}(ot,["keyword","function","operator","punctuation"]),at=Object.assign(Object.assign({},st),{"class-name":[{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:{punctuation:{pattern:/[<>.,]/}}}],builtin:{pattern:/\b(?:Array|Boolean|Date|Function|Map|Number|Object|Promise|RegExp|Set|String|WeakMap|WeakSet|bigint|boolean|never|null|number|string|symbol|undefined|unknown|void)\b/},keyword:[{pattern:/\b(?:abstract|as|asserts|async|await|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|infer|instanceof|interface|is|keyof|let|module|namespace|new|null|of|package|private|protected|public|readonly|return|require|set|static|super|switch|this|throw|try|type|typeof|undefined|var|void|while|with|yield)\b/}],function:it,"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:{pattern:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/},generic:{pattern:/<[\s\S]+/,inside:{punctuation:{pattern:/[<>(),.]/},keyword:{pattern:/\b(?:extends|infer|keyof)\b/},builtin:{pattern:/\b(?:boolean|never|null|number|string|symbol|undefined|unknown|void)\b/}}}}},operator:{pattern:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%|&^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]|!(?=\s*[^=])/},punctuation:rt}),ct=Object.assign(Object.assign({tag:{pattern:/<\/?(?:[\w.:-]+(?:\s+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}))*\s*\/?)?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>/]*/,inside:{punctuation:{pattern:/^<\/?/},namespace:{pattern:/^[^\s>/:]+:/}}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\})/,inside:{punctuation:[{pattern:/^=/},{pattern:/^(\s*)["'{]|[}"']$/,lookbehind:!0}],script:{pattern:/[\s\S]+/,inside:ot}}},spread:{pattern:/\{\.{3}[a-z_$][\w$]*(?:\.[\w$]+)*\}/,inside:{punctuation:{pattern:/^\{\.{3}|\}$/},"attr-name":{pattern:/[\s\S]+/}}},"attr-name":{pattern:/[^\s>/]+/,inside:{namespace:{pattern:/^[^\s>/:]+:/}}},punctuation:{pattern:/\/?>/}}}},ot),{entity:nt.entity}),lt={css:{comment:{pattern:/\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1/,greedy:!0},atrule:[{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:{pattern:/^@[\w-]+/},"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0},punctuation:{pattern:/[;:(){}]/}}}],url:{pattern:/\burl\((?:("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1|(?:[^\\\r\n()"']|\\[\s\S])*)\)/i,greedy:!0,inside:{function:{pattern:/^url/i},punctuation:{pattern:/^\(|\)$/},string:{pattern:/^("|')[\s\S]+(?=\1$)/,lookbehind:!0}}},selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?![\s{])|\((?:[^()]|\([^()]*\))*\))*(?=\s*\{)/,inside:{"pseudo-element":{pattern:/(?:::)[\w-]+/},"pseudo-class":{pattern:/(?::)[\w-]+/},class:{pattern:/\.[\w-]+/},id:{pattern:/#[\w-]+/},attribute:{pattern:/\[(?:[^[\]"']|("|')(?:\\[\s\S]|(?!\1)[^\\\n\r])*\1)*\]/,greedy:!0,inside:{punctuation:{pattern:/^\[|\]$/},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\u00B7\u00C0-\u024F])+/i,lookbehind:!0},"attr-value":[{pattern:/(=\s*)(?:"[^"]*"|'[^']*'|[^\s'"=]+)/,lookbehind:!0}],operator:{pattern:/[|~*^$]?=/}}}}},property:{pattern:/(?!\s)[-_a-z\u00B7\u00C0-\u024F][-\w\u00B7\u00C0-\u024F]*(?=\s*:)/i},important:{pattern:/!important\b/i},function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?/i,lookbehind:!0},unit:{pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},punctuation:{pattern:/[(){};:,]/},operator:{pattern:/[+\-*/=><~^|]+/}},html:nt,markup:nt,javascript:ot,js:ot,typescript:at,ts:at,jsx:ct,tsx:Object.assign(Object.assign({tag:ct.tag},at),{entity:ct.entity}),c:ot,clike:ot};const dt=Object.values(x);class pt extends a{splitTag(t){if(!this.hasSpecialCharacter(t)||t.length<2)return[t];{const e=[],n=t.split("");let o=0;return n.forEach((t=>{"<"===t||">"===t||"/"===t?(e.push(t),o=e.length):e[o]=e[o]?e[o]+t:t})),e}}isHighlightLanguage(t){return"plainText"!==t&&dt.includes(t)}markLineNumberNodes(t){0===t.length&&t.push({text:"\n",key:"0",className:""});let e=0;return t.map(((n,o)=>{let i=n.className;return 0!==o&&"\n"!==t[o-1].text||(e++,i=`v-code-line-number ${n.className}`),{text:n.text,key:`${o}`,className:i,mark:`${e}`}}))}hasSpecialCharacter(t){return/[<|>|\\/]/.test(t)}}!function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);r>3&&s&&Object.defineProperty(e,n,s)}([s()],pt.prototype,"value",void 0);class ut extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return t&&e&&this.isHighlightLanguage(e)}parse(){const{code:t,language:e}=this.value;let n=[];const o=Q(t,function(t){return lt[t]}(e));return n=this.getHighlightNodes(o),this.markLineNumberNodes(n)}getHighlightNodes(t,e){const n=[];for(const o of t)if("string"==typeof o){const t=o.split(/(\n|\t)/),i=t.length;for(let o=0;o<i;o++){const i=t[o];if(i){const t=this.splitTag(i);n.push(...t.map((t=>this.createCodeNode(t,e))))}}}else{const{content:t}=o;"string"==typeof t?n.push(...this.getHighlightNodes([t],o.type)):Array.isArray(t)&&n.push(...this.getHighlightNodes(t,o.type))}return n}createCodeNode(t,e){return{text:t,key:"",className:`token ${e||""}`,mark:""}}}class ht extends pt{canParse(){const{code:t,language:e}=this.value||{code:""};return!t||!e||"plainText"===e||!this.isHighlightLanguage(e)}parse(){var t,e;const n=(null!==(e=null===(t=this.value)||void 0===t?void 0:t.code)&&void 0!==e?e:"").split(/(\n)/);let o=[];return n.forEach((t=>{if(t){const e=this.splitTag(t);o.push(...e.map((t=>({text:t,key:"",className:""}))))}})),o=this.markLineNumberNodes(o),o}}var ft=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class vt extends a{constructor(){super(...arguments),this.insertCompositionTextEndFlag=!0,this.handleCompositionStart=t=>{this.insertCompositionTextEndFlag=!1,this.stopEventPropagation(t)},this.handleCompositionEnd=t=>{var e;this.insertCompositionTextEndFlag=!0,this.stopEventPropagation(t);const n=this.selectionController.getCurrentRange();n&&this.selectionController.setNextCodeBlockRange(n.contentOffset+t.data.length);const o=this.contentRenderer.getCodeContentContainerRef().innerText;this.valueController.updateValue(o,null===(e=this.value)||void 0===e?void 0:e.language)}}isComposing(){return!this.insertCompositionTextEndFlag}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.addEventListener("compositionstart",this.handleCompositionStart),t.addEventListener("compositionend",this.handleCompositionEnd))}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&(t.removeEventListener("compositionstart",this.handleCompositionStart),t.removeEventListener("compositionend",this.handleCompositionEnd))}stopEventPropagation(t){t.stopPropagation()}}ft([s()],vt.prototype,"selectionController",void 0),ft([s()],vt.prototype,"contentRenderer",void 0),ft([s()],vt.prototype,"valueController",void 0),ft([s()],vt.prototype,"contentParseController",void 0),ft([s()],vt.prototype,"value",void 0),ft([c("componentDidLoad")],vt.prototype,"registerInputEvent",null),ft([c("disconnectedCallback")],vt.prototype,"unregisterEventListener",null);var bt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class gt extends ${constructor(){super(...arguments),this.getEffectiveTargets=()=>[this.contentRenderer.getCodeContentContainerRef()]}async undo(){if(this.undoStack.length>1){const t=this.undoStack.pop();this.redoStack.push(t);const e=this.undoStack[this.undoStack.length-1];e&&await this.restoreState(e)}}async redo(){const t=this.redoStack.pop();this.undoStack.push(t),await this.restoreState(t)}initialHistory(){this.registerHistory({value:this.value,offset:this.value.code.length},!0)}getIneffectiveTargets(){return[]}async restoreState(t){const{value:e,offset:n}=t;this.selectionController.setNextCodeBlockRange(n),this.valueController.updateValue(e.code,e.language)}}bt([s()],gt.prototype,"contentRenderer",void 0),bt([s()],gt.prototype,"value",void 0),bt([s()],gt.prototype,"valueController",void 0),bt([s()],gt.prototype,"selectionController",void 0),bt([c("componentDidLoad")],gt.prototype,"initialHistory",null);var mt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};class yt extends Y{constructor(){super(...arguments),this.handlePasteEvent=t=>{var e,n;t.preventDefault(),this.stopEventPropagation(t);const o=t.clipboardData;if(null===(e=null==o?void 0:o.files)||void 0===e?void 0:e.length)return;const i=null!==(n=null==o?void 0:o.getData("text/plain"))&&void 0!==n?n:"";i&&this.updateCodeBlockRangeAndContent(i)}}registerInputEvent(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.addEventListener("paste",this.handlePasteEvent)}unregisterEventListener(){const t=this.contentRenderer.getCodeContentContainerRef();t&&t.removeEventListener("paste",this.handlePasteEvent)}updateCodeBlockRangeAndContent(t){const{nextOffset:e,updatedContent:n}=this.getLatestRangeAndContent(t);this.selectionController.setNextCodeBlockRange(e),this.valueController.updateValue(n,this.value.language,{recordHistory:!0,offset:this.selectionController.getCurrentRange().contentOffset})}getLatestRangeAndContent(t){const e=this.selectionController.getCurrentRange(),n=this.contentParseController.getCurrentCodeNodes(),o=this.getCodeNodesContent(n);return this.reCalculateRangeAndContent(e,o,t)}}mt([s()],yt.prototype,"host",void 0),mt([s()],yt.prototype,"valueController",void 0),mt([s()],yt.prototype,"contentRenderer",void 0),mt([s()],yt.prototype,"value",void 0),mt([s()],yt.prototype,"selectionController",void 0),mt([s()],yt.prototype,"contentParseController",void 0),mt([s()],yt.prototype,"inputController",void 0),mt([c("componentDidLoad")],yt.prototype,"registerInputEvent",null),mt([c("disconnectedCallback")],yt.prototype,"unregisterEventListener",null);var xt=function(t,e,n,o){var i,r=arguments.length,s=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,n,o);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(s=(r<3?i(s):r>3?i(e,n,s):i(e,n))||s);return r>3&&s&&Object.defineProperty(e,n,s),s};const Ct=class{constructor(t){n(this,t),this.vegaChange=o(this,"vegaChange",7),this.change=o(this,"change",7),this.vegaRemove=o(this,"vegaRemove",7),this.remove=o(this,"remove",7),this.globalSlimmers={},this.componentGlobalStyleSlimmer=new D(":root{--code-orange:#cd3e00;--code-green:#007e7e;--code-purple:#6851f5;--code-gray:#67727e;--code-neutral:rgb(15, 36, 51);--code-neutral-8:rgba(15, 36, 51, 0.8);--code-neutral-7:rgba(15, 36, 51, 0.7)}.dark{--code-orange:#ff9571;--code-green:#73e6dc;--code-purple:#c7bdff;--code-gray:#8b959f;--code-neutral:rgb(252, 252, 252);--code-neutral-8:rgba(252, 252, 252, 0.8);--code-neutral-7:rgba(252, 252, 252, 0.7)}"),this.translationSlimmer=new E,this.vegaComponentUsageRuntimeMetricsSlimmer=new d,this.codeBlockRenderer=new P,this.contentRenderer=new _,this.copyButtonRenderer=new K,this.valueController=new B,this.contentParseController=new M,this.prismCodeHighlightParser=new ut,this.defaultCodeHighlightParser=new ht,this.selectionController=new U,this.inputController=new G,this.insertCompositionTextController=new vt,this.focusController=new X,this.historyController=new gt,this.changeEventEmitter=R(Ct,g),this.removeEventEmitter=R(Ct,y),this.codeBlockPasteController=new yt,this.eventPreventSlimmer=new T([g],(()=>this.codeBlockRenderer.getToolbarContainerRef())),this.readOnly=!1,this.disabled=!1,this.showCopyButton=!0,this.showLineNumber=!0}watchEditableChange(){}componentShouldUpdate(t,e,n){return"value"!==n||!O(t,e)}async doFocus(){}render(){const e=C([this.readOnly?"readonly":"",this.disabled?"disabled":"",this.showLineNumber?"show-line-number":"",this.prismCodeHighlightParser.canParse()?"highlight":""]);return u(t(i,{contenteditable:!1,class:e},this.codeBlockRenderer.render()),this.host)}get host(){return r(this)}static get watchers(){return{readOnly:["watchEditableChange"],disabled:["watchEditableChange"]}}};xt([p()],Ct.prototype,"globalSlimmers",void 0),xt([l()],Ct.prototype,"componentGlobalStyleSlimmer",void 0),xt([l()],Ct.prototype,"translationSlimmer",void 0),xt([l()],Ct.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),xt([l()],Ct.prototype,"codeBlockRenderer",void 0),xt([l()],Ct.prototype,"contentRenderer",void 0),xt([l()],Ct.prototype,"copyButtonRenderer",void 0),xt([l()],Ct.prototype,"valueController",void 0),xt([l()],Ct.prototype,"contentParseController",void 0),xt([l()],Ct.prototype,"prismCodeHighlightParser",void 0),xt([l()],Ct.prototype,"defaultCodeHighlightParser",void 0),xt([l()],Ct.prototype,"selectionController",void 0),xt([l()],Ct.prototype,"inputController",void 0),xt([l()],Ct.prototype,"insertCompositionTextController",void 0),xt([l()],Ct.prototype,"focusController",void 0),xt([l()],Ct.prototype,"historyController",void 0),xt([l()],Ct.prototype,"changeEventEmitter",void 0),xt([l()],Ct.prototype,"removeEventEmitter",void 0),xt([l()],Ct.prototype,"codeBlockPasteController",void 0),xt([l()],Ct.prototype,"eventPreventSlimmer",void 0),Ct.style=':host{display:block;border-radius:2px;background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));padding-left:12px;padding-right:12px;padding-top:12px;padding-bottom:12px}:host code{display:block;box-sizing:border-box;color:rgba(var(--v-text-primary, 32, 54, 69, 1));text-align:left;font-family:"Roboto Mono";font-weight:400;line-height:22px;font-size:16px;white-space:pre-wrap;min-height:22px;tab-size:2px;word-break:break-word}:host code:focus-visible{outline:none}:host .editor-toolbar{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-bottom:12px;border:1px solid rgba(var(--v-border-divider-secondary, 199, 217, 229, 1));border-top-width:0px;border-left-width:0px;border-right-width:0px;margin-bottom:12px;user-select:none}:host .editor-toolbar vega-input-select{width:auto;min-width:161px}:host(.show-line-number) code .v-code-line-number::before{content:attr(data-mark);width:var(--v-code-line-number-width);margin-left:var(--v-code-line-number-ml);padding-right:16px;text-align:right;user-select:none;font-style:normal;word-break:keep-all;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));display:inline-block}:host(.show-line-number) code{padding-left:var(--v-code-block-pl)}:host::part(select-container){padding-top:0px;padding-bottom:0px;padding-left:8px;padding-right:8px;border-radius:4px}:host::part(selected-box),:host::part(placeholder){font-size:14px;user-select:none}:host::part(toggle-icon-container){width:12px;height:12px;line-height:12px}:host::part(toggle-icon){width:12px;height:12px}:host(.readonly) .copy-button-container{position:relative}:host(.readonly) .copy-button-container .copy-code-button{position:absolute;top:0px;right:0px}:host(.disabled:not(.highlight)) code{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host(.disabled.highlight){opacity:0.5}:host(.focus:not(.disabled,.readonly)){outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host(.highlight) code{color:var(--code-neutral)}code .comment,code .prolog,code .doctype,code .cdata{color:var(--code-gray);font-style:italic}code .namespace{color:var(--code-neutral-7)}code .string,code .attr-value,code .builtin{color:var(--code-green)}code .punctuation,code .operator,code .attr-equals{color:var(--code-gray)}code .entity,code .url,code .symbol,code .number,code .boolean,code .variable,code .constant,code .property,code .regex,code .inserted{color:var(--code-neutral-8)}code .atrule,code .function,code .attr-name{color:var(--code-orange)}code .deleted{color:var(--code-neutral)}code .function-variable{color:#ff0000}code .tag,code .selector,code .keyword{color:var(--code-purple)}';export{Ct as vega_code_block}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as t,a as e,M as s,C as n,l as r,f as i,d as o}from"./p-35d617d5.js";import{c as a}from"./p-a841cf13.js";import{V as c}from"./p-3e09aeed.js";import"./p-6e1ab235.js";import{I as l,c as h}from"./p-9a6bd32c.js";import{r as u}from"./p-528748fa.js";import{i as d}from"./p-b0f55f5f.js";import{g as p}from"./p-8b5d3a52.js";import{U as E,V as f}from"./p-85dcd07b.js";const L=[{payloadKey:"IS_OVERRIDECOLORS_METHOD_CALLED",payloadDescription:"Indicate if the method overrideColors of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"overrideColors"===e,payloadValue:()=>!0},{payloadKey:"IS_RESET_METHOD_CALLED",payloadDescription:"Indicate if the method reset of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"reset"===e,payloadValue:()=>!0},{payloadKey:"IS_TOGGLEDARKMODE_METHOD_CALLED",payloadDescription:"Indicate if the method toggleDarkMode of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"toggleDarkMode"===e,payloadValue:()=>!0},{payloadKey:"IS_ISDARKMODE_METHOD_CALLED",payloadDescription:"Indicate if the method isDarkMode of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"isDarkMode"===e,payloadValue:()=>!0},{payloadKey:"IS_APPLY_BRANDING_METHOD_CALLED",payloadDescription:"Indicate if the method applyBranding of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"applyBranding"===e,payloadValue:()=>!0},{payloadKey:"IS_VALIDATECOLORACCESSIBILITY_METHOD_CALLED",payloadDescription:"Indicate if the method validateColorAccessibility of public API ThemeManager is called",canAccept:(t,e)=>"ThemeManager"===t&&"validateColorAccessibility"===e,payloadValue:()=>!0}];class b{constructor(){this.vegaPublicAPIRuntimeMetricsSlimmer=h(b,["overrideColors","reset","toggleDarkMode","isDarkMode","applyBranding","validateColorAccessibility"],L)}async overrideColors(t){c.overrideColors(t)}async reset(){c.reset()}toggleDarkMode(t){c.toggleDarkMode(t)}isDarkMode(){return c.isDarkMode()}applyBranding(t){c.applyBranding(t)}async validateColorAccessibility(t){return c.validateColorAccessibility(t)}}!function(t,e,s,n){var r,i=arguments.length,o=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,s):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,n);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(i<3?r(o):i>3?r(e,s,o):r(e,s))||o);i>3&&o&&Object.defineProperty(e,s,o)}([l()],b.prototype,"vegaPublicAPIRuntimeMetricsSlimmer",void 0);const C=new b,g=["none","solid","dashed","dotted","double","groove","ridge","inset","outset"],T=[{key:"white",dark:"#04041C",light:"#FCFCFC"},{key:"red",dark:"#AA091C",light:"#FF4C61"},{key:"orange",dark:"#974502",light:"#FDAB68"},{key:"yellow",dark:"#735C00",light:"#FFDC4C"},{key:"green",dark:"#2E6D18",light:"#7BDA58"},{key:"teal",dark:"#287171",light:"#7BD1D1"},{key:"gray",dark:"#595959",light:"#999999"},{key:"black",dark:"#FCFCFC",light:"#04041C"}],_={key:"default-head-bg",dark:"#181830",light:"#F0F3F7"};class O{static getTableColors(){return O.TABLE_COLORS}static setTableColors(t){O.TABLE_COLORS=t}static getColorKey(t,e=!1){var s;let n=null;const r=O.TABLE_COLORS,i=e?[...r,_]:r;if(i){const e=null===(s=u(t))||void 0===s?void 0:s.toUpperCase();if(e)n=i.find((t=>C.isDarkMode()?t.dark===e:t.light===e));else for(const e of i)if(e.key===t){n=e;break}}return n?n.key:""}}O.TABLE_COLORS=T;class m extends t{constructor(t){super(),this.type=A.COLOR,this.colorKey=t,t&&(this.color=this.formatColor(t))}renderStyle(){return{color:this.color?c.isDarkMode()?this.color.dark:this.color.light:this.colorKey||""}}renderClass(){return null}toJSON(){var t;return{color:(null===(t=this.color)||void 0===t?void 0:t.key)||this.colorKey||""}}clone(){return new m(this.colorKey)}formatColor(t){return O.getTableColors().find((e=>e.key===t))}}var A,S;!function(t){t.TABLE="EXTENSION_TABLE",t.CELL="EXTENSION_TABLE_CELL",t.CAPTION="EXTENSION_TABLE_CAPTION",t.COLOR="EXTENSION_TABLE_COLOR"}(A||(A={}));class y extends t{constructor({backgroundColor:t,border:e,width:s,height:n,alignment:r,borderCollapse:i}={},o=!0){super(),this.type=A.TABLE,this.useInternalStyle=o,this.backgroundColor=t,this.border=e,this.width=s,this.height=n,this.alignment=o&&void 0===r?y.DEFAULT_ALIGNMENT:r,this.backgroundColorAnnotation=new m(t),this.borderColorAnnotation=new m(null==e?void 0:e.color),this.borderCollapse=o&&void 0===i?y.DEFAULT_BORDER_COLLAPSE:i}static from(t,e=!0){return[A.TABLE,new y(t,e)]}static getDefaultStyles(){return{borderCollapse:y.DEFAULT_BORDER_COLLAPSE,margin:y.DEFAULT_ALIGNMENT_STYLE_VALUE}}get borderStr(){return this.border?`${this.border.style} ${this.border.width} ${this.borderColorAnnotation.renderStyle().color}`.trim():null}clone(){return new y({backgroundColor:this.backgroundColor,border:this.border,width:this.width,height:this.height,alignment:this.alignment,borderCollapse:this.borderCollapse},this.useInternalStyle)}toJSON(){return{table:a({backgroundColor:this.backgroundColor,border:this.border,width:this.width,height:this.height,alignment:this.alignment,borderCollapse:this.borderCollapse})}}renderStyle(){const t=this.backgroundColorAnnotation.renderStyle().color,e=Object.assign({border:this.borderStr,width:this.width,height:this.height,borderCollapse:this.borderCollapse},this.renderAlignmentStyle());return t&&(e.backgroundColor=t),a(e)}renderClass(){return"v-rte--extension-table"}renderAlignmentStyle(){return this.alignment?{margin:"center"===this.alignment?y.DEFAULT_ALIGNMENT_STYLE_VALUE:"left"===this.alignment?"0":"0 0 0 auto"}:{}}}y.DEFAULT_BORDER_COLLAPSE="collapse",y.DEFAULT_ALIGNMENT="center",y.DEFAULT_ALIGNMENT_STYLE_VALUE="0 auto";class w extends e{constructor(t,e){super(t),this.dtoName=w.dtoName,this.type="table-block",this.children=[];const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(A.TABLE,new y)}static from(t,e){var s;const n=new w(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),n.children=super.generateBlockChildren(t.children,e,n),(null===(s=t.annotations)||void 0===s?void 0:s.table)&&n.annotationMap.set(...y.from(t.annotations.table,null==e?void 0:e.autoMatchFormat)),n}clone(t){const e=new w(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}getFirstNode(){return this.hasCaption()?this.children[0].children[0].getLastNode():this.children[0].children[0].children[0].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<table${super.generateAttributeString(t)}>${e}</table>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}getCaption(){const t=this.children.find((t=>"table-caption"===t.type));return null!=t?t:null}setCaption(t){const e=this.children.findIndex((t=>"table-caption"===t.type));t?(t.parent=this,e>=0?this.children[e]=t:this.children.unshift(t)):e>=0&&this.children.splice(e,1)}hasCaption(){return d(this.getCaption())}}w.dtoName="RTETableBlock",function(t){t.ROW="ROW",t.CAPTION="CAPTION",t.COLUMN="COLUMN",t.MERGE_CELLS="MERGE_CELLS",t.TABLE="TABLE",t.CELL="CELL",t.SPLIT_CELL="SPLIT_CELL"}(S||(S={}));class R{syncCursorPosition(t,e){const s=this.findRootContent(t);if(e&&s){const t=e.getRangeEndOffset();s.apply(new E(e,t))}}findRootContent(t){let e=t.parent;for(;e;){if(e instanceof f)return e;e=e.parent}}}const N="DELETE_TABLE_ROW";class M extends s{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_ROW",this.rowsToBeRemoved=t}}const I="INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION";class D extends s{constructor(t,e=[]){super(),this.isFlushable=!0,this.type="INSERT_TABLE_ROW_INTO_DIFFERENT_SECTION",this.selectedRows=[],this.insertDirection=t,this.selectedRows=e}}const v="INSERT_TABLE_ROW_INTO_SAME_SECTION";var x;!function(t){t.ABOVE="ABOVE",t.BELOW="BELOW"}(x||(x={}));class k extends s{constructor(t,e=[]){super(),this.isFlushable=!0,this.type="INSERT_TABLE_ROW_INTO_SAME_SECTION",this.selectedRows=[],this.insertDirection=t,this.selectedRows=e}}const B="TOGGLE_HEADER_ROW";class j extends s{constructor(t){super(),this.isFlushable=!0,this.type="TOGGLE_HEADER_ROW",this.selectedRows=t}}class H extends e{constructor(t){super(t),this.dtoName=H.dtoName,this.type="table-body",this.children=[]}static from(t,e){const s=new H(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new H(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<tbody${super.generateAttributeString(t)}>${e}</tbody>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}H.dtoName="RTETableBodyBlock";class F extends e{constructor(t){super(t),this.dtoName=F.dtoName,this.type="table-head",this.children=[]}static from(t,e){const s=new F(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new F(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<thead${super.generateAttributeString(t)}>${e}</thead>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}F.dtoName="RTETableHeadBlock";class $ extends e{constructor(t){super(t),this.dtoName=$.dtoName,this.type="table-row",this.children=[]}static from(t,e){const s=new $(t.id);return super.convertAnnotationsToMap(s.annotationMap,Object.assign({},t.annotations)),s.children=super.generateBlockChildren(t.children,e,s),s}clone(t){const e=new $(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<tr${super.generateAttributeString(t)}>${e}</tr>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}$.dtoName="RTETableRowBlock";class P extends t{constructor({backgroundColor:t,padding:e,border:s,width:n,height:r,textAlign:i,verticalAlign:o,minWidth:a,boxSizing:c}={},l=!0){super(),this.type=A.CELL,this.useInternalStyle=l,this.backgroundColor=t,this.width=n,this.height=r,this.border=l&&void 0===s?P.DEFAULT_BORDER:s,this.padding=l&&void 0===e?P.DEFAULT_PADDING:e,this.textAlign=l&&void 0===i?P.DEFAULT_HORIZONTAL_TEXT_ALIGN:i,this.verticalAlign=l&&void 0===o?P.DEFAULT_VERTICAL_TEXT_ALIGN:o,this.minWidth=l&&void 0===a?P.DEFAULT_CELL_MIN_WIDTH:a,this.boxSizing=l&&void 0===c?P.DEFAULT_BOX_SIZING:c}static from(t,e){return[A.CELL,new P(t,e)]}static getDefaultStyles(t=!0){return{padding:P.DEFAULT_PADDING,textAlign:P.DEFAULT_HORIZONTAL_TEXT_ALIGN,verticalAlign:P.DEFAULT_VERTICAL_TEXT_ALIGN,minWidth:P.DEFAULT_CELL_MIN_WIDTH,boxSizing:P.DEFAULT_BOX_SIZING,border:`${P.DEFAULT_BORDER.style} ${P.DEFAULT_BORDER.width} ${t?P.DEFAULT_BORDER.color:P.DEFAULT_BORDER_RGB_COLOR}`}}get borderStr(){return this.border?`${this.border.style||""} ${this.border.width||""} ${this.borderColorAnnotation.renderStyle().color}`.trim():null}set backgroundColor(t){this._backgroundColor=t,this.backgroundColorAnnotation=new m(t)}get backgroundColor(){return this._backgroundColor}set border(t){this._border=t,this.borderColorAnnotation=new m(null==t?void 0:t.color)}get border(){return this._border}clone(){return new P({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing},this.useInternalStyle)}toJSON(){return{tableCell:a({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing})}}renderStyle(t){const e=this.backgroundColorAnnotation.renderStyle().color,s={padding:this.padding,border:this.borderStr,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing};return e&&(s.backgroundColor=e),a((null==t?void 0:t.standalone)?s:this.removeDefaultValues(s),{cleanEmptyString:!0})}renderClass(){return null}removeDefaultValues(t){const e=Object.assign({},t);return e.padding===P.DEFAULT_PADDING&&delete e.padding,e.border===`${P.DEFAULT_BORDER.style} ${P.DEFAULT_BORDER.width} ${P.DEFAULT_BORDER.color}`&&delete e.border,e.textAlign===P.DEFAULT_HORIZONTAL_TEXT_ALIGN&&delete e.textAlign,e.verticalAlign===P.DEFAULT_VERTICAL_TEXT_ALIGN&&delete e.verticalAlign,e.minWidth===P.DEFAULT_CELL_MIN_WIDTH&&delete e.minWidth,e.boxSizing===P.DEFAULT_BOX_SIZING&&delete e.boxSizing,e}}P.DEFAULT_PADDING="12px",P.DEFAULT_BORDER={style:"solid",width:"1px",color:"#ddd"},P.DEFAULT_BORDER_RGB_COLOR="rgb(221, 221, 221)",P.DEFAULT_HORIZONTAL_TEXT_ALIGN="left",P.DEFAULT_VERTICAL_TEXT_ALIGN="middle",P.DEFAULT_CELL_MIN_WIDTH="55px",P.DEFAULT_BOX_SIZING="border-box";class W extends e{constructor(t,e){super(t),this.dtoName=W.dtoName,this.type="table-cell",this.children=[];const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(A.CELL,new P)}static from(t,e){var s;const n=new W(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),(null===(s=t.annotations)||void 0===s?void 0:s.tableCell)&&n.annotationMap.set(...P.from(t.annotations.tableCell,null==e?void 0:e.autoMatchFormat)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new W(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}get rowSpan(){const t=this.getCustomAttributeByName("rowspan");return isNaN(Number(t))?1:Math.max(Number(t),1)}get colSpan(){const t=this.getCustomAttributeByName("colspan");return isNaN(Number(t))?1:Math.max(Number(t),1)}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<td${super.generateAttributeString(t)}>${e}</td>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}getCustomAttributeByName(t){const e=this.getCustomAttributesAnnotation();if(e)return(e.toJSON().customAttribute||{})[t]}}W.dtoName="RTETableCellBlock";class G extends P{constructor(t={},e=!0){super(t,e)}static from(t,e){return[A.CELL,new G(t,e)]}static getDefaultBackgroundColor(){return c.isDarkMode()?_.dark:_.light}clone(){return new G({backgroundColor:this.backgroundColor,padding:this.padding,border:this.border,width:this.width,height:this.height,textAlign:this.textAlign,verticalAlign:this.verticalAlign,minWidth:this.minWidth,boxSizing:this.boxSizing},this.useInternalStyle)}renderStyle(t){var e;const s=super.renderStyle(t);return a(Object.assign(Object.assign({},s),{backgroundColor:null!==(e=s.backgroundColor)&&void 0!==e?e:G.getDefaultBackgroundColor()}))}}class V extends W{constructor(t,e){super(t,e),this.dtoName=V.dtoName,this.type="table-head-cell";const{autoMatchFormat:s}=e||{autoMatchFormat:!0};s&&this.annotationMap.set(A.CELL,new G)}static from(t,e){var s;const n=new V(t.id,e);return super.convertAnnotationsToMap(n.annotationMap,Object.assign({},t.annotations)),(null===(s=t.annotations)||void 0===s?void 0:s.tableCell)&&n.annotationMap.set(...G.from(t.annotations.tableCell,null==e?void 0:e.autoMatchFormat)),n.children=super.generateBlockChildren(t.children,e,n),n}clone(t){const e=new V(this.id);return e.children=this.children.map((t=>t.clone(e))),e.parent=t,e.annotationMap=super.cloneAnnotations(),e}toHtml(t){const e=this.children.map((e=>e.toHtml(t))).join("");return`<th${super.generateAttributeString(t)}>${e}</th>`}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,children:this.children.map((t=>t.toJSON()))})}}V.dtoName="RTETableHeadCellBlock";const U="MERGE_CELLS";class J extends s{constructor(t,e,s,n,r){super(),this.type="MERGE_CELLS",this.isFlushable=!0,this.targetCell=t,this.mergeCells=e,this.colSpan=s,this.rowSpan=n,this.direction=r}}var K,Y;!function(t){t.MERGE_CELLS="MERGE_CELLS",t.MERGE_CELL_UP="MERGE_CELL_UP",t.MERGE_CELL_RIGHT="MERGE_CELL_RIGHT",t.MERGE_CELL_DOWN="MERGE_CELL_DOWN",t.MERGE_CELL_LEFT="MERGE_CELL_LEFT"}(K||(K={}));class z extends R{canHandle(t){return t[0]===S.MERGE_CELLS}execute(t,e){const s=e.tableSelection.getSelectedCells(),n=t[1];switch(n){case K.MERGE_CELL_UP:case K.MERGE_CELL_RIGHT:case K.MERGE_CELL_DOWN:case K.MERGE_CELL_LEFT:{const t=this.getDirectionMergeCells(n,s[0]);this.handleMergeCells(t,n)}break;default:s.length>1&&this.handleMergeCells(s,K.MERGE_CELLS)}}getDirectionMergeCells(t,e){const s=it(e,t);if(!s)return[e];switch(t){case K.MERGE_CELL_UP:return[s,e];case K.MERGE_CELL_DOWN:return[e,s];case K.MERGE_CELL_LEFT:return[s,e];default:return[e,s]}}handleMergeCells(t,e){if(t.length<2)return;const s=ot(t),{minRow:n,maxRow:r,minCol:i,maxCol:o,targetCell:a}=s,c=new J(a,t,o-i+1,r-n+1,e);this.applyActionOnTable(c,a)}applyActionOnTable(t,e){const s=X(e,w);s&&s.apply(t)}}function X(t,e){return t?t instanceof e?t:X(t.parent,e):null}function Z(t,e){return{id:p(),type:"table-body",children:Array.from({length:t},(()=>function(t){return{id:p(),type:"table-row",children:Array.from({length:t},(()=>et("table-cell")))}}(e)))}}function q(t){return t.children.filter((t=>t instanceof H||t instanceof F)).flatMap((t=>t.children))}function Q(t){if(!t||!t.children||!t.children[0])return null;const e=t.children[0];return e instanceof i?e:Q(e)}function tt(t,e){for(const s of t){const t=s.children.find((t=>t.id===e));if(t)return t}return null}function et(t){const e=p();return{id:e,type:t,children:[{id:`${e}-p`,type:"paragraph",nodes:[{id:`${e}-p-t`,type:"text",text:""}]}]}}function st(t){return{colSpan:t.colSpan,rowSpan:t.rowSpan}}function nt(t,e,s){const n=null!=s?s:rt(e);for(let e=0;e<n.length;e++){const s=n[e];for(let e=0;e<s.length;e++)if(s[e]===t.id)return e}return-1}function rt(t){const e=[];return t.forEach(((t,s)=>{e[s]||(e[s]=[]);let n=0;t.children.forEach((t=>{const{colSpan:r,rowSpan:i}=st(t);for(;void 0!==e[s][n];)n++;for(let o=0;o<i;o++)for(let i=0;i<r;i++)e[s+o]||(e[s+o]=[]),e[s+o][n+i]=t.id;n+=r}))})),e}function it(t,e){if(!t)return null;const s=t.parent,n=s.parent.children,r=n.indexOf(s),{colSpan:i,rowSpan:o}=st(t),a=nt(t,n);let c=r,l=a;switch(e){case K.MERGE_CELL_LEFT:l=a-1;break;case K.MERGE_CELL_RIGHT:l=a+i;break;case K.MERGE_CELL_UP:c=r-1;break;default:c=r+o}return function(t,e,s){const n=rt(t);for(let r=0;r<t.length;r++){const i=t[r];for(const o of i.children){const{colSpan:i,rowSpan:a}=st(o),c=nt(o,t,n),l=r+a-1,h=c+i-1,u=s>=c&&s<=h;if(e>=r&&e<=l&&u)return o}}return null}(n,c,l)}function ot(t){const e=t[0].parent.parent.children,s=rt(e);let n=Number.POSITIVE_INFINITY,r=-1,i=Number.POSITIVE_INFINITY,o=-1;const a=new Set;return t.forEach((t=>{const c=e.indexOf(t.parent),l=nt(t,e,s),{colSpan:h,rowSpan:u}=st(t),d=c,p=c+u-1,E=l,f=l+h-1;for(let t=d;t<=p;t++)for(let e=E;e<=f;e++)a.add(`${t},${e}`);n=Math.min(n,d),r=Math.max(r,p),i=Math.min(i,E),o=Math.max(o,f)})),{minRow:n,maxRow:r,minCol:i,maxCol:o,targetCell:t[0],coveredPositions:a}}function at(t){let e=0;const s=q(t)[0];for(const t of s.children){const{colSpan:s}=st(t);e+=s}return e}function ct(t){if(1===t.length)return!0;const e=ot(t),{minRow:s,maxRow:n,minCol:r,maxCol:i,coveredPositions:o}=e;return o.size===(n-s+1)*(i-r+1)}function lt(t,e,s,i,o){const a=t.annotationMap.get(n.CUSTOM_ATTRIBUTE),c=a?Object.assign({},a.customAttribute):{};delete c.colspan,delete c.rowspan,e>1&&(c.colspan=String(e));const l=at(i)+(o?1:0);if(s>1&&e!==l&&(c.rowspan=String(s)),Object.keys(c).length>0){const e=new r(c);t.annotationMap.set(n.CUSTOM_ATTRIBUTE,e)}else t.annotationMap.delete(n.CUSTOM_ATTRIBUTE)}function ht(t){const e=et(t);return"table-head-cell"===t?V.from(e):W.from(e)}function ut(t,e,s){for(let n=0;n<s;n++){const s=t[n],r=e.children.find((t=>t.id===s));if(r&&!(r instanceof V))return n}return-1}function dt(t){const e=new Map;return t.forEach((t=>{for(let s=0;s<t.length;s++){const n=t[s];n&&!e.has(n)&&e.set(n,s)}})),e}function pt(t,e,s,n){if(0===t.length)return[0,-1];const r=s||q(e),i=null!=n?n:rt(r);let o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY;return t.forEach((t=>{const e=nt(t,r,i);o=Math.min(o,e),a=Math.max(a,e)})),[o,a]}!function(t){t.HEADER_ROW="HEADER_ROW",t.ADD_ROW_ABOVE="ADD_ROW_ABOVE",t.ADD_ROW_BELOW="ADD_ROW_BELOW",t.DELETE_ROW="DELETE_ROW",t.SELECT_ROW="SELECT_ROW"}(Y||(Y={}));class Et extends R{canHandle(t){return t[0]===S.ROW}execute(t,e){const s=t[1];switch(s){case Y.ADD_ROW_ABOVE:case Y.ADD_ROW_BELOW:this.handleInsertRow(s,e);break;case Y.DELETE_ROW:this.handleDeleteRow(e);break;case Y.HEADER_ROW:this.handleToggleHeader(e);break;case Y.SELECT_ROW:this.handleSelectRow(e)}}handleInsertRow(t,e){const s=this.getAllSelectedRows(e);if(s.length>0){const e=t===Y.ADD_ROW_ABOVE?x.ABOVE:x.BELOW,n=e===x.ABOVE?s[0]:s[s.length-1],r=n.parent instanceof H,i=this.shouldInsertHeaderRow(n,e)||r?new k(e,s):new D(e,s);this.applyActionToTable(s[0],i)}}shouldInsertHeaderRow(t,e){if(e===x.ABOVE)return t.parent instanceof F;{const e=t.parent;return e instanceof F&&e.children[e.children.length-1]!==t}}handleDeleteRow(t){const e=this.getAllSelectedRows(t);if(e.length){const t=new M(e);this.applyActionToTable(e[0],t)}}handleToggleHeader(t){const e=this.getAllSelectedRows(t);if(e.length>0){const t=new j(e);this.applyActionToTable(e[0],t)}}handleSelectRow(t){const e=this.getAllSelectedRows(t);if(e.length>0&&t&&t.tableSelection){const s=e.flatMap((t=>t.children));t.tableSelection.setSelectedCells(s)}}getAllSelectedRows(t){const e=new Set;if(t&&t.tableSelection){const{tableSelection:s}=t;s.getSelectedCells().forEach((t=>{const s=X(t,$);s&&e.add(s)}))}return Array.from(e)}applyActionToTable(t,e){const s=X(t,w);s&&s.apply(e)}}const ft="REPLACE_TABLE_CELL";class Lt extends s{constructor(t){super(),this.isFlushable=!0,this.type="REPLACE_TABLE_CELL",this.payload=t}}const bt="SPLIT_TABLE_CELL";class Ct extends s{constructor(t){super(),this.isFlushable=!0,this.type="SPLIT_TABLE_CELL",this.payload=t}}class gt extends o{getBoundaryCellColumnRange(t,e,s){let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.forEach((t=>{const i=nt(t,e,s);n=Math.min(n,i),r=Math.max(r,i)})),[n,r]}}class Tt extends gt{static isFullHeaderSelection(t){if(0===t.length)return!1;const e=X(t[0],w);if(e){const s=q(e),n=rt(s),r=new Map;s.forEach((t=>{t.children.forEach((t=>r.set(t.id,t)))}));const[i,o]=pt(t,e,s,n);for(const t of n)for(let e=i;e<=o;e++){const s=r.get(t[e]);if(s&&!(s instanceof V))return!1}return!0}return!1}handleAction(t,e){const s=t.headerOn,n=q(e),r=rt(n),[i,o]=this.getBoundaryCellColumnRange(t.tableCellHeaderRange,n,r);(s||!s&&i>0)&&this.toggleHeadRows(e,n,r,s,o,i),this.toggleBodyRows(e,n,r,s,i,o);const a=this.getRootContent(e);if(a&&t.tableCellHeaderRange[0].parent){const e=t.tableCellHeaderRange[0].parent.getFirstNode();e&&a.apply(new E(e,0))}}toggleHeadRows(t,e,s,n,r,i){var o;const a=((null===(o=t.children.find((t=>t instanceof F)))||void 0===o?void 0:o.children)||[]).length;for(let o=0;o<a;o++)this.toggleCellType(t,e[o],s[o],0,n?r:i-1,(()=>!0),(t=>V.from(t.toJSON())))}toggleBodyRows(t,e,s,n,r,i){var o;const a=s[0].length,c=(null===(o=t.children.find((t=>t instanceof H)))||void 0===o?void 0:o.children)||[],l=e.length-c.length;for(let o=0;o<c.length;o++){const c=o+l,h=e[c],u=s[c],d=ut(u,h,a);n?d>-1&&this.toggleCellType(t,h,u,d,i,(t=>!(t instanceof V)),(t=>V.from(t.toJSON()))):this.toggleCellType(t,h,u,r,-1===d?a-1:d-1,(t=>t instanceof V),(t=>W.from(t.toJSON())))}}toggleCellType(t,e,s,n,r,i,o){for(let a=n;a<=r;a++){const n=s[a],c=e.children.find((t=>t.id===n));if(c&&i(c)){const i=s.indexOf(n),l={table:t,cell:c,col:a,cellStartCol:i,endCol:r,targetCellType:o(c).type},h=i+c.colSpan-1;if(h>r||i<a){if(e.apply(new Ct(l)),h>r)return;a=h;continue}e.apply(new Lt(l))}c&&(a+=c.colSpan-1)}}}const _t="DELETE_TABLE_COLUMN";class Ot extends s{constructor(t){super(),this.isFlushable=!0,this.type="DELETE_TABLE_COLUMN",this.tableCellDeleteRange=t}}const mt="INSERT_TABLE_COLUMN";var At;!function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(At||(At={}));class St extends s{constructor(t,e){super(),this.isFlushable=!0,this.type="INSERT_TABLE_COLUMN",this.tableCellInsertRange=e,this.insertDirection=t}}const yt="SELECT_TABLE_COLUMN";class wt extends s{constructor(t,e){super(),this.type="SELECT_TABLE_COLUMN",this.tableCellSelectRange=t,this.selectCellCallback=e}}const Rt="TOGGLE_HEADER_TABLE_COLUMN";class Nt extends s{constructor(t,e){super(),this.isFlushable=!0,this.type="TOGGLE_HEADER_TABLE_COLUMN",this.headerOn=!1,this.tableCellHeaderRange=t,this.headerOn=e}}var Mt;!function(t){t.HEADER_COLUMN="HEADER_COLUMN",t.ADD_COLUMN_LEFT="ADD_COLUMN_LEFT",t.ADD_COLUMN_RIGHT="ADD_COLUMN_RIGHT",t.DELETE_COLUMN="DELETE_COLUMN",t.SELECT_COLUMN="SELECT_COLUMN"}(Mt||(Mt={}));class It extends R{canHandle(t){return t[0]===S.COLUMN}execute(t,e){const s=e.tableSelection.getSelectedCells();if(!s||0===s.length)return;const n=t[1];switch(n){case Mt.ADD_COLUMN_LEFT:case Mt.ADD_COLUMN_RIGHT:this.handleInsertColumn(n,s);break;case Mt.DELETE_COLUMN:this.handleDeleteColumn(s);break;case Mt.SELECT_COLUMN:this.handleSelectColumn(s,e);break;case Mt.HEADER_COLUMN:this.handleToggleHeaderColumn(s)}}handleInsertColumn(t,e){const s=new St(t===Mt.ADD_COLUMN_LEFT?At.LEFT:At.RIGHT,e);this.applyActionOnTable(s,e[0])}handleDeleteColumn(t){const e=new Ot(t);this.applyActionOnTable(e,t[0])}handleSelectColumn(t,e){const s=new wt(t,(t=>{e.tableSelection.setSelectedCells(t)}));this.applyActionOnTable(s,t[0])}handleToggleHeaderColumn(t){const e=!Tt.isFullHeaderSelection(t),s=new Nt(t,e);this.applyActionOnTable(s,t[0])}applyActionOnTable(t,e){const s=X(e,w);s&&s.apply(t)}}const Dt="SPLIT_CELL_HORIZONTALLY";class vt extends s{constructor(){super(),this.isFlushable=!0,this.type="SPLIT_CELL_HORIZONTALLY"}}const xt="SPLIT_CELL_VERTICALLY";class kt extends s{constructor(){super(),this.isFlushable=!0,this.type="SPLIT_CELL_VERTICALLY"}}var Bt;!function(t){t.SPLIT_CELL_HORIZONTALLY="SPLIT_CELL_HORIZONTALLY",t.SPLIT_CELL_VERTICALLY="SPLIT_CELL_VERTICALLY"}(Bt||(Bt={}));class jt extends R{canHandle(t){return t[0]===S.SPLIT_CELL}execute(t,e){const s=e.tableSelection.getSelectedCells();if(s&&1===s.length){const e=s[0];switch(t[1]){case Bt.SPLIT_CELL_HORIZONTALLY:this.handleSplitCellHorizontally(e);break;case Bt.SPLIT_CELL_VERTICALLY:this.handleSplitCellVertically(e)}}}handleSplitCellHorizontally(t){const e=new vt;t.apply(e)}handleSplitCellVertically(t){const e=new kt;t.apply(e)}}export{pt as $,$ as A,nt as B,It as C,x as D,T as E,I as F,v as G,N as H,At as I,B as J,mt as K,_t as L,z as M,Rt as N,Tt as O,bt as P,ft as Q,A as R,R as S,S as T,Dt as U,C as V,xt as W,yt as X,U as Y,g as Z,Mt as _,_ as a,Y as a0,Bt as a1,ct as a2,it as a3,y as b,P as c,V as d,Et as e,jt as f,O as g,w as h,Z as i,W as j,F as k,H as l,X as m,G as n,gt as o,q as p,rt as q,tt as r,lt as s,et as t,dt as u,at as v,Q as w,st as x,ht as y,K as z}
|