@heartlandone/vega 2.68.1 → 2.69.1
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-f7106a22.js → app-globals-837be7a6.js} +7 -7
- package/dist/cjs/{code-block-39074880.js → code-block-bb4cbafa.js} +1 -1
- package/dist/cjs/{component-global-style-slimmer-d5216fa7.js → component-global-style-slimmer-adfa2e59.js} +1 -1
- package/dist/cjs/{component-value-history-controller-slimmer.abstract-ddedf543.js → component-value-history-controller-slimmer.abstract-cf7b4bda.js} +2 -2
- package/dist/cjs/{dark-mode-style-controller-27809ff8.js → dark-mode-style-controller-c21172aa.js} +1 -1
- package/dist/cjs/{design-token-e14a4e66.js → design-token-00fe8d2f.js} +1 -1
- package/dist/cjs/{dto-renderer-manager-b7969d6c.js → dto-renderer-manager-c917dade.js} +1 -1
- package/dist/cjs/{element-appender-slimmer-7ee27ab3.js → element-appender-slimmer-f8e89f37.js} +2 -2
- package/dist/cjs/{form-field-controller-slimmer-2a091912.js → form-field-controller-slimmer-f865d397.js} +1 -1
- package/dist/cjs/{function-extension-f0e845f2.js → function-extension-28a4d781.js} +15 -10
- package/dist/cjs/{image-annotation-action-7f0626c8.js → image-annotation-action-8843adbf.js} +3 -3
- package/dist/cjs/index.cjs.js +11 -11
- package/dist/cjs/{language-extension-d0103d1a.js → language-extension-99c6fb40.js} +2 -2
- package/dist/cjs/loader.cjs.js +9 -9
- package/dist/cjs/{public-rules-8b67eaba.js → public-rules-759c745b.js} +5 -5
- package/dist/cjs/{range-002671b6.js → range-0b597850.js} +1 -1
- package/dist/cjs/{responsive-format-facade-347db035.js → responsive-format-facade-1d9c13a9.js} +5 -5
- package/dist/cjs/{rich-text-editor-required-rule-5392bd8a.js → rich-text-editor-required-rule-92d0640e.js} +1 -1
- package/dist/cjs/{style-formatter-0a09f0dd.js → style-formatter-1daa8371.js} +1 -1
- package/dist/cjs/{translation-f5adcb9f.js → translation-5f9f9c0c.js} +2 -0
- package/dist/cjs/{translation-slimmer-4b6239d1.js → translation-slimmer-f0ebe710.js} +1 -1
- package/dist/cjs/vega-accordion.cjs.entry.js +8 -8
- package/dist/cjs/vega-app-footer.cjs.entry.js +2 -2
- package/dist/cjs/vega-app-header-button.cjs.entry.js +8 -8
- package/dist/cjs/vega-box.cjs.entry.js +9 -9
- package/dist/cjs/vega-brand-logo.cjs.entry.js +2 -2
- package/dist/cjs/vega-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/vega-button-circle.cjs.entry.js +8 -8
- package/dist/cjs/vega-button.cjs.entry.js +8 -8
- package/dist/cjs/vega-calendar_4.cjs.entry.js +3 -3
- package/dist/cjs/vega-card.cjs.entry.js +8 -8
- package/dist/cjs/vega-carousel.cjs.entry.js +7 -7
- package/dist/cjs/vega-checkbox_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-chip.cjs.entry.js +8 -8
- 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-combo-box.cjs.entry.js +2 -2
- package/dist/cjs/vega-date-picker_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-dialog_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-divider.cjs.entry.js +8 -8
- package/dist/cjs/vega-dropdown_5.cjs.entry.js +20 -11
- package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
- package/dist/cjs/vega-file-uploader.cjs.entry.js +3 -3
- package/dist/cjs/vega-flag-icon.cjs.entry.js +8 -8
- package/dist/cjs/vega-flex.cjs.entry.js +9 -9
- package/dist/cjs/vega-font.cjs.entry.js +8 -8
- package/dist/cjs/vega-form.cjs.entry.js +2 -2
- package/dist/cjs/vega-grid.cjs.entry.js +8 -8
- package/dist/cjs/vega-icon.cjs.entry.js +8 -8
- package/dist/cjs/vega-image-uploader.cjs.entry.js +9 -9
- package/dist/cjs/vega-input-credit-card.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-numeric.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-passcode.cjs.entry.js +2 -2
- package/dist/cjs/vega-input-phone-number.cjs.entry.js +7 -7
- package/dist/cjs/vega-input-range.cjs.entry.js +3 -3
- package/dist/cjs/vega-input-select.cjs.entry.js +143 -17
- package/dist/cjs/vega-input.cjs.entry.js +89 -29
- package/dist/cjs/vega-left-nav_5.cjs.entry.js +9 -9
- package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +7 -7
- package/dist/cjs/{vega-nonce-manager-f927497f.js → vega-nonce-manager-df69d3ed.js} +2 -2
- package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +2 -2
- package/dist/cjs/vega-pagination.cjs.entry.js +8 -8
- package/dist/cjs/vega-popover_2.cjs.entry.js +9 -9
- package/dist/cjs/vega-radio_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-rich-text-content.cjs.entry.js +5 -5
- package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +11 -11
- package/dist/cjs/vega-selection-chip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega-selection-tile_2.cjs.entry.js +2 -2
- package/dist/cjs/vega-sidenav_3.cjs.entry.js +7 -7
- package/dist/cjs/vega-signature-capture.cjs.entry.js +12 -10
- package/dist/cjs/vega-stepper.cjs.entry.js +2 -2
- package/dist/cjs/vega-tab-group_2.cjs.entry.js +1 -1
- package/dist/cjs/vega-table_11.cjs.entry.js +8 -8
- package/dist/cjs/vega-textarea.cjs.entry.js +3 -3
- package/dist/cjs/vega-time-picker_2.cjs.entry.js +10 -10
- package/dist/cjs/vega-toggle-switch.cjs.entry.js +2 -2
- package/dist/cjs/vega-tooltip_2.cjs.entry.js +8 -8
- package/dist/cjs/vega.cjs.js +9 -9
- package/dist/collection/components/vega-button/vega-button.css +20 -12
- package/dist/collection/components/vega-dropdown/slimmers/controllers/vega-dropdown-selected-controller.js +4 -1
- package/dist/collection/components/vega-dropdown/vega-dropdown.js +27 -0
- package/dist/collection/components/vega-input/slimmers/renderers/vega-input-password-eye-renderer.js +41 -0
- package/dist/collection/components/vega-input/vega-input.css +13 -0
- package/dist/collection/components/vega-input/vega-input.js +21 -3
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.js +4 -0
- package/dist/collection/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.js +18 -4
- package/dist/collection/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.js +17 -3
- package/dist/collection/components/vega-input-select/vega-input-select.js +14 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/base-extension-renderer.js +3 -1
- package/dist/collection/components/vega-rich-text-editor/extensions/functions/renderers/function-toolbar-button-renderer.js +9 -6
- package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +1 -0
- package/dist/collection/components/vega-signature-capture/slimmers/written-mode/renderers/written-mode-renderer.js +1 -0
- package/dist/collection/components/vega-tab-group/vega-tab-group.js +2 -2
- package/dist/collection/components/vega-textarea/vega-textarea.js +2 -2
- package/dist/collection/global/icons/eye-slash.js +3 -0
- package/dist/collection/global/icons/eye.js +3 -0
- package/dist/collection/helpers/csp/test/vega-nonce-manager.test.js +11 -0
- package/dist/collection/helpers/csp/vega-nonce-manager.js +2 -2
- package/dist/collection/helpers/translation/locales/en.js +2 -0
- package/dist/collection/helpers/translation/tests/internal-translation-controller.test.js +2 -0
- package/dist/collection/helpers/validator/rules/input-select-value-in-source-rule.js +85 -0
- package/dist/collection/helpers/validator/test/rules/input-select-value-in-source-rule.test.js +99 -0
- package/dist/esm/{app-globals-2f689986.js → app-globals-fd4b7d97.js} +7 -7
- package/dist/esm/{code-block-e8839202.js → code-block-ecb4491b.js} +1 -1
- package/dist/esm/{component-global-style-slimmer-5d437fdf.js → component-global-style-slimmer-08046b38.js} +1 -1
- package/dist/esm/{component-value-history-controller-slimmer.abstract-c6f94113.js → component-value-history-controller-slimmer.abstract-5d618b88.js} +2 -2
- package/dist/esm/{dark-mode-style-controller-b7e85b6a.js → dark-mode-style-controller-de88a117.js} +1 -1
- package/dist/esm/{design-token-e9e6b011.js → design-token-2d77e8f5.js} +1 -1
- package/dist/esm/{dto-renderer-manager-7abc53bf.js → dto-renderer-manager-d862ae78.js} +1 -1
- package/dist/esm/{element-appender-slimmer-8dbc8387.js → element-appender-slimmer-6791c332.js} +2 -2
- package/dist/esm/{form-field-controller-slimmer-b23d9ff3.js → form-field-controller-slimmer-bf071b75.js} +1 -1
- package/dist/esm/{function-extension-eb1d062f.js → function-extension-8d39db56.js} +15 -10
- package/dist/esm/{image-annotation-action-7957653a.js → image-annotation-action-d0af138c.js} +3 -3
- package/dist/esm/index.js +11 -11
- package/dist/esm/{language-extension-3331131f.js → language-extension-8f51f5ff.js} +2 -2
- package/dist/esm/loader.js +9 -9
- package/dist/esm/{public-rules-e613dead.js → public-rules-d10e76f4.js} +5 -5
- package/dist/esm/{range-adf206fd.js → range-f7b9e2fb.js} +1 -1
- package/dist/esm/{responsive-format-facade-b0712993.js → responsive-format-facade-267935ae.js} +5 -5
- package/dist/esm/{rich-text-editor-required-rule-43857573.js → rich-text-editor-required-rule-774b822b.js} +1 -1
- package/dist/esm/{style-formatter-a20a1ef4.js → style-formatter-3f88c491.js} +1 -1
- package/dist/esm/{translation-f10b1e19.js → translation-96e5debd.js} +2 -0
- package/dist/esm/{translation-slimmer-984c9ce6.js → translation-slimmer-c936cb1b.js} +1 -1
- package/dist/esm/vega-accordion.entry.js +8 -8
- package/dist/esm/vega-app-footer.entry.js +2 -2
- package/dist/esm/vega-app-header-button.entry.js +8 -8
- package/dist/esm/vega-box.entry.js +9 -9
- package/dist/esm/vega-brand-logo.entry.js +2 -2
- package/dist/esm/vega-breadcrumb.entry.js +2 -2
- package/dist/esm/vega-button-circle.entry.js +8 -8
- package/dist/esm/vega-button.entry.js +8 -8
- package/dist/esm/vega-calendar_4.entry.js +3 -3
- package/dist/esm/vega-card.entry.js +8 -8
- package/dist/esm/vega-carousel.entry.js +7 -7
- package/dist/esm/vega-checkbox_2.entry.js +2 -2
- package/dist/esm/vega-chip.entry.js +8 -8
- package/dist/esm/vega-code-block.entry.js +8 -8
- package/dist/esm/vega-color-picker.entry.js +2 -2
- package/dist/esm/vega-combo-box.entry.js +2 -2
- package/dist/esm/vega-date-picker_2.entry.js +10 -10
- package/dist/esm/vega-dialog_2.entry.js +9 -9
- package/dist/esm/vega-divider.entry.js +8 -8
- package/dist/esm/vega-dropdown_5.entry.js +20 -11
- package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
- package/dist/esm/vega-file-uploader.entry.js +3 -3
- package/dist/esm/vega-flag-icon.entry.js +8 -8
- package/dist/esm/vega-flex.entry.js +9 -9
- package/dist/esm/vega-font.entry.js +8 -8
- package/dist/esm/vega-form.entry.js +2 -2
- package/dist/esm/vega-grid.entry.js +8 -8
- package/dist/esm/vega-icon.entry.js +8 -8
- package/dist/esm/vega-image-uploader.entry.js +9 -9
- package/dist/esm/vega-input-credit-card.entry.js +2 -2
- package/dist/esm/vega-input-numeric.entry.js +2 -2
- package/dist/esm/vega-input-passcode.entry.js +2 -2
- package/dist/esm/vega-input-phone-number.entry.js +7 -7
- package/dist/esm/vega-input-range.entry.js +3 -3
- package/dist/esm/vega-input-select.entry.js +143 -17
- package/dist/esm/vega-input.entry.js +90 -30
- package/dist/esm/vega-left-nav_5.entry.js +9 -9
- package/dist/esm/vega-loader-wrapper_2.entry.js +7 -7
- package/dist/esm/{vega-nonce-manager-87615d3c.js → vega-nonce-manager-497e5eb5.js} +2 -2
- package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +2 -2
- package/dist/esm/vega-pagination.entry.js +8 -8
- package/dist/esm/vega-popover_2.entry.js +9 -9
- package/dist/esm/vega-radio_2.entry.js +2 -2
- package/dist/esm/vega-rich-text-content.entry.js +5 -5
- package/dist/esm/vega-rich-text-editor_4.entry.js +11 -11
- package/dist/esm/vega-selection-chip_2.entry.js +8 -8
- package/dist/esm/vega-selection-tile_2.entry.js +2 -2
- package/dist/esm/vega-sidenav_3.entry.js +7 -7
- package/dist/esm/vega-signature-capture.entry.js +12 -10
- package/dist/esm/vega-stepper.entry.js +2 -2
- package/dist/esm/vega-tab-group_2.entry.js +1 -1
- package/dist/esm/vega-table_11.entry.js +8 -8
- package/dist/esm/vega-textarea.entry.js +3 -3
- package/dist/esm/vega-time-picker_2.entry.js +10 -10
- package/dist/esm/vega-toggle-switch.entry.js +2 -2
- package/dist/esm/vega-tooltip_2.entry.js +8 -8
- package/dist/esm/vega.js +9 -9
- package/dist/sri/vega-sri-manifest.json +258 -258
- package/dist/types/components/vega-dropdown/slimmers/controllers/vega-dropdown-selected-controller.d.ts +1 -0
- package/dist/types/components/vega-dropdown/vega-dropdown.d.ts +6 -0
- package/dist/types/components/vega-input/slimmers/renderers/vega-input-password-eye-renderer.d.ts +9 -0
- package/dist/types/components/vega-input/vega-input.d.ts +4 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-source-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/controllers/vega-input-select-value-controller.d.ts +1 -0
- package/dist/types/components/vega-input-select/slimmers/renderers/vega-input-select-dropdown-renderer.d.ts +1 -0
- package/dist/types/components/vega-input-select/types.d.ts +1 -0
- package/dist/types/components/vega-input-select/vega-input-select.d.ts +1 -0
- package/dist/types/components/vega-tab-group/vega-tab-group.d.ts +1 -1
- package/dist/types/components/vega-textarea/vega-textarea.d.ts +1 -1
- package/dist/types/components.d.ts +14 -4
- package/dist/types/global/icons/eye-slash.d.ts +3 -0
- package/dist/types/global/icons/eye.d.ts +3 -0
- package/dist/types/helpers/translation/interface.d.ts +2 -0
- package/dist/types/helpers/validator/rules/input-select-value-in-source-rule.d.ts +60 -0
- package/dist/types/helpers/validator/test/rules/input-select-value-in-source-rule.test.d.ts +1 -0
- package/dist/vega/index.esm.js +1 -1
- package/dist/vega/{p-8506e8c3.js → p-0cdb38d3.js} +1 -1
- package/dist/vega/{p-22fe8c61.entry.js → p-0e5297b9.entry.js} +1 -1
- package/dist/vega/{p-c54148fb.entry.js → p-0feceaac.entry.js} +1 -1
- package/dist/vega/{p-7747c163.js → p-1372b984.js} +1 -1
- package/dist/vega/{p-00376f71.entry.js → p-1739a877.entry.js} +1 -1
- package/dist/vega/{p-1dd7f8b2.entry.js → p-1a59703b.entry.js} +1 -1
- package/dist/vega/{p-85407fb9.js → p-1bb0c934.js} +1 -1
- package/dist/vega/{p-7dde3be9.entry.js → p-1e92737c.entry.js} +1 -1
- package/dist/vega/{p-9fb6fbcc.js → p-1f26de89.js} +1 -1
- package/dist/vega/{p-76b1dae4.entry.js → p-235bf01b.entry.js} +1 -1
- package/dist/vega/{p-99bf5993.entry.js → p-257ff60b.entry.js} +1 -1
- package/dist/vega/{p-3ad87199.entry.js → p-25a3fad7.entry.js} +1 -1
- package/dist/vega/{p-a6fb5a40.entry.js → p-2622f0a8.entry.js} +1 -1
- package/dist/vega/{p-24419ebe.entry.js → p-26c4f07c.entry.js} +1 -1
- package/dist/vega/{p-e0979451.entry.js → p-2e6ce1e9.entry.js} +1 -1
- package/dist/vega/{p-de8c5fae.entry.js → p-2ec7e020.entry.js} +1 -1
- package/dist/vega/{p-0849f85e.js → p-2f09c6aa.js} +1 -1
- package/dist/vega/p-330c224f.entry.js +1 -0
- package/dist/vega/{p-369810ae.js → p-33f3f306.js} +1 -1
- package/dist/vega/{p-2f04d2ac.js → p-35252108.js} +1 -1
- package/dist/vega/p-35cd469a.entry.js +1 -0
- package/dist/vega/p-366825fa.entry.js +1 -0
- package/dist/vega/{p-83a50ac2.entry.js → p-37020002.entry.js} +1 -1
- package/dist/vega/{p-69d27eaf.entry.js → p-379f1b40.entry.js} +1 -1
- package/dist/vega/{p-2478f65e.js → p-38cb2b40.js} +1 -1
- package/dist/vega/{p-19256107.entry.js → p-3c865f86.entry.js} +1 -1
- package/dist/vega/{p-56636a58.entry.js → p-3e040167.entry.js} +1 -1
- package/dist/vega/{p-54ae02db.js → p-4866e390.js} +1 -1
- package/dist/vega/{p-79e6e12c.js → p-4a467973.js} +1 -1
- package/dist/vega/{p-d4893487.js → p-4e13a26f.js} +1 -1
- package/dist/vega/{p-238afe1b.entry.js → p-52efaadb.entry.js} +1 -1
- package/dist/vega/{p-b78670c9.entry.js → p-54e56f0d.entry.js} +1 -1
- package/dist/vega/{p-48bc03fa.entry.js → p-58769a72.entry.js} +1 -1
- package/dist/vega/{p-de02f404.entry.js → p-5972c101.entry.js} +1 -1
- package/dist/vega/{p-16d68187.js → p-5d827fe5.js} +1 -1
- package/dist/vega/p-5e708ad5.entry.js +1 -0
- package/dist/vega/p-5f377954.js +1 -1
- package/dist/vega/{p-6609d87e.entry.js → p-652626b6.entry.js} +1 -1
- package/dist/vega/{p-0a55f984.entry.js → p-65a9af84.entry.js} +1 -1
- package/dist/vega/{p-f3399ef1.entry.js → p-67eb405d.entry.js} +1 -1
- package/dist/vega/{p-a2506cb5.entry.js → p-69aec6af.entry.js} +1 -1
- package/dist/vega/{p-b5060e84.entry.js → p-71ddccf2.entry.js} +1 -1
- package/dist/vega/{p-d5ff8b7f.js → p-75f981ce.js} +1 -1
- package/dist/vega/{p-2c945862.entry.js → p-785d9ac3.entry.js} +1 -1
- package/dist/vega/{p-c26332ae.entry.js → p-796d840c.entry.js} +1 -1
- package/dist/vega/{p-8dba59a6.entry.js → p-7a590741.entry.js} +1 -1
- package/dist/vega/{p-ad5393f0.entry.js → p-7b42da4f.entry.js} +1 -1
- package/dist/vega/{p-5a555092.entry.js → p-8ac2f43f.entry.js} +1 -1
- package/dist/vega/{p-1dcb1fcd.entry.js → p-8c6b6ad7.entry.js} +1 -1
- package/dist/vega/{p-d3905af1.entry.js → p-8ff96b8c.entry.js} +2 -2
- package/dist/vega/{p-56f77466.entry.js → p-91d71ae9.entry.js} +1 -1
- package/dist/vega/{p-94e167b8.entry.js → p-9794fd88.entry.js} +1 -1
- package/dist/vega/{p-1922303e.entry.js → p-9e59345f.entry.js} +1 -1
- package/dist/vega/{p-6ce1e9d4.entry.js → p-9fd503e9.entry.js} +1 -1
- package/dist/vega/{p-626246b4.entry.js → p-a630ce73.entry.js} +1 -1
- package/dist/vega/{p-787caad3.entry.js → p-b27fcac4.entry.js} +1 -1
- package/dist/vega/{p-a211ae63.js → p-b5ba0c11.js} +1 -1
- package/dist/vega/{p-018d70a5.js → p-b8b9ed2c.js} +1 -1
- package/dist/vega/{p-bb37a401.js → p-b9798158.js} +1 -1
- package/dist/vega/{p-2e32fbe6.entry.js → p-bcc396c2.entry.js} +1 -1
- package/dist/vega/{p-b8558278.entry.js → p-bfb86c3e.entry.js} +1 -1
- package/dist/vega/p-c224b44c.js +1 -0
- package/dist/vega/{p-54ddd06f.entry.js → p-c2f21426.entry.js} +1 -1
- package/dist/vega/{p-117be41b.js → p-c616c592.js} +1 -1
- package/dist/vega/p-c6ae78f2.entry.js +1 -0
- package/dist/vega/{p-f0fb3fdd.entry.js → p-cbabb07a.entry.js} +1 -1
- package/dist/vega/{p-bd0e55a2.entry.js → p-dde03224.entry.js} +1 -1
- package/dist/vega/{p-719354e7.entry.js → p-ea04a387.entry.js} +1 -1
- package/dist/vega/{p-d67200e8.entry.js → p-ea96635b.entry.js} +1 -1
- package/dist/vega/{p-4c192985.js → p-ef9cbad1.js} +1 -1
- package/dist/vega/{p-30a8d9d6.entry.js → p-f21b893b.entry.js} +1 -1
- package/dist/vega/p-f69f84a7.js +1 -0
- package/dist/vega/{p-3b800f1b.entry.js → p-fb320b50.entry.js} +1 -1
- package/dist/vega/{p-82ef2de0.entry.js → p-ff470366.entry.js} +1 -1
- package/dist/vega/vega.esm.js +1 -1
- package/package.json +2 -1
- package/dist/vega/p-113d305b.entry.js +0 -1
- package/dist/vega/p-16358fec.entry.js +0 -1
- package/dist/vega/p-240d9d35.entry.js +0 -1
- package/dist/vega/p-39482a1a.js +0 -1
- package/dist/vega/p-437f865f.js +0 -1
- package/dist/vega/p-705dad87.entry.js +0 -1
- package/dist/vega/p-bb0f2b5f.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as e,h as t,H as a,g as r}from"./p-6b2342e0.js";import{f as n}from"./p-447c7590.js";import{c as s}from"./p-de97c6d9.js";import{c as o}from"./p-86194314.js";import{s as p}from"./p-519a7d55.js";import{I as d}from"./p-6e1ab235.js";import{V as l,I as h}from"./p-d849e0f5.js";import{F as c}from"./p-
|
|
1
|
+
import{r as i,c as e,h as t,H as a,g as r}from"./p-6b2342e0.js";import{f as n}from"./p-447c7590.js";import{c as s}from"./p-de97c6d9.js";import{c as o}from"./p-86194314.js";import{s as p}from"./p-519a7d55.js";import{I as d}from"./p-6e1ab235.js";import{V as l,I as h}from"./p-d849e0f5.js";import{F as c}from"./p-1f26de89.js";import{T as g}from"./p-7c0b4c36.js";import{F as v}from"./p-a528714c.js";import{C as m}from"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-d9671d27.js";import"./p-6a334573.js";import"./p-bccee21e.js";import"./p-b75ee3ba.js";import"./p-02841589.js";import"./p-a4670e23.js";import"./p-308aa2e3.js";import"./p-f69f84a7.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-fde50319.js";var f=function(i,e,t,a){var r,n=arguments.length,s=n<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,t):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(i,e,t,a);else for(var o=i.length-1;o>=0;o--)(r=i[o])&&(s=(n<3?r(s):n>3?r(e,t,s):r(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s};const b=class{constructor(t){i(this,t),this.vegaChange=e(this,"vegaChange",7),this.change=e(this,"change",7),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new l,this.formFieldController=new c({propertyRules:[{propertyName:"required",ruleFactory:i=>i?new g:null}],validationRulesName:"validationRules",defaultValue:!1,attributeGetter:i=>this[i],inputContainerGetter:()=>this.toggleSwitchContainer,touchableAreaGetter:()=>[this.toggleSwitchContainer]}),this.changeEventEmitter=s(b,n),this.checked=!1,this.value=!1,this.size="default",this.required=!1,this.disabled=!1,this.validationRules=[],this.autoValidation=!0,this.isValid=null,this.toggleSwitch=()=>{this.disabled||(this.checked=!this.checked)},this.updateValue=i=>{this.checked=i.currentTarget.checked,i.stopPropagation()}}watchCheckedChange(){this.value=this.checked,this.changeEventEmitter.emit(this.checked),m.notify(v,{host:this.host,detail:this.value})}watchValue(i){this.checked=!0===i}watchValidationRules(){}componentWillLoad(){this.checked||!0!==this.value?this.value=this.checked:this.checked=!0}render(){let i=this.checked?"vega-container vega-container-checked":"vega-container";return i+=this.disabled?" vega-container-disabled":"",i+="small"===this.size?" vega-container-small-size":"",p(t(a,null,t("vega-flex",{gap:"size-8",ref:i=>this.toggleSwitchContainer=i},t("div",{class:`${i} vega-flex-shrink-0 v-min-w-min`},t("input",{type:"checkbox",name:"switch",disabled:this.disabled,checked:this.checked,onChange:this.updateValue,"aria-label":this.label||"No label defined",role:"button",tabIndex:0,onKeyDown:o()}),t("span",{class:this.disabled?"v-bg-tertiary":"v-bg-primary"})),this.renderLabelDom())),this.host)}renderLabelDom(){return this.label?t("div",{class:"vega-flex-basis-0 vega-flex-grow"},t("vega-field-label",{onClick:this.toggleSwitch,disabled:this.disabled,label:this.label,isFieldRequired:this.required})):null}get host(){return r(this)}static get watchers(){return{checked:["watchCheckedChange"],value:["watchValue"],validationRules:["watchValidationRules"]}}};f([h()],b.prototype,"globalSlimmers",void 0),f([d()],b.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),f([d()],b.prototype,"formFieldController",void 0),f([d()],b.prototype,"changeEventEmitter",void 0),b.style=':host{display:inline-block}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}div.vega-container{display:flex;justify-content:flex-start;align-items:center;border-radius:9999px;position:relative;box-sizing:content-box;height:24px;width:48px;padding:4px;background-color:rgba(var(--v-bg-toggle-switch, 107, 116, 125, 0.7))}div.vega-container:hover{background-color:rgba(var(--v-bg-toggle-switch-hover, 107, 116, 125, 1))}div.vega-container.vega-container-checked{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}div.vega-container.vega-container-checked:hover{background-color:rgba(var(--v-bg-action-hover, 4, 112, 236, 1))}div.vega-container.vega-container-disabled{background-color:rgba(var(--v-bg-disabled, 176, 180, 181, 1))}div.vega-container.vega-container-checked.vega-container-disabled{background-color:rgba(var(--v-bg-toggle-switch-selected-disabled, 153, 192, 255, 1))}div.vega-container-small-size{box-sizing:border-box;height:20px;width:32px;padding:2px}div.vega-container>span{margin-left:0px;transition-property:margin;transition-duration:0.1s;transition-timing-function:linear}div.vega-container:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}div.vega-container-checked>span{margin-left:24px}div.vega-container-checked.vega-container-small-size>span{margin-left:12px}div.vega-container>input{position:absolute;cursor:pointer;opacity:0;left:0px;top:0px;width:100%;height:100%;margin:0px;-webkit-tap-highlight-color:transparent}div.vega-container input:disabled{cursor:default}div.vega-container>span{display:inline-block;border-radius:9999px;box-shadow:var(--v-shadow-form-field, 0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.1));width:24px;height:24px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));box-shadow:var(--v-shadow-form-field, 0px 1px 2px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.1));transition-property:margin;transition-duration:0.1s;transition-timing-function:linear}div.vega-container-small-size{height:20px}div.vega-container-small-size>span{width:16px;height:16px}div{align-self:center}';export{b as vega_toggle_switch}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,c as t,h as i,H as r,g as o}from"./p-6b2342e0.js";import{R as s}from"./p-280cbcdb.js";import{c as a}from"./p-86194314.js";import{s as n}from"./p-519a7d55.js";import{a as l,h as p,c as h}from"./p-d9671d27.js";import{F as d}from"./p-
|
|
1
|
+
import{r as e,c as t,h as i,H as r,g as o}from"./p-6b2342e0.js";import{R as s}from"./p-280cbcdb.js";import{c as a}from"./p-86194314.js";import{s as n}from"./p-519a7d55.js";import{a as l,h as p,c as h}from"./p-d9671d27.js";import{F as d}from"./p-1f26de89.js";import{I as c}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-d849e0f5.js";import{F as g}from"./p-a528714c.js";import{c as x}from"./p-de97c6d9.js";import{C as b}from"./p-2d0d575f.js";import{f as v}from"./p-447c7590.js";import"./p-abd7aeaa.js";import"./p-02841589.js";import"./p-331a62d5.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-308aa2e3.js";import"./p-f69f84a7.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-b75ee3ba.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";import"./p-fde50319.js";import"./p-bccee21e.js";const u=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the color picker when a color is selected",payloadValue:e=>!1===e.autoValidation}];var w=function(e,t,i,r){var o,s=arguments.length,a=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var n=e.length-1;n>=0;n--)(o=e[n])&&(a=(s<3?o(a):s>3?o(t,i,a):o(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const y=class{constructor(r){e(this,r),this.vegaChange=t(this,"vegaChange",7),this.change=t(this,"change",7),this.globalSlimmers={},this.formFieldController=new d({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new s:null}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.colorPickerContainerRef,touchableAreaGetter:()=>[this.colorPickerTouchableAreaRef]}),this.changeEventEmitter=x(y,v),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(u),this.value="",this.hint="",this.disabled=!1,this.required=!1,this.label="",this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.colors=["#73E6DC","#806BFF","#FFDC83","#FF9571","#00BBFF","#FF82C9","#259F9F","#563D82"],this.isInline=!1,this.renderColorPickerContainer=()=>i("div",{class:l([this.isInline?null:"color-picker-inline"]),ref:e=>this.colorPickerContainerRef=e},i("vega-flex",{direction:"row",gap:"size-8",alignItems:"center"},this.colors.map((e=>{const t=this.value===e;return i("div",{id:e,class:{"color-picker-inline-items":!0,selected:t},ref:e=>this.colorPickerTouchableAreaRef=e,style:{backgroundColor:e},onClick:this.updateValueProp,role:"button",tabIndex:0,"aria-label":"color",onKeyDown:a()},t?i("vega-icon",{icon:"checkmark",size:"size-16",class:{"v-text-black":this.isDarkColorCheckmark(this.value),"v-text-white":!this.isDarkColorCheckmark(this.value)}}):null)})))),this.renderHintMessage=()=>i("vega-text",null,this.hint),this.updateValueProp=async e=>{this.disabled||(this.value=String(e.currentTarget.getAttribute("id")))}}watchValue(){this.resetValueIfInvalid(),this.changeEventEmitter.emit(this.value),b.notify(g,{host:this.host,detail:this.value})}watchValidationRules(){}connectedCallback(){this.resetValueIfInvalid()}render(){return n(i(r,{class:{disabled:this.disabled}},this.renderLabelDom(),this.renderColorPickerContainer(),this.hint&&this.renderHintMessage()),this.host)}renderLabelDom(){return i("vega-field-label",{"is-field-required":this.required,disabled:this.disabled,label:this.label})}isDarkColorCheckmark(e,t="#fcfcfc",i="#203645"){const r=this.getLuminance(e),o=this.getLuminance(t),s=this.getLuminance(i);return r>Math.sqrt((o+.05)*(s+.05))-.05}getLuminance(e){const t=[p(e).r/255,p(e).g/255,p(e).b/255].map((e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4));return.2126*t[0]+.7152*t[1]+.0722*t[2]}resetValueIfInvalid(){this.colors.some((e=>h(e).toUpperCase()==h(this.value).toUpperCase()))||(this.value="")}get host(){return o(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};w([f()],y.prototype,"globalSlimmers",void 0),w([c()],y.prototype,"formFieldController",void 0),w([c()],y.prototype,"changeEventEmitter",void 0),w([c()],y.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),y.style=':host{display:inline-block;text-align:left;line-height:normal}:host vega-field-label{margin-bottom:8px}:host(.disabled) .color-picker-inline{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}:host(.disabled) .color-picker-inline-items:hover{box-shadow:none}:host(.disabled) .color-picker-inline-items:focus-within{box-shadow:none}:host .color-picker-inline{border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));padding:12px;max-width:max-content}:host .color-picker-inline-items{display:flex;border:1px solid rgba(var(--v-border-chip, 205, 209, 211, 1));border-radius:4px;width:24px;height:24px;cursor:pointer;align-items:center;justify-content:center}:host .color-picker-inline-items.selected{border-color:rgba(var(--v-bg-inverted-primary, 4, 4, 28, 1))}:host .color-picker-inline-items:hover{box-shadow:0 0 0 4px rgba(var(--v-ring-input-focus, 19, 98, 226, 0.25))}:host .color-picker-inline-items:focus-visible{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:0px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));box-shadow:0px 0px 0px 1px rgba(var(--v-bg-primary, 252, 252, 252, 1)) inset;border:1px solid rgba(var(--v-bg-primary, 252, 252, 252, 1))}:host .checkmark-black{color:rgba(var(--v-text-black, 32, 54, 69, 1))}:host .checkmark-white{color:rgba(var(--v-text-white, 252, 252, 252, 1))}:host vega-text{padding-left:8px;padding-right:8px;padding-top:4px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host vega-text{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-error{display:inline-block;padding-left:8px;padding-right:8px;padding-top:8px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .color-picker-inline.error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}:host .vega-hidden{display:none}:host vega-flex{flex-wrap:wrap;max-width:264px}';export{y as vega_color_picker}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t}from"./p-b75ee3ba.js";const n=new class{constructor(n){var e;if(n)this._nonce=n;else if("function"==typeof t){const n=t();if(n){const t=null===(e=n.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.content;t&&(this._nonce=t)}}}set nonce(t){this._nonce=t}get nonce(){return this._nonce}patchHeadInsertBeforeWithNonceToStencil(){const e=t();if(!e)return;const o=e.head,s=o.insertBefore;o.insertBefore=function(t,e){return n.nonce?(t.nodeType===Node.ELEMENT_NODE&&t instanceof HTMLStyleElement&&t.hasAttribute("data-styles")&&t.innerHTML.includes("vega-")&&!t.hasAttribute("nonce")&&t.setAttribute("nonce",n.nonce),s.call(this,t,e)):s.call(this,t,e)}}};function e(t){n.nonce=t}export{e as s,n as v}
|
|
1
|
+
import{t}from"./p-b75ee3ba.js";const n=new class{constructor(n){var e;if(n)this._nonce=n;else if("function"==typeof t){const n=t();if(n){const t=null===(e=n.querySelector('meta[name="csp-nonce"]'))||void 0===e?void 0:e.content;t&&(this._nonce=t)}}}set nonce(t){this._nonce=t}get nonce(){return this._nonce}patchHeadInsertBeforeWithNonceToStencil(){const e=t();if(!e)return;const o=e.head,s=o.insertBefore;o.insertBefore=function(t,e){return n.nonce?(t.nodeType===Node.ELEMENT_NODE&&t instanceof HTMLStyleElement&&t.hasAttribute("data-styles")&&(t.innerHTML.includes("vega-")||t.innerHTML.includes(".hydrated"))&&!t.hasAttribute("nonce")&&t.setAttribute("nonce",n.nonce),s.call(this,t,e)):s.call(this,t,e)}}};function e(t){n.nonce=t}export{e as s,n as v}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as r}from"./p-
|
|
1
|
+
import{V as r}from"./p-4e13a26f.js";import{I as e}from"./p-abd7aeaa.js";class i extends e{evaluate(r){var e,i;if(!this.isAcceptedInputType(r))throw new Error(`Invalid value ${r} for rich text editor`);const t=(null===(e=null==r?void 0:r.children)||void 0===e?void 0:e.length)>1||1===(null===(i=null==r?void 0:r.children)||void 0===i?void 0:i.length)&&r.children.some((r=>r.isNotEmpty()));return{isValid:t,message:t?"":"This field is required"}}canEvaluate(r,e){return e?this.isAcceptedInputType(r)&&!e.disabled&&e.visible:this.isAcceptedInputType(r)}shouldShowError(r){return!r.disabled&&r.visible&&(r.touched||r.modified)}isAcceptedInputType(e){return null==e||e instanceof r}}export{i as R}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as t,e,b as n,h as s,A as r,T as o,B as i,H as a,l,c,m as d,n as h,o as u,p as m,q as w,I as T,r as E,S as p,j as g,t as R,u as k,f,C as B,v as I,w as b,x,s as O,N as L,y as N,z as y,D as A,E as C,F as j,G as H,M as S,J as v,K as D,U as M,L as P,O as V,P as F,R as U}from"./p-8506e8c3.js";import{g as z}from"./p-a4670e23.js";import{i as $}from"./p-b1faebe0.js";import{C as G}from"./p-2d0d575f.js";import{d as J}from"./p-447c7590.js";import{a as W,b as K}from"./p-308aa2e3.js";import{d as X}from"./p-02841589.js";import{r as Y,i as Z}from"./p-d9671d27.js";import{c as _}from"./p-bf19682d.js";import{L as Q}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);$(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(){return[`<li${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(z());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(z())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(o.name,RTEListItemBlock.name,new i),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new d),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new h),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new u),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class q extends R{constructor(){super(...arguments),this.type=k.LIST}renderStyle(t){return(null==t?void 0:t.standalone)?{paddingLeft:"8px",marginLeft:"16px"}:null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new q}toJSON(){}}class RTEListBlock extends f{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new q)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);$(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return b.from(e);case"customClass":return I.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(){const t=this.getBlockTag();return[`<${t}${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),`</${t}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new E(e)),n.forEach((t=>t.children.map((t=>t.apply(new p)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new E(t))})),0===e.children.length&&e.parent.apply(new E(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const o=t.selectedBlocks,i=o.map((t=>(t.children.map((t=>t.apply(new p))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new g(e,...i));else if(r)e.parent.apply(new T(e,...i));else{const t=e.children.indexOf(o[0]),n=e.children.indexOf(o[o.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new g(e,r,...i,a)),e.parent.apply(new E(e))}o.map((t=>{e.apply(new E(t))})),0===e.children.length&&e.parent.apply(new E(e))}toParagraph(t){const n=new e(z(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class tt{}class et{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter($)),e}}const nt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},st=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r]))continue;let o=0;for(const i of n)if(o=i.canHandle(t,r,e),o>0){const n=t.slice(r,r+o),a=new et(i,n);1===o&&i.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),r+=o-1;break}if(0===o&&r<t.length){const n=Array.from(t[r].childNodes),o=this.process(Array.from(n),e);o.length>0&&s.push(...o)}}return s}isInvalidElement(t){return t.nodeType===Node.COMMENT_NODE||["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return nt.getElementToBlockStrategies()}};class rt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class ot extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class it extends ot{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class at extends L{constructor(t,e){super(),this.type=N.IMAGE,this.size=t,this.alt=e}static from(t,e){return[N.IMAGE,new at(t,e)]}toJSON(){return $(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new at(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={verticalAlign:"bottom"};switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}class RTEImageNode extends y{constructor(t,e,n,s){super(t,s),this.type=A.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(t.id,t.url,e),r=!!n.autoMatchFormat,o=Object.assign({},t.annotations),{size:i}=o,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(o,["size"]),l=Object.assign(Object.assign({},a),{size:null!=i?i:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?at.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter($)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof at||t instanceof C)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(){const t=this.getAnnotationByType(N.IMAGE);return`<img${super.generateAttributeString(...[t&&t.alt?`alt="${t.alt}"`:null,`src="${this.url}"`,t&&t.size?`data-size="${t.size}"`:null].filter($))}>`}doAnnotationActionApply(t){const e=r.get(j.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(j.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class lt extends S{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends f{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(){const t=super.generateAttributeString(),e=this.children.map((t=>t.toHtml())).join("");return super.shouldRenderAsInternalWrapper()?e:[`<div${t}>`,e,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new RTEImageBlock(z())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new H(t));const o=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,o)),o}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new lt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const o=e.from({id:z(),type:"paragraph",nodes:[{id:z(),type:"text",text:"\n"}]});r.parent.apply(new T(r,o));const i=this.concatBlocksNodes(t.slice(1));return(0===i.length||i[0]&&""===i[0].text)&&i.push(new n(z(),"\n",o)),o.apply(new s(i)),o.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new E(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,o=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(o.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,o)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new g(e,o)):(e.apply(new v(n,r)),e.parent.apply(new T(e,o)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends f{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(){const t=this.htmlTag;return[`<${t}${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),`</${t}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class ct extends S{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new E(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new E(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const o=n.isEmpty();if(e.children.length&&s&&s.parent!==e)o&&e.apply(new E(n)),e.type===s.parent.type&&s.parent.apply(new ct(e));else if(this.isContentFirstNode(n)&&o&&(r=this.getNextNode(n)),o&&e.apply(new E(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new E(t)),s||o||(r=n)}0===e.children.length&&e.parent.apply(new E(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),o=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new E(t)):t.apply(new E(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new E(e)),r||(t.nextNode=n))}r?t.previousNode=r:o&&(t.nextNode=o)}}class ht extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}n.parent.apply(new g(n,s))}return s}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(N.LINK),e.apply(new s([n]))),e}}}class ut extends S{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class mt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:o}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==o){const e=r.text.substring(0,o),n=r.text.substring(o),i=r.cloneWithText(e),a=r.cloneWithText(n),l=[i,s];n&&l.push(a),t.apply(new g(r,...l)),t.apply(new E(r))}else t.apply(new g(r,s));else t.apply(0!==o?new T(r,s):new g(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new ut(t))}}class wt extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,o=this.createNewParagraph(n);if(o){const t=o.children[0];e.apply(0!==s?new T(r,t):new g(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new ut(t))}}class Tt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),o=this.copyInlineStyleToNewNode(t);if(r.apply(new s([o])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new g(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],o=1===n.children.length&&n.children[0].isEmpty();if(n===r&&o){const r=n.parent.parent;if("list-item"!==r.type){const o=e.from({id:z(),type:"paragraph",nodes:[]});return o.apply(new s(t.children)),r.apply(new T(n.parent,o)),n.parent.apply(new E(n)),o}r.parent.apply(new T(r,t)),n.parent.apply(new E(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(N.LINK),e}}class Et extends S{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class pt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Et(e):new E(e))}}class gt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let o=e;if(s===e.children[0]&&0===r)e.parent.apply(new g(e,...n));else{const t=new v(s,r);e.apply(t),e.parent.apply(new T(e,...n)),o=t.newBlock}t.futureFocusBlock=o}}}const Rt=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new pt:new P),r.register(c.APPEND_CHILDREN,t,new rt),r.register(c.INSERT_CHILDREN_BEFORE,t,new ot),r.register(c.INSERT_CHILDREN_AFTER,t,new it),r.register(c.DELETE_BLOCK_CONTENT,t,new dt),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new Tt:new ht),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new wt),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new mt),r.register(c.PASTE_CONTENT,t,new gt)}};class kt{}class ft extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||"bold"===t.style.fontWeight||"700"===t.style.fontWeight||t.classList.contains("v-rte--bold")}}class Bt extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class It extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class bt extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.generateCustomStyleAnnotations(t);return Object.keys(e).length>0?{customStyle:e}:{}}generateCustomStyleAnnotations(t){const e=t.getAttribute("style");return e?e.split(";").filter(Boolean).filter((t=>" "!==t)).map((t=>{const e=t.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[X(e[0].trim())]:e[1].trim().replace(";","")}})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{}):{}}}class xt extends kt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ot extends kt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Lt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Nt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=Y(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=V.filter((t=>t.key!==F.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of V)if(t.style.color.includes(e.key))return e.key;return null}}class yt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||"italic"===t.style.fontStyle||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class At extends kt{constructor(){super(...arguments),this.handlers=[new Bt,new It,new bt]}canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return e.link?{link:e.link}:"A"===t.tagName?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:z()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Ct extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes("line-through")||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class jt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes("underline")||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Ht extends kt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte--text-style-(title|subtitle|heading-1|heading-2|heading-3|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class St extends kt{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class vt extends kt{canHandle(t){return"RTEImageNode"===t.name}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}class Dt extends kt{constructor(){super(...arguments),this.customAttributeHandler=new Bt,this.customStyleAnnotationHandler=new bt,this.customClassAnnotationHandler=new It}canHandle(t,e){return"RTETextNode"===t.name&&!1===e.autoMatchFormat}handle(t,e){if(Dt.canHandleTags.includes(t.nodeName)){const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));if(n)return{inlineHtml:n}}return{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||1===t.childNodes.length&&t.childNodes[0].nodeType!==Node.TEXT_NODE){const e={htmlTag:t.nodeName.toLowerCase(),customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass};if(s){let n=s;for(;n.child&&t.parentNode&&n.child.htmlTag===t.parentNode.nodeName.toLowerCase();)n=n.child;n.child=e}else s=e}return s?Object.assign({},s):null}}Dt.canHandleTags=["A","ABBR","AUDIO","B","BDI","BDO","CITE","CODE","DEL","DFN","EMBED","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR","VIDEO"];const Mt=new class{constructor(){this.handlers=[new Ot,new xt,new ft,new yt,new jt,new Ct,new Nt,new At,new Lt,new St,new vt,new Bt,new It,new bt,new At,new Ht,new Dt]}generate(t,e,n={autoMatchFormat:!0}){const s="A"===e.tagName;return this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof At)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{})}};class Pt extends tt{constructor(){super(...arguments),this.annotationHandler=new Ht}generateChildNodes(t,e,s){const r=[],o=!(!s||!1!==s.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=nt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,i)),l)r.push(l);else if(Z(t)&&t.childNodes.length>0){const a=Mt.generate(n,t,Object.assign({parentAnnotations:o?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class Vt extends Pt{canHandle(t,e,n){const s=t[e];return!n.autoMatchFormat&&("DIV"!==s.nodeName||s.childNodes.length>0&&"IMG"!==s.childNodes[0].nodeName)&&Vt.canHandleTags.includes(t[e].nodeName)?1:0}handle(t,e){return RTEHtmlBlock.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}generateHtmlBlock(t,e){return{id:z(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:Mt.generate(RTEHtmlBlock,t,e),children:[]}}}Vt.canHandleTags=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","BUTTON","CAPTION","COL","COLGROUP","DIV","DD","DETAILS","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","HEADER","HR","HX","INPUT","LEGEND","MAIN","NAV","PRE","SECTION","SUMMARY","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR"];class Ft extends Pt{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return x.from({id:z(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Ut extends Pt{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:z(),type:"image",nodes:[{id:z(),type:"image",url:t.src,annotations:Mt.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},Mt.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class zt extends Pt{canHandle(t,e){let n=0;for(let s=e;s<t.length;s++){const e=t[s];if(e.nodeType!==Node.TEXT_NODE&&(!zt.canHandleTags.includes(e.nodeName)||""===e.textContent&&e.querySelector("IMG")))break;n++}return n}handle(t,s){const r=t[0].parentElement,o=s&&s.autoMatchFormat,i=this.generateChildNodes(t,o?Mt.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=o?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!o&&!a;return e.from(Object.assign({id:z(),type:a||"paragraph",nodes:i},l?{annotations:{internalWrapper:l}}:{annotations:Mt.generate(e,r,s)}),s)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}}zt.canHandleTags=[...Dt.canHandleTags,"CODE","A","VEGA-RICH-TEXT-LINK-EDITOR","BR"];class $t extends tt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:z(),type:"text",text:t,annotations:e}}}U.registerRTEDTOClass("paragraph",e),U.registerRTEDTOClass("title",e),U.registerRTEDTOClass("subtitle",e),U.registerRTEDTOClass("heading-1",e),U.registerRTEDTOClass("heading-2",e),U.registerRTEDTOClass("heading-3",e),U.registerRTEDTOClass("heading-4",e),U.registerRTEDTOClass("heading-5",e),U.registerRTEDTOClass("heading-6",e),U.registerRTEDTOClass("heading-6",e),U.registerRTEDTOClass("list-item",RTEListItemBlock),U.registerRTEDTOClass("bullet-list",RTEListBlock),U.registerRTEDTOClass("number-list",RTEListBlock),U.registerRTEDTOClass("image",RTEImageBlock),U.registerRTEDTOClass("code-block",x),U.registerRTEDTOClass("html-block",RTEHtmlBlock),U.registerRTEDTOClass("text",n),U.registerRTEDTOClass("image",RTEImageNode),Rt.registerBlockBasicStrategies(e.name),Rt.registerBlockBasicStrategies(RTEListBlock.name),Rt.registerBlockBasicStrategies(RTEListItemBlock.name),Rt.registerBlockBasicStrategies(RTEImageBlock.name),Rt.registerBlockBasicStrategies(RTEHtmlBlock.name),nt.registerElementToBlockStrategy(new zt),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if($(s))return RTEImageBlock.from({id:z(),type:"image",nodes:[{id:z(),type:"image",url:s.src,annotations:Mt.generate(RTEImageNode,n,e)}],annotations:Mt.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:z(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:Mt.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new Ft),nt.registerElementToBlockStrategy(new class extends Ft{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],n=e.querySelector("code");if(n)return super.handle([n]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?RTEListItemBlock.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:z(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:z(),type:"list-item",annotations:Mt.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),Mt.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,o=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),i=$(s)&&["UL","OL"].includes(s.nodeName);return r&&!o&&i?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:z(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:z(),type:"number-list",blocks:[],annotations:Mt.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:z(),type:"bullet-list",blocks:[],annotations:Mt.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),nt.registerElementToBlockStrategy(new Vt),nt.registerElementToNodeStrategy(new class extends $t{canHandle(t,e){const n=t[e];return!Z(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),o=Object.assign({},s),i=t[0],a=Mt.generate(n,i,Object.assign({parentAnnotations:r?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:s},e));if("BR"===i.nodeName)return this.generateTextNode("\n",a);if(0===i.childNodes.length){const t=r?_(Object.assign(Object.assign({},n.supportsHtmlTag(i.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml,plainText:$(a.inlineHtml)})):a;return Object.assign({},this.generateTextNode("",t))}}}),nt.registerElementToNodeStrategy(new class extends $t{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),o=!(!e||!1!==e.autoMatchFormat),i=t[0],a=i.parentNode.nodeName.toLowerCase(),l=o&&!n.supportsHtmlTag(a),c=this.generateTextNode(String(i.textContent),o?_(Object.assign(Object.assign({},"span"===a?r:{link:r.link,code:"code"===a?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}});class Gt{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new Jt(e)}}class Jt{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(Z(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class VegaRTEContent{constructor(t){t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=U.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new VegaRTEContent(n)}static createEmptyContent(){return VegaRTEContent.fromJSON([{id:z(),type:"paragraph",nodes:[{id:z(),type:"text",text:""}]}])}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=t.replace(/>\s+<\/?/g,(t=>t.endsWith("</")?t:"><")).replace(/(>)[\n\t]+(?=[a-zA-Z0-9_\W])/g,"$1").replace(/([a-zA-Z0-9_\W])[\n\t]+(?=<)/g,"$1"),s=Gt.preserve(n),r=s.getProcessedHtml(),o=(new DOMParser).parseFromString(r,"text/html").body,i=Array.from(o.childNodes);s.restore(i);const a=st.process(i,e).filter($).map((t=>t.toDto(e))).filter($);return new VegaRTEContent(a)}clone(t=!1){return new VegaRTEContent(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&Q.warn("The 'options' parameter in toHtml method is deprecated and will be removed in the future."),this.children.map((t=>t.toHtml())).join("")}apply(t){if(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=O.getDOMByEntity(this);t&&G.notify(J.getSubject(t,K),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new p)));const e=new RTEListItemBlock(z());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new RTEListBlock(z(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof RTEListItemBlock&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof RTEListBlock&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,VegaRTEContent.name,new P),r.register(c.APPEND_CHILDREN,VegaRTEContent.name,new rt),r.register(c.INSERT_CHILDREN_BEFORE,VegaRTEContent.name,new ot),r.register(c.INSERT_CHILDREN_AFTER,VegaRTEContent.name,new it),r.register(c.TRANSFORM_TO_CODE_BLOCK,VegaRTEContent.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new x(z(),this.getCodeContent(n),"plainText");e.apply(new g(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new E(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,VegaRTEContent.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,o=O.getDOMByEntity(e);o&&G.notify(J.getSubject(o,W),{node:s,offset:n,updateDirectly:r})}});const Wt=new class{constructor(){this.RTE_DTO_RENDERER_MAP=new Map,this.RTE_TOOLBAR_BUTTON_RENDERER_MAP=new Map}registerRTEDTORenderer(t,e){const n=this.RTE_DTO_RENDERER_MAP.get(t);if(e&&n&&n.constructor.name!==e.constructor.name)throw new Error(`Renderer for type ${t} is already registered with a different class(${n.constructor.name}).`);this.RTE_DTO_RENDERER_MAP.set(t,e)}registerRTEToolbarButtonRenderer(t,e){this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.set(t,e)}getRTERenderer(t){return this.RTE_DTO_RENDERER_MAP.get(t)}getRTEToolbarButtonRenderer(t){return this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.get(t)}};export{Pt as B,nt as E,lt as I,ct as M,Wt as R,Gt as S,ut as U,VegaRTEContent as V,Rt as a,tt as b,RTEListItemBlock as c,RTEImageBlock as d,RTEListBlock as e,RTEImageNode as f,at as g,Mt as h,st as i}
|
|
1
|
+
import{d as t,e,b as n,h as s,A as r,T as o,B as i,H as a,l,c,m as d,n as h,o as u,p as m,q as w,I as T,r as E,S as p,j as g,t as R,u as k,f,C as B,v as I,w as b,x,s as O,N as L,y as N,z as y,D as A,E as C,F as j,G as H,M as S,J as v,K as D,U as M,L as P,O as V,P as F,R as U}from"./p-0cdb38d3.js";import{g as z}from"./p-a4670e23.js";import{i as $}from"./p-b1faebe0.js";import{C as G}from"./p-2d0d575f.js";import{d as J}from"./p-447c7590.js";import{a as W,b as K}from"./p-308aa2e3.js";import{d as X}from"./p-02841589.js";import{r as Y,i as Z}from"./p-d9671d27.js";import{c as _}from"./p-bf19682d.js";import{L as Q}from"./p-6e1ab235.js";class RTEListItemBlock extends e{constructor(t,e,n){super(t,"list-item",n),this.nestList=[],this.nestList=e}static from(t,e={autoMatchFormat:!0}){const s=new RTEListItemBlock(t.id,void 0,e);s.children=t.nodes.map((t=>n.from(t,s,e))),t.children&&(s.nestList=t.children.map((t=>{const e=RTEListBlock.from(t);return e.parent=s,e})));const{annotations:r}=t;return r&&Object.entries(r).forEach((([t,e])=>{const n=this.createAnnotationEntity(t,e);$(n)&&s.annotationMap.set(...n)})),s}toJSON(){var t;return Object.assign(Object.assign({},super.toJSON()),{type:"list-item",children:null===(t=this.nestList)||void 0===t?void 0:t.map((t=>t.toJSON()))})}toHtml(){return[`<li${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),"</li>"].join("")}cloneWithNodes(t){const e=new RTEListItemBlock(z());return e.children=[],e.apply(new s(t)),e}getLastNode(){return this.nestList&&this.nestList.length>0?this.nestList[this.nestList.length-1].getLastNode():super.getLastNode()}createNewListItem(){return new RTEListItemBlock(z())}clone(t){var e;const n=new RTEListItemBlock(this.id);return n.children=this.children.map((t=>t.clone(n))),n.annotationMap=super.cloneAnnotations(),n.nestList=null===(e=this.nestList)||void 0===e?void 0:e.map((t=>t.clone(n))),n.parent=t,n}}r.register(o.name,RTEListItemBlock.name,new i),r.register(a.name,RTEListItemBlock.name,new l),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEListItemBlock.name,new d),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEListItemBlock.name,new h),r.register(c.DELETE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.nestList&&(e.nestList=e.nestList.length>1?e.nestList.filter((e=>e!==t.nestListBlockToBeRemoved)):void 0)}}),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEListItemBlock.name,new u),r.register(c.REPLACE_CHILD_NODES,RTEListItemBlock.name,new m),r.register(c.REPLACE_NEST_LIST,RTEListItemBlock.name,new class extends t{handleAction(t,e){t.newList.forEach((t=>{t.parent=e})),e.nestList=t.newList}}),r.register(c.MERGE_TWO_BLOCKS_NODES,RTEListItemBlock.name,new w),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListItemBlock.name,new class extends t{handleAction(t,e){e.parent.apply(t)}});class q extends R{constructor(){super(...arguments),this.type=k.LIST}renderStyle(t){return(null==t?void 0:t.standalone)?{paddingLeft:"8px",marginLeft:"16px"}:null}renderClass(t){return(null==t?void 0:t.standalone)?null:"v-rte--list"}clone(){return new q}toJSON(){}}class RTEListBlock extends f{constructor(t,e,n){super(t),this.type="bullet-list",this.children=[],this.type=e;const{autoMatchFormat:s}=n||{autoMatchFormat:!0};s&&this.annotationMap.set(k.LIST,new q)}static from(t,e={autoMatchFormat:!0}){const n=new RTEListBlock(t.id,t.type,e),{annotations:s}=t;return s&&Object.entries(s).forEach((([t,e])=>{const s=this.createAnnotationEntity(t,e);$(s)&&n.annotationMap.set(...s)})),n.children=t.blocks.map((t=>{const s=RTEListItemBlock.from(t,e);return s.parent=n,s})),n}static createAnnotationEntity(t,e){switch(t){case"customAttribute":return b.from(e);case"customClass":return I.from(e);case"customStyle":return B.from(e)}}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,blocks:this.children.map((t=>t.toJSON()))})}toHtml(){const t=this.getBlockTag();return[`<${t}${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),`</${t}>`].join("")}isNotEmpty(){return this.children.length>0}getLastNode(){return this.children[this.children.length-1].getLastNode()}clone(t){const e=new RTEListBlock(this.id,this.type);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getBlockTag(){return"number-list"===this.type?"ol":"ul"}}r.register(c.TRANSFORM_LIST_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,r=e.parent.createList(t.listType);if(n.every((t=>t.parent===e)))r.apply(new s(e.children)),e.parent.apply(new T(e,r)),e.parent.apply(new E(e)),n.forEach((t=>t.children.map((t=>t.apply(new p)))));else{const n=t.selectedBlocks.map((t=>e.parent.toListItem(t)));r.apply(new s(n)),e.parent.apply(new T(e,r)),t.selectedBlocks.forEach((t=>{t.parent.apply(new E(t))})),0===e.children.length&&e.parent.apply(new E(e))}}}),r.register(c.TRANSFORM_PARAGRAPH_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){let n=!1,r=!1;const o=t.selectedBlocks,i=o.map((t=>(t.children.map((t=>t.apply(new p))),t===e.children[0]&&(n=!0),t===e.children[e.children.length-1]&&(r=!0),this.toParagraph(t))));if(n)e.parent.apply(new g(e,...i));else if(r)e.parent.apply(new T(e,...i));else{const t=e.children.indexOf(o[0]),n=e.children.indexOf(o[o.length-1]),r=e.parent.createList(e.type);r.apply(new s(e.children.slice(0,t)));const a=e.parent.createList(e.type);a.apply(new s(e.children.slice(n+1))),e.parent.apply(new g(e,r,...i,a)),e.parent.apply(new E(e))}o.map((t=>{e.apply(new E(t))})),0===e.children.length&&e.parent.apply(new E(e))}toParagraph(t){const n=new e(z(),"paragraph");return n.apply(new s(t.children)),n.annotationMap=t.annotationMap,n}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEListBlock.name,new class extends t{handleAction(t,e){e.parent.apply("list-item"!==e.parent.type?new T(e,t.imageBlockToBeInserted):t)}});class tt{}class et{constructor(t,e){this.childrenOutput=[],this.currentStrategy=t,this.currentElements=e}setChildrenOutput(t){this.childrenOutput=t}toDto(t={autoMatchFormat:!0,skipCustomAnnotations:!0}){const e=this.currentStrategy.handle(this.currentElements,t);return this.childrenOutput.length>0&&e&&this.currentStrategy.appendChildBlocks(e,this.childrenOutput.map((e=>e.toDto(t))).filter($)),e}}const nt=new class{constructor(){this.elementToBlockStrategies=[],this.elementToNodeStrategies=[]}registerElementToBlockStrategy(t){this.hasDuplicateStrategy(t,this.elementToBlockStrategies)||this.elementToBlockStrategies.unshift(t)}registerElementToNodeStrategy(t){this.hasDuplicateStrategy(t,this.elementToNodeStrategies)||this.elementToNodeStrategies.unshift(t)}getElementToBlockStrategies(){return this.elementToBlockStrategies}getElementToNodeStrategies(){return this.elementToNodeStrategies}hasDuplicateStrategy(t,e){return e.includes(t)}},st=new class{process(t,e={autoMatchFormat:!0,skipCustomAnnotations:!0}){const n=this.getElementToBlockStrategies(),s=[];for(let r=0;r<t.length;r++){if(this.isInvalidElement(t[r]))continue;let o=0;for(const i of n)if(o=i.canHandle(t,r,e),o>0){const n=t.slice(r,r+o),a=new et(i,n);1===o&&i.shouldProceedToElementChildren()&&a.setChildrenOutput(this.process(Array.from(n[0].childNodes),e)),s.push(a),r+=o-1;break}if(0===o&&r<t.length){const n=Array.from(t[r].childNodes),o=this.process(Array.from(n),e);o.length>0&&s.push(...o)}}return s}isInvalidElement(t){return t.nodeType===Node.COMMENT_NODE||["META","STYLE"].includes(t.nodeName)}getElementToBlockStrategies(){return nt.getElementToBlockStrategies()}};class rt extends t{handleAction(t,e){const n=t.entityToBeAppended;e.children&&(n.forEach((t=>{t.parent=e})),e.children=e.children.concat(n))}}class ot extends t{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[...t.childrenToBeInserted,t.referChildren])}replaceElementWithElements(t,e,n){t.children&&(n.forEach((e=>{e.parent=t})),t.children=t.children.flatMap((t=>t===e?n:t)))}}class it extends ot{handleAction(t,e){this.replaceElementWithElements(e,t.referChildren,[t.referChildren,...t.childrenToBeInserted])}}class at extends L{constructor(t,e){super(),this.type=N.IMAGE,this.size=t,this.alt=e}static from(t,e){return[N.IMAGE,new at(t,e)]}toJSON(){return $(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new at(this.size,this.alt)}renderClass(t){return(null==t?void 0:t.standalone)?null:this.size?`v-rte--image-size-${this.size}`:null}renderStyle(t){if(!(null==t?void 0:t.standalone))return null;const e={verticalAlign:"bottom"};switch(this.size){case"sm":return Object.assign(Object.assign({},e),{width:"25%"});case"md":return Object.assign(Object.assign({},e),{width:"50%"});case"lg":return Object.assign(Object.assign({},e),{width:"100%"})}}}class RTEImageNode extends y{constructor(t,e,n,s){super(t,s),this.type=A.IMAGE,this.url=e,this.parent=n}static from(t,e,n={autoMatchFormat:!0}){const s=new RTEImageNode(t.id,t.url,e),r=!!n.autoMatchFormat,o=Object.assign({},t.annotations),{size:i}=o,a=function(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]])}return n}(o,["size"]),l=Object.assign(Object.assign({},a),{size:null!=i?i:r?"md":void 0});return s.annotationMap=new Map(Object.keys(l).map((t=>"size"===t||"alt"===t?at.from(l.size,l.alt):this.createAnnotationEntity(t,l[t]))).filter($)),s}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof at||t instanceof C)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return""==t.alt&&delete t.alt,Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"image",url:this.url})}clone(t){return new RTEImageNode(this.id,this.url,t,super.cloneAnnotations())}toHtml(){const t=this.getAnnotationByType(N.IMAGE);return`<img${super.generateAttributeString(...[t&&t.alt?`alt="${t.alt}"`:null,`src="${this.url}"`,t&&t.size?`data-size="${t.size}"`:null].filter($))}>`}doAnnotationActionApply(t){const e=r.get(j.name,RTEImageNode.name);e&&e.execute(t,this)}doModifyActionApply(t){r.executeTheStrategy(t,this)}}r.register(c.UPDATE_IMAGE_NODE_URL,RTEImageNode.name,new class extends t{handleAction(t,e){e.url=t.url}}),r.register(j.name,RTEImageNode.name,new class extends t{handleAction(t,e){const n=t.toAnnotation();e.annotationMap.set(n.type,n)}});class lt extends S{constructor(t,e){super(),this.type=c.INSERT_NEW_PARAGRAPH,this.startContainerNode=t,this.startOffset=e}}class RTEImageBlock extends f{constructor(t){super(t),this.type="image",this.children=[]}static from(t,e={autoMatchFormat:!0}){const n=new RTEImageBlock(t.id),{annotations:s}=t;return n.children=t.nodes.map((t=>RTEImageNode.from(t,n,e))),s&&super.convertAnnotationsToMap(n.annotationMap,s),n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:"image",nodes:this.children.map((t=>t.toJSON()))})}toHtml(){const t=super.generateAttributeString(),e=this.children.map((t=>t.toHtml())).join("");return super.shouldRenderAsInternalWrapper()?e:[`<div${t}>`,e,"</div>"].join("")}isNotEmpty(){return this.children.length>0&&this.children.some((t=>t.url.length>0))}getLastNode(){return this.children[this.children.length-1]}createNewImageBlock(){return new RTEImageBlock(z())}clone(t){const e=new RTEImageBlock(this.id);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}}r.register(c.MERGE_TWO_BLOCKS_NODES,RTEImageBlock.name,new w),r.register(c.REPLACE_CHILD_NODES,RTEImageBlock.name,new m),r.register(c.SPLIT_BLOCK_WITH_NODE,RTEImageBlock.name,new class extends t{handleAction(t,e){t.newBlock=this.splitImageNodes(t.splitPointNode,t.startOffsetOfNode,e)}splitImageNodes(t,e,n){const s=n.children.indexOf(t);if(s>-1){const t=n.children.slice(0,s+e),r=n.children.slice(s+e);n.apply(new H(t));const o=this.cloneWithNodes(r,n);return n.parent.apply(new T(n,o)),o}}cloneWithNodes(t,e){const n=e.createNewImageBlock();return n.children=[],n.apply(new s(t)),n}}),r.register(c.LINE_BREAK_SINGLE_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=new lt(t.startContainerNode,t.startOffset);e.apply(n);const s=n.newBlock;s&&(t.lineBreakNode=s.children[0])}}),r.register(c.LINE_BREAK_MULTIPLE_BLOCKS,RTEImageBlock.name,new class extends t{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,r){const o=e.from({id:z(),type:"paragraph",nodes:[{id:z(),type:"text",text:"\n"}]});r.parent.apply(new T(r,o));const i=this.concatBlocksNodes(t.slice(1));return(0===i.length||i[0]&&""===i[0].text)&&i.push(new n(z(),"\n",o)),o.apply(new s(i)),o.children[0]}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.children),t.parent.apply(new E(t)))})),e}}),r.register(c.INSERT_IMAGE_TO_BLOCK,RTEImageBlock.name,new class extends t{handleAction(t,e){const n=t.splitPointNode,r=t.startOffsetOfNode,o=t.imageBlockToBeInserted;e.children.length<1?e.apply(new s(o.children)):this.isCaretPositionAtBlockEnd(e,n,r)?e.parent.apply(new T(e,o)):this.isCaretPositionAtBlockStart(e,n,r)?e.parent.apply(new g(e,o)):(e.apply(new v(n,r)),e.parent.apply(new T(e,o)))}}),r.register(a.name,RTEImageBlock.name,new l);class RTEHtmlBlock extends f{constructor(t,e){super(t),this.type="html-block",this.children=[],this.htmlTag=e}static from(t,e){const n=new RTEHtmlBlock(t.id,t.htmlTag),{annotations:s}=t;return s&&super.convertAnnotationsToMap(n.annotationMap,s),n.children=this.generateBlockChildren(t.children,e,n),n}clone(t){const e=new RTEHtmlBlock(this.id,this.htmlTag);return e.children=this.children.map((t=>t.clone(e))),e.annotationMap=super.cloneAnnotations(),e.parent=t,e}getLastNode(){return this.children[this.children.length-1].getLastNode()}isNotEmpty(){return this.children.length>0}toHtml(){const t=this.htmlTag;return[`<${t}${super.generateAttributeString()}>`,this.children.map((t=>t.toHtml())).join(""),`</${t}>`].join("")}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{id:this.id,type:this.type,htmlTag:this.htmlTag,children:this.children.map((t=>t.toJSON()))})}}class ct extends S{constructor(t){super(),this.type=c.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends D{handleAction(t,e){const{startContainerNode:n}=t;n.isContentEditable()?n.isTextNode()&&this.deleteTextNodeContent(t,e):this.deleteDecoratorNodeContent(t,e);const s=e.parent;s&&e.isListItemBlock()&&0===s.children.length&&s.parent.apply(new E(s))}deleteTextNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;if(0!==s&&!n.isEmpty()){const r=n.text.slice(0,s-1)+n.text.slice(s);if(n.apply(new M(r)),r)return void(t.previousNode=n);{const s=this.getPreviousNode(n);return s&&s.parent===e&&"\n"===s.text||1===e.children.length?void(t.previousNode=n):(e.apply(new E(n)),void(t.previousNode=s))}}{let s=this.getPreviousNode(n),r=null;const o=n.isEmpty();if(e.children.length&&s&&s.parent!==e)o&&e.apply(new E(n)),e.type===s.parent.type&&s.parent.apply(new ct(e));else if(this.isContentFirstNode(n)&&o&&(r=this.getNextNode(n)),o&&e.apply(new E(n)),s&&s.isTextNode()&&(s.isEmpty()||!s.isContentEditable()&&s.parent===e)){const t=s;s=this.getPreviousNode(s),t.parent.apply(new E(t)),s||o||(r=n)}0===e.children.length&&e.parent.apply(new E(e)),s?t.previousNode=s:r&&(t.nextNode=r)}}deleteDecoratorNodeContent(t,e){const n=t.startContainerNode,s=t.startOffset;let r=this.getPreviousNode(n),o=null;if(0!==s){const t=e;this.isContentFirstNode(n)&&(o=this.getNextNode(n)),1===t.children.length?t.parent.apply(new E(t)):t.apply(new E(n))}else{const e=r;e&&!e.isContentEditable()&&(r=this.getPreviousNode(e),e.parent.apply(new E(e)),r||(t.nextNode=n))}r?t.previousNode=r:o&&(t.nextNode=o)}}class ht extends t{handleAction(t,e){const{startContainerNode:n}=t;t.newBlock=this.breakSingleBlock(n,t.startOffset,e)}breakSingleBlock(t,e,n){const s=this.getNewParagraph(t);if(s){if(this.isCaretPositionAtBlockEnd(n,t,e))n.parent.apply(new T(n,s));else{if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}n.parent.apply(new g(n,s))}return s}}getNewParagraph(t){const e=this.createNewParagraph("");if(e){let n=e.children[0];return t.isTextNode()&&t.isContentEditable()&&(e.children=[],n=t.cloneWithText(""),n.annotationMap.delete(N.LINK),e.apply(new s([n]))),e}}}class ut extends S{constructor(t,e,n=!1){super(),this.isFlushable=!0,this.type=c.UPDATE_CURSOR_POSITION,this.immediatelyRun=!1,this.nextFocusNode=t,this.offset=e,this.immediatelyRun=n,this.immediatelyRun&&(this.isFlushable=!1)}}class mt extends t{handleAction(t,e){const{rteRange:n,nodeToBeInserted:s}=t,{startNode:r,startOffset:o}=n;if(r){const t=e;if(r.isContentEditable()&&r.isTextNode())if("\n"!==r.text&&r.text&&0!==o){const e=r.text.substring(0,o),n=r.text.substring(o),i=r.cloneWithText(e),a=r.cloneWithText(n),l=[i,s];n&&l.push(a),t.apply(new g(r,...l)),t.apply(new E(r))}else t.apply(new g(r,s));else t.apply(0!==o?new T(r,s):new g(r,s));this.updateCursorPosition(s)}}updateCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new ut(t))}}class wt extends t{handleAction(t,e){const{text:n,offset:s,decoratorNode:r}=t,o=this.createNewParagraph(n);if(o){const t=o.children[0];e.apply(0!==s?new T(r,t):new g(r,t)),this.setTheCursorPosition(t)}}setTheCursorPosition(t){const e=this.getRootContent(t.parent);e&&e.apply(new ut(t))}}class Tt extends t{handleAction(t,e){t.newBlock=this.breakSingleListItemBlock(t.startContainerNode,t.startOffset,e)}breakSingleListItemBlock(t,e,n){const r=n.createNewListItem(),o=this.copyInlineStyleToNewNode(t);if(r.apply(new s([o])),this.isCaretPositionAtBlockEnd(n,t,e))return this.breakListItemAtEnd(r,n);if(!this.isCaretPositionAtBlockStart(n,t,e)){const s=new v(t,e);return n.apply(s),s.newBlock}return n.parent.apply(new g(n,r)),r}breakListItemAtEnd(t,n){const r=n.parent.children[n.parent.children.length-1],o=1===n.children.length&&n.children[0].isEmpty();if(n===r&&o){const r=n.parent.parent;if("list-item"!==r.type){const o=e.from({id:z(),type:"paragraph",nodes:[]});return o.apply(new s(t.children)),r.apply(new T(n.parent,o)),n.parent.apply(new E(n)),o}r.parent.apply(new T(r,t)),n.parent.apply(new E(n))}else n.parent.apply(new T(n,t));return t}copyInlineStyleToNewNode(t){const e=t.cloneWithText("");return e.annotationMap.delete(N.LINK),e}}class Et extends S{constructor(t){super(),this.type=c.DELETE_NEST_LIST,this.nestListBlockToBeRemoved=t}}class pt extends P{handleAction(t,e){super.handleAction(t,e);const n=e.parent;0===e.children.length&&n&&n.apply("list-item"===n.type?new Et(e):new E(e))}}class gt extends t{handleAction(t,e){if(e.parent){const{blocksToBeInserted:n,startNode:s,startOffset:r}=t;let o=e;if(s===e.children[0]&&0===r)e.parent.apply(new g(e,...n));else{const t=new v(s,r);e.apply(t),e.parent.apply(new T(e,...n)),o=t.newBlock}t.futureFocusBlock=o}}}const Rt=new class{registerBlockBasicStrategies(t){r.register(c.DELETE_CHILDREN,t,t===RTEListBlock.name?new pt:new P),r.register(c.APPEND_CHILDREN,t,new rt),r.register(c.INSERT_CHILDREN_BEFORE,t,new ot),r.register(c.INSERT_CHILDREN_AFTER,t,new it),r.register(c.DELETE_BLOCK_CONTENT,t,new dt),r.register(c.INSERT_NEW_PARAGRAPH,t,t===RTEListItemBlock.name?new Tt:new ht),r.register(c.INSERT_TEXT_TO_DECORATOR_NODE,t,new wt),r.register(c.INSERT_NODE_TO_NEAREST_ROOT,t,new mt),r.register(c.PASTE_CONTENT,t,new gt)}};class kt{}class ft extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isBold(t)||e.bold?{bold:!0}:{}}isBold(t){return"STRONG"===t.nodeName||"B"===t.nodeName||"bold"===t.style.fontWeight||"700"===t.style.fontWeight||t.classList.contains("v-rte--bold")}}class Bt extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getAttributes(t);return Object.keys(e).length>0?{customAttribute:e}:{}}getAttributes(t){return t.getAttributeNames().filter((t=>"style"!==t&&"class"!==t&&this.isValidAttr(t))).reduce(((e,n)=>(e[n]=t.getAttribute(n),e)),{})}isValidAttr(t){return/^[a-zA-Z_][\w-]*$/.test(t)}}class It extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.getCustomClass(t);return e.length>0?{customClass:e}:{}}getCustomClass(t){return t.classList.toString().split(" ").filter((t=>!t.includes("v-rte")&&""!==t))}}class bt extends kt{canHandle(t,e){return!e.skipCustomAnnotations&&!!t}handle(t){const e=this.generateCustomStyleAnnotations(t);return Object.keys(e).length>0?{customStyle:e}:{}}generateCustomStyleAnnotations(t){const e=t.getAttribute("style");return e?e.split(";").filter(Boolean).filter((t=>" "!==t)).map((t=>{const e=t.replace(/(['"])(.*?)\1/g,"$2").split(":");return{[X(e[0].trim())]:e[1].trim().replace(";","")}})).reduce(((t,e)=>Object.assign(Object.assign({},t),e)),{}):{}}}class xt extends kt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}handle(t){const e=this.getIndent(t);return e?{indent:e}:{}}getIndent(t){const e=t.style;let n;if(e.marginLeft)n=e.marginLeft;else{if(!e.margin)return null;{const t=e.margin.split(" ");switch(t.length){case 4:n=t[3];break;case 2:case 3:n=t[1];break;default:n=t[0]}}}const s=Number(n.replace("px",""));return s&&s>=0?Math.floor(s/16):null}}class Ot extends kt{canHandle(t){return["RTETextBlock","RTEListItemBlock","RTEListBlock"].includes(t.name)}handle(t){const e=this.getTextAlign(t);return e?{textAlign:e}:{}}getTextAlign(t){const e=t.classList;if(e.contains("v-rte--horizontal-alignment-left"))return"left";if(e.contains("v-rte--horizontal-alignment-center"))return"center";if(e.contains("v-rte--horizontal-alignment-right"))return"right";if(e.contains("v-rte--horizontal-alignment-justify"))return"justify";switch(t.style.textAlign){case"center":return"center";case"right":return"right";case"justify":return"justify";case"left":return"left";default:return null}}}class Lt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isCode(t)||e.code?{code:!0}:{}}isCode(t){return t.classList.contains("v-rte--code")||"CODE"===t.nodeName||"PRE"===t.nodeName||"monospace"===t.style.fontFamily||"Roboto Mono"===t.style.fontFamily.replace(/["']/g,"")}}class Nt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){const n=this.getColor(t)||e.textColor;return n?{textColor:n}:{}}getColor(t){var e;const n=null===(e=Y(t.style.color))||void 0===e?void 0:e.toUpperCase();if(n){const t=V.filter((t=>t.key!==F.key)).find((t=>t.light===n||t.dark===n));return t?t.key:null}for(const e of V)if(t.style.color.includes(e.key))return e.key;return null}}class yt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isItalic(t)||e.italic?{italic:!0}:{}}isItalic(t){return"I"===t.nodeName||"italic"===t.style.fontStyle||"EM"===t.nodeName||t.classList.contains("v-rte--italic")}}class At extends kt{constructor(){super(...arguments),this.handlers=[new Bt,new It,new bt]}canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return e.link?{link:e.link}:"A"===t.tagName?{link:this.generateLinkAnnotations(t)}:{}}generateLinkAnnotations(t){const e={href:t.getAttribute("href")||"",groupKey:z()};return this.handlers.forEach((n=>{Object.assign(e,n.handle(t))})),e}}class Ct extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isStrikethrough(t)||e.strikethrough?{strikethrough:!0}:{}}isStrikethrough(t){return t.style.textDecoration.includes("line-through")||"S"===t.nodeName||"DEL"===t.nodeName||t.classList.contains("v-rte--strikethrough")}}class jt extends kt{canHandle(t){return"RTETextNode"===t.name}handle(t,e={}){return this.isUnderline(t)||e.underline?{underline:!0}:{}}isUnderline(t){return t.style.textDecoration.includes("underline")||"U"===t.nodeName||"INS"===t.nodeName||t.classList.contains("v-rte--underline")}}class Ht extends kt{canHandle(t,e){return!!e.autoMatchFormat&&"RTETextBlock"===t.name}handle(t){const e=this.getTextStyle(t);return e?{textStyle:e}:{}}getTextStyle(t){const e=this.getElementTypeByDataType(t);if(e)return e;const n=this.getElementTypeByNodeName(t);if(n)return n;const s=this.getElementTypeByFontSize(t);if(s)return s;return this.getElementTypeByClassName(t)||null}getElementTypeByDataType(t){return t.nodeType!==Node.TEXT_NODE&&t.hasAttribute("data-type")?t.getAttribute("data-type"):null}getElementTypeByFontSize(t){var e;switch(null===(e=t.style)||void 0===e?void 0:e.fontSize){case"36px":return"title";case"28px":return"subtitle";case"22px":return"heading-1";case"20px":return"heading-2";case"18px":return"heading-3";default:return null}}getElementTypeByNodeName(t){switch(t.nodeName){case"H1":return"heading-1";case"H2":return"heading-2";case"H3":return"heading-3";case"H4":return"heading-4";case"H5":return"heading-5";case"H6":return"heading-6";default:return null}}getElementTypeByClassName(t){if(t.className){const e=/\bv-rte--text-style-(title|subtitle|heading-1|heading-2|heading-3|paragraph)\b/.exec(t.className);if(e)return e[1]}return null}}class St extends kt{canHandle(t){return"RTEImageNode"===t.name}handle(t){const e=this.getImageSize(t);return e?{size:e}:{}}getImageSize(t){return t.getAttribute("data-size")?t.getAttribute("data-size"):null}}class vt extends kt{canHandle(t){return"RTEImageNode"===t.name}handle(t){return t.hasAttribute("alt")?{alt:t.getAttribute("alt")}:{}}}class Dt extends kt{constructor(){super(...arguments),this.customAttributeHandler=new Bt,this.customStyleAnnotationHandler=new bt,this.customClassAnnotationHandler=new It}canHandle(t,e){return"RTETextNode"===t.name&&!1===e.autoMatchFormat}handle(t,e){if(Dt.canHandleTags.includes(t.nodeName)){const n=this.generateInlineHtmlAnnotation(t,Object.assign({},e));if(n)return{inlineHtml:n}}return{}}generateInlineHtmlAnnotation(t,e){let{inlineHtml:s}=e;if(!n.supportsHtmlTag(t.nodeName.toLowerCase())||1===t.childNodes.length&&t.childNodes[0].nodeType!==Node.TEXT_NODE){const e={htmlTag:t.nodeName.toLowerCase(),customAttribute:this.customAttributeHandler.handle(t).customAttribute,customStyle:this.customStyleAnnotationHandler.handle(t).customStyle,customClass:this.customClassAnnotationHandler.handle(t).customClass};if(s){let n=s;for(;n.child&&t.parentNode&&n.child.htmlTag===t.parentNode.nodeName.toLowerCase();)n=n.child;n.child=e}else s=e}return s?Object.assign({},s):null}}Dt.canHandleTags=["A","ABBR","AUDIO","B","BDI","BDO","CITE","CODE","DEL","DFN","EMBED","EM","I","INS","KBD","MARK","METER","OUTPUT","PROGRESS","Q","S","SMALL","SPAN","STRONG","SUB","SUP","TIME","U","VAR","VIDEO"];const Mt=new class{constructor(){this.handlers=[new Ot,new xt,new ft,new yt,new jt,new Ct,new Nt,new At,new Lt,new St,new vt,new Bt,new It,new bt,new At,new Ht,new Dt]}generate(t,e,n={autoMatchFormat:!0}){const s="A"===e.tagName;return this.handlers.filter((t=>!(!n.autoMatchFormat&&s)||t instanceof At)).filter((r=>e.nodeType!==Node.TEXT_NODE&&r.canHandle(t,{skipCustomAnnotations:n.skipCustomAnnotations||s,autoMatchFormat:n.autoMatchFormat}))).reduce(((t,s)=>{const r=s.handle(e,n.parentAnnotations);return Object.assign(Object.assign({},t),r)}),{})}};class Pt extends tt{constructor(){super(...arguments),this.annotationHandler=new Ht}generateChildNodes(t,e,s){const r=[],o=!(!s||!1!==s.autoMatchFormat),i=Object.assign({},e);return t.forEach((t=>{const a=nt.getElementToNodeStrategies().find((e=>e.canHandle([t],0,s)>0));let l=null;if(a&&(l=a.handle([t],s,i)),l)r.push(l);else if(Z(t)&&t.childNodes.length>0){const a=Mt.generate(n,t,Object.assign({parentAnnotations:o?{inlineHtml:i.inlineHtml,link:i.link,code:i.code}:e},s));r.push(...this.generateChildNodes(Array.from(t.childNodes),a,s))}})),r}matchTextBlockType(t){var e;return null!==(e=this.annotationHandler.handle(t).textStyle)&&void 0!==e?e:"paragraph"}}class Vt extends Pt{canHandle(t,e,n){const s=t[e];return!n.autoMatchFormat&&("DIV"!==s.nodeName||s.childNodes.length>0&&"IMG"!==s.childNodes[0].nodeName)&&Vt.canHandleTags.includes(t[e].nodeName)?1:0}handle(t,e){return RTEHtmlBlock.from(this.generateHtmlBlock(t[0],e),e)}appendChildBlocks(t,e){t.children=e.map((e=>(e.parent=t,e)))}shouldProceedToElementChildren(){return!0}generateHtmlBlock(t,e){return{id:z(),type:"html-block",htmlTag:t.nodeName.toLowerCase(),annotations:Mt.generate(RTEHtmlBlock,t,e),children:[]}}}Vt.canHandleTags=["ADDRESS","ARTICLE","ASIDE","BLOCKQUOTE","BUTTON","CAPTION","COL","COLGROUP","DIV","DD","DETAILS","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","HEADER","HR","HX","INPUT","LEGEND","MAIN","NAV","PRE","SECTION","SUMMARY","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR"];class Ft extends Pt{canHandle(t,e){return"PRE"!==t[e].tagName&&"CODE"!==t[e].tagName||!t[e].hasAttribute("data-language")?0:1}handle(t){const e=t[0];if(e){const t=e.textContent,n=e.dataset.language;return x.from({id:z(),type:"code-block",content:t,language:n})}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}class Ut extends Pt{createRTEImageBlock(t,e){const n=!(e&&e.autoMatchFormat||!t.parentNode||"DIV"===t.parentNode.nodeName);return RTEImageBlock.from({id:z(),type:"image",nodes:[{id:z(),type:"image",url:t.src,annotations:Mt.generate(RTEImageNode,t,e)}],annotations:Object.assign(Object.assign({},Mt.generate(RTEImageBlock,t.parentElement,e)),{internalWrapper:n})},e)}}class zt extends Pt{canHandle(t,e){let n=0;for(let s=e;s<t.length;s++){const e=t[s];if(e.nodeType!==Node.TEXT_NODE&&(!zt.canHandleTags.includes(e.nodeName)||""===e.textContent&&e.querySelector("IMG")))break;n++}return n}handle(t,s){const r=t[0].parentElement,o=s&&s.autoMatchFormat,i=this.generateChildNodes(t,o?Mt.generate(n,r,Object.assign(Object.assign({},s),{skipCustomAnnotations:!0})):{},s),a=o?super.matchTextBlockType(r):this.matchTextBlockTypeByTagName(r),l=!o&&!a;return e.from(Object.assign({id:z(),type:a||"paragraph",nodes:i},l?{annotations:{internalWrapper:l}}:{annotations:Mt.generate(e,r,s)}),s)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}matchTextBlockTypeByTagName(t){switch(t.nodeName){case"P":return"paragraph";default:return null}}}zt.canHandleTags=[...Dt.canHandleTags,"CODE","A","VEGA-RICH-TEXT-LINK-EDITOR","BR"];class $t extends tt{shouldProceedToElementChildren(){return!1}appendChildBlocks(){}generateTextNode(t,e){return{id:z(),type:"text",text:t,annotations:e}}}U.registerRTEDTOClass("paragraph",e),U.registerRTEDTOClass("title",e),U.registerRTEDTOClass("subtitle",e),U.registerRTEDTOClass("heading-1",e),U.registerRTEDTOClass("heading-2",e),U.registerRTEDTOClass("heading-3",e),U.registerRTEDTOClass("heading-4",e),U.registerRTEDTOClass("heading-5",e),U.registerRTEDTOClass("heading-6",e),U.registerRTEDTOClass("heading-6",e),U.registerRTEDTOClass("list-item",RTEListItemBlock),U.registerRTEDTOClass("bullet-list",RTEListBlock),U.registerRTEDTOClass("number-list",RTEListBlock),U.registerRTEDTOClass("image",RTEImageBlock),U.registerRTEDTOClass("code-block",x),U.registerRTEDTOClass("html-block",RTEHtmlBlock),U.registerRTEDTOClass("text",n),U.registerRTEDTOClass("image",RTEImageNode),Rt.registerBlockBasicStrategies(e.name),Rt.registerBlockBasicStrategies(RTEListBlock.name),Rt.registerBlockBasicStrategies(RTEListItemBlock.name),Rt.registerBlockBasicStrategies(RTEImageBlock.name),Rt.registerBlockBasicStrategies(RTEHtmlBlock.name),nt.registerElementToBlockStrategy(new zt),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){const n=t[e];return n.nodeType===Node.ELEMENT_NODE&&""===n.textContent&&n.querySelector("img")?1:0}handle(t,e){const n=t[0].querySelector("img");return this.createRTEImageBlock(n,e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){return"VEGA-RICH-TEXT-IMAGE-EDITOR"===t[e].tagName?1:0}handle(t,e){const n=t[0],s=n.querySelector("img");if($(s))return RTEImageBlock.from({id:z(),type:"image",nodes:[{id:z(),type:"image",url:s.src,annotations:Mt.generate(RTEImageNode,n,e)}],annotations:Mt.generate(RTEImageBlock,n.parentElement,e)},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Ut{canHandle(t,e){return"IMG"===t[e].tagName?1:0}handle(t,e){return this.createRTEImageBlock(t[0],e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return["heading-1","heading-2","heading-3","heading-4","heading-5","heading-6","title","subtitle"].includes(super.matchTextBlockType(t[e]))?1:0}handle(t,n){const s=this.generateChildNodes(Array.from(t[0].childNodes),{},n);return 0===s.length?null:e.from({id:z(),type:super.matchTextBlockType(t[0]),nodes:s,annotations:Mt.generate(e,t[0],n)},n)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new Ft),nt.registerElementToBlockStrategy(new class extends Ft{canHandle(t,e){return"VEGA-CODE-BLOCK"===t[e].tagName&&0==!!t[e].querySelector("vega-code-block")||this.isCodeBlockContainer(t[e])?1:0}handle(t){const e=this.isCodeBlockContainer(t[0])?t[0].querySelector("vega-code-block"):t[0],n=e.querySelector("code");if(n)return super.handle([n]);if(e.hasAttribute("data-content")){const t=document.createElement("code");return t.textContent=e.dataset.content,t.dataset.language=e.dataset.language,super.handle([t])}}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}isCodeBlockContainer(t){return"PRE"===t.tagName&&t.classList.contains("code-block-container")&&1===t.querySelectorAll("vega-code-block").length}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){if(!["UL","OL"].includes(t[e].parentElement.nodeName)&&t.some((t=>"LI"===t.nodeName))){let n=0;for(let s=e;s<t.length&&"LI"===t[s].nodeName;s++)n++;return n}return"LI"===t[e].tagName?1:0}handle(t,e){const n=t[0];return["UL","OL"].includes(n.parentElement.nodeName)?RTEListItemBlock.from(this.generateListItemBlockDTO(n,e),e):this.generateWithListBlock(t,e)}appendChildBlocks(t,e){t.nestList=e.filter((t=>["bullet-list","number-list"].includes(t.type)))}shouldProceedToElementChildren(){return!0}generateWithListBlock(t,e){return RTEListBlock.from({id:z(),type:"bullet-list",blocks:t.map((t=>this.generateListItemBlockDTO(t,e)))},e)}generateListItemBlockDTO(t,e){return{id:z(),type:"list-item",annotations:Mt.generate(RTEListItemBlock,t,e),nodes:this.generateChildNodes(Array.from(t.childNodes.length?t.childNodes:[t]).filter((t=>!["UL","OL"].includes(t.nodeName))),Mt.generate(n,t,Object.assign(Object.assign({},e),{skipCustomAnnotations:!0})),e)}}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){const n=t[e],s=n.parentElement,r="LI"!==n.nodeName,o=n.nodeType===Node.TEXT_NODE&&""===n.textContent.trim(),i=$(s)&&["UL","OL"].includes(s.nodeName);return r&&!o&&i?1:0}handle(t,e){const n=this.generateChildNodes(t,{},e);return RTEListItemBlock.from({id:z(),type:"list-item",nodes:n,annotations:{}},e)}appendChildBlocks(){}shouldProceedToElementChildren(){return!1}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return"OL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:z(),type:"number-list",blocks:[],annotations:Mt.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),nt.registerElementToBlockStrategy(new class extends Pt{canHandle(t,e){return"UL"===t[e].tagName?1:0}handle(t,e){return 0===t[0].childNodes.length?null:RTEListBlock.from({id:z(),type:"bullet-list",blocks:[],annotations:Mt.generate(RTEListBlock,t[0],e)},e)}appendChildBlocks(t,e){t.children=e.filter((t=>t instanceof RTEListItemBlock)),e.forEach((e=>e.parent=t))}shouldProceedToElementChildren(){return!0}}),nt.registerElementToBlockStrategy(new Vt),nt.registerElementToNodeStrategy(new class extends $t{canHandle(t,e){const n=t[e];return!Z(n)||"BR"!==n.nodeName&&0!==n.childNodes.length?0:1}handle(t,e,s){const r=!(!e||!1!==e.autoMatchFormat),o=Object.assign({},s),i=t[0],a=Mt.generate(n,i,Object.assign({parentAnnotations:r?{inlineHtml:o.inlineHtml,link:o.link,code:o.code}:s},e));if("BR"===i.nodeName)return this.generateTextNode("\n",a);if(0===i.childNodes.length){const t=r?_(Object.assign(Object.assign({},n.supportsHtmlTag(i.nodeName.toLowerCase())?a:{}),{inlineHtml:a.inlineHtml,plainText:$(a.inlineHtml)})):a;return Object.assign({},this.generateTextNode("",t))}}}),nt.registerElementToNodeStrategy(new class extends $t{canHandle(t,e){return t[e].nodeType===Node.TEXT_NODE?1:0}handle(t,e,s){const r=Object.assign({},s),o=!(!e||!1!==e.autoMatchFormat),i=t[0],a=i.parentNode.nodeName.toLowerCase(),l=o&&!n.supportsHtmlTag(a),c=this.generateTextNode(String(i.textContent),o?_(Object.assign(Object.assign({},"span"===a?r:{link:r.link,code:"code"===a?r.code:void 0}),{inlineHtml:r.inlineHtml,plainText:l||void 0})):r);return Object.assign({},c)}});class Gt{static preserve(t){const e=t.replace(/\s+style=/g," data-style=");return new Jt(e)}}class Jt{constructor(t){this.processedHtml=t}getProcessedHtml(){return this.processedHtml}restore(t){this.walkNodes(t)}walkNodes(t){t.forEach((t=>{if(Z(t)){const e=t.getAttribute("data-style");e&&(t.style.cssText=e,t.removeAttribute("data-style")),t.children.length>0&&this.walkNodes(Array.from(t.children))}}))}}class VegaRTEContent{constructor(t){t.forEach((t=>{t.parent=this})),this.children=t}static fromJSON(t,e={autoMatchFormat:!0}){const n=t.map((t=>{const n=U.getRTEBlockClass(t.type);if(n)return n.from(t,e);throw new Error(`[Vega] Unknown block type: ${t.type}`)}));return new VegaRTEContent(n)}static createEmptyContent(){return VegaRTEContent.fromJSON([{id:z(),type:"paragraph",nodes:[{id:z(),type:"text",text:""}]}])}static fromHtml(t,e={autoMatchFormat:!0,skipCustomAnnotations:!1}){const n=t.replace(/>\s+<\/?/g,(t=>t.endsWith("</")?t:"><")).replace(/(>)[\n\t]+(?=[a-zA-Z0-9_\W])/g,"$1").replace(/([a-zA-Z0-9_\W])[\n\t]+(?=<)/g,"$1"),s=Gt.preserve(n),r=s.getProcessedHtml(),o=(new DOMParser).parseFromString(r,"text/html").body,i=Array.from(o.childNodes);s.restore(i);const a=st.process(i,e).filter($).map((t=>t.toDto(e))).filter($);return new VegaRTEContent(a)}clone(t=!1){return new VegaRTEContent(t?this.children.map((t=>t.clone(this))):[...this.children])}toJSON(){return this.children.map((t=>t.toJSON()))}toHtml(t){return t&&Q.warn("The 'options' parameter in toHtml method is deprecated and will be removed in the future."),this.children.map((t=>t.toHtml())).join("")}apply(t){if(r.executeTheStrategy(t,this),t.executedFlag&&t.isFlushable){const t=O.getDOMByEntity(this);t&&G.notify(J.getSubject(t,K),{})}}getLastNode(){return 0===this.children.length?null:this.children[this.children.length-1].getLastNode()}toListItem(t){t.children.map((t=>t.apply(new p)));const e=new RTEListItemBlock(z());return e.apply(new s(t.children)),e.annotationMap=t.annotationMap,e}createList(t){return new RTEListBlock(z(),t)}findNodeById(t){return this.findNodeInBlocksById(t,this.children)}findNodeInBlocksById(t,e){for(const n of e){if("children"in n)for(const e of n.children)if(e.id===t)return e;if(n instanceof RTEListItemBlock&&n.nestList)for(const e of n.nestList){const n=this.findNodeInBlocksById(t,e.children);if(n)return n}if(n instanceof RTEListBlock&&n.children){const e=this.findNodeInBlocksById(t,n.children);if(e)return e}}return null}}r.register(c.DELETE_CHILDREN,VegaRTEContent.name,new P),r.register(c.APPEND_CHILDREN,VegaRTEContent.name,new rt),r.register(c.INSERT_CHILDREN_BEFORE,VegaRTEContent.name,new ot),r.register(c.INSERT_CHILDREN_AFTER,VegaRTEContent.name,new it),r.register(c.TRANSFORM_TO_CODE_BLOCK,VegaRTEContent.name,new class extends t{handleAction(t,e){const n=t.selectedBlocks,s=new x(z(),this.getCodeContent(n),"plainText");e.apply(new g(n[0],s)),t.newCodeBlock=s,this.removeSelectBlocks(n,e)}getCodeContent(t){return t.filter((t=>"image"!==t.type&&"list-item"!==t.type)).map((t=>t.children.map((t=>t.text)).join(""))).join("\n")}removeSelectBlocks(t,e){for(let n=0;n<t.length;n++)e.apply(new E(t[n]))}}),r.register(c.UPDATE_CURSOR_POSITION,VegaRTEContent.name,new class extends t{handleAction(t,e){const{offset:n,nextFocusNode:s,immediatelyRun:r}=t,o=O.getDOMByEntity(e);o&&G.notify(J.getSubject(o,W),{node:s,offset:n,updateDirectly:r})}});const Wt=new class{constructor(){this.RTE_DTO_RENDERER_MAP=new Map,this.RTE_TOOLBAR_BUTTON_RENDERER_MAP=new Map}registerRTEDTORenderer(t,e){const n=this.RTE_DTO_RENDERER_MAP.get(t);if(e&&n&&n.constructor.name!==e.constructor.name)throw new Error(`Renderer for type ${t} is already registered with a different class(${n.constructor.name}).`);this.RTE_DTO_RENDERER_MAP.set(t,e)}registerRTEToolbarButtonRenderer(t,e){this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.set(t,e)}getRTERenderer(t){return this.RTE_DTO_RENDERER_MAP.get(t)}getRTEToolbarButtonRenderer(t){return this.RTE_TOOLBAR_BUTTON_RENDERER_MAP.get(t)}};export{Pt as B,nt as E,lt as I,ct as M,Wt as R,Gt as S,ut as U,VegaRTEContent as V,Rt as a,tt as b,RTEListItemBlock as c,RTEImageBlock as d,RTEListBlock as e,RTEImageNode as f,at as g,Mt as h,st as i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,F as i,r as t,c as r,H as n,g as a}from"./p-6b2342e0.js";import{s as o}from"./p-519a7d55.js";import{c as s,V as p,M as d,I as l}from"./p-6e1ab235.js";import{V as u,I as h}from"./p-d849e0f5.js";import{c}from"./p-de97c6d9.js";import{D as g,f as v}from"./p-447c7590.js";import{F as f}from"./p-9fb6fbcc.js";import{i as b}from"./p-d27ae9ff.js";import{C as m}from"./p-2d0d575f.js";import{F as x}from"./p-a528714c.js";import{g as w,D as y}from"./p-d9671d27.js";import{C as j}from"./p-db57dddc.js";import{I as R}from"./p-f396c69a.js";import{I}from"./p-abd7aeaa.js";import{c as C}from"./p-86194314.js";import{T as V}from"./p-d5ff8b7f.js";import"./p-6a334573.js";import"./p-bccee21e.js";import"./p-b75ee3ba.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-a4670e23.js";import"./p-308aa2e3.js";import"./p-39482a1a.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-fde50319.js";import"./p-262ec334.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";var N=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class k extends p{getInputRangeContainerRef(){return this.inputRangeContainerRef}render(){return e(i,null,e("vega-flex",{class:"vega-input-range-container",direction:"horizontal"!==this.stack?"col":"row",alignItems:"horizontal"!==this.stack?"start":"center",gap:"size-8",ref:e=>this.inputRangeContainerRef=e},e("vega-field-label",{onClick:this.inputRangeInputRenderer.focusFirstInput,isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.inputRangeInputRenderer.render()),this.renderHintDom())}renderHintDom(){if(this.hint)return e("label",{class:"vega-input-range-hint"},e("vega-font",{variant:"font-footnote1-short",color:"text-secondary"},this.hint))}}N([s()],k.prototype,"required",void 0),N([s()],k.prototype,"disabled",void 0),N([s()],k.prototype,"label",void 0),N([s()],k.prototype,"hint",void 0),N([s()],k.prototype,"stack",void 0),N([s()],k.prototype,"inputRangeInputRenderer",void 0);var z=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class O extends p{emitEventAndNotifyAfterValueChange(e,i){b(e,i)||(this.changeEventEmitter.emit(e),m.notify(x,{host:this.host,detail:e}))}updateValueByRangeIndex(e,i){let t=this.value;t=0===i?[e,Array.isArray(this.value)&&!isNaN(Number(this.value[1]))?this.value[1]:""]:[Array.isArray(this.value)&&!isNaN(Number(this.value[0]))?this.value[0]:"",e],b(t,this.value)||this.setValue(t)}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){return Array.isArray(e)&&2===e.length}}z([s({writable:!0})],O.prototype,"value",void 0),z([s()],O.prototype,"host",void 0),z([s()],O.prototype,"changeEventEmitter",void 0),z([d("watchValue")],O.prototype,"emitEventAndNotifyAfterValueChange",null);var A=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class E extends p{constructor(){super(...arguments),this.isMobileDevice=w()===y.MOBILE,this.focusFirstInput=()=>{this.minFieldInputRef.doFocus()},this.inputValueChange=e=>{this.valueController.updateValueByRangeIndex(e.detail,"0"===e.host.dataset.index?0:1)}}getInputRefByIndex(e){return[this.minFieldInputRef,this.maxFieldInputRef][e]}render(){return e("vega-box",{class:{"vega-input-range-input-container":!0,"input-range-disabled":this.disabled,"input-range-mobile":this.isMobileDevice,"input-range-with-clear-icon":this.showClearIcon&&!this.disabled},corners:"rounded-8",backgroundColor:this.disabled?"bg-secondary":"bg-primary"},e("vega-flex",{"align-items":"center",direction:this.isMobileDevice?"col":"row"},e("vega-input",Object.assign({prefixIcon:this.prefixIcon},this.getInputPropsByRangeIndex(0),{ref:e=>{g.addUniqueObserverToNode(e,v,this.inputValueChange),this.minFieldInputRef=e}})),e("span",{class:"vega-input-range-divider"}),e("vega-input",Object.assign({class:{"with-left-padding-in-mobile":!!this.prefixIcon&&this.isMobileDevice}},this.getInputPropsByRangeIndex(1),{ref:e=>{g.addUniqueObserverToNode(e,v,this.inputValueChange),this.maxFieldInputRef=e}}))),this.clearIconRenderer.render())}getInputPropsByRangeIndex(e){return{type:"number","data-index":e,placeholder:this.getPlaceholderByIndex(e),showClearIcon:!1,disabled:this.disabled,size:this.size,min:this.min,max:this.max,value:this.getDefaultValueByIndex(e)}}getPlaceholderByIndex(e){return this.translationSlimmer.t((this.placeholder||E.defaultPlaceholder)[e])}getDefaultValueByIndex(e){return(this.value||["",""])[e]}}E.defaultPlaceholder=["Minimum","Maximum"],A([s()],E.prototype,"value",void 0),A([s()],E.prototype,"prefixIcon",void 0),A([s()],E.prototype,"disabled",void 0),A([s()],E.prototype,"min",void 0),A([s()],E.prototype,"max",void 0),A([s()],E.prototype,"size",void 0),A([s()],E.prototype,"placeholder",void 0),A([s()],E.prototype,"showClearIcon",void 0),A([s()],E.prototype,"valueController",void 0),A([s()],E.prototype,"clearIconRenderer",void 0),A([s()],E.prototype,"translationSlimmer",void 0);class F extends I{constructor(e){super(),this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""}),this.minValue=0===e.minValue||e.minValue?Number(e.minValue):null,this.maxValue=0===e.maxValue||e.maxValue?Number(e.maxValue):null}canEvaluate(e,i){return i?this.isAcceptedInputType(e)&&!i.disabled&&i.visible:this.isAcceptedInputType(e)}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Unexpected type of input: ${typeof e}: ${e}`);const i=Number(e[0]),t=Number(e[1]);return null!==this.minValue&&(""!==e[0]&&i<this.minValue||""!==e[1]&&t<this.minValue)?this.invalidResult({key:"The minimum input value is {0}",args:[this.minValue]}):null!==this.maxValue&&(""!==e[0]&&i>this.maxValue||""!==e[1]&&t>this.maxValue)?this.invalidResult({key:"The maximum input value is {0}",args:[this.maxValue]}):""!==e[0]&&""!==e[1]&&i>t?this.invalidResult("The end value should be greater than the start value"):this.validResult()}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return Array.isArray(e)&&2===e.length&&e.every((e=>"number"==typeof Number(e)))}}var M=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class S extends p{constructor(){super(...arguments),this.clearInputRangeValue=()=>{this.valueController.setValue(["",""]),this.inputRangeInputRenderer.focusFirstInput()}}render(){return e("div",{class:{"vega-input-range-clear-icon":!0,invisible:!this.shouldShowClearIcon()},"aria-label":"clear input range",role:"button",tabindex:this.disabled?-1:0,onClick:this.clearInputRangeValue,onKeyDown:C()},e("vega-icon",{icon:"close"}))}shouldShowClearIcon(){return this.showClearIcon&&!this.disabled&&Array.isArray(this.value)&&this.value.some((e=>!!e))}}M([s()],S.prototype,"showClearIcon",void 0),M([s()],S.prototype,"value",void 0),M([s()],S.prototype,"disabled",void 0),M([s()],S.prototype,"inputRangeInputRenderer",void 0),M([s()],S.prototype,"valueController",void 0);var B=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};const D=class{constructor(e){t(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new V,this.formFieldController=new f({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new R:null},{propertyName:"min",ruleFactory:(e,i)=>new F({minValue:e,maxValue:i}),dependence:"max"},{propertyName:"max",ruleFactory:(e,i)=>new F({minValue:i,maxValue:e}),dependence:"min"}],validationRulesName:"validationRules",defaultValue:["",""],attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputRangeRenderer.getInputRangeContainerRef(),touchableAreaGetter:()=>[this.inputRangeInputRenderer.getInputRefByIndex(0),this.inputRangeInputRenderer.getInputRefByIndex(1)]}),this.inputRangeInputRenderer=new E,this.clearIconRenderer=new S,this.inputRangeRenderer=new k,this.valueController=new O,this.inputChangeEventPrevent=new j([v],(()=>this.inputRangeRenderer.getInputRangeContainerRef())),this.changeEventEmitter=c(D,v),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.label="",this.value=["",""],this.showClearIcon=!0,this.min=null,this.max=null,this.required=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.size="default",this.placeholder=["Minimum","Maximum"],this.disabled=!1,this.hint="",this.stack="vertical"}watchValue(e,i){}watchValidationRules(){}render(){return o(e(n,{class:{disabled:this.disabled}},this.inputRangeRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};B([h()],D.prototype,"globalSlimmers",void 0),B([l()],D.prototype,"translationSlimmer",void 0),B([l()],D.prototype,"formFieldController",void 0),B([l()],D.prototype,"inputRangeInputRenderer",void 0),B([l()],D.prototype,"clearIconRenderer",void 0),B([l()],D.prototype,"inputRangeRenderer",void 0),B([l()],D.prototype,"valueController",void 0),B([l()],D.prototype,"inputChangeEventPrevent",void 0),B([l()],D.prototype,"changeEventEmitter",void 0),B([l()],D.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),D.style=':host{display:inline-block;width:100%}.vega-input-range-input-container{position:relative;width:100%;flex:1 1 0%;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));box-sizing:border-box;min-width:50%}.vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-input-range-input-container .vega-input-range-divider{display:inline-block;width:0px;height:24px;border-color:rgba(var(--v-border-color-input-field, 171, 198, 216, 1));border-style:solid;border-right-width:1px;border-left-width:0px;flex-shrink:0}.vega-input-range-input-container:focus-within .vega-input-range-divider{opacity:0}.vega-input-range-input-container .vega-input-range-clear-icon{position:absolute;width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));top:50%;right:16px;transform:translateY(-50%);z-index:2}.vega-input-range-input-container .vega-input-range-clear-icon.invisible{visibility:hidden}.vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border-radius:4px;padding:2px}.vega-input-range-input-container vega-input::part(input-container){border-width:0px}.vega-input-range-input-container vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));position:relative;box-shadow:0 0 0;margin:-1px;z-index:1}.vega-input-range-input-container.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled .vega-input-range-divider{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-mobile .vega-input-range-divider{width:100%;height:0px;border-right-width:0px;border-left-width:0px;border-top-width:0px;border-bottom-width:1px}.vega-input-range-input-container.input-range-mobile:focus-within .vega-input-range-divider{opacity:1}.vega-input-range-input-container.input-range-mobile .with-left-padding-in-mobile::part(input){padding-left:26px}.vega-input-range-input-container.input-range-mobile .vega-input-range-clear-icon{top:25%}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:first-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:2px}.vega-input-range-container.error .vega-input-range-input-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-input-range-container.error .vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-input-range-container.error .vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-input-range-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))}.vega-input-range-hint{display:inline-block;padding-top:12px;padding-right:8px;padding-left:8px}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{D as vega_input_range}
|
|
1
|
+
import{h as e,F as i,r as t,c as r,H as n,g as a}from"./p-6b2342e0.js";import{s as o}from"./p-519a7d55.js";import{c as s,V as p,M as d,I as l}from"./p-6e1ab235.js";import{V as u,I as h}from"./p-d849e0f5.js";import{c}from"./p-de97c6d9.js";import{D as g,f as v}from"./p-447c7590.js";import{F as f}from"./p-1f26de89.js";import{i as b}from"./p-d27ae9ff.js";import{C as m}from"./p-2d0d575f.js";import{F as x}from"./p-a528714c.js";import{g as w,D as y}from"./p-d9671d27.js";import{C as j}from"./p-db57dddc.js";import{I as R}from"./p-f396c69a.js";import{I}from"./p-abd7aeaa.js";import{c as C}from"./p-86194314.js";import{T as V}from"./p-75f981ce.js";import"./p-6a334573.js";import"./p-bccee21e.js";import"./p-b75ee3ba.js";import"./p-331a62d5.js";import"./p-02841589.js";import"./p-a4670e23.js";import"./p-308aa2e3.js";import"./p-f69f84a7.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-fde50319.js";import"./p-262ec334.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";var N=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class k extends p{getInputRangeContainerRef(){return this.inputRangeContainerRef}render(){return e(i,null,e("vega-flex",{class:"vega-input-range-container",direction:"horizontal"!==this.stack?"col":"row",alignItems:"horizontal"!==this.stack?"start":"center",gap:"size-8",ref:e=>this.inputRangeContainerRef=e},e("vega-field-label",{onClick:this.inputRangeInputRenderer.focusFirstInput,isFieldRequired:this.required,disabled:this.disabled,label:this.label}),this.inputRangeInputRenderer.render()),this.renderHintDom())}renderHintDom(){if(this.hint)return e("label",{class:"vega-input-range-hint"},e("vega-font",{variant:"font-footnote1-short",color:"text-secondary"},this.hint))}}N([s()],k.prototype,"required",void 0),N([s()],k.prototype,"disabled",void 0),N([s()],k.prototype,"label",void 0),N([s()],k.prototype,"hint",void 0),N([s()],k.prototype,"stack",void 0),N([s()],k.prototype,"inputRangeInputRenderer",void 0);var z=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class O extends p{emitEventAndNotifyAfterValueChange(e,i){b(e,i)||(this.changeEventEmitter.emit(e),m.notify(x,{host:this.host,detail:e}))}updateValueByRangeIndex(e,i){let t=this.value;t=0===i?[e,Array.isArray(this.value)&&!isNaN(Number(this.value[1]))?this.value[1]:""]:[Array.isArray(this.value)&&!isNaN(Number(this.value[0]))?this.value[0]:"",e],b(t,this.value)||this.setValue(t)}setValue(e){this.valueGuard(e)&&(this.value=e)}valueGuard(e){return Array.isArray(e)&&2===e.length}}z([s({writable:!0})],O.prototype,"value",void 0),z([s()],O.prototype,"host",void 0),z([s()],O.prototype,"changeEventEmitter",void 0),z([d("watchValue")],O.prototype,"emitEventAndNotifyAfterValueChange",null);var A=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class E extends p{constructor(){super(...arguments),this.isMobileDevice=w()===y.MOBILE,this.focusFirstInput=()=>{this.minFieldInputRef.doFocus()},this.inputValueChange=e=>{this.valueController.updateValueByRangeIndex(e.detail,"0"===e.host.dataset.index?0:1)}}getInputRefByIndex(e){return[this.minFieldInputRef,this.maxFieldInputRef][e]}render(){return e("vega-box",{class:{"vega-input-range-input-container":!0,"input-range-disabled":this.disabled,"input-range-mobile":this.isMobileDevice,"input-range-with-clear-icon":this.showClearIcon&&!this.disabled},corners:"rounded-8",backgroundColor:this.disabled?"bg-secondary":"bg-primary"},e("vega-flex",{"align-items":"center",direction:this.isMobileDevice?"col":"row"},e("vega-input",Object.assign({prefixIcon:this.prefixIcon},this.getInputPropsByRangeIndex(0),{ref:e=>{g.addUniqueObserverToNode(e,v,this.inputValueChange),this.minFieldInputRef=e}})),e("span",{class:"vega-input-range-divider"}),e("vega-input",Object.assign({class:{"with-left-padding-in-mobile":!!this.prefixIcon&&this.isMobileDevice}},this.getInputPropsByRangeIndex(1),{ref:e=>{g.addUniqueObserverToNode(e,v,this.inputValueChange),this.maxFieldInputRef=e}}))),this.clearIconRenderer.render())}getInputPropsByRangeIndex(e){return{type:"number","data-index":e,placeholder:this.getPlaceholderByIndex(e),showClearIcon:!1,disabled:this.disabled,size:this.size,min:this.min,max:this.max,value:this.getDefaultValueByIndex(e)}}getPlaceholderByIndex(e){return this.translationSlimmer.t((this.placeholder||E.defaultPlaceholder)[e])}getDefaultValueByIndex(e){return(this.value||["",""])[e]}}E.defaultPlaceholder=["Minimum","Maximum"],A([s()],E.prototype,"value",void 0),A([s()],E.prototype,"prefixIcon",void 0),A([s()],E.prototype,"disabled",void 0),A([s()],E.prototype,"min",void 0),A([s()],E.prototype,"max",void 0),A([s()],E.prototype,"size",void 0),A([s()],E.prototype,"placeholder",void 0),A([s()],E.prototype,"showClearIcon",void 0),A([s()],E.prototype,"valueController",void 0),A([s()],E.prototype,"clearIconRenderer",void 0),A([s()],E.prototype,"translationSlimmer",void 0);class F extends I{constructor(e){super(),this.invalidResult=e=>({isValid:!1,message:e}),this.validResult=()=>({isValid:!0,message:""}),this.minValue=0===e.minValue||e.minValue?Number(e.minValue):null,this.maxValue=0===e.maxValue||e.maxValue?Number(e.maxValue):null}canEvaluate(e,i){return i?this.isAcceptedInputType(e)&&!i.disabled&&i.visible:this.isAcceptedInputType(e)}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Unexpected type of input: ${typeof e}: ${e}`);const i=Number(e[0]),t=Number(e[1]);return null!==this.minValue&&(""!==e[0]&&i<this.minValue||""!==e[1]&&t<this.minValue)?this.invalidResult({key:"The minimum input value is {0}",args:[this.minValue]}):null!==this.maxValue&&(""!==e[0]&&i>this.maxValue||""!==e[1]&&t>this.maxValue)?this.invalidResult({key:"The maximum input value is {0}",args:[this.maxValue]}):""!==e[0]&&""!==e[1]&&i>t?this.invalidResult("The end value should be greater than the start value"):this.validResult()}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}isAcceptedInputType(e){return Array.isArray(e)&&2===e.length&&e.every((e=>"number"==typeof Number(e)))}}var M=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};class S extends p{constructor(){super(...arguments),this.clearInputRangeValue=()=>{this.valueController.setValue(["",""]),this.inputRangeInputRenderer.focusFirstInput()}}render(){return e("div",{class:{"vega-input-range-clear-icon":!0,invisible:!this.shouldShowClearIcon()},"aria-label":"clear input range",role:"button",tabindex:this.disabled?-1:0,onClick:this.clearInputRangeValue,onKeyDown:C()},e("vega-icon",{icon:"close"}))}shouldShowClearIcon(){return this.showClearIcon&&!this.disabled&&Array.isArray(this.value)&&this.value.some((e=>!!e))}}M([s()],S.prototype,"showClearIcon",void 0),M([s()],S.prototype,"value",void 0),M([s()],S.prototype,"disabled",void 0),M([s()],S.prototype,"inputRangeInputRenderer",void 0),M([s()],S.prototype,"valueController",void 0);var B=function(e,i,t,r){var n,a=arguments.length,o=a<3?i:null===r?r=Object.getOwnPropertyDescriptor(i,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,i,t,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(i,t,o):n(i,t))||o);return a>3&&o&&Object.defineProperty(i,t,o),o};const D=class{constructor(e){t(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new V,this.formFieldController=new f({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new R:null},{propertyName:"min",ruleFactory:(e,i)=>new F({minValue:e,maxValue:i}),dependence:"max"},{propertyName:"max",ruleFactory:(e,i)=>new F({minValue:i,maxValue:e}),dependence:"min"}],validationRulesName:"validationRules",defaultValue:["",""],attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputRangeRenderer.getInputRangeContainerRef(),touchableAreaGetter:()=>[this.inputRangeInputRenderer.getInputRefByIndex(0),this.inputRangeInputRenderer.getInputRefByIndex(1)]}),this.inputRangeInputRenderer=new E,this.clearIconRenderer=new S,this.inputRangeRenderer=new k,this.valueController=new O,this.inputChangeEventPrevent=new j([v],(()=>this.inputRangeRenderer.getInputRangeContainerRef())),this.changeEventEmitter=c(D,v),this.vegaComponentUsageRuntimeMetricsSlimmer=new u,this.label="",this.value=["",""],this.showClearIcon=!0,this.min=null,this.max=null,this.required=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[],this.size="default",this.placeholder=["Minimum","Maximum"],this.disabled=!1,this.hint="",this.stack="vertical"}watchValue(e,i){}watchValidationRules(){}render(){return o(e(n,{class:{disabled:this.disabled}},this.inputRangeRenderer.render()),this.host)}get host(){return a(this)}static get watchers(){return{value:["watchValue"],validationRules:["watchValidationRules"]}}};B([h()],D.prototype,"globalSlimmers",void 0),B([l()],D.prototype,"translationSlimmer",void 0),B([l()],D.prototype,"formFieldController",void 0),B([l()],D.prototype,"inputRangeInputRenderer",void 0),B([l()],D.prototype,"clearIconRenderer",void 0),B([l()],D.prototype,"inputRangeRenderer",void 0),B([l()],D.prototype,"valueController",void 0),B([l()],D.prototype,"inputChangeEventPrevent",void 0),B([l()],D.prototype,"changeEventEmitter",void 0),B([l()],D.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),D.style=':host{display:inline-block;width:100%}.vega-input-range-input-container{position:relative;width:100%;flex:1 1 0%;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));box-sizing:border-box;min-width:50%}.vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.vega-input-range-input-container .vega-input-range-divider{display:inline-block;width:0px;height:24px;border-color:rgba(var(--v-border-color-input-field, 171, 198, 216, 1));border-style:solid;border-right-width:1px;border-left-width:0px;flex-shrink:0}.vega-input-range-input-container:focus-within .vega-input-range-divider{opacity:0}.vega-input-range-input-container .vega-input-range-clear-icon{position:absolute;width:16px;height:16px;cursor:pointer;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));top:50%;right:16px;transform:translateY(-50%);z-index:2}.vega-input-range-input-container .vega-input-range-clear-icon.invisible{visibility:hidden}.vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px;border-radius:4px;padding:2px}.vega-input-range-input-container vega-input::part(input-container){border-width:0px}.vega-input-range-input-container vega-input::part(input-container):focus-within{outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:3px;border:1px solid rgba(var(--v-border-color-input-field-focus, 19, 98, 226, 1));position:relative;box-shadow:0 0 0;margin:-1px;z-index:1}.vega-input-range-input-container.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-disabled{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled:hover{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-disabled .vega-input-range-divider{border-color:rgba(var(--v-border-color-input-field-disabled, 222, 225, 227, 1))}.vega-input-range-input-container.input-range-mobile .vega-input-range-divider{width:100%;height:0px;border-right-width:0px;border-left-width:0px;border-top-width:0px;border-bottom-width:1px}.vega-input-range-input-container.input-range-mobile:focus-within .vega-input-range-divider{opacity:1}.vega-input-range-input-container.input-range-mobile .with-left-padding-in-mobile::part(input){padding-left:26px}.vega-input-range-input-container.input-range-mobile .vega-input-range-clear-icon{top:25%}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:first-child::part(input){padding-right:24px}.vega-input-range-input-container.input-range-mobile.input-range-with-clear-icon vega-input:last-child::part(input){padding-right:2px}.vega-input-range-container.error .vega-input-range-input-container{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-input-range-container.error .vega-input-range-input-container:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-input-range-container.error .vega-input-range-input-container .vega-input-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-input-range-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))}.vega-input-range-hint{display:inline-block;padding-top:12px;padding-right:8px;padding-left:8px}.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1));display:block;padding-top:12px;padding-right:8px;padding-left:8px}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){.vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}.vega-hidden{display:none}';export{D as vega_input_range}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as t,H as i,g as a}from"./p-6b2342e0.js";import{c as r,M as o,V as s,I as n}from"./p-6e1ab235.js";import{V as l,I as d}from"./p-d849e0f5.js";import{n as c}from"./p-018d70a5.js";import{s as p}from"./p-519a7d55.js";import{a as g}from"./p-d9671d27.js";import{R as h}from"./p-85407fb9.js";import{P as m,g as f}from"./p-7d9cd9c8.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-4c192985.js";import"./p-a528714c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-54ae02db.js";import"./p-b75ee3ba.js";import"./p-bccee21e.js";import"./p-447c7590.js";import"./p-262ec334.js";import"./p-d4893487.js";import"./p-8506e8c3.js";import"./p-308aa2e3.js";import"./p-02841589.js";import"./p-b1faebe0.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-d884c644.js";import"./p-bf19682d.js";import"./p-8c9ea6f4.js";import"./p-a7b5f497.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-5d676a94.js";import"./p-39482a1a.js";var b=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class v extends s{connectedCallback(){this.setIndex()}disconnectedCallback(){this.removeIndex()}setIndex(){const e=document.querySelector(this.host.dataset.container);e&&"BODY"===e.tagName&&c.setZIndex(this.host,"base")}removeIndex(){c.removeZIndex(this.host,"base")}}b([r()],v.prototype,"host",void 0),b([o("connectedCallback")],v.prototype,"connectedCallback",null),b([o("disconnectedCallback")],v.prototype,"disconnectedCallback",null);var x=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const u=class{constructor(t){e(this,t),this.globalSlimmers={},this.manageVegaLoaderWrapperZIndexController=new v,this.vegaComponentUsageRuntimeMetricsSlimmer=new l}render(){return t(i,{class:"vega-loader-wrapper"},t("slot",null))}get host(){return a(this)}};x([d()],u.prototype,"globalSlimmers",void 0),x([n()],u.prototype,"manageVegaLoaderWrapperZIndexController",void 0),x([n()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u.style=":host{display:block;display:inline-flex;align-items:center;justify-content:center;top:0px;right:0px;bottom:0px;left:0px;background-color:rgba(var(--v-bg-backdrop-loading, 255, 255, 255, 0.5))}:host(.absolute-wrapper){position:absolute}:host(.fixed-wrapper){width:100%;height:100%;position:fixed}";const j=[{payloadKey:"MODE_IS_INDETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"indeterminate"===e.mode},{payloadKey:"MODE_IS_DETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"determinate"===e.mode}];var k=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const w=class{constructor(i){e(this,i),this.globalSlimmers={},this.pageResizeObserverSlimmer=new m,this.vegaComponentUsageRuntimeMetricsSlimmer=new l(j),this.currentBreakpoint=f(),this.shape="circle",this.size="default",this.mode="indeterminate",this.percent=0,this.label="",this.hint="",this.status="default",this.renderCircleLoader=()=>{const e=this.getCircleLoaderRadius(this.getResponsiveSize()),i="indeterminate"===this.mode?.75:this.percent/100,a=2*Math.PI*e,r="error"===this.status?a:a*i;return t("svg",{class:"circle-loader"},t("circle",{r:e,class:"circle-loader-track",part:"circle-loader-track"}),t("circle",{r:e,class:"circle-loader-progress",part:"circle-loader-progress","stroke-linecap":"indeterminate"===this.mode?"round":"butt","stroke-dasharray":[r,a].join(" ")}),"determinate"===this.mode&&t("circle",{r:e,class:g(["circle-loader-progress-pointer",0===i&&"v-hidden"].filter(Boolean)),"stroke-dashoffset":-r,"stroke-dasharray":[0,a].join(" ")}))},this.renderBarLoader=()=>{let e=75;return"determinate"===this.mode&&(e="error"===this.status?100:this.percent),t("div",{class:"bar-loader-track"},t("div",{class:g(["bar-loader",this.getResponsiveSize()]),style:{width:`${e}%`}}))},this.renderLabelAndHint=()=>{if(this.label||this.hint)return t("vega-flex",{direction:"col",gap:"size-4",alignItems:"center"},this.label&&t("span",{class:"vega-loading-indicator-label"},this.label),this.hint&&t("span",{class:"vega-loading-indicator-hint"},this.hint))},this.getResponsiveSize=()=>h.formatCustom(this.size),this.getCircleLoaderRadius=e=>{switch(e){case"micro":return 6.5;case"small":return 10;case"large":return 52;default:return 20}}}render(){const e=g([this.getResponsiveSize(),this.mode,`status-${this.status}`,this.shape].map((e=>`vega-loading-indicator-${e}`)));return p(t(i,{class:e},t("vega-flex",{direction:"col",gap:"size-16",alignItems:"center"},"circle"===this.shape?this.renderCircleLoader():this.renderBarLoader(),this.renderLabelAndHint())),this.host)}get host(){return a(this)}};k([d()],w.prototype,"globalSlimmers",void 0),k([n()],w.prototype,"pageResizeObserverSlimmer",void 0),k([n()],w.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w.style=':host{display:inline-block}:host(.vega-loading-indicator-bar){width:100%}:host(.vega-loading-indicator-indeterminate) .circle-loader{animation:circle-loader-animation 2000ms linear infinite;transform:rotate(-90deg)}:host(.vega-loading-indicator-determinate) .circle-loader{transform:rotate(-180deg)}:host(.vega-loading-indicator-default) .circle-loader{width:48px;height:48px}:host(.vega-loading-indicator-micro) .circle-loader{width:16px;height:16px}:host(.vega-loading-indicator-small) .circle-loader{width:24px;height:24px}:host(.vega-loading-indicator-large) .circle-loader{width:120px;height:120px}:host .circle-loader-track{stroke:rgba(var(--v-bg-loading-track, 229, 239, 255, 1));fill:none;cy:50%;cx:50%}:host .circle-loader-progress-pointer.v-hidden{display:none}:host .circle-loader-progress-pointer,:host .circle-loader-progress{stroke:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));fill:none;cy:50%;cx:50%}:host(.vega-loading-indicator-status-success) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-success) .circle-loader-progress{stroke:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-error) .circle-loader-progress{stroke:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-default) .circle-loader-progress-pointer,:host(.vega-loading-indicator-default) .circle-loader-track,:host(.vega-loading-indicator-default) .circle-loader-progress{stroke-width:8px}:host .circle-loader-progress-pointer{stroke-linecap:round}:host(.vega-loading-indicator-micro) .circle-loader-progress-pointer,:host(.vega-loading-indicator-micro) .circle-loader-track,:host(.vega-loading-indicator-micro) .circle-loader-progress{stroke-width:3px}:host(.vega-loading-indicator-small) .circle-loader-progress-pointer,:host(.vega-loading-indicator-small) .circle-loader-track,:host(.vega-loading-indicator-small) .circle-loader-progress{stroke-width:4px}:host(.vega-loading-indicator-large) .circle-loader-progress-pointer,:host(.vega-loading-indicator-large) .circle-loader-track,:host(.vega-loading-indicator-large) .circle-loader-progress{stroke-width:16px}@keyframes circle-loader-animation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host .bar-loader{border-radius:9999px;position:absolute;box-sizing:border-box;height:8px;background-color:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));content:"";width:75%;top:0;left:0}:host(.vega-loading-indicator-status-success) .bar-loader{background-color:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .bar-loader{background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-micro) .bar-loader,:host(.vega-loading-indicator-micro) .bar-loader-track{height:3px}:host(.vega-loading-indicator-small) .bar-loader,:host(.vega-loading-indicator-small) .bar-loader-track{height:4px}:host(.vega-loading-indicator-large) .bar-loader,:host(.vega-loading-indicator-large) .bar-loader-track{height:16px}:host(.vega-loading-indicator-indeterminate) .bar-loader{animation:bar-loader-animation 1250ms cubic-bezier(0.75, 0, 0.5, 1) infinite;animation-delay:50ms}@keyframes bar-loader-animation{0%{left:0;transform:translateX(-100%)}100%{left:100%;transform:translateX(0%)}}:host .bar-loader-track{display:inline-block;border-radius:9999px;position:relative;overflow:hidden;height:8px;width:100%;background-color:rgba(var(--v-bg-loading-track, 229, 239, 255, 1))}:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}';export{u as vega_loader_wrapper,w as vega_loading_indicator}
|
|
1
|
+
import{r as e,h as t,H as i,g as a}from"./p-6b2342e0.js";import{c as r,M as o,V as s,I as n}from"./p-6e1ab235.js";import{V as l,I as d}from"./p-d849e0f5.js";import{n as c}from"./p-b8b9ed2c.js";import{s as p}from"./p-519a7d55.js";import{a as g}from"./p-d9671d27.js";import{R as h}from"./p-1bb0c934.js";import{P as m,g as f}from"./p-7d9cd9c8.js";import"./p-a4670e23.js";import"./p-6a334573.js";import"./p-ef9cbad1.js";import"./p-a528714c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-112455b1.js";import"./p-4866e390.js";import"./p-b75ee3ba.js";import"./p-bccee21e.js";import"./p-447c7590.js";import"./p-262ec334.js";import"./p-4e13a26f.js";import"./p-0cdb38d3.js";import"./p-308aa2e3.js";import"./p-02841589.js";import"./p-b1faebe0.js";import"./p-ed45b3b6.js";import"./p-74168615.js";import"./p-d884c644.js";import"./p-bf19682d.js";import"./p-8c9ea6f4.js";import"./p-a7b5f497.js";import"./p-0c667d6a.js";import"./p-d27ae9ff.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-5d676a94.js";import"./p-f69f84a7.js";var b=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};class v extends s{connectedCallback(){this.setIndex()}disconnectedCallback(){this.removeIndex()}setIndex(){const e=document.querySelector(this.host.dataset.container);e&&"BODY"===e.tagName&&c.setZIndex(this.host,"base")}removeIndex(){c.removeZIndex(this.host,"base")}}b([r()],v.prototype,"host",void 0),b([o("connectedCallback")],v.prototype,"connectedCallback",null),b([o("disconnectedCallback")],v.prototype,"disconnectedCallback",null);var x=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const u=class{constructor(t){e(this,t),this.globalSlimmers={},this.manageVegaLoaderWrapperZIndexController=new v,this.vegaComponentUsageRuntimeMetricsSlimmer=new l}render(){return t(i,{class:"vega-loader-wrapper"},t("slot",null))}get host(){return a(this)}};x([d()],u.prototype,"globalSlimmers",void 0),x([n()],u.prototype,"manageVegaLoaderWrapperZIndexController",void 0),x([n()],u.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),u.style=":host{display:block;display:inline-flex;align-items:center;justify-content:center;top:0px;right:0px;bottom:0px;left:0px;background-color:rgba(var(--v-bg-backdrop-loading, 255, 255, 255, 0.5))}:host(.absolute-wrapper){position:absolute}:host(.fixed-wrapper){width:100%;height:100%;position:fixed}";const j=[{payloadKey:"MODE_IS_INDETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"indeterminate"===e.mode},{payloadKey:"MODE_IS_DETERMINATE",payloadDescription:"Specifies the mode of the loading indicator",payloadValue:e=>"determinate"===e.mode}];var k=function(e,t,i,a){var r,o=arguments.length,s=o<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(s=(o<3?r(s):o>3?r(t,i,s):r(t,i))||s);return o>3&&s&&Object.defineProperty(t,i,s),s};const w=class{constructor(i){e(this,i),this.globalSlimmers={},this.pageResizeObserverSlimmer=new m,this.vegaComponentUsageRuntimeMetricsSlimmer=new l(j),this.currentBreakpoint=f(),this.shape="circle",this.size="default",this.mode="indeterminate",this.percent=0,this.label="",this.hint="",this.status="default",this.renderCircleLoader=()=>{const e=this.getCircleLoaderRadius(this.getResponsiveSize()),i="indeterminate"===this.mode?.75:this.percent/100,a=2*Math.PI*e,r="error"===this.status?a:a*i;return t("svg",{class:"circle-loader"},t("circle",{r:e,class:"circle-loader-track",part:"circle-loader-track"}),t("circle",{r:e,class:"circle-loader-progress",part:"circle-loader-progress","stroke-linecap":"indeterminate"===this.mode?"round":"butt","stroke-dasharray":[r,a].join(" ")}),"determinate"===this.mode&&t("circle",{r:e,class:g(["circle-loader-progress-pointer",0===i&&"v-hidden"].filter(Boolean)),"stroke-dashoffset":-r,"stroke-dasharray":[0,a].join(" ")}))},this.renderBarLoader=()=>{let e=75;return"determinate"===this.mode&&(e="error"===this.status?100:this.percent),t("div",{class:"bar-loader-track"},t("div",{class:g(["bar-loader",this.getResponsiveSize()]),style:{width:`${e}%`}}))},this.renderLabelAndHint=()=>{if(this.label||this.hint)return t("vega-flex",{direction:"col",gap:"size-4",alignItems:"center"},this.label&&t("span",{class:"vega-loading-indicator-label"},this.label),this.hint&&t("span",{class:"vega-loading-indicator-hint"},this.hint))},this.getResponsiveSize=()=>h.formatCustom(this.size),this.getCircleLoaderRadius=e=>{switch(e){case"micro":return 6.5;case"small":return 10;case"large":return 52;default:return 20}}}render(){const e=g([this.getResponsiveSize(),this.mode,`status-${this.status}`,this.shape].map((e=>`vega-loading-indicator-${e}`)));return p(t(i,{class:e},t("vega-flex",{direction:"col",gap:"size-16",alignItems:"center"},"circle"===this.shape?this.renderCircleLoader():this.renderBarLoader(),this.renderLabelAndHint())),this.host)}get host(){return a(this)}};k([d()],w.prototype,"globalSlimmers",void 0),k([n()],w.prototype,"pageResizeObserverSlimmer",void 0),k([n()],w.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),w.style=':host{display:inline-block}:host(.vega-loading-indicator-bar){width:100%}:host(.vega-loading-indicator-indeterminate) .circle-loader{animation:circle-loader-animation 2000ms linear infinite;transform:rotate(-90deg)}:host(.vega-loading-indicator-determinate) .circle-loader{transform:rotate(-180deg)}:host(.vega-loading-indicator-default) .circle-loader{width:48px;height:48px}:host(.vega-loading-indicator-micro) .circle-loader{width:16px;height:16px}:host(.vega-loading-indicator-small) .circle-loader{width:24px;height:24px}:host(.vega-loading-indicator-large) .circle-loader{width:120px;height:120px}:host .circle-loader-track{stroke:rgba(var(--v-bg-loading-track, 229, 239, 255, 1));fill:none;cy:50%;cx:50%}:host .circle-loader-progress-pointer.v-hidden{display:none}:host .circle-loader-progress-pointer,:host .circle-loader-progress{stroke:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));fill:none;cy:50%;cx:50%}:host(.vega-loading-indicator-status-success) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-success) .circle-loader-progress{stroke:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .circle-loader-progress-pointer,:host(.vega-loading-indicator-status-error) .circle-loader-progress{stroke:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-default) .circle-loader-progress-pointer,:host(.vega-loading-indicator-default) .circle-loader-track,:host(.vega-loading-indicator-default) .circle-loader-progress{stroke-width:8px}:host .circle-loader-progress-pointer{stroke-linecap:round}:host(.vega-loading-indicator-micro) .circle-loader-progress-pointer,:host(.vega-loading-indicator-micro) .circle-loader-track,:host(.vega-loading-indicator-micro) .circle-loader-progress{stroke-width:3px}:host(.vega-loading-indicator-small) .circle-loader-progress-pointer,:host(.vega-loading-indicator-small) .circle-loader-track,:host(.vega-loading-indicator-small) .circle-loader-progress{stroke-width:4px}:host(.vega-loading-indicator-large) .circle-loader-progress-pointer,:host(.vega-loading-indicator-large) .circle-loader-track,:host(.vega-loading-indicator-large) .circle-loader-progress{stroke-width:16px}@keyframes circle-loader-animation{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}:host .bar-loader{border-radius:9999px;position:absolute;box-sizing:border-box;height:8px;background-color:rgba(var(--v-bg-loading-progress, 153, 192, 255, 1));content:"";width:75%;top:0;left:0}:host(.vega-loading-indicator-status-success) .bar-loader{background-color:rgba(var(--v-bg-status-success, 160, 233, 167, 1))}:host(.vega-loading-indicator-status-error) .bar-loader{background-color:rgba(var(--v-bg-status-error, 255, 110, 139, 1))}:host(.vega-loading-indicator-micro) .bar-loader,:host(.vega-loading-indicator-micro) .bar-loader-track{height:3px}:host(.vega-loading-indicator-small) .bar-loader,:host(.vega-loading-indicator-small) .bar-loader-track{height:4px}:host(.vega-loading-indicator-large) .bar-loader,:host(.vega-loading-indicator-large) .bar-loader-track{height:16px}:host(.vega-loading-indicator-indeterminate) .bar-loader{animation:bar-loader-animation 1250ms cubic-bezier(0.75, 0, 0.5, 1) infinite;animation-delay:50ms}@keyframes bar-loader-animation{0%{left:0;transform:translateX(-100%)}100%{left:100%;transform:translateX(0%)}}:host .bar-loader-track{display:inline-block;border-radius:9999px;position:relative;overflow:hidden;height:8px;width:100%;background-color:rgba(var(--v-bg-loading-track, 229, 239, 255, 1))}:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-label{font-family:"Inter", sans-serif;font-size:18px;font-weight:700;line-height:25px;letter-spacing:0px}}:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-loading-indicator-hint{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}';export{u as vega_loader_wrapper,w as vega_loading_indicator}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,r as t,c as i,H as s,g as o}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as n,V as a,M as l,I as c}from"./p-6e1ab235.js";import{V as h,I as d}from"./p-d849e0f5.js";import{c as p}from"./p-86194314.js";import{c as f}from"./p-de97c6d9.js";import{d as v,f as b}from"./p-447c7590.js";import{C as g}from"./p-2d0d575f.js";import{i as x,C as m,R as u,F as w}from"./p-a528714c.js";import{S as y}from"./p-fde50319.js";import{f as j}from"./p-308aa2e3.js";import{f as k}from"./p-d9671d27.js";import{O as R}from"./p-331a62d5.js";import{C}from"./p-db57dddc.js";import{C as S}from"./p-521d1d07.js";import{c as z}from"./p-a0467b83.js";import{F as I}from"./p-9fb6fbcc.js";import{R as E}from"./p-280cbcdb.js";import"./p-6a334573.js";import"./p-bccee21e.js";import"./p-b75ee3ba.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";import"./p-02841589.js";import"./p-a4670e23.js";import"./p-39482a1a.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";var O=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class T extends a{getSelectorContainerRef(){return this.selectorContainerRef}render(){return e("vega-flex",{"align-items":"start","justify-content":"start",gap:"size-16",class:{"selection-tile":!0,disabled:this.disabled,checked:this.checked,error:this.showError},"aria-label":this.titleText||"No label defined",tabIndex:this.disabled?-1:0,onClick:()=>{"radio"===this.selectType&&this.checked||this.checkedController.onCheck(!this.checked)},onKeyDown:p()},e("div",{class:"vega-flex-grow"},this.renderContent()),this.renderSelect())}renderContent(){return this.hasContentSlot()?e("slot",{name:"content"}):e("vega-flex",{gap:"size-12"},e("vega-flex",{class:"vega-flex-shrink-0"},this.renderPrefixIcon()),e("div",{class:"vega-flex-grow"},this.renderText()))}renderPrefixIcon(){return this.hasPrefixSlot()?e("slot",{name:"prefix"}):this.prefixIcon?e("vega-icon",{icon:this.prefixIcon,size:"size-16",color:this.disabled?"text-secondary":"text-primary",class:"selection-tile-icon"}):void 0}renderText(){return e("vega-flex",{class:"vega-flex-grow",direction:"col","align-items":"start","justify-content":"start"},e("div",{class:"selection-tile-title"},this.titleText),this.note&&e("div",{class:"selection-tile-note"},this.note))}renderSelect(){return e("vega-flex",{"align-items":"start",class:"vega-flex-shrink-0 selection-tile-select",ref:e=>this.selectorContainerRef=e},"checkbox"===this.selectType?this.renderCheckbox():this.renderRadio())}renderCheckbox(){return e("vega-checkbox",{size:"small",disabled:this.disabled,checked:this.checked})}renderRadio(){return e("vega-radio",{size:"small",disabled:this.disabled,checked:this.checked})}hasPrefixSlot(){return null!==this.host.querySelector("[slot=prefix]")}hasContentSlot(){return null!==this.host.querySelector("[slot=content]")}}O([n()],T.prototype,"host",void 0),O([n()],T.prototype,"prefixIcon",void 0),O([n()],T.prototype,"titleText",void 0),O([n()],T.prototype,"note",void 0),O([n()],T.prototype,"selectType",void 0),O([n()],T.prototype,"disabled",void 0),O([n()],T.prototype,"checked",void 0),O([n()],T.prototype,"showError",void 0),O([n()],T.prototype,"checkedController",void 0);var V=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class N extends a{setChecked(e){this.checked=e}onCheck(e){const t=e?this.value:"";this.checked=e,this.changeEventEmitter.emit(t),g.notify(x,{host:this.host,detail:{checked:e,value:this.value}})}}V([n()],N.prototype,"host",void 0),V([n({writable:!0})],N.prototype,"checked",void 0),V([n()],N.prototype,"changeEventEmitter",void 0),V([n()],N.prototype,"value",void 0);var A=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class F extends y{constructor(){super({parent:"vega-selection-tile-group",subStates:[{subStateName:"selectType",parentStateName:"selectType"},{subStateName:"disabled",parentStateName:"disabled",callback:e=>{"boolean"==typeof e&&(this.disabled=e)}},{subStateName:"checked",parentStateName:"value",callback:e=>{this.checkedController.setChecked(Array.isArray(e)?e.includes(this.value):e===this.value)}},{subStateName:"distributeEvenly",parentStateName:"distributeEvenly"}]})}}A([n()],F.prototype,"host",void 0),A([n({writable:!0})],F.prototype,"selectType",void 0),A([n({writable:!0})],F.prototype,"disabled",void 0),A([n()],F.prototype,"checked",void 0),A([n()],F.prototype,"value",void 0),A([n()],F.prototype,"checkedController",void 0),A([n({writable:!0})],F.prototype,"distributeEvenly",void 0);var D=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class q extends a{connectedCallback(){this.selectionTileGroup=k(this.host,"vega-selection-tile-group"),this.fieldErrorObserver=new R(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),g.register(v.getSubject(this.selectionTileGroup||this.host,j),this.fieldErrorObserver)}disconnectedCallback(){g.unregister(v.getSubject(this.selectionTileGroup,j),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}D([n({writable:!0})],q.prototype,"showError",void 0),D([n()],q.prototype,"host",void 0),D([l("connectedCallback")],q.prototype,"connectedCallback",null),D([l("disconnectedCallback")],q.prototype,"disconnectedCallback",null);var G=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const _=class{constructor(e){t(this,e),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.renderer=new T,this.checkedController=new N,this.stateController=new F,this.showErrorController=new q,this.changeEventEmitter=f(_,b),this.checkboxEventPrevent=new C([b],(()=>this.renderer.getSelectorContainerRef())),this.checkboxValueChangeObserver=new S(m,(e=>this.checkedController.onCheck(e.detail))),this.radioValueChangeObserver=new S(u,(e=>{e.detail&&this.checkedController.onCheck(e.detail)})),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.showError=!1,this.distributeEvenly=!1,this.titleText="",this.disabled=!1,this.selectType="radio"}render(){return r(e(s,{class:{"distribute-evenly":this.distributeEvenly}},this.renderer.render()),this.host)}get host(){return o(this)}};G([d()],_.prototype,"globalSlimmers",void 0),G([c()],_.prototype,"renderer",void 0),G([c()],_.prototype,"checkedController",void 0),G([c()],_.prototype,"stateController",void 0),G([c()],_.prototype,"showErrorController",void 0),G([c()],_.prototype,"changeEventEmitter",void 0),G([c()],_.prototype,"checkboxEventPrevent",void 0),G([c()],_.prototype,"checkboxValueChangeObserver",void 0),G([c()],_.prototype,"radioValueChangeObserver",void 0),G([c()],_.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_.style=':host::not(.distribute-evenly){display:block}:host(.distribute-evenly){display:flex;width:100%}:host(.distribute-evenly) .selection-tile{flex:1}:host{display:block}:host .selection-tile{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1));cursor:pointer;margin:1px}:host .selection-tile:not(.disabled):hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1))}:host .selection-tile:not(.disabled):focus-visible{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .selection-tile:not(.disabled).checked{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));margin:0px}:host .selection-tile:not(.disabled).checked:hover{border:2px solid rgba(var(--v-border-tile-selected-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-tile-selected-hover, 229, 239, 255, 1))}:host .selection-tile:not(.disabled).checked:focus-visible{border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .selection-tile:not(.disabled).error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1));background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1))}:host .selection-tile:not(.disabled).error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1));background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1))}:host .selection-tile:not(.disabled).error:focus-visible{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1));background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .selection-tile.disabled{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));pointer-events:none}:host .selection-tile.disabled .selection-tile-title,:host .selection-tile.disabled .selection-tile-note{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .selection-tile .selection-tile-icon{margin-top:4px;margin-bottom:4px}:host .selection-tile .selection-tile-select{height:24px}:host .selection-tile .selection-tile-select vega-checkbox,:host .selection-tile .selection-tile-select vega-radio{margin-top:4px}';var P=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class L extends a{getGroupContainerRef(){return this.groupContainerRef}render(){return e("div",null,this.renderLabel(),this.renderContainer(),this.renderHint())}renderLabel(){return this.label&&e("div",{class:"vega-label"},e("label",{"aria-label":this.label},this.label,this.renderRequire()))}renderRequire(){return this.required&&e("span",{class:"vega-require"},"*")}renderContainer(){return e("div",{class:"container",ref:e=>this.groupContainerRef=e},e("vega-flex",{direction:"horizontal"===this.layout?"row":"col",gap:"size-12"},e("slot",{onSlotchange:()=>this.itemsController.syncTileArrayAndValue()})))}renderHint(){return this.hint&&e("div",{class:"vega-hint"},e("label",null,this.hint))}}P([n()],L.prototype,"host",void 0),P([n()],L.prototype,"label",void 0),P([n()],L.prototype,"required",void 0),P([n()],L.prototype,"hint",void 0),P([n()],L.prototype,"layout",void 0),P([n()],L.prototype,"selectType",void 0),P([n()],L.prototype,"itemsController",void 0);var M=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class H extends a{watchValue(){this.changeEventEmitter.emit(this.value),g.notify(w,{host:this.host,detail:this.value})}onSelectionTilesChanged(){"checkbox"===this.selectType?this.setValueFromCheckboxItems():this.setValueFromRadioItems()}onSelectionTileChecked(e){"checkbox"===this.selectType?this.setValueFromCheckbox(e):this.setValueFromRadio(e)}setValueFromCheckbox(e){e.checked&&!this.value.includes(e.value)?this.value=[...this.value,e.value]:!e.checked&&this.value.includes(e.value)&&(this.value=[...this.value.filter((t=>t!==e.value))])}setValueFromRadio(e){e.checked&&(this.value=e.value)}setValueFromCheckboxItems(){0===this.value.length&&(this.value=this.itemsController.getSelectionTileArray().filter((e=>e.checked)).map((e=>e.value)))}setValueFromRadioItems(){if(!this.value){const e=this.itemsController.getSelectionTileArray().find((e=>e.checked));e&&(this.value=e.value)}}}M([n()],H.prototype,"host",void 0),M([n({writable:!0})],H.prototype,"value",void 0),M([n()],H.prototype,"selectType",void 0),M([n()],H.prototype,"changeEventEmitter",void 0),M([n()],H.prototype,"itemsController",void 0),M([l("watchValue")],H.prototype,"watchValue",null);var U=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class K extends a{constructor(){super(...arguments),this.selectionTileArray=[]}initSelectionTileArray(){this.syncTileArrayAndValue()}getSelectionTileArray(){return this.selectionTileArray}syncTileArrayAndValue(){this.selectionTileArray=Array.from(this.host.querySelectorAll("vega-selection-tile")),this.valueController.onSelectionTilesChanged()}touchableAreaGetter(){const e="checkbox"===this.selectType?"vega-checkbox":"vega-radio";return this.selectionTileArray.map((t=>t.shadowRoot.querySelector(e).shadowRoot.querySelector("input")))}}U([n()],K.prototype,"host",void 0),U([n()],K.prototype,"selectType",void 0),U([n()],K.prototype,"valueController",void 0),U([l("componentWillLoad")],K.prototype,"initSelectionTileArray",null);var W=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const B=class{constructor(e){t(this,e),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.renderer=new L,this.itemsController=new K,this.valueController=new H,this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new E:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getGroupContainerRef(),touchableAreaGetter:()=>this.itemsController.touchableAreaGetter(),defaultValue:e=>"checkbox"===e.selectType?[]:"",attributeGetter:e=>this[e]}),this.changeEventEmitter=f(B,b),this.checkboxEventPrevent=new C([b],(()=>this.renderer.getGroupContainerRef())),this.selectionTileChangeObserver=new S(x,(e=>this.valueController.onSelectionTileChecked(e.detail))),this.selectTypeNotifySlimmer=z(B,"selectType","watchSelectType"),this.disabledNotifySlimmer=z(B,"disabled","watchDisabled"),this.valueNotifySlimmer=z(B,"value","watchValue"),this.distributeEvenlyNotifySlimmer=z(B,"distributeEvenly","watchDistributeEvenly"),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.label="",this.distributeEvenly=!1,this.selectType="radio",this.value="checkbox"===this.selectType?[]:"",this.layout="vertical",this.validationRules=[],this.isValid=null}watchDistributeEvenly(){}watchSelectType(){}watchValue(){}watchDisabled(){}watchValidationRules(){}render(){return r(e(s,null,this.renderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{distributeEvenly:["watchDistributeEvenly"],selectType:["watchSelectType"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};W([d()],B.prototype,"globalSlimmers",void 0),W([c()],B.prototype,"renderer",void 0),W([c()],B.prototype,"itemsController",void 0),W([c()],B.prototype,"valueController",void 0),W([c()],B.prototype,"formFieldController",void 0),W([c()],B.prototype,"changeEventEmitter",void 0),W([c()],B.prototype,"checkboxEventPrevent",void 0),W([c()],B.prototype,"selectionTileChangeObserver",void 0),W([c()],B.prototype,"selectTypeNotifySlimmer",void 0),W([c()],B.prototype,"disabledNotifySlimmer",void 0),W([c()],B.prototype,"valueNotifySlimmer",void 0),W([c()],B.prototype,"distributeEvenlyNotifySlimmer",void 0),W([c()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),B.style=':host{display:block;text-align:left;line-height:normal}:host .vega-error{display:block;margin-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}:host .vega-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;margin-bottom:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-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 .vega-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 .vega-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-label label{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}:host .vega-label .vega-require{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-top:12px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}';export{_ as vega_selection_tile,B as vega_selection_tile_group}
|
|
1
|
+
import{h as e,r as t,c as i,H as s,g as o}from"./p-6b2342e0.js";import{s as r}from"./p-519a7d55.js";import{c as n,V as a,M as l,I as c}from"./p-6e1ab235.js";import{V as h,I as d}from"./p-d849e0f5.js";import{c as p}from"./p-86194314.js";import{c as f}from"./p-de97c6d9.js";import{d as v,f as b}from"./p-447c7590.js";import{C as g}from"./p-2d0d575f.js";import{i as x,C as m,R as u,F as w}from"./p-a528714c.js";import{S as y}from"./p-fde50319.js";import{f as j}from"./p-308aa2e3.js";import{f as k}from"./p-d9671d27.js";import{O as R}from"./p-331a62d5.js";import{C}from"./p-db57dddc.js";import{C as S}from"./p-521d1d07.js";import{c as z}from"./p-a0467b83.js";import{F as I}from"./p-1f26de89.js";import{R as E}from"./p-280cbcdb.js";import"./p-6a334573.js";import"./p-bccee21e.js";import"./p-b75ee3ba.js";import"./p-5f377954.js";import"./p-e77a83e4.js";import"./p-db8cdba6.js";import"./p-112455b1.js";import"./p-02841589.js";import"./p-a4670e23.js";import"./p-f69f84a7.js";import"./p-7d9cd9c8.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-abd7aeaa.js";import"./p-78a57a17.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-262ec334.js";var O=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class T extends a{getSelectorContainerRef(){return this.selectorContainerRef}render(){return e("vega-flex",{"align-items":"start","justify-content":"start",gap:"size-16",class:{"selection-tile":!0,disabled:this.disabled,checked:this.checked,error:this.showError},"aria-label":this.titleText||"No label defined",tabIndex:this.disabled?-1:0,onClick:()=>{"radio"===this.selectType&&this.checked||this.checkedController.onCheck(!this.checked)},onKeyDown:p()},e("div",{class:"vega-flex-grow"},this.renderContent()),this.renderSelect())}renderContent(){return this.hasContentSlot()?e("slot",{name:"content"}):e("vega-flex",{gap:"size-12"},e("vega-flex",{class:"vega-flex-shrink-0"},this.renderPrefixIcon()),e("div",{class:"vega-flex-grow"},this.renderText()))}renderPrefixIcon(){return this.hasPrefixSlot()?e("slot",{name:"prefix"}):this.prefixIcon?e("vega-icon",{icon:this.prefixIcon,size:"size-16",color:this.disabled?"text-secondary":"text-primary",class:"selection-tile-icon"}):void 0}renderText(){return e("vega-flex",{class:"vega-flex-grow",direction:"col","align-items":"start","justify-content":"start"},e("div",{class:"selection-tile-title"},this.titleText),this.note&&e("div",{class:"selection-tile-note"},this.note))}renderSelect(){return e("vega-flex",{"align-items":"start",class:"vega-flex-shrink-0 selection-tile-select",ref:e=>this.selectorContainerRef=e},"checkbox"===this.selectType?this.renderCheckbox():this.renderRadio())}renderCheckbox(){return e("vega-checkbox",{size:"small",disabled:this.disabled,checked:this.checked})}renderRadio(){return e("vega-radio",{size:"small",disabled:this.disabled,checked:this.checked})}hasPrefixSlot(){return null!==this.host.querySelector("[slot=prefix]")}hasContentSlot(){return null!==this.host.querySelector("[slot=content]")}}O([n()],T.prototype,"host",void 0),O([n()],T.prototype,"prefixIcon",void 0),O([n()],T.prototype,"titleText",void 0),O([n()],T.prototype,"note",void 0),O([n()],T.prototype,"selectType",void 0),O([n()],T.prototype,"disabled",void 0),O([n()],T.prototype,"checked",void 0),O([n()],T.prototype,"showError",void 0),O([n()],T.prototype,"checkedController",void 0);var V=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class N extends a{setChecked(e){this.checked=e}onCheck(e){const t=e?this.value:"";this.checked=e,this.changeEventEmitter.emit(t),g.notify(x,{host:this.host,detail:{checked:e,value:this.value}})}}V([n()],N.prototype,"host",void 0),V([n({writable:!0})],N.prototype,"checked",void 0),V([n()],N.prototype,"changeEventEmitter",void 0),V([n()],N.prototype,"value",void 0);var A=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class F extends y{constructor(){super({parent:"vega-selection-tile-group",subStates:[{subStateName:"selectType",parentStateName:"selectType"},{subStateName:"disabled",parentStateName:"disabled",callback:e=>{"boolean"==typeof e&&(this.disabled=e)}},{subStateName:"checked",parentStateName:"value",callback:e=>{this.checkedController.setChecked(Array.isArray(e)?e.includes(this.value):e===this.value)}},{subStateName:"distributeEvenly",parentStateName:"distributeEvenly"}]})}}A([n()],F.prototype,"host",void 0),A([n({writable:!0})],F.prototype,"selectType",void 0),A([n({writable:!0})],F.prototype,"disabled",void 0),A([n()],F.prototype,"checked",void 0),A([n()],F.prototype,"value",void 0),A([n()],F.prototype,"checkedController",void 0),A([n({writable:!0})],F.prototype,"distributeEvenly",void 0);var D=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class q extends a{connectedCallback(){this.selectionTileGroup=k(this.host,"vega-selection-tile-group"),this.fieldErrorObserver=new R(this.canAcceptFieldErrorObserver.bind(this),this.fieldErrorObserverListener.bind(this)),g.register(v.getSubject(this.selectionTileGroup||this.host,j),this.fieldErrorObserver)}disconnectedCallback(){g.unregister(v.getSubject(this.selectionTileGroup,j),this.fieldErrorObserver)}canAcceptFieldErrorObserver(){return!0}fieldErrorObserverListener(e){this.showError=e.showError}}D([n({writable:!0})],q.prototype,"showError",void 0),D([n()],q.prototype,"host",void 0),D([l("connectedCallback")],q.prototype,"connectedCallback",null),D([l("disconnectedCallback")],q.prototype,"disconnectedCallback",null);var G=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const _=class{constructor(e){t(this,e),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.renderer=new T,this.checkedController=new N,this.stateController=new F,this.showErrorController=new q,this.changeEventEmitter=f(_,b),this.checkboxEventPrevent=new C([b],(()=>this.renderer.getSelectorContainerRef())),this.checkboxValueChangeObserver=new S(m,(e=>this.checkedController.onCheck(e.detail))),this.radioValueChangeObserver=new S(u,(e=>{e.detail&&this.checkedController.onCheck(e.detail)})),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.showError=!1,this.distributeEvenly=!1,this.titleText="",this.disabled=!1,this.selectType="radio"}render(){return r(e(s,{class:{"distribute-evenly":this.distributeEvenly}},this.renderer.render()),this.host)}get host(){return o(this)}};G([d()],_.prototype,"globalSlimmers",void 0),G([c()],_.prototype,"renderer",void 0),G([c()],_.prototype,"checkedController",void 0),G([c()],_.prototype,"stateController",void 0),G([c()],_.prototype,"showErrorController",void 0),G([c()],_.prototype,"changeEventEmitter",void 0),G([c()],_.prototype,"checkboxEventPrevent",void 0),G([c()],_.prototype,"checkboxValueChangeObserver",void 0),G([c()],_.prototype,"radioValueChangeObserver",void 0),G([c()],_.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),_.style=':host::not(.distribute-evenly){display:block}:host(.distribute-evenly){display:flex;width:100%}:host(.distribute-evenly) .selection-tile{flex:1}:host{display:block}:host .selection-tile{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:12px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));border-radius:8px;background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));color:rgba(var(--v-text-primary, 32, 54, 69, 1));cursor:pointer;margin:1px}:host .selection-tile:not(.disabled):hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1));background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1))}:host .selection-tile:not(.disabled):focus-visible{border:1px solid rgba(var(--v-border-input-field-focus, 19, 98, 226, 1));background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .selection-tile:not(.disabled).checked{background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));margin:0px}:host .selection-tile:not(.disabled).checked:hover{border:2px solid rgba(var(--v-border-tile-selected-hover, 4, 112, 236, 1));background-color:rgba(var(--v-bg-tile-selected-hover, 229, 239, 255, 1))}:host .selection-tile:not(.disabled).checked:focus-visible{border:2px solid rgba(var(--v-border-tile-selected, 19, 98, 226, 1));background-color:rgba(var(--v-bg-tile-selected, 242, 247, 255, 1));outline:2px solid rgba(var(--v-border-color-action, 19, 98, 226, 1));outline-offset:2px}:host .selection-tile:not(.disabled).error{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1));background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1))}:host .selection-tile:not(.disabled).error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1));background-color:rgba(var(--v-bg-tile-hover, 245, 247, 247, 1))}:host .selection-tile:not(.disabled).error:focus-visible{border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1));background-color:rgba(var(--v-bg-tile, 252, 252, 252, 1));outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}:host .selection-tile.disabled{border:1px solid rgba(var(--v-border-input-field-disabled, 222, 225, 227, 1));background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1));pointer-events:none}:host .selection-tile.disabled .selection-tile-title,:host .selection-tile.disabled .selection-tile-note{color:rgba(var(--v-text-input-disabled, 107, 116, 125, 1))}:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .selection-tile .selection-tile-title{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .selection-tile .selection-tile-note{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .selection-tile .selection-tile-icon{margin-top:4px;margin-bottom:4px}:host .selection-tile .selection-tile-select{height:24px}:host .selection-tile .selection-tile-select vega-checkbox,:host .selection-tile .selection-tile-select vega-radio{margin-top:4px}';var P=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class L extends a{getGroupContainerRef(){return this.groupContainerRef}render(){return e("div",null,this.renderLabel(),this.renderContainer(),this.renderHint())}renderLabel(){return this.label&&e("div",{class:"vega-label"},e("label",{"aria-label":this.label},this.label,this.renderRequire()))}renderRequire(){return this.required&&e("span",{class:"vega-require"},"*")}renderContainer(){return e("div",{class:"container",ref:e=>this.groupContainerRef=e},e("vega-flex",{direction:"horizontal"===this.layout?"row":"col",gap:"size-12"},e("slot",{onSlotchange:()=>this.itemsController.syncTileArrayAndValue()})))}renderHint(){return this.hint&&e("div",{class:"vega-hint"},e("label",null,this.hint))}}P([n()],L.prototype,"host",void 0),P([n()],L.prototype,"label",void 0),P([n()],L.prototype,"required",void 0),P([n()],L.prototype,"hint",void 0),P([n()],L.prototype,"layout",void 0),P([n()],L.prototype,"selectType",void 0),P([n()],L.prototype,"itemsController",void 0);var M=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class H extends a{watchValue(){this.changeEventEmitter.emit(this.value),g.notify(w,{host:this.host,detail:this.value})}onSelectionTilesChanged(){"checkbox"===this.selectType?this.setValueFromCheckboxItems():this.setValueFromRadioItems()}onSelectionTileChecked(e){"checkbox"===this.selectType?this.setValueFromCheckbox(e):this.setValueFromRadio(e)}setValueFromCheckbox(e){e.checked&&!this.value.includes(e.value)?this.value=[...this.value,e.value]:!e.checked&&this.value.includes(e.value)&&(this.value=[...this.value.filter((t=>t!==e.value))])}setValueFromRadio(e){e.checked&&(this.value=e.value)}setValueFromCheckboxItems(){0===this.value.length&&(this.value=this.itemsController.getSelectionTileArray().filter((e=>e.checked)).map((e=>e.value)))}setValueFromRadioItems(){if(!this.value){const e=this.itemsController.getSelectionTileArray().find((e=>e.checked));e&&(this.value=e.value)}}}M([n()],H.prototype,"host",void 0),M([n({writable:!0})],H.prototype,"value",void 0),M([n()],H.prototype,"selectType",void 0),M([n()],H.prototype,"changeEventEmitter",void 0),M([n()],H.prototype,"itemsController",void 0),M([l("watchValue")],H.prototype,"watchValue",null);var U=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class K extends a{constructor(){super(...arguments),this.selectionTileArray=[]}initSelectionTileArray(){this.syncTileArrayAndValue()}getSelectionTileArray(){return this.selectionTileArray}syncTileArrayAndValue(){this.selectionTileArray=Array.from(this.host.querySelectorAll("vega-selection-tile")),this.valueController.onSelectionTilesChanged()}touchableAreaGetter(){const e="checkbox"===this.selectType?"vega-checkbox":"vega-radio";return this.selectionTileArray.map((t=>t.shadowRoot.querySelector(e).shadowRoot.querySelector("input")))}}U([n()],K.prototype,"host",void 0),U([n()],K.prototype,"selectType",void 0),U([n()],K.prototype,"valueController",void 0),U([l("componentWillLoad")],K.prototype,"initSelectionTileArray",null);var W=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const B=class{constructor(e){t(this,e),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.globalSlimmers={},this.renderer=new L,this.itemsController=new K,this.valueController=new H,this.formFieldController=new I({propertyRules:[{propertyName:"required",ruleFactory:e=>e?new E:null}],validationRulesName:"validationRules",inputContainerGetter:()=>this.renderer.getGroupContainerRef(),touchableAreaGetter:()=>this.itemsController.touchableAreaGetter(),defaultValue:e=>"checkbox"===e.selectType?[]:"",attributeGetter:e=>this[e]}),this.changeEventEmitter=f(B,b),this.checkboxEventPrevent=new C([b],(()=>this.renderer.getGroupContainerRef())),this.selectionTileChangeObserver=new S(x,(e=>this.valueController.onSelectionTileChecked(e.detail))),this.selectTypeNotifySlimmer=z(B,"selectType","watchSelectType"),this.disabledNotifySlimmer=z(B,"disabled","watchDisabled"),this.valueNotifySlimmer=z(B,"value","watchValue"),this.distributeEvenlyNotifySlimmer=z(B,"distributeEvenly","watchDistributeEvenly"),this.vegaComponentUsageRuntimeMetricsSlimmer=new h,this.label="",this.distributeEvenly=!1,this.selectType="radio",this.value="checkbox"===this.selectType?[]:"",this.layout="vertical",this.validationRules=[],this.isValid=null}watchDistributeEvenly(){}watchSelectType(){}watchValue(){}watchDisabled(){}watchValidationRules(){}render(){return r(e(s,null,this.renderer.render()),this.host)}get host(){return o(this)}static get watchers(){return{distributeEvenly:["watchDistributeEvenly"],selectType:["watchSelectType"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};W([d()],B.prototype,"globalSlimmers",void 0),W([c()],B.prototype,"renderer",void 0),W([c()],B.prototype,"itemsController",void 0),W([c()],B.prototype,"valueController",void 0),W([c()],B.prototype,"formFieldController",void 0),W([c()],B.prototype,"changeEventEmitter",void 0),W([c()],B.prototype,"checkboxEventPrevent",void 0),W([c()],B.prototype,"selectionTileChangeObserver",void 0),W([c()],B.prototype,"selectTypeNotifySlimmer",void 0),W([c()],B.prototype,"disabledNotifySlimmer",void 0),W([c()],B.prototype,"valueNotifySlimmer",void 0),W([c()],B.prototype,"distributeEvenlyNotifySlimmer",void 0),W([c()],B.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),B.style=':host{display:block;text-align:left;line-height:normal}:host .vega-error{display:block;margin-top:12px;font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-error, 189, 41, 71, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-error{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}:host .vega-hidden{display:none}:host .vega-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;margin-bottom:16px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-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 .vega-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 .vega-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-label label{color:rgba(var(--v-text-primary, 32, 54, 69, 1))}:host .vega-label .vega-require{color:rgba(var(--v-text-error, 189, 41, 71, 1));margin-left:4px}:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px;color:rgba(var(--v-text-secondary, 107, 116, 125, 1));padding-top:12px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1024px) and (max-width: 1439px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}@media screen and (min-width: 1440px) and (max-width: 9999px){:host .vega-hint{font-family:"Inter", sans-serif;font-size:14px;font-weight:400;line-height:18px;letter-spacing:0px}}';export{_ as vega_selection_tile,B as vega_selection_tile_group}
|