@globalpayments/vega 2.50.0 → 2.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/LICENSE +9 -17
  2. package/dist/cjs/{app-globals-7f879795.js → app-globals-4ecf85bb.js} +9 -6
  3. package/dist/cjs/{child-nodes-event-prevent-slimmer-26ecfb15.js → child-nodes-event-prevent-slimmer-29020cc8.js} +1 -1
  4. package/dist/cjs/{child-nodes-notify-observer-slimmer-5817a53b.js → child-nodes-notify-observer-slimmer-30ba81ac.js} +1 -1
  5. package/dist/cjs/{code-block-d0b98262.js → code-block-2d014e17.js} +2 -2
  6. package/dist/cjs/{component-73a88c4e.js → component-1e352960.js} +1 -0
  7. package/dist/cjs/{component-global-style-slimmer-6749808c.js → component-global-style-slimmer-b0b4b997.js} +3 -0
  8. package/dist/cjs/{content-state-d2f6a5ac.js → content-state-6a5da7ec.js} +1 -1
  9. package/dist/cjs/{dark-mode-style-controller-4adb7fb2.js → dark-mode-style-controller-f9a32d68.js} +8 -0
  10. package/dist/cjs/{design-token-36495784.js → design-token-3f4f0bc3.js} +1 -1
  11. package/dist/cjs/{dom-node-subject-factory-d5826bff.js → dom-node-subject-factory-769dd00f.js} +1 -1
  12. package/dist/cjs/{dom-node-subject-observer-factory-a7a3b196.js → dom-node-subject-observer-factory-5aa4cc83.js} +1 -1
  13. package/dist/cjs/{effect-37695d3d.js → effect-98e88068.js} +2 -8
  14. package/dist/cjs/{element-appender-slimmer-e5ca155e.js → element-appender-slimmer-5b1d8ffb.js} +12 -7
  15. package/dist/cjs/{event-emit-slimmer-ee7a8c06.js → event-emit-slimmer-36036ef7.js} +15 -4
  16. package/dist/cjs/{form-field-controller-slimmer-ff6d7dfc.js → form-field-controller-slimmer-01c01946.js} +7 -5
  17. package/dist/cjs/{image-annotation-action-e11f242e.js → image-annotation-action-617bbb13.js} +4 -4
  18. package/dist/cjs/{index-73624bb3.js → index-ebb1bb17.js} +2 -2
  19. package/dist/cjs/index.cjs.js +13 -13
  20. package/dist/cjs/{inject-keyboard-manager-b301e887.js → inject-keyboard-manager-dd628ccc.js} +1 -1
  21. package/dist/cjs/{internal-vega-event-manager-58afcde7.js → internal-vega-event-manager-e98944ac.js} +7 -1
  22. package/dist/cjs/{keyboard-manager-2ccf4b16.js → keyboard-manager-8c74eeb9.js} +3 -1
  23. package/dist/cjs/{keyboard-manager-slimmer-900cf2f5.js → keyboard-manager-slimmer-eb364bee.js} +1 -1
  24. package/dist/cjs/{legend-input-processor-8bcce3bf.js → legend-input-processor-b1f323fa.js} +2 -0
  25. package/dist/cjs/loader.cjs.js +11 -11
  26. package/dist/cjs/{page-resize-observer-slimmer-44e08878.js → page-resize-observer-slimmer-efa79728.js} +1 -0
  27. package/dist/cjs/{public-rules-8e2542d9.js → public-rules-a3b7e267.js} +6 -6
  28. package/dist/cjs/{responsive-format-facade-325d3d90.js → responsive-format-facade-6b81192d.js} +5 -5
  29. package/dist/cjs/{rich-text-editor-required-rule-e325cd21.js → rich-text-editor-required-rule-e9c7c379.js} +1 -1
  30. package/dist/cjs/{selection-controller-93e9b350.js → selection-controller-1d7c0999.js} +7 -4
  31. package/dist/cjs/{string-input-formatter-slimmer-b28c6bd2.js → string-input-formatter-slimmer-a5feb2ed.js} +2 -2
  32. package/dist/cjs/{style-formatter-0c3f5ada.js → style-formatter-497d0fa4.js} +1 -1
  33. package/dist/cjs/{sub-state-notify-slimmer-06e0a8db.js → sub-state-notify-slimmer-f68fbf29.js} +1 -1
  34. package/dist/cjs/{sub-state-observer-slimmer-66f3038c.js → sub-state-observer-slimmer-e06cdf7e.js} +2 -2
  35. package/dist/cjs/{ui-13b42af0.js → ui-6c069604.js} +2 -0
  36. package/dist/cjs/vega-accordion.cjs.entry.js +14 -14
  37. package/dist/cjs/vega-app-footer.cjs.entry.js +2 -2
  38. package/dist/cjs/vega-app-header-button.cjs.entry.js +15 -15
  39. package/dist/cjs/vega-backdrop.cjs.entry.js +2 -2
  40. package/dist/cjs/vega-banner.cjs.entry.js +6 -6
  41. package/dist/cjs/vega-bar-chart.cjs.entry.js +2 -2
  42. package/dist/cjs/vega-box.cjs.entry.js +15 -13
  43. package/dist/cjs/vega-brand-logo.cjs.entry.js +2 -2
  44. package/dist/cjs/vega-breadcrumb.cjs.entry.js +7 -7
  45. package/dist/cjs/vega-button-circle.cjs.entry.js +15 -15
  46. package/dist/cjs/vega-button-group_2.cjs.entry.js +9 -9
  47. package/dist/cjs/vega-button-link.cjs.entry.js +7 -7
  48. package/dist/cjs/vega-button.cjs.entry.js +14 -14
  49. package/dist/cjs/vega-calendar_3.cjs.entry.js +10 -10
  50. package/dist/cjs/vega-card.cjs.entry.js +12 -12
  51. package/dist/cjs/vega-carousel.cjs.entry.js +17 -14
  52. package/dist/cjs/vega-checkbox_2.cjs.entry.js +11 -11
  53. package/dist/cjs/vega-chip.cjs.entry.js +15 -15
  54. package/dist/cjs/vega-code-block.cjs.entry.js +96 -102
  55. package/dist/cjs/vega-color-picker.cjs.entry.js +9 -9
  56. package/dist/cjs/vega-combo-box.cjs.entry.js +12 -12
  57. package/dist/cjs/vega-counter-badge.cjs.entry.js +1 -1
  58. package/dist/cjs/vega-date-picker_2.cjs.entry.js +30 -21
  59. package/dist/cjs/vega-dialog_2.cjs.entry.js +22 -16
  60. package/dist/cjs/vega-divider.cjs.entry.js +12 -12
  61. package/dist/cjs/vega-dropdown_5.cjs.entry.js +21 -21
  62. package/dist/cjs/vega-env-manager-23b8b23c.js +2 -2
  63. package/dist/cjs/vega-field-error.cjs.entry.js +1 -1
  64. package/dist/cjs/vega-field-label.cjs.entry.js +6 -6
  65. package/dist/cjs/vega-file-uploader.cjs.entry.js +9 -9
  66. package/dist/cjs/vega-flag-icon.cjs.entry.js +12 -12
  67. package/dist/cjs/vega-flex.cjs.entry.js +13 -13
  68. package/dist/cjs/vega-font.cjs.entry.js +12 -12
  69. package/dist/cjs/vega-form.cjs.entry.js +12 -12
  70. package/dist/cjs/vega-grid.cjs.entry.js +12 -12
  71. package/dist/cjs/vega-hint.cjs.entry.js +1 -1
  72. package/dist/cjs/vega-icon.cjs.entry.js +16 -13
  73. package/dist/cjs/vega-image-uploader.cjs.entry.js +18 -16
  74. package/dist/cjs/vega-input-credit-card.cjs.entry.js +10 -10
  75. package/dist/cjs/vega-input-numeric.cjs.entry.js +13 -13
  76. package/dist/cjs/vega-input-phone-number.cjs.entry.js +15 -15
  77. package/dist/cjs/vega-input-range.cjs.entry.js +12 -12
  78. package/dist/cjs/vega-input-select.cjs.entry.js +16 -16
  79. package/dist/cjs/vega-input.cjs.entry.js +32 -14
  80. package/dist/cjs/vega-item-toggle.cjs.entry.js +6 -6
  81. package/dist/cjs/vega-left-nav_5.cjs.entry.js +23 -18
  82. package/dist/cjs/vega-line-chart.cjs.entry.js +3 -3
  83. package/dist/cjs/vega-loader-wrapper_2.cjs.entry.js +12 -11
  84. package/dist/cjs/vega-page-notification_2.cjs.entry.js +4 -4
  85. package/dist/cjs/vega-pagination-page-selector-mobile.cjs.entry.js +6 -6
  86. package/dist/cjs/vega-pagination-page-size-selector-mobile.cjs.entry.js +4 -4
  87. package/dist/cjs/vega-pagination.cjs.entry.js +14 -14
  88. package/dist/cjs/vega-pie-chart.cjs.entry.js +2 -2
  89. package/dist/cjs/vega-popover_2.cjs.entry.js +16 -16
  90. package/dist/cjs/vega-progress-tracker.cjs.entry.js +6 -6
  91. package/dist/cjs/vega-radio_2.cjs.entry.js +13 -13
  92. package/dist/cjs/vega-rich-text-content.cjs.entry.js +13 -16
  93. package/dist/cjs/vega-rich-text-editor_4.cjs.entry.js +23 -21
  94. package/dist/cjs/vega-section-title.cjs.entry.js +1 -1
  95. package/dist/cjs/vega-segment-control.cjs.entry.js +7 -7
  96. package/dist/cjs/vega-selection-chip_2.cjs.entry.js +17 -17
  97. package/dist/cjs/vega-selection-tile_2.cjs.entry.js +12 -12
  98. package/dist/cjs/vega-sidenav_3.cjs.entry.js +20 -16
  99. package/dist/cjs/vega-signature-capture.cjs.entry.js +17 -16
  100. package/dist/cjs/{vega-skeleton-loader-controller-83e05b6c.js → vega-skeleton-loader-controller-ae2ab090.js} +15 -5
  101. package/dist/cjs/vega-skeleton.cjs.entry.js +1 -1
  102. package/dist/cjs/vega-stepper.cjs.entry.js +10 -10
  103. package/dist/cjs/vega-tab-group_2.cjs.entry.js +8 -8
  104. package/dist/cjs/vega-table_8.cjs.entry.js +16 -16
  105. package/dist/cjs/vega-text.cjs.entry.js +4 -2
  106. package/dist/cjs/vega-textarea.cjs.entry.js +10 -10
  107. package/dist/cjs/vega-time-picker_2.cjs.entry.js +21 -21
  108. package/dist/cjs/vega-toggle-switch.cjs.entry.js +9 -9
  109. package/dist/cjs/vega-tooltip_2.cjs.entry.js +15 -15
  110. package/dist/cjs/vega.cjs.js +11 -11
  111. package/dist/cjs/{wait-for-vega-handler-0a0738ac.js → wait-for-vega-handler-4491efc9.js} +3 -1
  112. package/dist/cjs/{y-axis-input-processor-e371c142.js → y-axis-input-processor-19a07af5.js} +1 -1
  113. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-responsive-style-controller.js +1 -0
  114. package/dist/collection/components/vega-box/slimmers/controllers/vega-box-state-styles-controller.js +1 -0
  115. package/dist/collection/components/vega-carousel/vega-carousel.js +3 -0
  116. package/dist/collection/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.js +25 -0
  117. package/dist/collection/components/vega-code-block/slimmers/controllers/default-code-highlight-parse-controller.js +6 -20
  118. package/dist/collection/components/vega-code-block/slimmers/controllers/prism-code-highlight-parse-controller.js +1 -14
  119. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.js +50 -56
  120. package/dist/collection/components/vega-code-block/slimmers/controllers/vega-code-block-selection-controller.js +2 -0
  121. package/dist/collection/components/vega-code-block/vega-code-block.css +1 -1
  122. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-month-year-dropdown-renderer.js +5 -0
  123. package/dist/collection/components/vega-date-picker/slimmers/renderers/vega-date-picker-calendar-renderer.js +4 -0
  124. package/dist/collection/components/vega-icon/vega-icon.js +4 -1
  125. package/dist/collection/components/vega-image-uploader/slimmers/controllers/vega-image-uploader-preview-controller.js +2 -0
  126. package/dist/collection/components/vega-input/slimmers/controllers/vega-input-compact-width-controller.js +1 -0
  127. package/dist/collection/components/vega-input/vega-input.css +12 -2
  128. package/dist/collection/components/vega-input/vega-input.js +27 -3
  129. package/dist/collection/components/vega-input-range/slimmers/renderers/vega-input-range-clear-icon-renderer.js +1 -1
  130. package/dist/collection/components/vega-input-range/vega-input-range.css +10 -0
  131. package/dist/collection/components/vega-loader-wrapper/slimmers/controllers/manage-vega-loader-wrapper-z-index-controller.js +1 -0
  132. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-backdrop-controller.js +3 -0
  133. package/dist/collection/components/vega-modal/slimmers/controllers/vega-modal-open-state-controller.js +2 -0
  134. package/dist/collection/components/vega-modal/slimmers/controllers/vega-nested-modal-controller.js +1 -0
  135. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-backdrop-controller.js +3 -0
  136. package/dist/collection/components/vega-nav/vega-left-nav/slimmers/controllers/vega-left-nav-open-state-controller.js +2 -0
  137. package/dist/collection/components/vega-rich-text-editor/dto/renderers/nodes/code-block-node-renderer.js +2 -5
  138. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/element-to-dto-strategy/vega-code-block-to-rte-code-block-strategy.js +1 -0
  139. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/helper/input-event-handler/insert-paste-handler.js +1 -0
  140. package/dist/collection/components/vega-rich-text-editor/slimmers/controllers/selection-controller.js +1 -0
  141. package/dist/collection/components/vega-rich-text-editor/test/e2e-utils.js +5 -0
  142. package/dist/collection/components/vega-sidenav/slimmers/controllers/vega-sidenav-backdrop-controller.js +3 -0
  143. package/dist/collection/components/vega-sidenav/slimmers/controllers/vega-sidenav-open-status-controller.js +1 -0
  144. package/dist/collection/components/vega-signature-capture/slimmers/written-mode/controllers/written-mode-svg-controller.js +1 -0
  145. package/dist/collection/components/vega-text/slimmers/renderers/vega-text-tooltip-renderer.js +2 -0
  146. package/dist/collection/components/vega-time-picker/slimmers/renderers/vega-time-picker-range-clear-button-renderer.js +1 -1
  147. package/dist/collection/components/vega-time-picker/vega-time-picker.css +10 -0
  148. package/dist/collection/global/scripts/before-vega-load.js +3 -0
  149. package/dist/collection/helpers/chart/graph-context-factory.js +2 -0
  150. package/dist/collection/helpers/common/wait-for-vega-handler.js +3 -1
  151. package/dist/collection/helpers/dialog/vega-dialog-controller.js +2 -0
  152. package/dist/collection/helpers/event-manager/event-delegated/vega-button-click-strategy.js +1 -0
  153. package/dist/collection/helpers/event-manager/event-delegated/vega-checkbox-change-strategy.js +1 -0
  154. package/dist/collection/helpers/event-manager/event-delegated/vega-input-select-change-strategy.js +1 -0
  155. package/dist/collection/helpers/event-manager/event-delegated/vega-input-strategy.js +1 -0
  156. package/dist/collection/helpers/event-manager/event-delegated/vega-radio-change-strategy.js +1 -0
  157. package/dist/collection/helpers/event-manager/event-delegated/vega-textarea-change-strategy.js +1 -0
  158. package/dist/collection/helpers/event-manager/slimmers/event-emit-slimmer.js +3 -1
  159. package/dist/collection/helpers/event-manager/test/event-emit-slimmer.test.js +11 -1
  160. package/dist/collection/helpers/keyboard/keyboard-manager.js +2 -0
  161. package/dist/collection/helpers/notify/vega-notify-controller.js +6 -1
  162. package/dist/collection/helpers/skeleton-loader/vega-skeleton-loader-controller.js +3 -0
  163. package/dist/collection/helpers/slimmers/component-global-style-slimmer.js +3 -0
  164. package/dist/collection/helpers/slimmers/element-appender/body-positioned-wrapper/default-wrapper.js +1 -0
  165. package/dist/collection/helpers/slimmers/element-appender/body-positioned-wrapper/position-relative-to-wrapper.js +2 -0
  166. package/dist/collection/helpers/slimmers/element-appender/element-appender-slimmer.js +2 -0
  167. package/dist/collection/helpers/slimmers/field-error-ui-controller-strategies/sibling-container-error-label-container-retrieval-strategy.js +1 -0
  168. package/dist/collection/helpers/slimmers/field-error-ui-controller-strategies/sibling-container-self-retrieval-strategy.js +1 -0
  169. package/dist/collection/helpers/slimmers/page-resize-observer-slimmer.js +1 -0
  170. package/dist/collection/helpers/theme/controllers/color-schema-overriding-controller.js +2 -0
  171. package/dist/collection/helpers/theme/controllers/style-controller.abstract.js +3 -0
  172. package/dist/collection/helpers/theme/internal-theme-manager.js +3 -0
  173. package/dist/collection/helpers/ui/element-appender.js +1 -1
  174. package/dist/collection/polyfill/shadow-selection/shadow-selection-polyfill.js +2 -0
  175. package/dist/collection/utils/component.js +1 -0
  176. package/dist/collection/utils/e2e-utils.js +3 -0
  177. package/dist/collection/utils/effect.js +2 -0
  178. package/dist/collection/utils/safe-document.js +9 -0
  179. package/dist/collection/utils/test/safe-document.test.js +13 -0
  180. package/dist/collection/utils/test-utils.js +1 -0
  181. package/dist/collection/utils/ui.js +3 -0
  182. package/dist/esm/{app-globals-6614c573.js → app-globals-d96d623d.js} +9 -6
  183. package/dist/esm/{child-nodes-event-prevent-slimmer-1142fb79.js → child-nodes-event-prevent-slimmer-2b975cbf.js} +1 -1
  184. package/dist/esm/{child-nodes-notify-observer-slimmer-ddaad39a.js → child-nodes-notify-observer-slimmer-eeed5986.js} +1 -1
  185. package/dist/esm/{code-block-527df049.js → code-block-ef2f04ca.js} +2 -2
  186. package/dist/esm/{component-cae24190.js → component-7d906393.js} +1 -0
  187. package/dist/esm/{component-global-style-slimmer-000e0c11.js → component-global-style-slimmer-dad40b64.js} +3 -0
  188. package/dist/esm/{content-state-120176f3.js → content-state-69d29a07.js} +1 -1
  189. package/dist/esm/{dark-mode-style-controller-2ada8e22.js → dark-mode-style-controller-ea798fc8.js} +8 -0
  190. package/dist/esm/{design-token-5672a708.js → design-token-2060cd0d.js} +1 -1
  191. package/dist/esm/{dom-node-subject-factory-eb6bba5d.js → dom-node-subject-factory-6374611f.js} +1 -1
  192. package/dist/esm/{dom-node-subject-observer-factory-6083d518.js → dom-node-subject-observer-factory-c345ca2e.js} +1 -1
  193. package/dist/esm/{effect-8efd2c3c.js → effect-f50e072d.js} +2 -8
  194. package/dist/esm/{element-appender-slimmer-be7ccd98.js → element-appender-slimmer-64a77b7f.js} +12 -7
  195. package/dist/esm/{event-emit-slimmer-480d3b54.js → event-emit-slimmer-7428cc01.js} +15 -4
  196. package/dist/esm/{form-field-controller-slimmer-ec2000c0.js → form-field-controller-slimmer-87d80e46.js} +7 -5
  197. package/dist/esm/{image-annotation-action-07f3d354.js → image-annotation-action-1497f70e.js} +4 -4
  198. package/dist/esm/{index-ae88803d.js → index-f5d2fe61.js} +2 -2
  199. package/dist/esm/index.js +13 -13
  200. package/dist/esm/{inject-keyboard-manager-f513be4a.js → inject-keyboard-manager-e39c0fd9.js} +1 -1
  201. package/dist/esm/{internal-vega-event-manager-56c6469a.js → internal-vega-event-manager-d80c53c5.js} +7 -1
  202. package/dist/esm/{keyboard-manager-262be5ce.js → keyboard-manager-9564ad83.js} +3 -1
  203. package/dist/esm/{keyboard-manager-slimmer-42bf9773.js → keyboard-manager-slimmer-2218e6ba.js} +1 -1
  204. package/dist/esm/{legend-input-processor-8f76ce8a.js → legend-input-processor-1d266967.js} +2 -0
  205. package/dist/esm/loader.js +11 -11
  206. package/dist/esm/{page-resize-observer-slimmer-15a84d26.js → page-resize-observer-slimmer-c51f1912.js} +1 -0
  207. package/dist/esm/{public-rules-b315bf89.js → public-rules-3436034b.js} +6 -6
  208. package/dist/esm/{responsive-format-facade-738b3413.js → responsive-format-facade-8c0ce819.js} +5 -5
  209. package/dist/esm/{rich-text-editor-required-rule-3b87fb40.js → rich-text-editor-required-rule-cc5b6a2d.js} +1 -1
  210. package/dist/esm/{selection-controller-c04f1e18.js → selection-controller-3d6dfc87.js} +7 -4
  211. package/dist/esm/{string-input-formatter-slimmer-4f0eadb0.js → string-input-formatter-slimmer-e53b6412.js} +2 -2
  212. package/dist/esm/{style-formatter-5870bbe1.js → style-formatter-1eca1299.js} +1 -1
  213. package/dist/esm/{sub-state-notify-slimmer-6768a092.js → sub-state-notify-slimmer-b6c8051c.js} +1 -1
  214. package/dist/esm/{sub-state-observer-slimmer-2958d1a3.js → sub-state-observer-slimmer-93eeb87d.js} +2 -2
  215. package/dist/esm/{ui-ed1283bb.js → ui-7d177fb0.js} +2 -0
  216. package/dist/esm/vega-accordion.entry.js +14 -14
  217. package/dist/esm/vega-app-footer.entry.js +2 -2
  218. package/dist/esm/vega-app-header-button.entry.js +15 -15
  219. package/dist/esm/vega-backdrop.entry.js +2 -2
  220. package/dist/esm/vega-banner.entry.js +6 -6
  221. package/dist/esm/vega-bar-chart.entry.js +2 -2
  222. package/dist/esm/vega-box.entry.js +15 -13
  223. package/dist/esm/vega-brand-logo.entry.js +2 -2
  224. package/dist/esm/vega-breadcrumb.entry.js +7 -7
  225. package/dist/esm/vega-button-circle.entry.js +15 -15
  226. package/dist/esm/vega-button-group_2.entry.js +9 -9
  227. package/dist/esm/vega-button-link.entry.js +7 -7
  228. package/dist/esm/vega-button.entry.js +14 -14
  229. package/dist/esm/vega-calendar_3.entry.js +10 -10
  230. package/dist/esm/vega-card.entry.js +12 -12
  231. package/dist/esm/vega-carousel.entry.js +17 -14
  232. package/dist/esm/vega-checkbox_2.entry.js +11 -11
  233. package/dist/esm/vega-chip.entry.js +15 -15
  234. package/dist/esm/vega-code-block.entry.js +96 -102
  235. package/dist/esm/vega-color-picker.entry.js +9 -9
  236. package/dist/esm/vega-combo-box.entry.js +12 -12
  237. package/dist/esm/vega-counter-badge.entry.js +1 -1
  238. package/dist/esm/vega-date-picker_2.entry.js +30 -21
  239. package/dist/esm/vega-dialog_2.entry.js +22 -16
  240. package/dist/esm/vega-divider.entry.js +12 -12
  241. package/dist/esm/vega-dropdown_5.entry.js +21 -21
  242. package/dist/esm/vega-env-manager-8f8dc473.js +2 -2
  243. package/dist/esm/vega-field-error.entry.js +1 -1
  244. package/dist/esm/vega-field-label.entry.js +6 -6
  245. package/dist/esm/vega-file-uploader.entry.js +9 -9
  246. package/dist/esm/vega-flag-icon.entry.js +12 -12
  247. package/dist/esm/vega-flex.entry.js +13 -13
  248. package/dist/esm/vega-font.entry.js +12 -12
  249. package/dist/esm/vega-form.entry.js +12 -12
  250. package/dist/esm/vega-grid.entry.js +12 -12
  251. package/dist/esm/vega-hint.entry.js +1 -1
  252. package/dist/esm/vega-icon.entry.js +16 -13
  253. package/dist/esm/vega-image-uploader.entry.js +18 -16
  254. package/dist/esm/vega-input-credit-card.entry.js +10 -10
  255. package/dist/esm/vega-input-numeric.entry.js +13 -13
  256. package/dist/esm/vega-input-phone-number.entry.js +15 -15
  257. package/dist/esm/vega-input-range.entry.js +12 -12
  258. package/dist/esm/vega-input-select.entry.js +16 -16
  259. package/dist/esm/vega-input.entry.js +32 -14
  260. package/dist/esm/vega-item-toggle.entry.js +6 -6
  261. package/dist/esm/vega-left-nav_5.entry.js +23 -18
  262. package/dist/esm/vega-line-chart.entry.js +3 -3
  263. package/dist/esm/vega-loader-wrapper_2.entry.js +12 -11
  264. package/dist/esm/vega-page-notification_2.entry.js +4 -4
  265. package/dist/esm/vega-pagination-page-selector-mobile.entry.js +6 -6
  266. package/dist/esm/vega-pagination-page-size-selector-mobile.entry.js +4 -4
  267. package/dist/esm/vega-pagination.entry.js +14 -14
  268. package/dist/esm/vega-pie-chart.entry.js +2 -2
  269. package/dist/esm/vega-popover_2.entry.js +16 -16
  270. package/dist/esm/vega-progress-tracker.entry.js +6 -6
  271. package/dist/esm/vega-radio_2.entry.js +13 -13
  272. package/dist/esm/vega-rich-text-content.entry.js +13 -16
  273. package/dist/esm/vega-rich-text-editor_4.entry.js +23 -21
  274. package/dist/esm/vega-section-title.entry.js +1 -1
  275. package/dist/esm/vega-segment-control.entry.js +7 -7
  276. package/dist/esm/vega-selection-chip_2.entry.js +17 -17
  277. package/dist/esm/vega-selection-tile_2.entry.js +12 -12
  278. package/dist/esm/vega-sidenav_3.entry.js +20 -16
  279. package/dist/esm/vega-signature-capture.entry.js +17 -16
  280. package/dist/esm/{vega-skeleton-loader-controller-878e1b28.js → vega-skeleton-loader-controller-06f48dd2.js} +15 -5
  281. package/dist/esm/vega-skeleton.entry.js +1 -1
  282. package/dist/esm/vega-stepper.entry.js +10 -10
  283. package/dist/esm/vega-tab-group_2.entry.js +8 -8
  284. package/dist/esm/vega-table_8.entry.js +16 -16
  285. package/dist/esm/vega-text.entry.js +4 -2
  286. package/dist/esm/vega-textarea.entry.js +10 -10
  287. package/dist/esm/vega-time-picker_2.entry.js +21 -21
  288. package/dist/esm/vega-toggle-switch.entry.js +9 -9
  289. package/dist/esm/vega-tooltip_2.entry.js +15 -15
  290. package/dist/esm/vega.js +11 -11
  291. package/dist/esm/{wait-for-vega-handler-b18eb955.js → wait-for-vega-handler-e0a928cd.js} +3 -1
  292. package/dist/esm/{y-axis-input-processor-e090b01c.js → y-axis-input-processor-95995d34.js} +1 -1
  293. package/dist/types/components/vega-code-block/slimmers/controllers/code-highlight-parser.abstract.d.ts +7 -0
  294. package/dist/types/components/vega-code-block/slimmers/controllers/vega-code-block-input-controller.d.ts +15 -14
  295. package/dist/types/components/vega-input/types.d.ts +2 -0
  296. package/dist/types/components/vega-input/vega-input.d.ts +9 -2
  297. package/dist/types/components.d.ts +3 -3
  298. package/dist/types/types/components.type.d.ts +1 -1
  299. package/dist/types/utils/safe-document.d.ts +7 -0
  300. package/dist/types/utils/test/safe-document.test.d.ts +1 -0
  301. package/dist/vega/index.esm.js +1 -1
  302. package/dist/vega/{p-5ce386c8.entry.js → p-06cd4a19.entry.js} +1 -1
  303. package/dist/vega/p-06fb002a.js +1 -0
  304. package/dist/vega/{p-5f7e87d8.entry.js → p-07cdaf74.entry.js} +1 -1
  305. package/dist/vega/{p-4ea06c45.entry.js → p-07e40eea.entry.js} +1 -1
  306. package/dist/vega/{p-29f9be26.entry.js → p-0ce88865.entry.js} +1 -1
  307. package/dist/vega/{p-cd437a76.entry.js → p-1071f790.entry.js} +1 -1
  308. package/dist/vega/{p-45e28b9b.js → p-111d41fe.js} +1 -1
  309. package/dist/vega/{p-38c9f0a2.entry.js → p-12929d20.entry.js} +1 -1
  310. package/dist/vega/{p-6934013c.js → p-138fcf6e.js} +1 -1
  311. package/dist/vega/{p-27ccf34d.entry.js → p-151dec6a.entry.js} +1 -1
  312. package/dist/vega/p-1b81fc7a.entry.js +1 -0
  313. package/dist/vega/{p-56a0b13d.js → p-1df029c2.js} +1 -1
  314. package/dist/vega/{p-539bf755.entry.js → p-21d4f12e.entry.js} +1 -1
  315. package/dist/vega/{p-9f64b39a.entry.js → p-21d5656d.entry.js} +1 -1
  316. package/dist/vega/{p-9f002a09.js → p-21e180f2.js} +1 -1
  317. package/dist/vega/{p-1e172471.entry.js → p-2329cb73.entry.js} +1 -1
  318. package/dist/vega/{p-dc94d914.entry.js → p-29fe94b6.entry.js} +1 -1
  319. package/dist/vega/p-2f5d9aab.js +1 -0
  320. package/dist/vega/{p-b257180d.entry.js → p-30c363d8.entry.js} +2 -2
  321. package/dist/vega/{p-d00fbc11.entry.js → p-32a24ef1.entry.js} +1 -1
  322. package/dist/vega/{p-829d0394.js → p-33bd7e31.js} +1 -1
  323. package/dist/vega/{p-7b0a4688.entry.js → p-36827489.entry.js} +1 -1
  324. package/dist/vega/{p-8aa7e56e.entry.js → p-388abe56.entry.js} +1 -1
  325. package/dist/vega/{p-bdd3147b.js → p-3b34389d.js} +1 -1
  326. package/dist/vega/{p-05373557.js → p-3eb2d433.js} +1 -1
  327. package/dist/vega/{p-9a72d29f.js → p-3fa7d356.js} +1 -1
  328. package/dist/vega/{p-2fb5cef7.entry.js → p-447a2b18.entry.js} +1 -1
  329. package/dist/vega/{p-d3765409.entry.js → p-4bca12ee.entry.js} +1 -1
  330. package/dist/vega/{p-b518e1a0.entry.js → p-5016b57e.entry.js} +1 -1
  331. package/dist/vega/{p-01e6e55a.entry.js → p-52905c68.entry.js} +1 -1
  332. package/dist/vega/{p-efdda17c.entry.js → p-52bdeea0.entry.js} +1 -1
  333. package/dist/vega/{p-87019626.entry.js → p-53803447.entry.js} +1 -1
  334. package/dist/vega/{p-854849ea.entry.js → p-53815555.entry.js} +1 -1
  335. package/dist/vega/{p-d7937711.js → p-55563f5f.js} +1 -1
  336. package/dist/vega/{p-7f5a85c6.entry.js → p-578ac47f.entry.js} +1 -1
  337. package/dist/vega/{p-8e66b9b0.entry.js → p-586139ce.entry.js} +1 -1
  338. package/dist/vega/{p-6c6a91fe.entry.js → p-597732e9.entry.js} +1 -1
  339. package/dist/vega/{p-64f452fe.entry.js → p-5c9efff8.entry.js} +1 -1
  340. package/dist/vega/{p-21b18100.js → p-5e530257.js} +1 -1
  341. package/dist/vega/p-5f377954.js +1 -1
  342. package/dist/vega/{p-3f191ec3.entry.js → p-60164904.entry.js} +1 -1
  343. package/dist/vega/{p-020b04ed.js → p-613ee009.js} +1 -1
  344. package/dist/vega/{p-6ece526e.entry.js → p-61b72038.entry.js} +1 -1
  345. package/dist/vega/{p-36499e56.entry.js → p-642da014.entry.js} +1 -1
  346. package/dist/vega/{p-b8d9d3a0.entry.js → p-647734d1.entry.js} +1 -1
  347. package/dist/vega/{p-cd205d96.js → p-65cca90f.js} +1 -1
  348. package/dist/vega/{p-a0e122a6.entry.js → p-66145767.entry.js} +1 -1
  349. package/dist/vega/{p-872de7ee.js → p-6681efd5.js} +1 -1
  350. package/dist/vega/{p-419697c6.js → p-6b7dca3e.js} +1 -1
  351. package/dist/vega/{p-767b257b.entry.js → p-6ceb2d26.entry.js} +1 -1
  352. package/dist/vega/{p-e1a2a701.js → p-6e01f0a2.js} +1 -1
  353. package/dist/vega/{p-5eec1e1f.entry.js → p-6f3dd430.entry.js} +1 -1
  354. package/dist/vega/p-71d897e5.entry.js +1 -0
  355. package/dist/vega/p-72a4edf2.entry.js +1 -0
  356. package/dist/vega/{p-67cf7b9d.entry.js → p-7add21f8.entry.js} +1 -1
  357. package/dist/vega/p-7df1ad72.entry.js +1 -0
  358. package/dist/vega/p-7e70938a.entry.js +1 -0
  359. package/dist/vega/{p-5064a804.js → p-864de9a1.js} +1 -1
  360. package/dist/vega/{p-d2a2af2c.entry.js → p-86713a15.entry.js} +1 -1
  361. package/dist/vega/{p-acf6908c.entry.js → p-8a0d7805.entry.js} +1 -1
  362. package/dist/vega/{p-0bc7c935.js → p-8bdc9e75.js} +1 -1
  363. package/dist/vega/p-8e31e7ea.js +1 -0
  364. package/dist/vega/{p-4a9a42e7.entry.js → p-901b20d6.entry.js} +1 -1
  365. package/dist/vega/{p-81ffd087.entry.js → p-90954fe4.entry.js} +1 -1
  366. package/dist/vega/{p-7893d070.js → p-9c0cda62.js} +1 -1
  367. package/dist/vega/{p-d516cc5d.entry.js → p-9d3292b7.entry.js} +1 -1
  368. package/dist/vega/{p-36a19c06.entry.js → p-9eab97ee.entry.js} +1 -1
  369. package/dist/vega/{p-a88c382b.entry.js → p-a0bd5bd7.entry.js} +1 -1
  370. package/dist/vega/{p-a6ef59b9.js → p-a0dab2d0.js} +1 -1
  371. package/dist/vega/{p-12e6173c.entry.js → p-a1fbf49b.entry.js} +1 -1
  372. package/dist/vega/{p-9524e48a.entry.js → p-aab6f547.entry.js} +1 -1
  373. package/dist/vega/{p-392cf0cf.entry.js → p-b264d92e.entry.js} +1 -1
  374. package/dist/vega/{p-9eed80df.entry.js → p-b51fa6ac.entry.js} +1 -1
  375. package/dist/vega/{p-43701910.entry.js → p-b7594b78.entry.js} +1 -1
  376. package/dist/vega/{p-055d7856.entry.js → p-c192c2d2.entry.js} +1 -1
  377. package/dist/vega/{p-b59c8fdf.entry.js → p-c4447540.entry.js} +1 -1
  378. package/dist/vega/{p-ad1460f2.entry.js → p-c8023434.entry.js} +1 -1
  379. package/dist/vega/{p-5fbb2aba.entry.js → p-c91190df.entry.js} +1 -1
  380. package/dist/vega/{p-99b9b320.entry.js → p-cada532e.entry.js} +1 -1
  381. package/dist/vega/{p-fba8f692.entry.js → p-d0f0a908.entry.js} +1 -1
  382. package/dist/vega/{p-5477b0ef.entry.js → p-d53b262c.entry.js} +1 -1
  383. package/dist/vega/{p-e8fc027e.entry.js → p-d9cb6ec4.entry.js} +1 -1
  384. package/dist/vega/p-e16e23b7.entry.js +1 -0
  385. package/dist/vega/{p-87a1fc77.entry.js → p-e37ac14f.entry.js} +1 -1
  386. package/dist/vega/{p-aa7037b1.entry.js → p-e5f1fd0b.entry.js} +1 -1
  387. package/dist/vega/p-e7b00bf0.js +1 -0
  388. package/dist/vega/{p-6d073cd2.entry.js → p-e81b672b.entry.js} +1 -1
  389. package/dist/vega/{p-bc8fd0ee.entry.js → p-e860318d.entry.js} +1 -1
  390. package/dist/vega/{p-0e1872b7.entry.js → p-ea723616.entry.js} +1 -1
  391. package/dist/vega/{p-1e194737.js → p-eb832119.js} +1 -1
  392. package/dist/vega/{p-30dcf606.entry.js → p-ec7d98f0.entry.js} +1 -1
  393. package/dist/vega/{p-86782109.js → p-eea36d3c.js} +1 -1
  394. package/dist/vega/{p-7703176f.entry.js → p-f0f787a2.entry.js} +1 -1
  395. package/dist/vega/p-f2f31686.entry.js +1 -0
  396. package/dist/vega/{p-fc21fb2d.entry.js → p-f41ae5e0.entry.js} +1 -1
  397. package/dist/vega/p-f4a13f3f.js +1 -0
  398. package/dist/vega/{p-0f9b3ffd.entry.js → p-f9a9fca6.entry.js} +1 -1
  399. package/dist/vega/{p-dbd2a79b.entry.js → p-fac5990f.entry.js} +1 -1
  400. package/dist/vega/{p-0228c197.entry.js → p-fd0b2509.entry.js} +1 -1
  401. package/dist/vega/{p-044f6193.js → p-fecb4044.js} +1 -1
  402. package/dist/vega/vega.esm.js +1 -1
  403. package/package.json +2 -2
  404. package/dist/vega/p-3f5bac0f.entry.js +0 -1
  405. package/dist/vega/p-66759f4e.js +0 -1
  406. package/dist/vega/p-6dc2cae8.entry.js +0 -1
  407. package/dist/vega/p-7f6d6c20.js +0 -1
  408. package/dist/vega/p-8f4e3a60.js +0 -1
  409. package/dist/vega/p-9ba14b7c.entry.js +0 -1
  410. package/dist/vega/p-ae3048da.entry.js +0 -1
  411. package/dist/vega/p-b4bfbcb9.entry.js +0 -1
  412. package/dist/vega/p-cd0575c3.entry.js +0 -1
  413. package/dist/vega/p-d2284b8a.js +0 -1
  414. package/dist/vega/p-f5a2038f.js +0 -1
  415. package/dist/vega/p-fed9220b.entry.js +0 -1
  416. /package/dist/vega/{p-eda5b7fd.js → p-05b10af4.js} +0 -0
  417. /package/dist/vega/{p-50677c8e.js → p-0c8bd757.js} +0 -0
  418. /package/dist/vega/{p-af7a3154.js → p-13effc6b.js} +0 -0
  419. /package/dist/vega/{p-ecfa7534.js → p-272440e8.js} +0 -0
  420. /package/dist/vega/{p-9b797118.js → p-519a7d55.js} +0 -0
  421. /package/dist/vega/{p-c0291e2e.js → p-834434d5.js} +0 -0
  422. /package/dist/vega/{p-bf953152.js → p-d5776087.js} +0 -0
  423. /package/dist/vega/{p-0fd6c35b.js → p-fa5eb496.js} +0 -0
@@ -1 +1 @@
1
- import{h as e,F as t,r as i,c as n,H as r,g as a}from"./p-21d26bb4.js";import{c as s,V as o,I as l}from"./p-6e1ab235.js";import{g as d,D as c}from"./p-bf953152.js";import{V as m,I as p}from"./p-4387d550.js";import{D as h}from"./p-66759f4e.js";import{b as f,a as b}from"./p-e1a2a701.js";import{s as g}from"./p-9b797118.js";import{C as x}from"./p-419697c6.js";import{c as v}from"./p-86782109.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-020b04ed.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-6a334573.js";var u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class w extends o{constructor(){super(...arguments),this.isMobile=d()===c.MOBILE}getBreadcrumbContainerRef(){return this.vegaBreadcrumbContainerRef}render(){return e("div",{class:{"vega-breadcrumb":!0,mobile:this.isMobile,collapsed:this.isCollapsed(),single:1==this.items.length},ref:e=>this.vegaBreadcrumbContainerRef=e},this.renderItems())}renderItems(){const i=this.items.map(((e,t)=>this.itemRenderer.render(e,{isMobile:this.isMobile,isLastItem:this.items.length===t+1})));return this.isCollapsed()&&i.splice(1,0,this.collapsedItemRenderer.render(this.items.slice(1,this.items.length-1))),e(t,null,i)}isCollapsed(){return!this.isMobile&&"none"!==this.maxItems&&this.maxItems>=4&&this.items.length>this.maxItems}}u([s()],w.prototype,"items",void 0),u([s()],w.prototype,"maxItems",void 0),u([s()],w.prototype,"itemRenderer",void 0),u([s()],w.prototype,"collapsedItemRenderer",void 0);class y extends o{render(t){const i=t.map((e=>({label:e.label,key:e.label})));return e("div",{class:"vega-breadcrumb-item"},e("vega-dropdown",{source:i,placement:["bottom"],alignment:"center",maxHeight:200,ref:e=>{h.addUniqueObserverToNode(e,f,(e=>{this.clickController.dropdownClick(e.detail)}))}},e("vega-text",null,"...")),e("vega-icon",{icon:"chevron-right-rounded",size:"size-12",color:"text-secondary"}))}}!function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);a>3&&s&&Object.defineProperty(t,i,s)}([s()],y.prototype,"clickController",void 0);class j extends o{render(t,i){return e("div",{class:"vega-breadcrumb-item",key:t.label},this.renderContent(t,i))}renderContent(i,n){return n.isMobile&&!n.isLastItem?e(t,null,this.renderIcon("chevron-left-rounded","text-link"),this.renderLabel(i)):n.isLastItem?this.renderLabel(i,!0):e(t,null,this.renderLabel(i),this.renderIcon("chevron-right-rounded","text-secondary"))}renderIcon(t,i){return e("vega-icon",{icon:t,size:"size-12",color:i})}renderLabel(t,i){return t.tooltip?e("vega-tooltip",{text:t.tooltip,placement:["bottom"]},this.renderLink(t,i)):this.renderLink(t,i)}renderLink(t,i){return i?e("span",{class:"vega-breadcrumb-last-label"},t.label):e("vega-button-link",{label:t.label,ref:e=>{h.addUniqueObserverToNode(e,b,(()=>{this.clickController.click(t)}))}})}}!function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);a>3&&s&&Object.defineProperty(t,i,s)}([s()],j.prototype,"clickController",void 0);var I=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class k extends o{click(e){const t=this.clickEventEmitter.emit(e);t&&!t.defaultPrevented&&e.href&&(window.location.href=e.href)}dropdownClick(e){const t=this.items.find((t=>t.label===e));t&&this.click(t)}}I([s()],k.prototype,"items",void 0),I([s()],k.prototype,"clickEventEmitter",void 0);var R=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const z=class{constructor(e){i(this,e),this.vegaClick=n(this,"vegaClick",7),this.click=n(this,"click",7),this.globalSlimmers={},this.renderer=new w,this.collapsedItemRenderer=new y,this.itemRenderer=new j,this.clickController=new k,this.eventsPrevent=new x([b],(()=>this.renderer.getBreadcrumbContainerRef())),this.clickEventEmitter=v(z,b),this.vegaComponentUsageRuntimeMetricsSlimmer=new m,this.maxItems=4,this.items=[]}render(){return g(e(r,null,this.renderer.render()),this.host)}get host(){return a(this)}};R([p()],z.prototype,"globalSlimmers",void 0),R([l()],z.prototype,"renderer",void 0),R([l()],z.prototype,"collapsedItemRenderer",void 0),R([l()],z.prototype,"itemRenderer",void 0),R([l()],z.prototype,"clickController",void 0),R([l()],z.prototype,"eventsPrevent",void 0),R([l()],z.prototype,"clickEventEmitter",void 0),R([l()],z.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),z.style=':host{display:block}:host .vega-breadcrumb{display:flex;gap:8px;flex-wrap:wrap}:host .vega-breadcrumb-hidden{display:none !important}:host .vega-breadcrumb-item{display:flex;gap:8px;align-items:center}:host .vega-breadcrumb-item vega-button-link::part(label-text){font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb-item vega-button-link::part(label-text){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-breadcrumb-item vega-button-link::part(label-text){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-breadcrumb-item vega-button-link::part(label-text){font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb-item vega-dropdown vega-text{cursor:pointer;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb-item vega-dropdown vega-text{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-breadcrumb-item vega-dropdown vega-text{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-breadcrumb-item vega-dropdown vega-text{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb-item vega-icon{flex-shrink:0}:host .vega-breadcrumb-item .vega-breadcrumb-last-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb-item .vega-breadcrumb-last-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-breadcrumb-item .vega-breadcrumb-last-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-breadcrumb-item .vega-breadcrumb-last-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb-item vega-button-link::part(label-container){text-decoration:none}:host .vega-breadcrumb.mobile>.vega-breadcrumb-item{display:none}:host .vega-breadcrumb.mobile .vega-breadcrumb-item:nth-last-child(2){display:flex}:host .vega-breadcrumb.mobile.single .vega-breadcrumb-item{display:flex;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb.mobile.single .vega-breadcrumb-item{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-breadcrumb.mobile.single .vega-breadcrumb-item{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-breadcrumb.mobile.single .vega-breadcrumb-item{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb.collapsed .vega-breadcrumb-item:nth-child(n+3):not(:last-child){display:none}';export{z as vega_breadcrumb}
1
+ import{h as e,F as t,r as i,c as n,H as r,g as a}from"./p-21d26bb4.js";import{c as s,V as o,I as l}from"./p-6e1ab235.js";import{g as d,D as c}from"./p-d5776087.js";import{V as m,I as p}from"./p-4387d550.js";import{D as h}from"./p-e7b00bf0.js";import{b as f,a as b}from"./p-6e01f0a2.js";import{s as g}from"./p-519a7d55.js";import{C as x}from"./p-6b7dca3e.js";import{c as v}from"./p-eea36d3c.js";import"./p-2d0d575f.js";import"./p-331a62d5.js";import"./p-613ee009.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-6a334573.js";var u=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class w extends o{constructor(){super(...arguments),this.isMobile=d()===c.MOBILE}getBreadcrumbContainerRef(){return this.vegaBreadcrumbContainerRef}render(){return e("div",{class:{"vega-breadcrumb":!0,mobile:this.isMobile,collapsed:this.isCollapsed(),single:1==this.items.length},ref:e=>this.vegaBreadcrumbContainerRef=e},this.renderItems())}renderItems(){const i=this.items.map(((e,t)=>this.itemRenderer.render(e,{isMobile:this.isMobile,isLastItem:this.items.length===t+1})));return this.isCollapsed()&&i.splice(1,0,this.collapsedItemRenderer.render(this.items.slice(1,this.items.length-1))),e(t,null,i)}isCollapsed(){return!this.isMobile&&"none"!==this.maxItems&&this.maxItems>=4&&this.items.length>this.maxItems}}u([s()],w.prototype,"items",void 0),u([s()],w.prototype,"maxItems",void 0),u([s()],w.prototype,"itemRenderer",void 0),u([s()],w.prototype,"collapsedItemRenderer",void 0);class y extends o{render(t){const i=t.map((e=>({label:e.label,key:e.label})));return e("div",{class:"vega-breadcrumb-item"},e("vega-dropdown",{source:i,placement:["bottom"],alignment:"center",maxHeight:200,ref:e=>{h.addUniqueObserverToNode(e,f,(e=>{this.clickController.dropdownClick(e.detail)}))}},e("vega-text",null,"...")),e("vega-icon",{icon:"chevron-right-rounded",size:"size-12",color:"text-secondary"}))}}!function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);a>3&&s&&Object.defineProperty(t,i,s)}([s()],y.prototype,"clickController",void 0);class j extends o{render(t,i){return e("div",{class:"vega-breadcrumb-item",key:t.label},this.renderContent(t,i))}renderContent(i,n){return n.isMobile&&!n.isLastItem?e(t,null,this.renderIcon("chevron-left-rounded","text-link"),this.renderLabel(i)):n.isLastItem?this.renderLabel(i,!0):e(t,null,this.renderLabel(i),this.renderIcon("chevron-right-rounded","text-secondary"))}renderIcon(t,i){return e("vega-icon",{icon:t,size:"size-12",color:i})}renderLabel(t,i){return t.tooltip?e("vega-tooltip",{text:t.tooltip,placement:["bottom"]},this.renderLink(t,i)):this.renderLink(t,i)}renderLink(t,i){return i?e("span",{class:"vega-breadcrumb-last-label"},t.label):e("vega-button-link",{label:t.label,ref:e=>{h.addUniqueObserverToNode(e,b,(()=>{this.clickController.click(t)}))}})}}!function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);a>3&&s&&Object.defineProperty(t,i,s)}([s()],j.prototype,"clickController",void 0);var I=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};class k extends o{click(e){const t=this.clickEventEmitter.emit(e);t&&!t.defaultPrevented&&e.href&&(window.location.href=e.href)}dropdownClick(e){const t=this.items.find((t=>t.label===e));t&&this.click(t)}}I([s()],k.prototype,"items",void 0),I([s()],k.prototype,"clickEventEmitter",void 0);var R=function(e,t,i,n){var r,a=arguments.length,s=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,n);else for(var o=e.length-1;o>=0;o--)(r=e[o])&&(s=(a<3?r(s):a>3?r(t,i,s):r(t,i))||s);return a>3&&s&&Object.defineProperty(t,i,s),s};const z=class{constructor(e){i(this,e),this.vegaClick=n(this,"vegaClick",7),this.click=n(this,"click",7),this.globalSlimmers={},this.renderer=new w,this.collapsedItemRenderer=new y,this.itemRenderer=new j,this.clickController=new k,this.eventsPrevent=new x([b],(()=>this.renderer.getBreadcrumbContainerRef())),this.clickEventEmitter=v(z,b),this.vegaComponentUsageRuntimeMetricsSlimmer=new m,this.maxItems=4,this.items=[]}render(){return g(e(r,null,this.renderer.render()),this.host)}get host(){return a(this)}};R([p()],z.prototype,"globalSlimmers",void 0),R([l()],z.prototype,"renderer",void 0),R([l()],z.prototype,"collapsedItemRenderer",void 0),R([l()],z.prototype,"itemRenderer",void 0),R([l()],z.prototype,"clickController",void 0),R([l()],z.prototype,"eventsPrevent",void 0),R([l()],z.prototype,"clickEventEmitter",void 0),R([l()],z.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),z.style=':host{display:block}:host .vega-breadcrumb{display:flex;gap:8px;flex-wrap:wrap}:host .vega-breadcrumb-hidden{display:none !important}:host .vega-breadcrumb-item{display:flex;gap:8px;align-items:center}:host .vega-breadcrumb-item vega-button-link::part(label-text){font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb-item vega-button-link::part(label-text){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-breadcrumb-item vega-button-link::part(label-text){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-breadcrumb-item vega-button-link::part(label-text){font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb-item vega-dropdown vega-text{cursor:pointer;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-link, 19, 98, 226, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb-item vega-dropdown vega-text{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-breadcrumb-item vega-dropdown vega-text{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-breadcrumb-item vega-dropdown vega-text{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb-item vega-icon{flex-shrink:0}:host .vega-breadcrumb-item .vega-breadcrumb-last-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb-item .vega-breadcrumb-last-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-breadcrumb-item .vega-breadcrumb-last-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-breadcrumb-item .vega-breadcrumb-last-label{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb-item vega-button-link::part(label-container){text-decoration:none}:host .vega-breadcrumb.mobile>.vega-breadcrumb-item{display:none}:host .vega-breadcrumb.mobile .vega-breadcrumb-item:nth-last-child(2){display:flex}:host .vega-breadcrumb.mobile.single .vega-breadcrumb-item{display:flex;font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px;color:rgba(var(--v-text-primary, 32, 54, 69, 1))}@media screen and (min-width: 768px) and (max-width: 1023px){:host .vega-breadcrumb.mobile.single .vega-breadcrumb-item{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-breadcrumb.mobile.single .vega-breadcrumb-item{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-breadcrumb.mobile.single .vega-breadcrumb-item{font-family:"Inter", sans-serif;font-size:16px;font-weight:500;line-height:22px;letter-spacing:0px}}:host .vega-breadcrumb.collapsed .vega-breadcrumb-item:nth-child(n+3):not(:last-child){display:none}';export{z as vega_breadcrumb}
@@ -1 +1 @@
1
- import{M as t,V as e,L as s,c as i}from"./p-6e1ab235.js";import{d as n}from"./p-1bc5b3bc.js";import{v as o,w as h,a as r,G as a,g as c,Z as f,D as d,z as l,u}from"./p-05373557.js";import{g as p}from"./p-9b797118.js";import{C as g}from"./p-2d0d575f.js";import{d as m}from"./p-e1a2a701.js";import{b as w}from"./p-425ba7d6.js";import{O}from"./p-331a62d5.js";import{f as R}from"./p-bf953152.js";import{S as b}from"./p-1fb56e14.js";let v=!1;class C{constructor(){this.rangeCount=0,this.ranges=[]}getRangeAt(t){return this.ranges[t]}addRange(t){if(this.ranges.push(t),this.rangeCount=this.ranges.length,!v){const e=window.getSelection();e.removeAllRanges(),e.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}}removeAllRanges(){this.ranges=[],this.rangeCount=0}}const N=new class{constructor(){this.supportShadowSelection="function"==typeof window.ShadowRoot.prototype.getSelection,this.supportBeforeInput="function"==typeof window.InputEvent.prototype.getTargetRanges,this.isFirefox=window.navigator.userAgent.toLowerCase().indexOf("firefox")>0,this.listen()}getSelection(t){return this.supportShadowSelection?t.getSelection():this.isFirefox?this.getFirefoxSelection():this.polyfilledShadowSelection}getFirefoxSelection(){const t=document.getSelection(),e=t.getRangeAt(0),s=e.startContainer,i=e.endContainer;if(s!==i&&s.textContent.length===e.startOffset){const t=s.nodeType===Node.TEXT_NODE?s.parentNode.nextSibling:s.nextSibling;e.setStart(t.firstChild,0)}if(i!==s&&0===e.endOffset){const t=i.nodeType===Node.TEXT_NODE?i.parentNode.previousSibling:i.previousSibling;e.setEnd(t.lastChild,t.lastChild.textContent.length)}return t}listen(){this.isFirefox||this.supportShadowSelection||!this.supportBeforeInput||(this.polyfilledShadowSelection=new C,window.addEventListener("selectionchange",(()=>{if(!v){v=!0;const t=p();t&&t.hasAttribute("contenteditable")?document.execCommand("indent"):this.polyfilledShadowSelection.removeAllRanges(),v=!1}}),!0),window.addEventListener("beforeinput",(t=>{if(v){const e=t.getTargetRanges()[0],s=new Range;s.setStart(e.startContainer,e.startOffset),s.setEnd(e.endContainer,e.endOffset),this.polyfilledShadowSelection.removeAllRanges(),this.polyfilledShadowSelection.addRange(s),t.preventDefault(),t.stopImmediatePropagation()}}),!0))}};class S extends e{constructor(t){super(),this.autoRunTaskQueue=new b(t)}async executeTaskHook(){this.autoRunTaskQueue.queue.length&&await this.autoRunTaskQueue.runTask()}enqueueTheTaskIntoQueue(t=!1){this.autoRunTaskQueue.enqueue({run:async()=>{try{await this.doTask()}catch(t){s.error("The auto task run failed.",t)}}},t)}}!function(t,e,s,i){var n,o=arguments.length,h=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(e,s,h):n(e,s))||h);o>3&&h&&Object.defineProperty(e,s,h)}([t("componentDidUpdate")],S.prototype,"executeTaskHook",null);class j{constructor(t,e,s=0,i=0,n,o,h){this._startOffset=0,this._endOffset=0,this._startContainer=t,this._endContainer=e,this._startOffset=s,this._endOffset=i,this._startNode=n,this._endNode=o,h&&(this._oldNativeRange=h)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(t,e){const{startOffset:s,endOffset:i}=t;this._startOffset=s,this._endOffset=i;const n=t.startNode,h=t.endNode;if(n instanceof o){this._startNode=n,this._endNode=h;const t=this.getElementByRTENode(this._startNode),e=this._startNode===this._endNode?t:this.getElementByRTENode(this._endNode);t&&(this._startContainer=t,this._endContainer=e)}else this._startContainer=n,this._endContainer=h,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),e&&(this._oldNativeRange=e);return new j(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new j(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){const t=this.getElementByRTENode(this._startNode),e=this._startNode===this._endNode?t:this.getElementByRTENode(this._endNode),s=new Range;return t&&e?(s.setStart(t,this._startOffset),s.setEnd(e,this._endOffset),this._startContainer=t,this._endContainer=e,this._oldNativeRange=s,s):this._oldNativeRange?this._oldNativeRange:void 0}getElementByRTENode(t){if(t){const e=h.getDOMByEntity(t);if(e)return t instanceof r?R(e,"vega-rich-text-image-editor"):e.firstChild}}getRTENodeByElement(t){if(t){const e=t.nodeType===Node.TEXT_NODE?t.parentElement:"VEGA-RICH-TEXT-IMAGE-EDITOR"===t.nodeName?t.querySelector("img"):t;return h.getEntityByDOM(e)}}}class E{constructor(t){this.range=t}clone(){const t=this.range.clone();return new E(t)}}var T=function(t,e,s,i){var n,o=arguments.length,h=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(e,s,h):n(e,s))||h);return o>3&&h&&Object.defineProperty(e,s,h),h};class y extends S{constructor(){super(1),this.currentRange=new j,this.handleSelectionWithDebounce=n(this.handleSelectionChange,y.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.pendingRestoreSelectionNodes=[],this.doTask=async()=>{await Promise.resolve();const t=this.currentRange.toNativeRange();t&&this.setSelectionRange(t)}}connectedCallback(){this.registerSelectionRangeChangeObserver()}disconnectedCallback(){g.unregister(m.getSubject(this.host,w),this.selectionRangeChangeObserver)}componentDidLoad(){document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}watchValueUpdate(){this.prepareRestoreSelectionState(),this.restoreSelection()}getCurrentRange(){return this.currentRange}getSelectedNodes(){return Array.from(this.selectionMap.values()).flat()}getSelectedBlocks(){return Array.from(this.selectionMap.keys())}setSelectionState(t){this.selectionState=t}enqueueSelectionRangeFutureState(t,e,s,i,n=!1){t instanceof a?this.internalCodeBlockSelectionController.enqueueSelectionRangeFutureState(t,e,n):(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:s=s||t,startOffset:e,endOffset:i=i||0===i?i:e}),super.enqueueTheTaskIntoQueue(n))}setSelectionRange(t){const e=this.getSelection();e&&(e.removeAllRanges(),e.addRange(t),this.saveSelection())}getSelection(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();return N.getSelection(t.shadowRoot)}saveSelection(){const t=this.getSelection();if(t&&t.rangeCount>0&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:s,endContainer:i,startOffset:n,endOffset:o}=e;this.currentRange=this.currentRange.updateRTERange({startNode:s,endNode:i,startOffset:n,endOffset:o},e)}}restoreSelection(){if(this.selectionState){const{startNode:t,endNode:e,startOffset:s,endOffset:i}=this.selectionState.range;t instanceof c&&t===e&&0===t.text.length?this.enqueueSelectionRangeFutureState(t,f.length):this.enqueueSelectionRangeFutureState(t,s,e,i),this.selectionState=null}}handleSelectionChange(){if(this.disabled)return;const t=this.getSelection();if(!t||0===t.rangeCount)return;this.clearSelectionMap(),this.saveSelection();const e=t.getRangeAt(0),s=[],i=t=>{if(e.intersectsNode(t)){if(t.nodeType===Node.TEXT_NODE){const e=h.getEntityByDOM(t.parentElement);if(e instanceof o)return void s.push(e)}if(t.nodeType===Node.ELEMENT_NODE){const i="VEGA-RICH-TEXT-IMAGE-EDITOR"===t.nodeName?t.querySelector("img"):t,n=h.getEntityByDOM(i);if(n instanceof u)return void(this.internalCodeBlockSelectionController.isCodeBlockSelected(n,e)&&s.push(n.nodes[0]));if(n instanceof o)return void s.push(n)}t.childNodes.forEach(i)}};i(e.commonAncestorContainer),s.forEach((t=>{this.selectionMap.has(t.parentBlock)?this.selectionMap.get(t.parentBlock).push(t):this.selectionMap.set(t.parentBlock,[t])})),this.getSelectedNodes().forEach((t=>t.apply(new d(e))))}clearSelectionMap(){this.getSelectedNodes().filter((t=>"CODE_BLOCK_NODE"!==t.type)).forEach((t=>{t.annotationMap.delete(l.SELECTION_RANGE)})),this.selectionMap=new Map}isAcceptableSelectionRangeChange(){return!0}registerSelectionRangeChangeObserver(){this.selectionRangeChangeObserver=new O(this.isAcceptableSelectionRangeChange.bind(this),(t=>{t.updateDirectly?this.enqueueSelectionRangeFutureState(t.node,t.offset):this.pendingRestoreSelectionNodes.push(t.node)})),g.register(m.getSubject(this.host,w),this.selectionRangeChangeObserver)}prepareRestoreSelectionState(){if(this.pendingRestoreSelectionNodes.length>0){const t=this.pendingRestoreSelectionNodes[0],e=this.pendingRestoreSelectionNodes.length>1?this.pendingRestoreSelectionNodes[this.pendingRestoreSelectionNodes.length-1]:t,{startOffset:s,endOffset:i,endContainer:n,startContainer:o}=this.currentRange;o&&h.getDOMByEntity(t)===o.parentElement&&n&&h.getDOMByEntity(e)===n.parentElement?(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:e,startOffset:s,endOffset:i}),this.selectionState=new E(this.currentRange)):(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:e,startOffset:0,endOffset:e.text.length}),this.selectionState=new E(this.currentRange)),this.pendingRestoreSelectionNodes=[]}}}y.SELECTION_CHANGE_DEBOUNCE_TIME=50,T([i()],y.prototype,"vegaRichTextEditorRenderer",void 0),T([i({writable:!0})],y.prototype,"selectionMap",void 0),T([i()],y.prototype,"host",void 0),T([i()],y.prototype,"value",void 0),T([i()],y.prototype,"disabled",void 0),T([i()],y.prototype,"valueController",void 0),T([i()],y.prototype,"insertCompositionTextController",void 0),T([i()],y.prototype,"historyController",void 0),T([i()],y.prototype,"internalCodeBlockSelectionController",void 0),T([t("connectedCallback")],y.prototype,"connectedCallback",null),T([t("disconnectedCallback")],y.prototype,"disconnectedCallback",null),T([t("componentDidLoad")],y.prototype,"componentDidLoad",null),T([t("watchValueUpdate")],y.prototype,"watchValueUpdate",null);export{S as A,E as R,N as S,y as a}
1
+ import{M as t,V as e,L as s,c as i}from"./p-6e1ab235.js";import{d as n}from"./p-1bc5b3bc.js";import{v as o,w as h,a as r,G as a,g as c,Z as d,D as f,z as l,u}from"./p-3eb2d433.js";import{g as p}from"./p-519a7d55.js";import{C as g}from"./p-2d0d575f.js";import{d as m}from"./p-6e01f0a2.js";import{b as w}from"./p-425ba7d6.js";import{O}from"./p-331a62d5.js";import{f as R}from"./p-d5776087.js";import{S as v}from"./p-1fb56e14.js";let C=!1;class b{constructor(){this.rangeCount=0,this.ranges=[]}getRangeAt(t){return this.ranges[t]}addRange(t){if(this.ranges.push(t),this.rangeCount=this.ranges.length,!C){const e=window.getSelection();e.removeAllRanges(),e.setBaseAndExtent(t.startContainer,t.startOffset,t.endContainer,t.endOffset)}}removeAllRanges(){this.ranges=[],this.rangeCount=0}}const N=new class{constructor(){this.supportShadowSelection="function"==typeof window.ShadowRoot.prototype.getSelection,this.supportBeforeInput="function"==typeof window.InputEvent.prototype.getTargetRanges,this.isFirefox=window.navigator.userAgent.toLowerCase().indexOf("firefox")>0,this.listen()}getSelection(t){return this.supportShadowSelection?t.getSelection():this.isFirefox?this.getFirefoxSelection():this.polyfilledShadowSelection}getFirefoxSelection(){const t=document.getSelection(),e=t.getRangeAt(0),s=e.startContainer,i=e.endContainer;if(s!==i&&s.textContent.length===e.startOffset){const t=s.nodeType===Node.TEXT_NODE?s.parentNode.nextSibling:s.nextSibling;e.setStart(t.firstChild,0)}if(i!==s&&0===e.endOffset){const t=i.nodeType===Node.TEXT_NODE?i.parentNode.previousSibling:i.previousSibling;e.setEnd(t.lastChild,t.lastChild.textContent.length)}return t}listen(){this.isFirefox||this.supportShadowSelection||!this.supportBeforeInput||(this.polyfilledShadowSelection=new b,window.addEventListener("selectionchange",(()=>{if(!C){C=!0;const t=p();t&&t.hasAttribute("contenteditable")?document.execCommand("indent"):this.polyfilledShadowSelection.removeAllRanges(),C=!1}}),!0),window.addEventListener("beforeinput",(t=>{if(C){const e=t.getTargetRanges()[0],s=new Range;s.setStart(e.startContainer,e.startOffset),s.setEnd(e.endContainer,e.endOffset),this.polyfilledShadowSelection.removeAllRanges(),this.polyfilledShadowSelection.addRange(s),t.preventDefault(),t.stopImmediatePropagation()}}),!0))}};class S extends e{constructor(t){super(),this.autoRunTaskQueue=new v(t)}async executeTaskHook(){this.autoRunTaskQueue.queue.length&&await this.autoRunTaskQueue.runTask()}enqueueTheTaskIntoQueue(t=!1){this.autoRunTaskQueue.enqueue({run:async()=>{try{await this.doTask()}catch(t){s.error("The auto task run failed.",t)}}},t)}}!function(t,e,s,i){var n,o=arguments.length,h=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(e,s,h):n(e,s))||h);o>3&&h&&Object.defineProperty(e,s,h)}([t("componentDidUpdate")],S.prototype,"executeTaskHook",null);class j{constructor(t,e,s=0,i=0,n,o,h){this._startOffset=0,this._endOffset=0,this._startContainer=t,this._endContainer=e,this._startOffset=s,this._endOffset=i,this._startNode=n,this._endNode=o,h&&(this._oldNativeRange=h)}get startContainer(){return this._startContainer}get endContainer(){return this._endContainer}get startNode(){return this._startNode}get endNode(){return this._endNode}get startOffset(){return this._startOffset}get endOffset(){return this._endOffset}updateRTERange(t,e){const{startOffset:s,endOffset:i}=t;this._startOffset=s,this._endOffset=i;const n=t.startNode,h=t.endNode;if(n instanceof o){this._startNode=n,this._endNode=h;const t=this.getElementByRTENode(this._startNode),e=this._startNode===this._endNode?t:this.getElementByRTENode(this._endNode);t&&(this._startContainer=t,this._endContainer=e)}else this._startContainer=n,this._endContainer=h,this._startNode=this.getRTENodeByElement(this._startContainer),this._endNode=this._startContainer===this._endContainer?this._startNode:this.getRTENodeByElement(this._endContainer),e&&(this._oldNativeRange=e);return new j(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}clone(){return new j(this._startContainer,this._endContainer,this._startOffset,this._endOffset,this._startNode,this._endNode,this._oldNativeRange)}toNativeRange(){const t=this.getElementByRTENode(this._startNode),e=this._startNode===this._endNode?t:this.getElementByRTENode(this._endNode),s=new Range;return t&&e?(s.setStart(t,this._startOffset),s.setEnd(e,this._endOffset),this._startContainer=t,this._endContainer=e,this._oldNativeRange=s,s):this._oldNativeRange?this._oldNativeRange:void 0}getElementByRTENode(t){if(t){const e=h.getDOMByEntity(t);if(e)return t instanceof r?R(e,"vega-rich-text-image-editor"):e.firstChild}}getRTENodeByElement(t){if(t){const e=t.nodeType===Node.TEXT_NODE?t.parentElement:"VEGA-RICH-TEXT-IMAGE-EDITOR"===t.nodeName?t.querySelector("img"):t;return h.getEntityByDOM(e)}}}class E{constructor(t){this.range=t}clone(){const t=this.range.clone();return new E(t)}}var T=function(t,e,s,i){var n,o=arguments.length,h=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)h=Reflect.decorate(t,e,s,i);else for(var r=t.length-1;r>=0;r--)(n=t[r])&&(h=(o<3?n(h):o>3?n(e,s,h):n(e,s))||h);return o>3&&h&&Object.defineProperty(e,s,h),h};class y extends S{constructor(){super(1),this.currentRange=new j,this.handleSelectionWithDebounce=n(this.handleSelectionChange,y.SELECTION_CHANGE_DEBOUNCE_TIME,this),this.pendingRestoreSelectionNodes=[],this.doTask=async()=>{await Promise.resolve();const t=this.currentRange.toNativeRange();t&&this.setSelectionRange(t)}}connectedCallback(){this.registerSelectionRangeChangeObserver()}disconnectedCallback(){g.unregister(m.getSubject(this.host,w),this.selectionRangeChangeObserver)}componentDidLoad(){document.addEventListener("selectionchange",this.handleSelectionWithDebounce)}watchValueUpdate(){this.prepareRestoreSelectionState(),this.restoreSelection()}getCurrentRange(){return this.currentRange}getSelectedNodes(){return Array.from(this.selectionMap.values()).flat()}getSelectedBlocks(){return Array.from(this.selectionMap.keys())}setSelectionState(t){this.selectionState=t}enqueueSelectionRangeFutureState(t,e,s,i,n=!1){t instanceof a?this.internalCodeBlockSelectionController.enqueueSelectionRangeFutureState(t,e,n):(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:s=s||t,startOffset:e,endOffset:i=i||0===i?i:e}),super.enqueueTheTaskIntoQueue(n))}setSelectionRange(t){const e=this.getSelection();e&&(e.removeAllRanges(),e.addRange(t),this.saveSelection())}getSelection(){const t=this.vegaRichTextEditorRenderer.getRichTextContentRef();return N.getSelection(t.shadowRoot)}saveSelection(){const t=this.getSelection();if(t&&t.rangeCount>0&&0===this.autoRunTaskQueue.queue.length&&!this.insertCompositionTextController.isComposing()){const e=t.getRangeAt(0),{startContainer:s,endContainer:i,startOffset:n,endOffset:o}=e;this.currentRange=this.currentRange.updateRTERange({startNode:s,endNode:i,startOffset:n,endOffset:o},e)}}restoreSelection(){if(this.selectionState){const{startNode:t,endNode:e,startOffset:s,endOffset:i}=this.selectionState.range;t instanceof c&&t===e&&0===t.text.length?this.enqueueSelectionRangeFutureState(t,d.length):this.enqueueSelectionRangeFutureState(t,s,e,i),this.selectionState=null}}handleSelectionChange(){if(this.disabled)return;const t=this.getSelection();if(!t||0===t.rangeCount)return;this.clearSelectionMap(),this.saveSelection();const e=t.getRangeAt(0),s=[],i=t=>{if(e.intersectsNode(t)){if(t.nodeType===Node.TEXT_NODE){const e=h.getEntityByDOM(t.parentElement);if(e instanceof o)return void s.push(e)}if(t.nodeType===Node.ELEMENT_NODE){const i="VEGA-RICH-TEXT-IMAGE-EDITOR"===t.nodeName?t.querySelector("img"):t,n=h.getEntityByDOM(i);if(n instanceof u)return void(this.internalCodeBlockSelectionController.isCodeBlockSelected(n,e)&&s.push(n.nodes[0]));if(n instanceof o)return void s.push(n)}t.childNodes.forEach(i)}};i(e.commonAncestorContainer),s.forEach((t=>{this.selectionMap.has(t.parentBlock)?this.selectionMap.get(t.parentBlock).push(t):this.selectionMap.set(t.parentBlock,[t])})),this.getSelectedNodes().forEach((t=>t.apply(new f(e))))}clearSelectionMap(){this.getSelectedNodes().filter((t=>"CODE_BLOCK_NODE"!==t.type)).forEach((t=>{t.annotationMap.delete(l.SELECTION_RANGE)})),this.selectionMap=new Map}isAcceptableSelectionRangeChange(){return!0}registerSelectionRangeChangeObserver(){this.selectionRangeChangeObserver=new O(this.isAcceptableSelectionRangeChange.bind(this),(t=>{t.updateDirectly?this.enqueueSelectionRangeFutureState(t.node,t.offset):this.pendingRestoreSelectionNodes.push(t.node)})),g.register(m.getSubject(this.host,w),this.selectionRangeChangeObserver)}prepareRestoreSelectionState(){if(this.pendingRestoreSelectionNodes.length>0){const t=this.pendingRestoreSelectionNodes[0],e=this.pendingRestoreSelectionNodes.length>1?this.pendingRestoreSelectionNodes[this.pendingRestoreSelectionNodes.length-1]:t,{startOffset:s,endOffset:i,endContainer:n,startContainer:o}=this.currentRange;o&&h.getDOMByEntity(t)===o.parentElement&&n&&h.getDOMByEntity(e)===n.parentElement?(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:e,startOffset:s,endOffset:i}),this.selectionState=new E(this.currentRange)):(this.currentRange=this.currentRange.updateRTERange({startNode:t,endNode:e,startOffset:0,endOffset:e.text.length}),this.selectionState=new E(this.currentRange)),this.pendingRestoreSelectionNodes=[]}}}y.SELECTION_CHANGE_DEBOUNCE_TIME=50,T([i()],y.prototype,"vegaRichTextEditorRenderer",void 0),T([i({writable:!0})],y.prototype,"selectionMap",void 0),T([i()],y.prototype,"host",void 0),T([i()],y.prototype,"value",void 0),T([i()],y.prototype,"disabled",void 0),T([i()],y.prototype,"valueController",void 0),T([i()],y.prototype,"insertCompositionTextController",void 0),T([i()],y.prototype,"historyController",void 0),T([i()],y.prototype,"internalCodeBlockSelectionController",void 0),T([t("connectedCallback")],y.prototype,"connectedCallback",null),T([t("disconnectedCallback")],y.prototype,"disconnectedCallback",null),T([t("componentDidLoad")],y.prototype,"componentDidLoad",null),T([t("watchValueUpdate")],y.prototype,"watchValueUpdate",null);export{S as A,E as R,N as S,y as a}
@@ -1 +1 @@
1
- import{i as t}from"./p-b1f65b13.js";import{C as e}from"./p-2d0d575f.js";import{d as s}from"./p-e1a2a701.js";import{a as n,b as i}from"./p-425ba7d6.js";import{L as r}from"./p-6e1ab235.js";import{g as o}from"./p-37b05e0b.js";import{V as c}from"./p-50677c8e.js";var a,h;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(a||(a={}));class l{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT"}(h||(h={}));class u extends l{}const d=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap}register(t,e){this.domToEntity.set(t,e),this.entityToDOM.set(e,t)}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}};var p,f,w;!function(t){t.DELETE_CHILD="DELETE_CHILD",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILD_NODES="APPEND_CHILD_NODES",t.INSERT_BLOCKS_AFTER="INSERT_BLOCKS_AFTER",t.INSERT_BLOCKS_BEFORE="INSERT_BLOCKS_BEFORE",t.INSERT_NODES_AFTER="INSERT_NODES_AFTER",t.INSERT_NODES_BEFORE="INSERT_NODES_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.BREAK_SINGLE_BLOCK="BREAK_SINGLE_BLOCK",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK"}(p||(p={}));class x{constructor(){this.isFlushable=!1}}class A extends u{constructor(t){super(),this.type=h.ALIGNMENT,this.textAlign=t}static from(t){return[h.ALIGNMENT,new A(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(){return`v-rte--horizontal-alignment-${this.textAlign}`}clone(){return new A(this.textAlign)}render(){return null}}class E extends u{constructor(t){super(),this.type=h.INDENT,this.indent=Math.max(0,t)}static from(t){return[h.INDENT,new E(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new E(this.indent)}render(){return this.indent>0?{"margin-left":16*this.indent+"px"}:null}}class g{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=t instanceof x?t.type:t.constructor.name,n=g.get(s,e.constructor.name);if(n)return n.execute(t,e);r.error(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)}}g.registry=new Map;class O{constructor(t){this.annotationMap=new Map,this.id=t}static createAnnotationEntity(t,e){switch(t){case"textAlign":return A.from(e);case"indent":return E.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof u)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(t){if(this.doApply(t),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}doApply(t){t instanceof x?g.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(f||(f={}));class N{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}doApply(t){t instanceof x?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK"}(w||(w={}));class y extends l{}class S extends y{constructor(t="md",e){super(),this.type=w.IMAGE,this.size=t,this.alt=e}static from(t,e){return[w.IMAGE,new S(t,e)]}toJSON(){return t(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new S(this.size,this.alt)}render(){switch(this.size){case"sm":return{width:"25%"};case"md":return{width:"50%"};case"lg":return{width:"100%"}}}}class T{execute(t,e){return r.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.nodes[t.nodes.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtTextBlockStart(t,e,s){return e===t.nodes[0]&&0===s}isCaretPositionAtImageBlockStart(t,e,s){return e===t.nodes[0]&&0===s}isCaretPositionAtImageBlockEnd(t,e,s){return e===t.nodes[t.nodes.length-1]&&1===s}}class m{}class _ extends N{constructor(t,e,s,n){super(t,n),this.type=f.IMAGE,this.url=e,this.parentBlock=s}static from(e,s){const n=new _(e.id,e.url,s);let i;return i=e.annotations&&0!==Object.keys(e.annotations).length?e.annotations:{size:"md"},n.annotationMap=new Map(Object.keys(i).map((()=>S.from(i.size,i.alt))).filter(t)),n}toJSON(){const t=this.annotationMap.get(w.IMAGE),e={};return(null==t?void 0:t.size)&&(e.size=t.size),(null==t?void 0:t.alt)&&(e.alt=t.alt),Object.assign(Object.assign({id:this.id},Object.keys(e).length>0?{annotations:e}:{}),{type:"image",url:this.url})}clone(){return new _(this.id,this.url,this.parentBlock,super.cloneAnnotations())}doAnnotationActionApply(t){const e=g.get(m.name,_.name);e&&e.execute(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_IMAGE_NODE_URL,_.name,new class extends T{handleAction(t,e){e.url=t.url}}),g.register(m.name,_.name,new class extends T{handleAction(t,e){const s=t.toAnnotation();e.annotationMap.set(s.type,s)}});class C extends x{constructor(t){super(),this.type=p.DELETE_CHILD,this.entityToBeRemoved=t}}class L extends T{getPreviousNode(t){const e=t.parentBlock,s=e.nodes.indexOf(t);if(s>0)return e.nodes[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parentBlock,s=e.nodes.indexOf(t);if(e.nodes[s+1])return e.nodes[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parentBlock,s=e.nodes.indexOf(t),n=e.parent;if("list-item"===e.type){const t=n.parent;return 0===s&&Array.isArray(n.blocks)&&n.blocks[0]===e&&"list-item"!==t.type&&Array.isArray(t.blocks)&&t.blocks[0]===n}return 0===s&&Array.isArray(n.blocks)&&n.blocks[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.blocks){const e=t.parent.blocks.indexOf(t);if(e>0)return t.parent.blocks[e-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){if("list-item"===t.type)return t.children&&t.children.length>0?this.getBlockLastNode(t.children[t.children.length-1]):t.nodes[t.nodes.length-1];if("number-list"===t.type||"bullet-list"===t.type){const e=t.blocks;if(e)return this.getBlockLastNode(e[e.length-1])}else if(t.nodes)return t.nodes[t.nodes.length-1]}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.blocks)return this.getBlockFirstNode(t.blocks[0])}else if(t.nodes)return t.nodes[0]}getNextBlock(t){if(t&&t.parent&&t.parent.blocks){const e=t.parent.blocks.indexOf(t);if(t.parent.blocks[e+1])return t.parent.blocks[e+1];if("list-item"===t.type&&t.parent.blocks.length===e+1)return this.getNextBlock(t.parent)}}}class B extends x{constructor(t){super(),this.type=p.APPEND_CHILD_NODES,this.entityToBeAppended=t}}class I extends T{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.nodes;"image"!==s.type&&(t=s.nodes.filter((t=>t.text))),e.apply(new B(t)),s.parent.apply(new C(s))}}}class k extends T{handleAction(t,e){e.nodes=e.nodes.filter((e=>e!==t.entityToBeRemoved)),0===e.nodes.length&&e.parent&&e.parent.apply(new C(e))}}class b extends T{handleAction(t,e){const s=t.entityToBeAppended;s.forEach((t=>{t.parentBlock=e})),e.nodes=e.nodes.concat(s)}}class D extends T{handleAction(t,e){e.nodes=[],e.apply(new B(t.newChildNodes))}}class R extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_AFTER,this.referBlock=t,this.blocksToBeInserted=e}}class M extends x{constructor(t){super(),this.type=p.REPLACE_CHILD_NODES,this.newChildNodes=t}}class F extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_BEFORE,this.referBlock=t,this.blocksToBeInserted=e}}class K extends x{constructor(t,e){super(),this.type=p.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class j extends m{constructor(){super(...arguments),this.doSplit=!0}}class P extends l{constructor(t){super(),this.type=a.SELECTION_RANGE,this.range=t}clone(){return new P(this.range)}}class v extends y{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new v(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new v(this.strikethrough)}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class H extends y{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.UNDERLINE,new H(t)]}toJSON(){return{underline:this.underline}}clone(){return new H(this.underline)}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class J extends y{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new J(t)]}toJSON(){return{italic:this.italic}}clone(){return new J(this.italic)}render(){return this.italic?{"font-style":"italic"}:null}}class W extends y{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new W(t)]}toJSON(){return{bold:this.bold}}clone(){return new W(this.bold)}render(){return this.bold?{"font-weight":"700"}:null}}class G extends y{constructor(t){super(),this.type=w.CODE,this.code=t}static from(t){return[w.CODE,new G(t)]}toJSON(){return{code:this.code}}clone(){return new G(this.code)}renderClass(){return this.code?"v-rte--code":null}render(){return null}}const z=[{key:"black",light:"#111128",dark:"#E3E3E8"},{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="​";class $ extends y{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new $(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new $(this.textColor.key)}renderClass(){return null}render(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return z.find((e=>e.key===t))||z[0]}}class X extends y{constructor(t){super(),this.type=w.LINK,this.link=t}static from(t){return[w.LINK,new X({href:t.href,groupKey:t.groupKey})]}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}clone(){return new X(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class q extends l{constructor(t){super(),this.type=a.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new q("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone())))})),t}}class V extends m{constructor(t,e){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e}toAnnotation(){return new q(this.groupKey)}}class Y extends m{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class Q extends x{constructor(t){super(),this.type=p.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class Z extends l{constructor(){super(...arguments),this.type=a.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE]}}class tt extends j{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new Z}}class et extends j{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new G(this.code)}}class st extends m{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class nt extends j{constructor({link:e,newText:s,needMergeNode:n,doSplit:i}){super(),this.isFlushable=!0,this.link=e,this.needMergeNode=n,this.newText=s,t(i)&&(this.doSplit=i)}toAnnotation(){return new X(this.link)}}class it extends N{constructor(t,e,s,n){super(t,n),this.type=f.TEXT,this.parentBlock=s,this.text=e}static from(e,s){const n=new it(e.id,e.text,s),{annotations:i}=e;return i&&(n.annotationMap=new Map(Object.keys(i).map((t=>(i.link&&s.apply(new V(i.link.groupKey,[n])),this.createAnnotationEntity(t,i[t])))).filter(t))),n}static createAnnotationEntity(t,e){switch(t){case"bold":return W.from(e);case"italic":return J.from(e);case"underline":return H.from(e);case"strikethrough":return v.from(e);case"code":return G.from(e);case"textColor":return $.from(e);case"link":return X.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof y)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}cloneWithText(t){return new it(o(),t,this.parentBlock,super.cloneAnnotations())}clone(){return new it(this.id,this.text,this.parentBlock,super.cloneAnnotations())}isEmpty(){return!this.text||"​"===this.text||"\n"===this.text}doAnnotationActionApply(t){const e=this.getAnnotationByType(a.SELECTION_RANGE);if(t instanceof j&&t.doSplit&&e){const e=g.get(j.name,it.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);this.parentBlock.mergeNodes(t)}doModifyActionApply(t){g.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof Y)return void this.syncUpSelectedNodes(t);s instanceof P||this.syncUpSelectedNodes(t);const n=g.get(m.name,it.name);n&&n.execute(e,t)}syncUpSelectedNodes(t){const n=d.getDOMByEntity(this);if(n){const r=s.getSubjectFromParentNodeByEventId(n,i);r&&e.notify(r,{node:t})}}}g.register(p.UPDATE_TEXT,it.name,new class extends T{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.annotationMap.delete(w.LINK)}}),g.register(p.REPLACE_SELECTED_TEXT,it.name,new class extends T{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:i,startOffset:r,endOffset:o}=e;let c=s.text;if(n===i&&r===o&&t)c=s.text.slice(0,r)+t+s.text.slice(r);else{const e=n.parentElement,a=i.parentElement,h=e&&d.getEntityByDOM(e),l=a&&d.getEntityByDOM(a);let u=0,p=s.text.length;h&&h===s?(u=r,p=n===i?o:p):l&&l===s&&(p=o),c=s.text.slice(0,u)+t+s.text.slice(p)}s.apply(new Q(c))}}}),g.register(j.name,it.name,new class extends T{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(a.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof j&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=s.range,o=t===n&&i===r;e.parentBlock.nodes=e.parentBlock.nodes.flatMap((t=>t.id===e.id?o?this.insertNewNode(i,e):this.shouldSplitSelection(s.range)?this.splitTextNode(s.range,e):(this.setApplyTargetNode(e),e):t))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");return this.setApplyTargetNode(s),0===t?[s,e]:t===e.text.length?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:i}=t;return e!==s||n>0||i<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:i}=t,r=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const i=t.substring(0,s),r=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(i),e.cloneWithText(r),e.cloneWithText(o)]},a=r&&d.getEntityByDOM(r),h=o&&d.getEntityByDOM(o);if(a&&a.id===e.id){const r=s===n?t.endOffset:e.text.length,[o,a,h]=c(e.text,i,r);return this.setApplyTargetNode(a),[o,a,h].filter((t=>!!t.text))}if(h&&h.id===e.id){const[s,n,i]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,i].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}),g.register(m.name,it.name,new class extends T{handleAction(e,s){const n=e.toAnnotation();if(e instanceof st)s.annotationMap.delete(e.annotationType);else{if(!(n instanceof Z))return n instanceof y||n instanceof P?(e instanceof nt&&(t(e.newText)&&(s.text=e.newText),s.parentBlock.apply(new V(e.link.groupKey,[s]))),e instanceof et&&this.handleAction(new tt,s),void s.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{s.deleteAnnotationByType(t)}))}}});class rt extends u{constructor(t){super(),this.type=h.TEXT_STYLE,this.textStyle=t}static from(t){return[h.TEXT_STYLE,new rt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new rt(this.textStyle)}render(){const t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};switch(this.textStyle){case"paragraph":return t;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500"};case"heading-4":return{fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};case"heading-5":return{fontFamily:"Inter",fontSize:"14px",lineHeight:"22px",fontWeight:"500"};case"heading-6":return{fontFamily:"Inter",fontSize:"12px",lineHeight:"22px",fontWeight:"500"}}}}class ot extends m{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new rt(this.textStyle)}}class ct extends j{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new W(this.bold)}}class at extends T{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),i=t.text.slice(e),r=s.nodes.indexOf(t);if(r>-1){const e=s.nodes.slice(0,r),o=s.nodes.slice(r+1);n&&e.push(t.cloneWithText(n)),i&&o.unshift(t.cloneWithText(i)),s.apply(new M(e));const c=s.cloneWithNodes(o);return s.parent.apply(new R(s,c)),c}}}}class ht extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new it(o(),"\n",s),i=t.text.slice(0,e),r=t.text.slice(e),c=s.nodes.indexOf(t);if(c>-1){const e=s.nodes.slice(0,c),o=s.nodes.slice(c+1);i&&e.push(t.cloneWithText(i)),r&&o.unshift(t.cloneWithText(r)),this.mergeLineBreakNodes(e,n,o,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new M([...t,e,...s]))}}class lt extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.nodes,n=new it(o(),"\n",e),i=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,i,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.nodes),t.parent.apply(new C(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new M([...t,e,...s]))}}class ut extends x{constructor(t){super(),this.type=p.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends L{handleAction(t,e){this.deleteNodeContent(t,e)}deleteNodeContent(t,e){const s=t.startContainerNode,n=t.startOffset;if(0!==n&&!s.isEmpty()){const i=s.text.slice(0,n-1)+s.text.slice(n);if(s.apply(new Q(i)),i)return void(t.previousNode=s);{const n=this.getPreviousNode(s);return n&&n.parentBlock===e&&"\n"===n.text||1===e.nodes.length?void(t.previousNode=s):(e.apply(new C(s)),void(t.previousNode=n))}}{let n=this.getPreviousNode(s),i=null;if(e.nodes.length&&n&&n.parentBlock!==e)s.isEmpty()&&e.apply(new C(s)),e.type===n.parentBlock.type&&n.parentBlock.apply(new ut(e));else if(this.isContentFirstNode(s)&&s.isEmpty()&&(i=this.getNextNode(s)),s.isEmpty()&&e.apply(new C(s)),n instanceof it&&n.isEmpty()){const t=n;n=this.getPreviousNode(n),t.parentBlock.apply(new C(t)),n||(i=s)}0===e.nodes.length&&e.parent.apply(new C(e)),n?t.previousNode=n:i&&(t.nextNode=i)}}}class pt extends T{replaceNodeWithNodes(t,e,s){t.nodes&&(s.forEach((e=>{e.parentBlock=t})),t.nodes=t.nodes.flatMap((t=>t===e?s:t)))}}class ft extends pt{handleAction(t,e){const s=t.referNode,n=[...t.nodesToBeInserted,s];this.replaceNodeWithNodes(e,s,n)}}class wt extends O{constructor(t,e){super(t),this.nodes=[],this.type=e,this.annotationMap=wt.isAcceptableTextStyle(e)?new Map([rt.from(e)]):new Map([rt.from("paragraph")])}static from(e){const s=new wt(e.id,e.type),{annotations:n}=e;return s.nodes=e.nodes.map((t=>it.from(t,s))),n&&Object.entries(n).forEach((([e,n])=>{const i=this.createAnnotationEntity(e,n);t(i)&&s.annotationMap.set(...i)})),s}static createAnnotationEntity(t,e){return"textStyle"===t?rt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.nodes=this.nodes.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof nt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(w.LINK),i=s.getAnnotationByType(w.LINK);if(t&&i&&t.toEqual(i))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.nodes.map((t=>t.toJSON()))})}cloneWithNodes(t){const e=new wt(o(),this.type);return e.nodes=[],e.apply(new B(t)),e}clone(){const t=new wt(this.id,this.type);return t.nodes=this.nodes.map((e=>{const s=e.clone();return s.parentBlock=t,s})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}isNotEmpty(){return this.nodes.length>0&&this.nodes.some((t=>!t.isEmpty()))}getLastNode(){return this.nodes[this.nodes.length-1]}createNewParagraph(){return new wt(o(),"paragraph")}doAnnotationActionApply(t){const e=g.get(t.constructor.name,wt.name);e&&e.execute(t,this)}}g.register(ot.name,wt.name,new class extends T{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.nodes.forEach(t.bold?t=>{const e=new ct(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new st(w.BOLD))})}}),g.register(V.name,wt.name,new class extends T{handleAction(t,e){const s=e.getAnnotationByType(a.LINK_GROUP);if(s){const n=s.linkGroups.get(t.groupKey);s.linkGroups.set(t.groupKey,[...n,...t.nodes]),e.annotationMap.set(a.LINK_GROUP,s)}}}),g.register(p.DELETE_CHILD,wt.name,new k),g.register(p.APPEND_CHILD_NODES,wt.name,new b),g.register(p.SPLIT_BLOCK_WITH_NODE,wt.name,new at),g.register(p.REPLACE_CHILD_NODES,wt.name,new D),g.register(p.MERGE_TWO_BLOCKS_NODES,wt.name,new I),g.register(p.BREAK_SINGLE_BLOCK,wt.name,new class extends T{handleAction(t,e){t.newBlock=this.breakSingleTextBlock(t.startContainerNode,t.startOffset,e)}breakSingleTextBlock(t,e,s){const n=this.copyInlineStyleToNewParagraph(t,s);if(this.isCaretPositionAtTextBlockEnd(s,t,e))s.parent.apply(new R(s,n));else{if(!this.isCaretPositionAtTextBlockStart(s,t,e)){const n=new K(t,e);return s.apply(n),n.newBlock}s.parent.apply(new F(s,n))}return n}copyInlineStyleToNewParagraph(t,e){const s=t.cloneWithText("");s.annotationMap.delete(w.LINK);const n=e.createNewParagraph();return n.apply(new B([s])),n}}),g.register(p.LINE_BREAK_SINGLE_BLOCK,wt.name,new ht),g.register(p.LINE_BREAK_MULTIPLE_BLOCKS,wt.name,new lt),g.register(p.DELETE_BLOCK_CONTENT,wt.name,new dt),g.register(p.INSERT_IMAGE_TO_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,i=t.imageBlockToBeInserted;if(this.isCaretPositionAtTextBlockEnd(e,s,n))e.parent.apply(new R(e,i));else if(this.isCaretPositionAtTextBlockStart(e,s,n))e.parent.apply(new F(e,i));else{const t=new K(s,n);e.apply(t),e.parent.apply(new R(e,i))}}}),g.register(p.INSERT_NODES_BEFORE,wt.name,new ft),g.register(p.TRANSFORM_LIST_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),i=t.selectedBlocks,r=i.map((t=>s.toListItem(t)));n.apply(new B(r)),s.apply(new R(t.selectedBlocks[0],n)),i.forEach((t=>{t.parent.apply(new C(t))}))}});class xt extends x{constructor(t,e){super(),this.isFlushable=!0,this.type=p.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class At extends m{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new P(this.range)}}class Et extends N{constructor(t,e,s,n){super(t),this.type=f.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parentBlock=n,this.language=s}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}clone(){return new Et(this.id,this.text,this.language,this.parentBlock)}doAnnotationActionApply(t){g.executeTheStrategy(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_CODE_BLOCK,Et.name,new class extends T{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),g.register(At.name,Et.name,new class extends T{handleAction(t,e){e.annotationMap.set(a.SELECTION_RANGE,t.toAnnotation())}});class gt extends O{constructor(t,e,s){super(t),this.type="code-block",this.nodes=[new Et(`${t}-1`,e,s,this)]}static from(t){return new gt(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.nodes[0];return{id:this.id,type:"code-block",content:e,language:t}}clone(){const t=gt.from(this.toJSON());return t.parent=this.parent,t}apply(t){if(t instanceof x&&g.executeTheStrategy(t,this),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}isNotEmpty(){return!!this.nodes.length}getLastNode(){return this.nodes[0]}isSelected(){return this.nodes[0].annotationMap.has(a.SELECTION_RANGE)}}g.register(p.DELETE_CODE_BLOCK,gt.name,new class extends L{handleAction(t,e){const s=e.nodes[0],n=e.parent;if(n){let t=this.getPreviousNode(s),i=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),i=0),n.apply(new C(e));const r=t?d.getDOMByEntity(t):null;if(0===n.blocks.length){const s=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:""}]});e.parent.apply(new B([s])),t=s.nodes[0],i=0}this.notifyUpdateSelection(t,r,i,e)}}notifyUpdateSelection(t,n,r,o){const c=d.getDOMByEntity(o);if(c){const o=s.getSubjectFromParentNodeByEventId(c,i);o&&e.notify(o,{node:t,updateDirectly:!!n,offset:r})}}getRTENodeEndOffset(t){return t&&"CODE_BLOCK_NODE"!==t.type?"IMAGE"!==t.type?t.text.length:1:0}}),g.register(p.DELETE_CHILD,gt.name,new k),g.register(p.SWITCH_OUT_FROM_CODE_BLOCK,gt.name,new class extends T{handleAction(t,n){const{content:r,language:c}=t,a=r.split("\n"),h=new xt(a.slice(0,a.length-2).join("\n"),c);h.isFlushable=!1,n.nodes[0].apply(h);const l=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),text:"",type:"text"}]});n.parent.apply(new R(n,l));const u=d.getDOMByEntity(n);if(u){const t=s.getSubjectFromParentNodeByEventId(u,i);t&&e.notify(t,{node:l.nodes[0]})}}}),g.register(p.INSERT_IMAGE_TO_BLOCK,gt.name,new class extends T{handleAction(t,e){e.parent.apply(new R(e,t.imageBlockToBeInserted))}}),gt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{E as $,T as A,L as B,S as C,At as D,$ as E,z as F,Et as G,m as H,R as I,ct as J,J as K,nt as L,x as M,w as N,H as O,ot as P,rt as Q,C as R,K as S,j as T,xt as U,W as V,h as W,tt as X,et as Y,U as Z,v as _,_ as a,A as a0,Q as a1,ut as a2,M as b,B as c,wt as d,F as e,p as f,it as g,pt as h,O as i,g as j,I as k,k as l,b as m,D as n,ft as o,dt as p,ht as q,lt as r,at as s,Y as t,gt as u,N as v,d as w,u as x,y,a as z}
1
+ import{i as t}from"./p-b1f65b13.js";import{C as e}from"./p-2d0d575f.js";import{d as s}from"./p-6e01f0a2.js";import{a as n,b as i}from"./p-425ba7d6.js";import{L as r}from"./p-6e1ab235.js";import{g as o}from"./p-37b05e0b.js";import{V as c}from"./p-0c8bd757.js";var a,h;!function(t){t.SELECTION_RANGE="SELECTION_RANGE",t.CLEAR_FORMATTING="CLEAR_FORMATTING",t.LINK_GROUP="LINK_GROUP"}(a||(a={}));class l{}!function(t){t.ALIGNMENT="ALIGNMENT",t.TEXT_STYLE="TEXT_STYLE",t.INDENT="INDENT"}(h||(h={}));class u extends l{}const d=new class{constructor(){this.domToEntity=new WeakMap,this.entityToDOM=new WeakMap}register(t,e){this.domToEntity.set(t,e),this.entityToDOM.set(e,t)}getEntityByDOM(t){return this.domToEntity.get(t)}getDOMByEntity(t){return this.entityToDOM.get(t)}removeDirtyDomRef(t){this.domToEntity.delete(t)}};var p,f,w;!function(t){t.DELETE_CHILD="DELETE_CHILD",t.DELETE_NEST_LIST="DELETE_NEST_LIST",t.UPDATE_TEXT="UPDATE_TEXT",t.REPLACE_SELECTED_TEXT="REPLACE_SELECTED_TEXT",t.APPEND_CHILD_NODES="APPEND_CHILD_NODES",t.INSERT_BLOCKS_AFTER="INSERT_BLOCKS_AFTER",t.INSERT_BLOCKS_BEFORE="INSERT_BLOCKS_BEFORE",t.INSERT_NODES_AFTER="INSERT_NODES_AFTER",t.INSERT_NODES_BEFORE="INSERT_NODES_BEFORE",t.SPLIT_BLOCK_WITH_NODE="SPLIT_BLOCK_WITH_NODE",t.REPLACE_CHILD_NODES="REPLACE_CHILD_NODES",t.REPLACE_NEST_LIST="REPLACE_NEST_LIST",t.MERGE_TWO_BLOCKS_NODES="MERGE_TWO_BLOCKS_NODES",t.BREAK_SINGLE_BLOCK="BREAK_SINGLE_BLOCK",t.LINE_BREAK_SINGLE_BLOCK="LINE_BREAK_SINGLE_BLOCK",t.LINE_BREAK_MULTIPLE_BLOCKS="LINE_BREAK_MULTIPLE_BLOCKS",t.TRANSFORM_LIST_BLOCK="TRANSFORM_LIST_BLOCK",t.TRANSFORM_PARAGRAPH_BLOCK="TRANSFORM_PARAGRAPH_BLOCK",t.DELETE_BLOCK_CONTENT="DELETE_BLOCK_CONTENT",t.INSERT_IMAGE_TO_BLOCK="INSERT_IMAGE_TO_BLOCK",t.UPDATE_IMAGE_NODE_URL="UPDATE_IMAGE_NODE_URL",t.TRANSFORM_TO_CODE_BLOCK="TRANSFORM_TO_CODE_BLOCK",t.UPDATE_CODE_BLOCK="UPDATE_CODE_BLOCK",t.SWITCH_OUT_FROM_CODE_BLOCK="SWITCH_OUT_FROM_CODE_BLOCK",t.DELETE_CODE_BLOCK="DELETE_CODE_BLOCK"}(p||(p={}));class x{constructor(){this.isFlushable=!1}}class A extends u{constructor(t){super(),this.type=h.ALIGNMENT,this.textAlign=t}static from(t){return[h.ALIGNMENT,new A(t)]}toJSON(){return{textAlign:this.textAlign}}renderClass(){return`v-rte--horizontal-alignment-${this.textAlign}`}clone(){return new A(this.textAlign)}render(){return null}}class E extends u{constructor(t){super(),this.type=h.INDENT,this.indent=Math.max(0,t)}static from(t){return[h.INDENT,new E(t)]}toJSON(){return this.indent>0?{indent:this.indent}:null}clone(){return new E(this.indent)}render(){return this.indent>0?{"margin-left":16*this.indent+"px"}:null}}class g{static register(t,e,s){this.registry.has(e)||this.registry.set(e,new Map),this.registry.get(e).set(t,s)}static get(t,e){const s=this.registry.get(e);if(s)return s.get(t)}static executeTheStrategy(t,e){const s=t instanceof x?t.type:t.constructor.name,n=g.get(s,e.constructor.name);if(n)return n.execute(t,e);r.error(`Type ${s} action handle strategy is not registered in class ${e.constructor.name}`)}}g.registry=new Map;class O{constructor(t){this.annotationMap=new Map,this.id=t}static createAnnotationEntity(t,e){switch(t){case"textAlign":return A.from(e);case"indent":return E.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof u)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{})}getAnnotationByType(t){return this.annotationMap.get(t)}apply(t){if(this.doApply(t),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}doApply(t){t instanceof x?g.executeTheStrategy(t,this):this.applyAnnotationAction(t)}applyAnnotationAction(t){const e=t.toAnnotation();this.annotationMap.set(e.type,e),"function"==typeof this.doAnnotationActionApply&&this.doAnnotationActionApply(t)}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.TEXT="TEXT",t.IMAGE="IMAGE",t.CODE_BLOCK_NODE="CODE_BLOCK_NODE"}(f||(f={}));class N{constructor(t,e){this.annotationMap=new Map,this.id=t,e&&(this.annotationMap=e)}getAnnotationByType(t){return this.annotationMap.get(t)}deleteAnnotationByType(t){this.annotationMap.delete(t),this.flushChange()}apply(t){return this.doApply(t),t.isFlushable&&this.flushChange(),this}doApply(t){t instanceof x?this.doModifyActionApply(t):this.doAnnotationActionApply(t)}flushChange(){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}cloneAnnotations(){return new Map(Array.from(this.annotationMap.entries()).map((([t,e])=>[t,e.clone()])))}}!function(t){t.BOLD="BOLD",t.ITALIC="ITALIC",t.UNDERLINE="UNDERLINE",t.STRIKETHROUGH="STRIKETHROUGH",t.SELECTION_RANGE="SELECTION_RANGE",t.IMAGE="IMAGE",t.CODE="CODE",t.TEXT_COLOR="TEXT_COLOR",t.LINK="LINK"}(w||(w={}));class y extends l{}class S extends y{constructor(t="md",e){super(),this.type=w.IMAGE,this.size=t,this.alt=e}static from(t,e){return[w.IMAGE,new S(t,e)]}toJSON(){return t(this.alt)?{size:this.size,alt:this.alt}:{size:this.size}}clone(){return new S(this.size,this.alt)}render(){switch(this.size){case"sm":return{width:"25%"};case"md":return{width:"50%"};case"lg":return{width:"100%"}}}}class T{execute(t,e){return r.log(`Executing action ${t.constructor.name} on ${e.constructor.name} ${e.id}`),this.handleAction(t,e)}isCaretPositionAtTextBlockEnd(t,e,s){const n=t.nodes[t.nodes.length-1];return e===n&&(e.isEmpty()||s===n.text.length)}isCaretPositionAtTextBlockStart(t,e,s){return e===t.nodes[0]&&0===s}isCaretPositionAtImageBlockStart(t,e,s){return e===t.nodes[0]&&0===s}isCaretPositionAtImageBlockEnd(t,e,s){return e===t.nodes[t.nodes.length-1]&&1===s}}class m{}class _ extends N{constructor(t,e,s,n){super(t,n),this.type=f.IMAGE,this.url=e,this.parentBlock=s}static from(e,s){const n=new _(e.id,e.url,s);let i;return i=e.annotations&&0!==Object.keys(e.annotations).length?e.annotations:{size:"md"},n.annotationMap=new Map(Object.keys(i).map((()=>S.from(i.size,i.alt))).filter(t)),n}toJSON(){const t=this.annotationMap.get(w.IMAGE),e={};return(null==t?void 0:t.size)&&(e.size=t.size),(null==t?void 0:t.alt)&&(e.alt=t.alt),Object.assign(Object.assign({id:this.id},Object.keys(e).length>0?{annotations:e}:{}),{type:"image",url:this.url})}clone(){return new _(this.id,this.url,this.parentBlock,super.cloneAnnotations())}doAnnotationActionApply(t){const e=g.get(m.name,_.name);e&&e.execute(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_IMAGE_NODE_URL,_.name,new class extends T{handleAction(t,e){e.url=t.url}}),g.register(m.name,_.name,new class extends T{handleAction(t,e){const s=t.toAnnotation();e.annotationMap.set(s.type,s)}});class C extends x{constructor(t){super(),this.type=p.DELETE_CHILD,this.entityToBeRemoved=t}}class L extends T{getPreviousNode(t){const e=t.parentBlock,s=e.nodes.indexOf(t);if(s>0)return e.nodes[s-1];if(e.parent){const t=this.getPreviousBlock(e);if(t)return this.getBlockLastNode(t)}}getNextNode(t){const e=t.parentBlock,s=e.nodes.indexOf(t);if(e.nodes[s+1])return e.nodes[s+1];if(e.parent){const t=this.getNextBlock(e);if(t)return this.getBlockFirstNode(t)}}isContentFirstNode(t){const e=t.parentBlock,s=e.nodes.indexOf(t),n=e.parent;if("list-item"===e.type){const t=n.parent;return 0===s&&Array.isArray(n.blocks)&&n.blocks[0]===e&&"list-item"!==t.type&&Array.isArray(t.blocks)&&t.blocks[0]===n}return 0===s&&Array.isArray(n.blocks)&&n.blocks[0]===e}getPreviousBlock(t){if(t&&t.parent&&t.parent.blocks){const e=t.parent.blocks.indexOf(t);if(e>0)return t.parent.blocks[e-1];if(("number-list"===t.parent.type||"bullet-list"===t.parent.type)&&0===e)return this.getPreviousBlock(t.parent)}}getBlockLastNode(t){if("list-item"===t.type)return t.children&&t.children.length>0?this.getBlockLastNode(t.children[t.children.length-1]):t.nodes[t.nodes.length-1];if("number-list"===t.type||"bullet-list"===t.type){const e=t.blocks;if(e)return this.getBlockLastNode(e[e.length-1])}else if(t.nodes)return t.nodes[t.nodes.length-1]}getBlockFirstNode(t){if("number-list"===t.type||"bullet-list"===t.type){if(t.blocks)return this.getBlockFirstNode(t.blocks[0])}else if(t.nodes)return t.nodes[0]}getNextBlock(t){if(t&&t.parent&&t.parent.blocks){const e=t.parent.blocks.indexOf(t);if(t.parent.blocks[e+1])return t.parent.blocks[e+1];if("list-item"===t.type&&t.parent.blocks.length===e+1)return this.getNextBlock(t.parent)}}}class B extends x{constructor(t){super(),this.type=p.APPEND_CHILD_NODES,this.entityToBeAppended=t}}class I extends T{handleAction(t,e){const s=t.blockNeedToBeMerged;if(e.type===s.type||"image"!==e.type&&"image"!==s.type){let t=s.nodes;"image"!==s.type&&(t=s.nodes.filter((t=>t.text))),e.apply(new B(t)),s.parent.apply(new C(s))}}}class b extends T{handleAction(t,e){e.nodes=e.nodes.filter((e=>e!==t.entityToBeRemoved)),0===e.nodes.length&&e.parent&&e.parent.apply(new C(e))}}class k extends T{handleAction(t,e){const s=t.entityToBeAppended;s.forEach((t=>{t.parentBlock=e})),e.nodes=e.nodes.concat(s)}}class D extends T{handleAction(t,e){e.nodes=[],e.apply(new B(t.newChildNodes))}}class R extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_AFTER,this.referBlock=t,this.blocksToBeInserted=e}}class M extends x{constructor(t){super(),this.type=p.REPLACE_CHILD_NODES,this.newChildNodes=t}}class F extends x{constructor(t,...e){super(),this.type=p.INSERT_BLOCKS_BEFORE,this.referBlock=t,this.blocksToBeInserted=e}}class K extends x{constructor(t,e){super(),this.type=p.SPLIT_BLOCK_WITH_NODE,this.splitPointNode=t,this.startOffsetOfNode=e}}class j extends m{constructor(){super(...arguments),this.doSplit=!0}}class P extends l{constructor(t){super(),this.type=a.SELECTION_RANGE,this.range=t}clone(){return new P(this.range)}}class v extends y{constructor(t){super(),this.type=w.STRIKETHROUGH,this.strikethrough=t}static from(t){return[w.STRIKETHROUGH,new v(t)]}toJSON(){return{strikethrough:this.strikethrough}}clone(){return new v(this.strikethrough)}renderClass(){return this.strikethrough?"v-rte--strikethrough":null}render(){return null}}class H extends y{constructor(t){super(),this.type=w.UNDERLINE,this.underline=t}static from(t){return[w.UNDERLINE,new H(t)]}toJSON(){return{underline:this.underline}}clone(){return new H(this.underline)}renderClass(){return this.underline?"v-rte--underline":null}render(){return null}}class J extends y{constructor(t){super(),this.type=w.ITALIC,this.italic=t}static from(t){return[w.ITALIC,new J(t)]}toJSON(){return{italic:this.italic}}clone(){return new J(this.italic)}render(){return this.italic?{"font-style":"italic"}:null}}class W extends y{constructor(t){super(),this.type=w.BOLD,this.bold=t}static from(t){return[w.BOLD,new W(t)]}toJSON(){return{bold:this.bold}}clone(){return new W(this.bold)}render(){return this.bold?{"font-weight":"700"}:null}}class G extends y{constructor(t){super(),this.type=w.CODE,this.code=t}static from(t){return[w.CODE,new G(t)]}toJSON(){return{code:this.code}}clone(){return new G(this.code)}renderClass(){return this.code?"v-rte--code":null}render(){return null}}const z=[{key:"black",light:"#111128",dark:"#E3E3E8"},{key:"gray",light:"#5E5E6D",dark:"#B9B9C1"},{key:"green",light:"#01801F",dark:"#59D977"},{key:"red",light:"#BD2947",dark:"#FFB2B5"},{key:"purple",light:"#563D82",dark:"#BEB2FF"},{key:"teal",light:"#17758F",dark:"#4CD8FF"}],U="​";class $ extends y{constructor(t){super(),this.type=w.TEXT_COLOR,this.textColor=this.formatTextColor(t)}static from(t){return[w.TEXT_COLOR,new $(t)]}toJSON(){return{textColor:this.textColor.key}}clone(){return new $(this.textColor.key)}renderClass(){return null}render(){return{color:c.isDarkMode()?this.textColor.dark:this.textColor.light}}formatTextColor(t){return z.find((e=>e.key===t))||z[0]}}class X extends y{constructor(t){super(),this.type=w.LINK,this.link=t}static from(t){return[w.LINK,new X({href:t.href,groupKey:t.groupKey})]}toJSON(){return{link:{href:this.link.href,groupKey:this.link.groupKey}}}clone(){return new X(this.link)}toEqual(t){return this.link.groupKey===t.link.groupKey}render(){return null}}class q extends l{constructor(t){super(),this.type=a.LINK_GROUP,this.linkGroups=new Map,this.linkGroups=new Map([[t,[]]])}clone(){const t=new q("");return this.linkGroups.forEach(((e,s)=>{t.linkGroups.set(s,e.map((t=>t.clone())))})),t}}class V extends m{constructor(t,e){super(),this.isFlushable=!1,this.groupKey=t,this.nodes=e}toAnnotation(){return new q(this.groupKey)}}class Y extends m{constructor(){super(),this.isFlushable=!1}toAnnotation(){return null}}class Q extends x{constructor(t){super(),this.type=p.UPDATE_TEXT,this.newTextContent="",this.newTextContent=t}}class Z extends l{constructor(){super(...arguments),this.type=a.CLEAR_FORMATTING,this.items=[w.BOLD,w.ITALIC,w.UNDERLINE,w.STRIKETHROUGH,w.TEXT_COLOR,w.CODE]}}class tt extends j{constructor(){super(...arguments),this.isFlushable=!0}toAnnotation(){return new Z}}class et extends j{constructor(t){super(),this.isFlushable=!0,this.code=t}toAnnotation(){return new G(this.code)}}class st extends m{constructor(t){super(),this.isFlushable=!0,this.annotationType=t}toAnnotation(){}}class nt extends j{constructor({link:e,newText:s,needMergeNode:n,doSplit:i}){super(),this.isFlushable=!0,this.link=e,this.needMergeNode=n,this.newText=s,t(i)&&(this.doSplit=i)}toAnnotation(){return new X(this.link)}}class it extends N{constructor(t,e,s,n){super(t,n),this.type=f.TEXT,this.parentBlock=s,this.text=e}static from(e,s){const n=new it(e.id,e.text,s),{annotations:i}=e;return i&&(n.annotationMap=new Map(Object.keys(i).map((t=>(i.link&&s.apply(new V(i.link.groupKey,[n])),this.createAnnotationEntity(t,i[t])))).filter(t))),n}static createAnnotationEntity(t,e){switch(t){case"bold":return W.from(e);case"italic":return J.from(e);case"underline":return H.from(e);case"strikethrough":return v.from(e);case"code":return G.from(e);case"textColor":return $.from(e);case"link":return X.from(e)}}toJSON(){const t=Array.from(this.annotationMap.values()).filter((t=>t instanceof y)).reduce(((t,e)=>Object.assign(Object.assign({},t),e.toJSON())),{});return Object.assign(Object.assign({id:this.id},Object.keys(t).length>0?{annotations:t}:{}),{type:"text",text:this.text})}cloneWithText(t){return new it(o(),t,this.parentBlock,super.cloneAnnotations())}clone(){return new it(this.id,this.text,this.parentBlock,super.cloneAnnotations())}isEmpty(){return!this.text||"​"===this.text||"\n"===this.text}doAnnotationActionApply(t){const e=this.getAnnotationByType(a.SELECTION_RANGE);if(t instanceof j&&t.doSplit&&e){const e=g.get(j.name,it.name);if(e){const s=e.execute(t,this);s&&this.applyActionToNode(s,t)}}else this.applyActionToNode(this,t);this.parentBlock.mergeNodes(t)}doModifyActionApply(t){g.executeTheStrategy(t,this)}applyActionToNode(t,e){const s=e.toAnnotation();if(e instanceof Y)return void this.syncUpSelectedNodes(t);s instanceof P||this.syncUpSelectedNodes(t);const n=g.get(m.name,it.name);n&&n.execute(e,t)}syncUpSelectedNodes(t){const n=d.getDOMByEntity(this);if(n){const r=s.getSubjectFromParentNodeByEventId(n,i);r&&e.notify(r,{node:t})}}}g.register(p.UPDATE_TEXT,it.name,new class extends T{handleAction(t,e){e.text=t.newTextContent,!e.text&&e.annotationMap.has("LINK")&&e.annotationMap.delete(w.LINK)}}),g.register(p.REPLACE_SELECTED_TEXT,it.name,new class extends T{handleAction(t,e){this.replaceSelectedText(t.textToBeInsert,t.currentRange,e)}replaceSelectedText(t,e,s){if(e&&e.startContainer&&e.endContainer){const{startContainer:n,endContainer:i,startOffset:r,endOffset:o}=e;let c=s.text;if(n===i&&r===o&&t)c=s.text.slice(0,r)+t+s.text.slice(r);else{const e=n.parentElement,a=i.parentElement,h=e&&d.getEntityByDOM(e),l=a&&d.getEntityByDOM(a);let u=0,p=s.text.length;h&&h===s?(u=r,p=n===i?o:p):l&&l===s&&(p=o),c=s.text.slice(0,u)+t+s.text.slice(p)}s.apply(new Q(c))}}}),g.register(j.name,it.name,new class extends T{constructor(){super(...arguments),this.applyTargetNode=null}handleAction(t,e){const s=e.getAnnotationByType(a.SELECTION_RANGE);if(this.setApplyTargetNode(null),t instanceof j&&t.doSplit&&s){const{startContainer:t,endContainer:n,startOffset:i,endOffset:r}=s.range,o=t===n&&i===r;e.parentBlock.nodes=e.parentBlock.nodes.flatMap((t=>t.id===e.id?o?this.insertNewNode(i,e):this.shouldSplitSelection(s.range)?this.splitTextNode(s.range,e):(this.setApplyTargetNode(e),e):t))}return this.applyTargetNode}insertNewNode(t,e){const s=e.cloneWithText("");return this.setApplyTargetNode(s),0===t?[s,e]:t===e.text.length?[e,s]:[e.cloneWithText(e.text.substring(0,t)),s,e.cloneWithText(e.text.substring(t))]}shouldSplitSelection(t){const{startContainer:e,endContainer:s,startOffset:n,endOffset:i}=t;return e!==s||n>0||i<(s.textContent?s.textContent.length:0)}splitTextNode(t,e){const{startContainer:s,endContainer:n,startOffset:i}=t,r=s.parentElement,o=n.parentElement,c=(t,s,n)=>{const i=t.substring(0,s),r=t.substring(s,n),o=t.substring(n);return[e.cloneWithText(i),e.cloneWithText(r),e.cloneWithText(o)]},a=r&&d.getEntityByDOM(r),h=o&&d.getEntityByDOM(o);if(a&&a.id===e.id){const r=s===n?t.endOffset:e.text.length,[o,a,h]=c(e.text,i,r);return this.setApplyTargetNode(a),[o,a,h].filter((t=>!!t.text))}if(h&&h.id===e.id){const[s,n,i]=c(e.text,0,t.endOffset);return this.setApplyTargetNode(n),[s,n,i].filter((t=>!!t.text))}return this.setApplyTargetNode(e),e}setApplyTargetNode(t){this.applyTargetNode=t}}),g.register(m.name,it.name,new class extends T{handleAction(e,s){const n=e.toAnnotation();if(e instanceof st)s.annotationMap.delete(e.annotationType);else{if(!(n instanceof Z))return n instanceof y||n instanceof P?(e instanceof nt&&(t(e.newText)&&(s.text=e.newText),s.parentBlock.apply(new V(e.link.groupKey,[s]))),e instanceof et&&this.handleAction(new tt,s),void s.annotationMap.set(n.type,n)):void 0;n.items.forEach((t=>{s.deleteAnnotationByType(t)}))}}});class rt extends u{constructor(t){super(),this.type=h.TEXT_STYLE,this.textStyle=t}static from(t){return[h.TEXT_STYLE,new rt(t)]}toJSON(){return{textStyle:this.textStyle}}clone(){return new rt(this.textStyle)}render(){const t={fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};switch(this.textStyle){case"paragraph":return t;case"title":return{fontFamily:"Inter",fontSize:"36px",lineHeight:"40px",fontWeight:"500"};case"subtitle":return{fontFamily:"Inter",fontSize:"28px",lineHeight:"32px",fontWeight:"500"};case"heading-1":return{fontFamily:"Inter",fontSize:"22px",lineHeight:"24px",fontWeight:"500"};case"heading-2":return{fontFamily:"Inter",fontSize:"20px",lineHeight:"24px",fontWeight:"500"};case"heading-3":return{fontFamily:"Inter",fontSize:"18px",lineHeight:"22px",fontWeight:"500"};case"heading-4":return{fontFamily:"Inter",fontSize:"16px",lineHeight:"22px",fontWeight:"500"};case"heading-5":return{fontFamily:"Inter",fontSize:"14px",lineHeight:"22px",fontWeight:"500"};case"heading-6":return{fontFamily:"Inter",fontSize:"12px",lineHeight:"22px",fontWeight:"500"}}}}class ot extends m{constructor(t,e){super(),this.isFlushable=!0,this.textStyle=t,this.bold=e}toAnnotation(){return new rt(this.textStyle)}}class ct extends j{constructor(t){super(),this.isFlushable=!0,this.bold=t}toAnnotation(){return new W(this.bold)}}class at extends T{handleAction(t,e){t.newBlock=this.splitTextNodeBlock(t.splitPointNode,t.startOffsetOfNode,e)}splitTextNodeBlock(t,e,s){if(t){const n=t.text.slice(0,e),i=t.text.slice(e),r=s.nodes.indexOf(t);if(r>-1){const e=s.nodes.slice(0,r),o=s.nodes.slice(r+1);n&&e.push(t.cloneWithText(n)),i&&o.unshift(t.cloneWithText(i)),s.apply(new M(e));const c=s.cloneWithNodes(o);return s.parent.apply(new R(s,c)),c}}}}class ht extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakSingleBlock(t.startContainerNode,t.startOffset,e)}lineBreakSingleBlock(t,e,s){if(t){const n=new it(o(),"\n",s),i=t.text.slice(0,e),r=t.text.slice(e),c=s.nodes.indexOf(t);if(c>-1){const e=s.nodes.slice(0,c),o=s.nodes.slice(c+1);i&&e.push(t.cloneWithText(i)),r&&o.unshift(t.cloneWithText(r)),this.mergeLineBreakNodes(e,n,o,s)}return n}}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new M([...t,e,...s]))}}class lt extends T{handleAction(t,e){t.lineBreakNode=this.lineBreakMultipleBlocks(t.selectedBlocks,e)}lineBreakMultipleBlocks(t,e){const s=e.nodes,n=new it(o(),"\n",e),i=this.concatBlocksNodes(t.slice(1));return this.mergeLineBreakNodes(s,n,i,e),n}concatBlocksNodes(t){const e=[];return t.map((t=>{"image"!==t.type&&(e.push(...t.nodes),t.parent.apply(new C(t)))})),e}mergeLineBreakNodes(t,e,s,n){(0===s.length||s[0]&&""===s[0].text)&&s.push(new it(o(),"\n",n,t[t.length-1]&&t[t.length-1].annotationMap)),n.apply(new M([...t,e,...s]))}}class ut extends x{constructor(t){super(),this.type=p.MERGE_TWO_BLOCKS_NODES,this.blockNeedToBeMerged=t}}class dt extends L{handleAction(t,e){this.deleteNodeContent(t,e)}deleteNodeContent(t,e){const s=t.startContainerNode,n=t.startOffset;if(0!==n&&!s.isEmpty()){const i=s.text.slice(0,n-1)+s.text.slice(n);if(s.apply(new Q(i)),i)return void(t.previousNode=s);{const n=this.getPreviousNode(s);return n&&n.parentBlock===e&&"\n"===n.text||1===e.nodes.length?void(t.previousNode=s):(e.apply(new C(s)),void(t.previousNode=n))}}{let n=this.getPreviousNode(s),i=null;if(e.nodes.length&&n&&n.parentBlock!==e)s.isEmpty()&&e.apply(new C(s)),e.type===n.parentBlock.type&&n.parentBlock.apply(new ut(e));else if(this.isContentFirstNode(s)&&s.isEmpty()&&(i=this.getNextNode(s)),s.isEmpty()&&e.apply(new C(s)),n instanceof it&&n.isEmpty()){const t=n;n=this.getPreviousNode(n),t.parentBlock.apply(new C(t)),n||(i=s)}0===e.nodes.length&&e.parent.apply(new C(e)),n?t.previousNode=n:i&&(t.nextNode=i)}}}class pt extends T{replaceNodeWithNodes(t,e,s){t.nodes&&(s.forEach((e=>{e.parentBlock=t})),t.nodes=t.nodes.flatMap((t=>t===e?s:t)))}}class ft extends pt{handleAction(t,e){const s=t.referNode,n=[...t.nodesToBeInserted,s];this.replaceNodeWithNodes(e,s,n)}}class wt extends O{constructor(t,e){super(t),this.nodes=[],this.type=e,this.annotationMap=wt.isAcceptableTextStyle(e)?new Map([rt.from(e)]):new Map([rt.from("paragraph")])}static from(e){const s=new wt(e.id,e.type),{annotations:n}=e;return s.nodes=e.nodes.map((t=>it.from(t,s))),n&&Object.entries(n).forEach((([e,n])=>{const i=this.createAnnotationEntity(e,n);t(i)&&s.annotationMap.set(...i)})),s}static createAnnotationEntity(t,e){return"textStyle"===t?rt.from(e):super.createAnnotationEntity(t,e)}static isAcceptableTextStyle(t){return["title","subtitle","paragraph","heading-1","heading-2","heading-3","heading-4","heading-5","heading-6"].includes(t)}mergeNodes(t){this.nodes=this.nodes.reduce(((e,s)=>{const n=e.at(-1);if(t instanceof nt&&t.needMergeNode){const t=null==n?void 0:n.getAnnotationByType(w.LINK),i=s.getAnnotationByType(w.LINK);if(t&&i&&t.toEqual(i))return e}return[...e,s]}),[])}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{type:this.type,nodes:this.nodes.map((t=>t.toJSON()))})}cloneWithNodes(t){const e=new wt(o(),this.type);return e.nodes=[],e.apply(new B(t)),e}clone(){const t=new wt(this.id,this.type);return t.nodes=this.nodes.map((e=>{const s=e.clone();return s.parentBlock=t,s})),t.annotationMap=super.cloneAnnotations(),t.parent=this.parent,t}isNotEmpty(){return this.nodes.length>0&&this.nodes.some((t=>!t.isEmpty()))}getLastNode(){return this.nodes[this.nodes.length-1]}createNewParagraph(){return new wt(o(),"paragraph")}doAnnotationActionApply(t){const e=g.get(t.constructor.name,wt.name);e&&e.execute(t,this)}}g.register(ot.name,wt.name,new class extends T{handleAction(t,e){"list-item"!==e.type&&(e.type=t.textStyle),e.nodes.forEach(t.bold?t=>{const e=new ct(!0);e.doSplit=!1,t.apply(e)}:t=>{t.apply(new st(w.BOLD))})}}),g.register(V.name,wt.name,new class extends T{handleAction(t,e){const s=e.getAnnotationByType(a.LINK_GROUP);if(s){const n=s.linkGroups.get(t.groupKey);s.linkGroups.set(t.groupKey,[...n,...t.nodes]),e.annotationMap.set(a.LINK_GROUP,s)}}}),g.register(p.DELETE_CHILD,wt.name,new b),g.register(p.APPEND_CHILD_NODES,wt.name,new k),g.register(p.SPLIT_BLOCK_WITH_NODE,wt.name,new at),g.register(p.REPLACE_CHILD_NODES,wt.name,new D),g.register(p.MERGE_TWO_BLOCKS_NODES,wt.name,new I),g.register(p.BREAK_SINGLE_BLOCK,wt.name,new class extends T{handleAction(t,e){t.newBlock=this.breakSingleTextBlock(t.startContainerNode,t.startOffset,e)}breakSingleTextBlock(t,e,s){const n=this.copyInlineStyleToNewParagraph(t,s);if(this.isCaretPositionAtTextBlockEnd(s,t,e))s.parent.apply(new R(s,n));else{if(!this.isCaretPositionAtTextBlockStart(s,t,e)){const n=new K(t,e);return s.apply(n),n.newBlock}s.parent.apply(new F(s,n))}return n}copyInlineStyleToNewParagraph(t,e){const s=t.cloneWithText("");s.annotationMap.delete(w.LINK);const n=e.createNewParagraph();return n.apply(new B([s])),n}}),g.register(p.LINE_BREAK_SINGLE_BLOCK,wt.name,new ht),g.register(p.LINE_BREAK_MULTIPLE_BLOCKS,wt.name,new lt),g.register(p.DELETE_BLOCK_CONTENT,wt.name,new dt),g.register(p.INSERT_IMAGE_TO_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=t.splitPointNode,n=t.startOffsetOfNode,i=t.imageBlockToBeInserted;if(this.isCaretPositionAtTextBlockEnd(e,s,n))e.parent.apply(new R(e,i));else if(this.isCaretPositionAtTextBlockStart(e,s,n))e.parent.apply(new F(e,i));else{const t=new K(s,n);e.apply(t),e.parent.apply(new R(e,i))}}}),g.register(p.INSERT_NODES_BEFORE,wt.name,new ft),g.register(p.TRANSFORM_LIST_BLOCK,wt.name,new class extends T{handleAction(t,e){const s=e.parent,n=s.createList(t.listType),i=t.selectedBlocks,r=i.map((t=>s.toListItem(t)));n.apply(new B(r)),s.apply(new R(t.selectedBlocks[0],n)),i.forEach((t=>{t.parent.apply(new C(t))}))}});class xt extends x{constructor(t,e){super(),this.isFlushable=!0,this.type=p.UPDATE_CODE_BLOCK,this.content=t,this.language=e}}class At extends m{constructor(t){super(),this.isFlushable=!1,this.range=t}toAnnotation(){return new P(this.range)}}class Et extends N{constructor(t,e,s,n){super(t),this.type=f.CODE_BLOCK_NODE,this.text="",this.annotationMap=new Map,this.text=e,this.parentBlock=n,this.language=s}toJSON(){return{id:this.id,type:"text",text:this.text,language:this.language}}clone(){return new Et(this.id,this.text,this.language,this.parentBlock)}doAnnotationActionApply(t){g.executeTheStrategy(t,this)}doModifyActionApply(t){g.executeTheStrategy(t,this)}}g.register(p.UPDATE_CODE_BLOCK,Et.name,new class extends T{handleAction(t,e){const{content:s,language:n}=t;e.language=n,e.text=s}}),g.register(At.name,Et.name,new class extends T{handleAction(t,e){e.annotationMap.set(a.SELECTION_RANGE,t.toAnnotation())}});class gt extends O{constructor(t,e,s){super(t),this.type="code-block",this.nodes=[new Et(`${t}-1`,e,s,this)]}static from(t){return new gt(t.id,t.content,t.language)}toJSON(){const{language:t,text:e}=this.nodes[0];return{id:this.id,type:"code-block",content:e,language:t}}clone(){const t=gt.from(this.toJSON());return t.parent=this.parent,t}apply(t){if(t instanceof x&&g.executeTheStrategy(t,this),t.isFlushable){const t=d.getDOMByEntity(this);if(t){const i=s.getSubjectFromParentNodeByEventId(t,n);i&&e.notify(i,{})}}}isNotEmpty(){return!!this.nodes.length}getLastNode(){return this.nodes[0]}isSelected(){return this.nodes[0].annotationMap.has(a.SELECTION_RANGE)}}g.register(p.DELETE_CODE_BLOCK,gt.name,new class extends L{handleAction(t,e){const s=e.nodes[0],n=e.parent;if(n){let t=this.getPreviousNode(s),i=this.getRTENodeEndOffset(t);t||(t=this.getNextNode(s),i=0),n.apply(new C(e));const r=t?d.getDOMByEntity(t):null;if(0===n.blocks.length){const s=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),type:"text",text:""}]});e.parent.apply(new B([s])),t=s.nodes[0],i=0}this.notifyUpdateSelection(t,r,i,e)}}notifyUpdateSelection(t,n,r,o){const c=d.getDOMByEntity(o);if(c){const o=s.getSubjectFromParentNodeByEventId(c,i);o&&e.notify(o,{node:t,updateDirectly:!!n,offset:r})}}getRTENodeEndOffset(t){return t&&"CODE_BLOCK_NODE"!==t.type?"IMAGE"!==t.type?t.text.length:1:0}}),g.register(p.DELETE_CHILD,gt.name,new b),g.register(p.SWITCH_OUT_FROM_CODE_BLOCK,gt.name,new class extends T{handleAction(t,n){const{content:r,language:c}=t,a=r.split("\n"),h=new xt(a.slice(0,a.length-2).join("\n"),c);h.isFlushable=!1,n.nodes[0].apply(h);const l=wt.from({id:o(),type:"paragraph",nodes:[{id:o(),text:"",type:"text"}]});n.parent.apply(new R(n,l));const u=d.getDOMByEntity(n);if(u){const t=s.getSubjectFromParentNodeByEventId(u,i);t&&e.notify(t,{node:l.nodes[0]})}}}),g.register(p.INSERT_IMAGE_TO_BLOCK,gt.name,new class extends T{handleAction(t,e){e.parent.apply(new R(e,t.imageBlockToBeInserted))}}),gt.CODE_BLOCK_PLACEHOLDER_CLASS_NAME="code-block-placeholder-element";export{E as $,T as A,L as B,S as C,At as D,$ as E,z as F,Et as G,m as H,R as I,ct as J,J as K,nt as L,x as M,w as N,H as O,ot as P,rt as Q,C as R,K as S,j as T,xt as U,W as V,h as W,tt as X,et as Y,U as Z,v as _,_ as a,A as a0,Q as a1,ut as a2,M as b,B as c,wt as d,F as e,p as f,it as g,pt as h,O as i,g as j,I as k,b as l,k as m,D as n,ft as o,dt as p,ht as q,lt as r,at as s,Y as t,gt as u,N as v,d as w,u as x,y,a as z}
@@ -1 +1 @@
1
- import{V as r}from"./p-044f6193.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.blocks)||void 0===e?void 0:e.length)>1||1===(null===(i=null==r?void 0:r.blocks)||void 0===i?void 0:i.length)&&r.blocks.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
+ import{V as r}from"./p-fecb4044.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.blocks)||void 0===e?void 0:e.length)>1||1===(null===(i=null==r?void 0:r.blocks)||void 0===i?void 0:i.length)&&r.blocks.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{h as e,F as t,r as i,c as r,H as o,g as n}from"./p-21d26bb4.js";import{C as s}from"./p-75b58efe.js";import{T as a,a as d}from"./p-924b4e24.js";import{s as l}from"./p-9b797118.js";import{c as p,V as c,M as h,L as u,I as m}from"./p-6e1ab235.js";import{V as v,I as g}from"./p-4387d550.js";import{F as f}from"./p-9f002a09.js";import{D as b}from"./p-66759f4e.js";import{f as w,A as x,B as y,a as k}from"./p-e1a2a701.js";import{g as R,D as j}from"./p-bf953152.js";import{c as D}from"./p-86194314.js";import{a as I,p as S,e as C}from"./p-08835909.js";import{i as T}from"./p-d27ae9ff.js";import{b as V}from"./p-5773a9a3.js";import{C as O}from"./p-2d0d575f.js";import{E as A}from"./p-0bc7c935.js";import{K as E}from"./p-d7937711.js";import{i as F}from"./p-b1f65b13.js";import{I as M}from"./p-abd7aeaa.js";import{C as $}from"./p-419697c6.js";import{c as P}from"./p-86782109.js";import{T as z}from"./p-d64b20c2.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-425ba7d6.js";import"./p-4ab3df00.js";import"./p-c0291e2e.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-52b8f2d2.js";import"./p-6934013c.js";import"./p-262ec334.js";import"./p-1e194737.js";import"./p-50677c8e.js";import"./p-112455b1.js";import"./p-020b04ed.js";import"./p-8f4e3a60.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-cc63e827.js";import"./p-0fd6c35b.js";import"./p-044f6193.js";import"./p-05373557.js";import"./p-56a0b13d.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";var N=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class _ extends c{constructor(){super(...arguments),this.onTimePickerFocus=async()=>{"single"===this.mode?await this.singleInputRenderer.getInputRef().doFocus():await this.rangeInputRenderer.getStartInputRef().doFocus()}}render(){return e("vega-field-label",{onClick:this.onTimePickerFocus,"is-field-required":this.required,disabled:this.disabled,label:this.label})}}N([p()],_.prototype,"label",void 0),N([p()],_.prototype,"mode",void 0),N([p()],_.prototype,"required",void 0),N([p()],_.prototype,"disabled",void 0),N([p()],_.prototype,"singleInputRenderer",void 0),N([p()],_.prototype,"rangeInputRenderer",void 0);var L=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class B extends c{constructor(){super(...arguments),this.onChildVegaInputChange=e=>{this.valueController.setValue(e.detail)}}getInputRef(){return this.timeInputRef}updateInputValue(e){this.timeInputRef.value=e}render(){return e("div",{class:"time-picker-input"},e("vega-input",{"prefix-icon":"clock-face",placeholder:this.getPlaceholder(),disabled:this.disabled,size:this.size,value:"string"==typeof this.value?this.value:"",ref:e=>{this.timeInputRef=e,this.handleVegaInputEvent(e)}}))}handleVegaInputEvent(e){b.addUniqueObserverToNode(e,w,(e=>{this.onChildVegaInputChange(e)})),b.addUniqueObserverToNode(e,x,(()=>{this.singleDropdownController.show()})),b.addUniqueObserverToNode(e,y,(e=>{this.valueController.checkValueAfterInputBlur(e)}))}getPlaceholder(){return this.placeholder&&"string"==typeof this.placeholder?this.placeholder:this.translationSlimmer.t("Select Time")}}L([p()],B.prototype,"placeholder",void 0),L([p()],B.prototype,"size",void 0),L([p()],B.prototype,"disabled",void 0),L([p()],B.prototype,"value",void 0),L([p()],B.prototype,"valueController",void 0),L([p()],B.prototype,"singleDropdownController",void 0),L([p()],B.prototype,"translationSlimmer",void 0);var W=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class K extends c{constructor(){super(...arguments),this.isMobileDevice=R()===j.MOBILE,this.isTabletDevice=R()===j.TABLET,this.renderDropdownByTimeSource=()=>e(t,null,this.renderDropdownColumn(this.dropdownSource.hours,"hour"),this.renderDropdownColumn(this.dropdownSource.minutes,"minute"),"12-hour"===this.timeFormat&&this.renderDropdownColumn(["AM","PM"],"amPm")),this.onItemClick=(e,t)=>{this.dropdownSelectedItemsController.setSelectedItems(Object.assign(Object.assign({},this.selectedTimeValue),{[t]:e}))},this.onNowButtonClick=()=>{this.dropdownSelectedItemsController.setSelectedItemsToCurrentTime(),this.singleDropdownController.hide()},this.onApplyButtonClick=()=>{this.valueController.updateValueBySelectedItems(),this.singleDropdownController.hide()}}componentDidRenderCallback(){this.dropdownContainer&&this.dropdownContainer.parentElement===this.dropdown&&this.dropdown.shadowRoot.append(this.dropdownContainer)}getDropdownRef(){return this.dropdown}getSelectedItem(){const e=[],t=this.dropdown.shadowRoot;return t.querySelectorAll(".vega-dropdown-item-selected").forEach((t=>{e.push(t)})),0===e.length&&t.querySelectorAll(".vega-time-picker-dropdown-panel li:first-child").forEach((t=>{e.push(t)})),e}render(){return e("vega-time-picker-dropdown",{class:{"vega-time-picker-dropdown":!0,mobile:this.isMobileDevice,tablet:this.isTabletDevice},ref:e=>this.dropdown=e},e("div",{class:"vega-time-picker-dropdown-container",ref:e=>this.dropdownContainer=e},e("div",{class:"vega-time-picker-dropdown-panel"},this.renderDropdownByTimeSource()),e("div",{class:"horizontal-divider v-my-size-12"}),this.renderDropdownFoot()))}renderDropdownColumn(t,i){return e("ul",{role:"menu","aria-label":"dropdown-ul",class:{"vega-time-picker-panel-column":!0}},t.map(((e,t)=>this.renderDropdownItem(e,i,t))))}renderDropdownItem(t,i,r){return e("li",{key:t,role:"menuitem","aria-label":t,class:{"vega-dropdown-item-selected":this.isItemSelected(t,i)},tabIndex:0===r?0:-1,"data-index":r,onClick:()=>this.onItemClick(t,i),onKeyDown:D()},e("span",{"data-index":r,innerHTML:t}))}renderDropdownFoot(){return e("div",{class:"vega-time-picker-dropdown-footer"},e("div",{class:"vega-time-picker-now"},e("vega-button-link",{size:"small",label:"Now",ref:e=>{b.addUniqueObserverToNode(e,k,(()=>{this.onNowButtonClick()}))}})),e("div",null,e("vega-button-link",{size:"small",label:"Apply",ref:e=>{b.addUniqueObserverToNode(e,k,(()=>{this.onApplyButtonClick()}))}})))}isItemSelected(e,t){return this.selectedTimeValue[`${t}`]===e}}W([p()],K.prototype,"timeFormat",void 0),W([p()],K.prototype,"dropdownSource",void 0),W([p()],K.prototype,"selectedTimeValue",void 0),W([p()],K.prototype,"valueController",void 0),W([p()],K.prototype,"dropdownSelectedItemsController",void 0),W([p()],K.prototype,"singleDropdownController",void 0),W([h("componentDidRender")],K.prototype,"componentDidRenderCallback",null);var U=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class q extends c{emitChangeEventOrClearTimePicker(e,t){"range"===this.mode&&T(e,t)||(this.valueGuard(e)?(this.changeEventEmitter.emit(e),O.notify(V,{host:this.host,detail:e})):"single"===this.mode?this.clearTimePicker():this.clearRangeTimePicker())}updateValueIfSelectedItemsChange(){"single"===this.mode&&Object.keys(this.selectedTimeValue).length>0&&this.updateValueBySelectedItems()}resetCurrentValueIfModeChange(){this.resetValue()}checkTheDefaultValueForRangeMode(){"range"===this.mode&&this.value&&!this.valueGuard(this.value)&&this.clearRangeTimePicker()}checkValueAfterInputBlur(e){const t=e.host;this.valueGuard(t.value)?this.increments>1&&this.value&&t.value&&t.value!==this.value&&(t.value=this.value):this.clearTimePicker()}setValue(e){this.valueGuard(e)&&(this.value=e)}resetValue(){this.value="single"===this.mode?"":["",""]}updateValueBySelectedItems(){const e=this.selectedTimeValue.hour?this.selectedTimeValue.hour:"12-hour"===this.timeFormat?"12":"00",t=this.selectedTimeValue.minute?this.selectedTimeValue.minute:"00";this.setValue("12-hour"===this.timeFormat?`${e}:${t} ${this.selectedTimeValue.amPm?this.selectedTimeValue.amPm:"AM"}`:`${e}:${t}`)}updateValueByRangeType(e,t){this.setValue("start"===t?[e,Array.isArray(this.value)&&this.value[1]&&I(this.value[1],this.timeFormat)?this.value[1]:""]:[Array.isArray(this.value)&&this.value[0]&&I(this.value[0],this.timeFormat)?this.value[0]:"",e])}clearRangeTimePicker(){this.value=["",""],this.rangeInputRenderer.getStartInputRef().value="",this.rangeInputRenderer.getEndInputRef().value=""}clearTimePicker(){this.value="",this.singleInputRenderer.getInputRef().value="",this.dropdownSelectedItemsController.setSelectedItems({})}valueGuard(e){let t;switch(this.mode){case"single":t=e&&"string"==typeof e&&I(e,this.timeFormat)||""===e;break;case"range":t=Array.isArray(e)&&2===e.length&&e.every((e=>I(e,this.timeFormat)||""===e))}return t||u.warn(`Invalid time picker value ${e} for ${this.mode} mode`),t}}U([p({writable:!0})],q.prototype,"value",void 0),U([p()],q.prototype,"mode",void 0),U([p()],q.prototype,"timeFormat",void 0),U([p()],q.prototype,"selectedTimeValue",void 0),U([p()],q.prototype,"increments",void 0),U([p()],q.prototype,"changeEventEmitter",void 0),U([p()],q.prototype,"singleInputRenderer",void 0),U([p()],q.prototype,"rangeInputRenderer",void 0),U([p()],q.prototype,"dropdownSelectedItemsController",void 0),U([p()],q.prototype,"host",void 0),U([h("watchValue")],q.prototype,"emitChangeEventOrClearTimePicker",null),U([h("watchSelectedTimeValue")],q.prototype,"updateValueIfSelectedItemsChange",null),U([h("watchMode")],q.prototype,"resetCurrentValueIfModeChange",null),U([h("componentDidLoad")],q.prototype,"checkTheDefaultValueForRangeMode",null);var G=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class H extends A{constructor(){super((()=>({target:this.singleInputRenderer.getInputRef(),appendableElement:this.singleDropdownRenderer.getDropdownRef(),positionRelativeTo:this.positionRelativeTo,translocation:{X:0,Y:8},placement:["bottom","top"]})),(()=>"custom"))}initValueAndDropdownSource(){this.valueController.resetValue(),this.initDropdownSource()}initDropdownSourceAndInputMaskConfig(){this.valueController.resetValue(),this.initDropdownSource(),this.inputMaskController.initInputMask()}initDropdownSourceAndSelectedItems(){this.initDropdownSource(),"single"===this.mode&&this.dropdownSelectedItemsController.initSelectedItemsByString(this.value)}hideDropdownWhenDisabled(){"single"===this.mode&&this.hide()}initDropdownSource(){this.dropdownSource={hours:this.getSourceHoursStrings(),minutes:this.getSourceMinutesStrings()}}getSourceMinutesStrings(){(this.increments<1||this.increments>59||isNaN(Number(this.increments)))&&(u.warn("The increments should be between 1 and 59."),this.increments=1);const e=[];for(let t=0;t<60;t+=this.increments)e.push(S(t));return e}getSourceHoursStrings(){const e=[];if("12-hour"===this.timeFormat){e.push("12");for(let t=1;t<12;t++)e.push(S(t))}else for(let t=0;t<24;t++)e.push(S(t));return e}}G([p({writable:!0})],H.prototype,"isDropdownShow",void 0),G([p({writable:!0})],H.prototype,"dropdownSource",void 0),G([p()],H.prototype,"mode",void 0),G([p({writable:!0})],H.prototype,"increments",void 0),G([p()],H.prototype,"timeFormat",void 0),G([p()],H.prototype,"value",void 0),G([p()],H.prototype,"positionRelativeTo",void 0),G([p()],H.prototype,"selectedTimeValue",void 0),G([p()],H.prototype,"singleInputRenderer",void 0),G([p()],H.prototype,"rangeInputRenderer",void 0),G([p()],H.prototype,"singleDropdownRenderer",void 0),G([p()],H.prototype,"valueController",void 0),G([p()],H.prototype,"dropdownSelectedItemsController",void 0),G([p()],H.prototype,"inputMaskController",void 0),G([h("watchIncrements")],H.prototype,"initValueAndDropdownSource",null),G([h("watchTimeFormat")],H.prototype,"initDropdownSourceAndInputMaskConfig",null),G([h("componentWillLoad")],H.prototype,"initDropdownSourceAndSelectedItems",null),G([h("watchDisabled")],H.prototype,"hideDropdownWhenDisabled",null);var Y=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class X extends c{constructor(){super(...arguments),this.DROPDOWN_ITEM_DEFAULT_HEIGHT=32,this.initSelectedItemsByString=e=>{this.selectedTimeValue=""!==e&&I(e,this.timeFormat)?this.getClosetTimeValue(e):{}},this.scrollToSelectedElement=e=>{const t=e.closest("ul"),i=Number(e.dataset.index)*this.DROPDOWN_ITEM_DEFAULT_HEIGHT;t.scrollTop=i},this.getClosestMinuteForCurrent=e=>{const t=this.dropdownSource.minutes.filter((t=>Number(t)<=Number(e)));return t[t.length-1]},this.getCurrentTime=e=>{const t=new Date(Date.now()).getHours(),i=S(new Date(Date.now()).getMinutes());return"12-hour"===e?{hour:S(t>12?t-12:0===t?12:t),minute:i,amPm:t>=12?"PM":"AM"}:{hour:S(t),minute:i}},this.selectedElementScrollTop=()=>{("single"===this.mode?this.singleDropdownRenderer.getSelectedItem():this.rangeDropdownRenderer.getSelectedItem()).forEach((e=>{this.scrollToSelectedElement(e)}))}}syncSelectedItemsByValueChange(e){"single"===this.mode&&(!I(e,this.timeFormat)&&e||this.initSelectedItemsByString(e))}syncSelectedItemsPositionWhenDropdownShow(e){e&&(this.disabled||this.selectedElementScrollTop())}syncSelectedItemsPosition(){("single"===this.mode&&Object.keys(this.selectedTimeValue).length>0||"range"===this.mode&&Array.isArray(this.value)&&(this.value[0]||this.value[1]))&&this.selectedElementScrollTop()}setSelectedItems(e){this.selectedTimeValue=e}setSelectedItemsToCurrentTime(){this.selectedTimeValue=this.getCurrentTime(this.timeFormat)}getClosetTimeValue(e){const t=e.replace(" ",":").split(":");return{hour:t[0],minute:this.increments>1?this.getClosestMinuteForCurrent(t[1]):t[1],amPm:"12-hour"===this.timeFormat?t[2]:void 0}}}Y([p({writable:!0})],X.prototype,"selectedTimeValue",void 0),Y([p()],X.prototype,"mode",void 0),Y([p()],X.prototype,"value",void 0),Y([p()],X.prototype,"timeFormat",void 0),Y([p()],X.prototype,"dropdownSource",void 0),Y([p()],X.prototype,"increments",void 0),Y([p()],X.prototype,"disabled",void 0),Y([p()],X.prototype,"singleDropdownRenderer",void 0),Y([p()],X.prototype,"rangeDropdownRenderer",void 0),Y([h("watchValue")],X.prototype,"syncSelectedItemsByValueChange",null),Y([h("watchIsDropdownShow")],X.prototype,"syncSelectedItemsPositionWhenDropdownShow",null),Y([h("componentDidRender")],X.prototype,"syncSelectedItemsPosition",null);var J=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class Q extends E{constructor(){super((e=>{const t=e.singleDropdownRenderer.getDropdownRef(),i=e.rangeDropdownRenderer.getStartDropdownRef(),r=e.rangeDropdownRenderer.getEndDropdownRef();return[{keyCode:"Enter",activeElementInScope:[e.host],callback:e.componentBlurAndHideDropdown},{keyCode:["ArrowUp","ArrowDown"],activeElementInScope:[t,i,r],callback:t=>{e.switchHourOrMinuteFocus(t)}},{keyCode:"Escape",activeElementInScope:[e.host,t,i,r],callback:e.componentBlurAndHideDropdown}]})),this.componentBlurAndHideDropdown=async()=>{"single"===this.mode?(await this.singleInputRenderer.getInputRef().doBlur(),this.singleDropdownController.hide()):(await this.rangeInputRenderer.getStartInputRef().doBlur(),await this.rangeInputRenderer.getEndInputRef().doBlur(),this.startDropdownController.hide(),this.endDropdownController.hide())}}switchHourOrMinuteFocus(e){const t=e.key,i=e.composedPath()[0];let r=null;"LI"===i.tagName&&"menuitem"===i.getAttribute("role")&&(r="ArrowDown"===t?i.nextElementSibling:i.previousElementSibling),r&&r.focus()}}J([p()],Q.prototype,"host",void 0),J([p()],Q.prototype,"mode",void 0),J([p()],Q.prototype,"singleInputRenderer",void 0),J([p()],Q.prototype,"singleDropdownRenderer",void 0),J([p()],Q.prototype,"rangeDropdownRenderer",void 0),J([p()],Q.prototype,"rangeInputRenderer",void 0),J([p()],Q.prototype,"singleDropdownController",void 0),J([p()],Q.prototype,"startDropdownController",void 0),J([p()],Q.prototype,"endDropdownController",void 0);var Z=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class ee extends c{constructor(){super(...arguments),this.isMobileDevice=R()===j.MOBILE,this.onInputChange=e=>{e.host.parentElement.classList.contains("time-picker-input-start")?this.valueController.updateValueByRangeType(e.detail,"start"):this.valueController.updateValueByRangeType(e.detail,"end")},this.timePickerInputFocus=e=>{const t=e.host,i=Array.isArray(this.value)?this.value:["",""];t.parentElement.classList.contains("time-picker-input-start")?this.startDropdownController.showAndScrollPosition(i[0]):this.endDropdownController.showAndScrollPosition(i[1]?i[1]:i[0])},this.timePickerInputBlur=e=>{const t=e.host,i=t.parentElement.classList.contains("time-picker-input-start")?"start":"end";if(I(t.value,this.timeFormat)){if(t.value&&this.increments>1){const{hour:e,minute:i,amPm:r}=this.dropdownSelectedItemsController.getClosetTimeValue(t.value);t.value=`${e}:${i}${r?" "+r:""}`}}else t.value="",this.valueController.updateValueByRangeType("",i)}}getStartInputRef(){return this.startTimeInputRef}getEndInputRef(){return this.endTimeInputRef}render(){const i=Array.isArray(this.value)?this.value[0]:"",r=Array.isArray(this.value)?this.value[1]:"";return e(t,null,e("vega-flex",{class:"v-w-full",gap:"0","align-items":"center",direction:this.isMobileDevice?"col":"row"},e("div",{class:"time-picker-input time-picker-input-start vega-flex-basis-0 vega-flex-grow"},e("vega-input",{"prefix-icon":"clock-face",placeholder:this.getPlaceholderBySourceType("start"),disabled:this.disabled,size:this.size,value:i,ref:e=>(this.handlerEvent(e),this.startTimeInputRef=e),"show-clear-icon":"false"})),e("span",{class:"range-input-divider v-min-w-min vega-flex-shrink-0"}),e("div",{class:"time-picker-input time-picker-input-end vega-flex-basis-0 vega-flex-grow"},e("vega-input",{placeholder:this.getPlaceholderBySourceType("end"),disabled:this.disabled,size:this.size,value:r,ref:e=>(this.handlerEvent(e),this.endTimeInputRef=e),"show-clear-icon":"false"}))),this.rangeClearButtonRenderer.render())}handlerEvent(e){b.addUniqueObserverToNode(e,y,(e=>{this.timePickerInputBlur(e)})),b.addUniqueObserverToNode(e,w,(e=>{this.onInputChange(e)})),b.addUniqueObserverToNode(e,x,(e=>{this.timePickerInputFocus(e)}))}getPlaceholderBySourceType(e){return"start"===e?Array.isArray(this.placeholder)&&this.placeholder[0]?this.placeholder[0]:this.translationSlimmer.t("Start Time"):Array.isArray(this.placeholder)&&this.placeholder[1]?this.placeholder[1]:this.translationSlimmer.t("End Time")}}Z([p()],ee.prototype,"mode",void 0),Z([p()],ee.prototype,"placeholder",void 0),Z([p()],ee.prototype,"disabled",void 0),Z([p()],ee.prototype,"size",void 0),Z([p()],ee.prototype,"positionRelativeTo",void 0),Z([p()],ee.prototype,"timeFormat",void 0),Z([p()],ee.prototype,"increments",void 0),Z([p()],ee.prototype,"value",void 0),Z([p()],ee.prototype,"startDropdownController",void 0),Z([p()],ee.prototype,"endDropdownController",void 0),Z([p()],ee.prototype,"valueController",void 0),Z([p()],ee.prototype,"rangeClearButtonRenderer",void 0),Z([p()],ee.prototype,"rangeDropdownRenderer",void 0),Z([p()],ee.prototype,"dropdownSelectedItemsController",void 0),Z([p()],ee.prototype,"translationSlimmer",void 0);var te=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class ie extends c{constructor(){super(...arguments),this.isMobileDevice=R()===j.MOBILE,this.isTabletDevice=R()===j.TABLET,this.renderStartDropdown=()=>e("vega-time-picker-dropdown",{class:{"vega-time-picker-dropdown start-dropdown":!0,mobile:this.isMobileDevice,tablet:this.isTabletDevice},ref:e=>this.startDropdown=e},e("div",{class:"vega-time-picker-dropdown-container",ref:e=>this.startDropdownContainer=e},e("div",{class:"vega-time-picker-dropdown-panel"},this.renderDropdownList("start")))),this.renderEndDropdown=()=>e("vega-time-picker-dropdown",{class:{"vega-time-picker-dropdown end-dropdown":!0,mobile:this.isMobileDevice,tablet:this.isTabletDevice},ref:e=>this.endDropdown=e},e("div",{class:"vega-time-picker-dropdown-container",ref:e=>this.endDropdownContainer=e},e("div",{class:"vega-time-picker-dropdown-panel"},this.renderDropdownList("end")))),this.renderDropdownList=t=>{const i=this.getTimeArray();return e("ul",{role:"menu","aria-label":"dropdown-ul",class:{"vega-time-picker-panel-column":!0}},i.map(((e,i)=>this.renderDropdownItem(e,t,i))))}}componentDidRenderCallback(){this.startDropdownContainer&&this.startDropdownContainer.parentElement===this.startDropdown&&this.startDropdown.shadowRoot.append(this.startDropdownContainer),this.endDropdownContainer&&this.endDropdownContainer.parentElement===this.endDropdown&&this.endDropdown.shadowRoot.append(this.endDropdownContainer)}getStartDropdownRef(){return this.startDropdown}getEndDropdownRef(){return this.endDropdown}getSelectedItem(){const e=this.startDropdown.shadowRoot,t=this.endDropdown.shadowRoot;let i=[e.querySelector(".vega-dropdown-item-selected"),t.querySelector(".vega-dropdown-item-selected")].filter(F);return 0===i.length&&(i=[e.querySelector(".vega-time-picker-dropdown-panel li:first-child"),t.querySelector(".vega-time-picker-dropdown-panel li:first-child")].filter(F)),i}render(){return e(t,null,this.renderStartDropdown(),this.renderEndDropdown())}renderDropdownItem(t,i,r){return e("li",{key:t,role:"menuitem","aria-label":t,class:{"vega-dropdown-item-selected":this.isItemSelected(t,i)},tabIndex:0===r?0:-1,"data-index":r,onClick:()=>this.onItemClick(t,i),onKeyDown:D()},e("span",{"data-index":r,innerHTML:t}))}onItemClick(e,t){this.valueController.updateValueByRangeType(e,t),"start"===t?(this.startDropdownController.hide(),this.rangeInputRenderer.getEndInputRef().doFocus()):this.endDropdownController.hide()}isItemSelected(e,t){const i=this.value&&Array.isArray(this.value)?this.value:["",""];return"start"===t&&i[0]===e||"end"===t&&i[1]===e}getTimeArray(){const e=[],t=[],i=[],r=this.timeFormat,{hours:o,minutes:n}=this.dropdownSource;if(this.dropdownSource)for(let s=0;s<o.length;s++)for(let a=0;a<n.length;a++){const d=`${o[s]}:${n[a]}`;e.push(d),"12-hour"===r&&(i.push(d+" AM"),t.push(d+" PM"))}return"12-hour"===r?i.concat(t):e}}te([p()],ie.prototype,"timeFormat",void 0),te([p()],ie.prototype,"value",void 0),te([p()],ie.prototype,"dropdownSource",void 0),te([p()],ie.prototype,"valueController",void 0),te([p()],ie.prototype,"rangeInputRenderer",void 0),te([p()],ie.prototype,"startDropdownController",void 0),te([p()],ie.prototype,"endDropdownController",void 0),te([h("componentDidRender")],ie.prototype,"componentDidRenderCallback",null);var re=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class oe extends c{constructor(){super(...arguments),this.onClickClearIcon=()=>{this.valueController.clearRangeTimePicker(),this.endDropdownController.hide(),this.rangeInputRenderer.getStartInputRef().doFocus()}}render(){return e("div",{class:{"vega-time-picker-range-clear-icon":!0,invisible:!this.isInvisible()},"aria-label":"clear input",role:"button",tabindex:"-1",onClick:this.onClickClearIcon,onKeyDown:D()},e("vega-icon",{icon:"close",class:"v-min-w-min vega-flex-shrink-0"}))}isInvisible(){return!this.disabled&&Array.isArray(this.value)&&(Boolean(this.value[0])||Boolean(this.value[1]))}}re([p()],oe.prototype,"disabled",void 0),re([p()],oe.prototype,"value",void 0),re([p()],oe.prototype,"valueController",void 0),re([p()],oe.prototype,"endDropdownController",void 0),re([p()],oe.prototype,"rangeInputRenderer",void 0);class ne extends M{constructor(e){super(),this.config=e}canEvaluate(e,t){return t?this.isAcceptedInputType(e)&&!t.disabled&&t.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Unexpected type of input: ${typeof e}: ${e}`);const t=this.isStartTimeBeforeEndTime(e[0],e[1]);return{isValid:t,message:t?"":"The end time should be later than start time"}}isAcceptedInputType(e){return Array.isArray(e)&&2===e.length&&e.every((e=>I(e,this.config.timeFormat)))}isStartTimeBeforeEndTime(e,t){const i=new Date,r=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`;return new Date(`${r}T${C(t)}`)>new Date(`${r}T${C(e)}`)}}var se=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class ae extends c{initInputMask(){const e={type:"custom",options:{mask:"12-hour"===this.timeFormat?"xx:xx xx":"xx:xx",slot:"x",accept:"12-hour"===this.timeFormat?/[0-9|A|P|M]/:/\d/}};"range"===this.mode?(this.rangeInputRenderer.getStartInputRef().maskConfig=e,this.rangeInputRenderer.getEndInputRef().maskConfig=e):this.singleInputRenderer.getInputRef().maskConfig=e}}se([p()],ae.prototype,"timeFormat",void 0),se([p()],ae.prototype,"mode",void 0),se([p()],ae.prototype,"singleInputRenderer",void 0),se([p()],ae.prototype,"rangeInputRenderer",void 0),se([h("componentDidLoad")],ae.prototype,"initInputMask",null);var de=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class le extends A{constructor(e){super((()=>({target:"start"===e?this.rangeInputRenderer.getStartInputRef():this.rangeInputRenderer.getEndInputRef(),appendableElement:"start"===e?this.rangeDropdownRenderer.getStartDropdownRef():this.rangeDropdownRenderer.getEndDropdownRef(),positionRelativeTo:this.positionRelativeTo,translocation:{X:0,Y:8},placement:["bottom","top"],matchTargetWidth:!0})),(()=>"custom"),"isRangeDropdownShow"),this.isRangeDropdownShow=!1,this.rangeDropdownType="start",this.showAndScrollPosition=e=>{if(this.show(),e){const t=("start"===this.rangeDropdownType?this.rangeDropdownRenderer.getStartDropdownRef():this.rangeDropdownRenderer.getEndDropdownRef()).shadowRoot.querySelector(`[aria-label="${e}"]`);t&&this.dropdownSelectedItemsController.scrollToSelectedElement(t)}},this.rangeDropdownType=e}hideDropdownWhenDisabled(){"range"===this.mode&&this.isRangeDropdownShow&&this.hide()}}de([p()],le.prototype,"positionRelativeTo",void 0),de([p()],le.prototype,"mode",void 0),de([p()],le.prototype,"rangeDropdownRenderer",void 0),de([p()],le.prototype,"rangeInputRenderer",void 0),de([p()],le.prototype,"dropdownSelectedItemsController",void 0),de([h("watchDisabled")],le.prototype,"hideDropdownWhenDisabled",null);const pe=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the time picker during user input",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the time picker during user input",payloadValue:e=>!1===e.autoValidation},{payloadKey:"MODE_IS_SINGLE",payloadDescription:"Specifies the mode for selecting time in the time picker, `single` indicates the ability to select a single time.",payloadValue:e=>"single"===e.mode},{payloadKey:"MODE_IS_RANGE",payloadDescription:"Specifies the mode for selecting time in the time picker, `range` indicates the ability to select a time range",payloadValue:e=>"range"===e.mode}];var ce=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};const he=class{constructor(e){i(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new z,this.labelRenderer=new _,this.singleInputRenderer=new B,this.singleDropdownRenderer=new K,this.valueController=new q,this.singleDropdownController=new H,this.dropdownSelectedItemsController=new X,this.keyboardController=new Q,this.formFieldController=new f({propertyRules:[{propertyName:"required",ruleFactory:(e,t,i)=>e?"range"===i?new a({timeFormat:t}):new d({timeFormat:t}):null,dependence:["timeFormat","mode"]},{propertyName:"timeFormat",ruleFactory:(e,t,i)=>e&&t?"range"===i?new a({timeFormat:e}):new d({timeFormat:e}):null,dependence:["required","mode"]},{propertyName:"mode",ruleFactory:(e,t)=>"range"===e?new ne({timeFormat:t}):null,dependence:"timeFormat"}],validationRulesName:"validationRules",defaultValue:e=>"range"===e.mode?["",""]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>"single"===this.mode?[this.singleInputRenderer.getInputRef()]:[this.rangeInputRenderer.getStartInputRef(),this.rangeInputRenderer.getEndInputRef()]}),this.rangeInputRenderer=new ee,this.rangeClearButtonRenderer=new oe,this.rangeDropdownRenderer=new ie,this.startDropdownController=new le("start"),this.endDropdownController=new le("end"),this.inputMaskController=new ae,this.inputEventPrevent=new $([w],(()=>this.inputContainerRef)),this.changeEventEmitter=P(he,w),this.vegaComponentUsageRuntimeMetricsSlimmer=new v(pe),this.isMobileDevice=R()===j.MOBILE,this.isTabletDevice=R()===j.TABLET,this.dropdownSource={hours:[],minutes:[]},this.isDropdownShow=!1,this.selectedTimeValue={},this.mode="single",this.required=!1,this.increments=1,this.timeFormat="24-hour",this.value="range"===this.mode?["",""]:"",this.size="default",this.disabled=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[]}async watchIsDropdownShow(e){}watchSelectedTimeValue(){}watchMode(){}watchIncrements(){}watchTimeFormat(){}watchValue(e,t){}watchDisabled(){}watchValidationRules(){}componentWillLoad(){}componentDidLoad(){}componentDidRender(){}render(){const t="range"===this.mode;return l(e(o,{class:{disabled:this.disabled}},this.labelRenderer.render(),e("div",{class:this.getTimePickerClass(t),ref:e=>this.inputContainerRef=e},t?this.rangeInputRenderer.render():this.singleInputRenderer.render()),t?this.rangeDropdownRenderer.render():this.singleDropdownRenderer.render()),this.host)}getTimePickerClass(e){return{"vega-time-picker-input-container":!0,"range-mode":e,mobile:e&&this.isMobileDevice,tablet:e&&this.isTabletDevice}}get host(){return n(this)}static get watchers(){return{isDropdownShow:["watchIsDropdownShow"],selectedTimeValue:["watchSelectedTimeValue"],mode:["watchMode"],increments:["watchIncrements"],timeFormat:["watchTimeFormat"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};ce([g()],he.prototype,"globalSlimmers",void 0),ce([m()],he.prototype,"translationSlimmer",void 0),ce([m()],he.prototype,"labelRenderer",void 0),ce([m()],he.prototype,"singleInputRenderer",void 0),ce([m()],he.prototype,"singleDropdownRenderer",void 0),ce([m()],he.prototype,"valueController",void 0),ce([m()],he.prototype,"singleDropdownController",void 0),ce([m()],he.prototype,"dropdownSelectedItemsController",void 0),ce([m()],he.prototype,"keyboardController",void 0),ce([m()],he.prototype,"formFieldController",void 0),ce([m()],he.prototype,"rangeInputRenderer",void 0),ce([m()],he.prototype,"rangeClearButtonRenderer",void 0),ce([m()],he.prototype,"rangeDropdownRenderer",void 0),ce([m()],he.prototype,"startDropdownController",void 0),ce([m()],he.prototype,"endDropdownController",void 0),ce([m()],he.prototype,"inputMaskController",void 0),ce([m()],he.prototype,"inputEventPrevent",void 0),ce([m()],he.prototype,"changeEventEmitter",void 0),ce([m()],he.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ce([s()],he.prototype,"watchValue",null),he.style=':host{display:inline-block;text-align:left;line-height:normal;width:100%}vega-field-label{margin-bottom:8px}vega-input::part(field-error-message){display:none}.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-time-picker-input-container.error vega-input::part(input-container){border-width:0px}.vega-time-picker-input-container.error vega-input::part(input-container):hover{border-width:0px}.vega-time-picker-input-container.error vega-input::part(input-container):focus-within{outline:none}.vega-time-picker-input-container.error{border-radius:8px;border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-time-picker-input-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-time-picker-input-container.error: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-hidden{display:none}.range-input-divider{width:1px;height:24px;border-style:solid;border-right-width:1px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1))}.mobile .range-input-divider{width:100%;height:1px;border-style:solid;border-right-width:0px;border-top-width:1px;border-bottom-width:0px;border-left-width:0px}.mobile .time-picker-input-end vega-input::part(input){padding-left:26px}.range-mode{position:relative;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1))}:host(.disabled) .range-mode{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}:host:not(.disabled) .range-mode:not(.error):hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.range-mode vega-input::part(input-container),:host(.disabled) .range-mode vega-input::part(input-container):hover{border-width:0px}.range-mode:not(.error) .time-picker-input-start vega-input::part(input-container):focus-within,.range-mode:not(.error) .time-picker-input-end 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));margin:-1px}.range-mode .vega-time-picker-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%)}.range-mode.mobile .vega-time-picker-range-clear-icon{top:75%}.range-mode.mobile .time-picker-input{width:100%}vega-time-picker-dropdown.vega-force-hidden{display:none !important}.vega-time-picker-range-clear-icon.invisible{visibility:hidden}';var ue=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};const me=class{constructor(e){i(this,e),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new v}render(){return l(e(o,null),this.host)}get host(){return n(this)}};ue([g()],me.prototype,"globalSlimmers",void 0),ue([m()],me.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),me.style=':host(.vega-time-picker-dropdown){border-radius:12px;position:absolute;overflow:hidden}:host(.vega-force-hidden){display:none !important}.vega-time-picker-dropdown-container{flex-direction:column;position:relative;padding-top:16px;padding-bottom:16px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:12px;box-shadow:var(--v-shadow-dropdown-menu, 0px 2px 4px -2px rgba(0, 0, 0, 0.1), 0px 4px 6px -1px rgba(0, 0, 0, 0.1))}.vega-time-picker-dropdown-panel{display:flex;height:224px}.vega-time-picker-dropdown-panel>ul{flex-grow:1;overflow:hidden;padding-left:0px;margin:0px;width:72px;list-style-type:none;scroll-behavior:smooth}.vega-time-picker-dropdown-panel>ul:hover{overflow-y:auto}:host(.mobile) .vega-time-picker-dropdown-panel>ul,:host(.tablet) .vega-time-picker-dropdown-panel>ul{overflow-y:auto;overflow-x:hidden}.vega-time-picker-dropdown-panel>ul:hover::-webkit-scrollbar{width:4px}.vega-time-picker-dropdown-panel>ul:hover::-webkit-scrollbar-thumb{background-color:rgba(var(--v-bg-status-info, 205, 209, 211, 1));border-radius:9999px}.vega-time-picker-panel-column:not(:last-child){border-right-width:1px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1));border-right-style:solid}.vega-time-picker-dropdown-panel>ul>li{padding-top:4px;padding-bottom:4px;padding-left:16px;cursor:pointer;display:flex;align-items:center;width:100%}.vega-time-picker-dropdown-panel>ul>li:focus{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}.vega-time-picker-dropdown-panel>ul>li:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}.vega-time-picker-dropdown-panel>ul>li.vega-dropdown-item-selected{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}.vega-time-picker-dropdown-panel>ul>li{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;text-decoration:none;outline:0}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-time-picker-dropdown-panel>ul>li{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){.vega-time-picker-dropdown-panel>ul>li{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){.vega-time-picker-dropdown-panel>ul>li{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.vega-time-picker-panel-column::after{display:block;height:192px;content:""}.vega-time-picker-dropdown-footer{display:flex;padding-left:16px;padding-right:16px;justify-content:flex-end}.vega-time-picker-dropdown-footer .vega-time-picker-now{flex-grow:1}.horizontal-divider{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));width:100%;margin-top:12px;margin-bottom:12px}';export{he as vega_time_picker,me as vega_time_picker_dropdown}
1
+ import{h as e,F as t,r as i,c as r,H as o,g as n}from"./p-21d26bb4.js";import{C as s}from"./p-75b58efe.js";import{T as a,a as d}from"./p-924b4e24.js";import{s as l}from"./p-519a7d55.js";import{c as p,V as c,M as h,L as u,I as m}from"./p-6e1ab235.js";import{V as v,I as g}from"./p-4387d550.js";import{F as f}from"./p-21e180f2.js";import{D as b}from"./p-e7b00bf0.js";import{f as w,A as x,B as y,a as k}from"./p-6e01f0a2.js";import{g as R,D as j}from"./p-d5776087.js";import{c as D}from"./p-86194314.js";import{a as I,p as S,e as C}from"./p-08835909.js";import{i as T}from"./p-d27ae9ff.js";import{b as V}from"./p-5773a9a3.js";import{C as O}from"./p-2d0d575f.js";import{E as A}from"./p-8bdc9e75.js";import{K as E}from"./p-55563f5f.js";import{i as F}from"./p-b1f65b13.js";import{I as M}from"./p-abd7aeaa.js";import{C as $}from"./p-6b7dca3e.js";import{c as P}from"./p-eea36d3c.js";import{T as z}from"./p-d64b20c2.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-425ba7d6.js";import"./p-4ab3df00.js";import"./p-834434d5.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-52b8f2d2.js";import"./p-138fcf6e.js";import"./p-262ec334.js";import"./p-eb832119.js";import"./p-0c8bd757.js";import"./p-112455b1.js";import"./p-613ee009.js";import"./p-06fb002a.js";import"./p-0c667d6a.js";import"./p-5f377954.js";import"./p-4d793cb0.js";import"./p-7a40e033.js";import"./p-cc63e827.js";import"./p-fa5eb496.js";import"./p-fecb4044.js";import"./p-3eb2d433.js";import"./p-1df029c2.js";import"./p-3a0a4d15.js";import"./p-d884c644.js";var N=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class _ extends c{constructor(){super(...arguments),this.onTimePickerFocus=async()=>{"single"===this.mode?await this.singleInputRenderer.getInputRef().doFocus():await this.rangeInputRenderer.getStartInputRef().doFocus()}}render(){return e("vega-field-label",{onClick:this.onTimePickerFocus,"is-field-required":this.required,disabled:this.disabled,label:this.label})}}N([p()],_.prototype,"label",void 0),N([p()],_.prototype,"mode",void 0),N([p()],_.prototype,"required",void 0),N([p()],_.prototype,"disabled",void 0),N([p()],_.prototype,"singleInputRenderer",void 0),N([p()],_.prototype,"rangeInputRenderer",void 0);var L=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class B extends c{constructor(){super(...arguments),this.onChildVegaInputChange=e=>{this.valueController.setValue(e.detail)}}getInputRef(){return this.timeInputRef}updateInputValue(e){this.timeInputRef.value=e}render(){return e("div",{class:"time-picker-input"},e("vega-input",{"prefix-icon":"clock-face",placeholder:this.getPlaceholder(),disabled:this.disabled,size:this.size,value:"string"==typeof this.value?this.value:"",ref:e=>{this.timeInputRef=e,this.handleVegaInputEvent(e)}}))}handleVegaInputEvent(e){b.addUniqueObserverToNode(e,w,(e=>{this.onChildVegaInputChange(e)})),b.addUniqueObserverToNode(e,x,(()=>{this.singleDropdownController.show()})),b.addUniqueObserverToNode(e,y,(e=>{this.valueController.checkValueAfterInputBlur(e)}))}getPlaceholder(){return this.placeholder&&"string"==typeof this.placeholder?this.placeholder:this.translationSlimmer.t("Select Time")}}L([p()],B.prototype,"placeholder",void 0),L([p()],B.prototype,"size",void 0),L([p()],B.prototype,"disabled",void 0),L([p()],B.prototype,"value",void 0),L([p()],B.prototype,"valueController",void 0),L([p()],B.prototype,"singleDropdownController",void 0),L([p()],B.prototype,"translationSlimmer",void 0);var W=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class K extends c{constructor(){super(...arguments),this.isMobileDevice=R()===j.MOBILE,this.isTabletDevice=R()===j.TABLET,this.renderDropdownByTimeSource=()=>e(t,null,this.renderDropdownColumn(this.dropdownSource.hours,"hour"),this.renderDropdownColumn(this.dropdownSource.minutes,"minute"),"12-hour"===this.timeFormat&&this.renderDropdownColumn(["AM","PM"],"amPm")),this.onItemClick=(e,t)=>{this.dropdownSelectedItemsController.setSelectedItems(Object.assign(Object.assign({},this.selectedTimeValue),{[t]:e}))},this.onNowButtonClick=()=>{this.dropdownSelectedItemsController.setSelectedItemsToCurrentTime(),this.singleDropdownController.hide()},this.onApplyButtonClick=()=>{this.valueController.updateValueBySelectedItems(),this.singleDropdownController.hide()}}componentDidRenderCallback(){this.dropdownContainer&&this.dropdownContainer.parentElement===this.dropdown&&this.dropdown.shadowRoot.append(this.dropdownContainer)}getDropdownRef(){return this.dropdown}getSelectedItem(){const e=[],t=this.dropdown.shadowRoot;return t.querySelectorAll(".vega-dropdown-item-selected").forEach((t=>{e.push(t)})),0===e.length&&t.querySelectorAll(".vega-time-picker-dropdown-panel li:first-child").forEach((t=>{e.push(t)})),e}render(){return e("vega-time-picker-dropdown",{class:{"vega-time-picker-dropdown":!0,mobile:this.isMobileDevice,tablet:this.isTabletDevice},ref:e=>this.dropdown=e},e("div",{class:"vega-time-picker-dropdown-container",ref:e=>this.dropdownContainer=e},e("div",{class:"vega-time-picker-dropdown-panel"},this.renderDropdownByTimeSource()),e("div",{class:"horizontal-divider v-my-size-12"}),this.renderDropdownFoot()))}renderDropdownColumn(t,i){return e("ul",{role:"menu","aria-label":"dropdown-ul",class:{"vega-time-picker-panel-column":!0}},t.map(((e,t)=>this.renderDropdownItem(e,i,t))))}renderDropdownItem(t,i,r){return e("li",{key:t,role:"menuitem","aria-label":t,class:{"vega-dropdown-item-selected":this.isItemSelected(t,i)},tabIndex:0===r?0:-1,"data-index":r,onClick:()=>this.onItemClick(t,i),onKeyDown:D()},e("span",{"data-index":r,innerHTML:t}))}renderDropdownFoot(){return e("div",{class:"vega-time-picker-dropdown-footer"},e("div",{class:"vega-time-picker-now"},e("vega-button-link",{size:"small",label:"Now",ref:e=>{b.addUniqueObserverToNode(e,k,(()=>{this.onNowButtonClick()}))}})),e("div",null,e("vega-button-link",{size:"small",label:"Apply",ref:e=>{b.addUniqueObserverToNode(e,k,(()=>{this.onApplyButtonClick()}))}})))}isItemSelected(e,t){return this.selectedTimeValue[`${t}`]===e}}W([p()],K.prototype,"timeFormat",void 0),W([p()],K.prototype,"dropdownSource",void 0),W([p()],K.prototype,"selectedTimeValue",void 0),W([p()],K.prototype,"valueController",void 0),W([p()],K.prototype,"dropdownSelectedItemsController",void 0),W([p()],K.prototype,"singleDropdownController",void 0),W([h("componentDidRender")],K.prototype,"componentDidRenderCallback",null);var U=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class q extends c{emitChangeEventOrClearTimePicker(e,t){"range"===this.mode&&T(e,t)||(this.valueGuard(e)?(this.changeEventEmitter.emit(e),O.notify(V,{host:this.host,detail:e})):"single"===this.mode?this.clearTimePicker():this.clearRangeTimePicker())}updateValueIfSelectedItemsChange(){"single"===this.mode&&Object.keys(this.selectedTimeValue).length>0&&this.updateValueBySelectedItems()}resetCurrentValueIfModeChange(){this.resetValue()}checkTheDefaultValueForRangeMode(){"range"===this.mode&&this.value&&!this.valueGuard(this.value)&&this.clearRangeTimePicker()}checkValueAfterInputBlur(e){const t=e.host;this.valueGuard(t.value)?this.increments>1&&this.value&&t.value&&t.value!==this.value&&(t.value=this.value):this.clearTimePicker()}setValue(e){this.valueGuard(e)&&(this.value=e)}resetValue(){this.value="single"===this.mode?"":["",""]}updateValueBySelectedItems(){const e=this.selectedTimeValue.hour?this.selectedTimeValue.hour:"12-hour"===this.timeFormat?"12":"00",t=this.selectedTimeValue.minute?this.selectedTimeValue.minute:"00";this.setValue("12-hour"===this.timeFormat?`${e}:${t} ${this.selectedTimeValue.amPm?this.selectedTimeValue.amPm:"AM"}`:`${e}:${t}`)}updateValueByRangeType(e,t){this.setValue("start"===t?[e,Array.isArray(this.value)&&this.value[1]&&I(this.value[1],this.timeFormat)?this.value[1]:""]:[Array.isArray(this.value)&&this.value[0]&&I(this.value[0],this.timeFormat)?this.value[0]:"",e])}clearRangeTimePicker(){this.value=["",""],this.rangeInputRenderer.getStartInputRef().value="",this.rangeInputRenderer.getEndInputRef().value=""}clearTimePicker(){this.value="",this.singleInputRenderer.getInputRef().value="",this.dropdownSelectedItemsController.setSelectedItems({})}valueGuard(e){let t;switch(this.mode){case"single":t=e&&"string"==typeof e&&I(e,this.timeFormat)||""===e;break;case"range":t=Array.isArray(e)&&2===e.length&&e.every((e=>I(e,this.timeFormat)||""===e))}return t||u.warn(`Invalid time picker value ${e} for ${this.mode} mode`),t}}U([p({writable:!0})],q.prototype,"value",void 0),U([p()],q.prototype,"mode",void 0),U([p()],q.prototype,"timeFormat",void 0),U([p()],q.prototype,"selectedTimeValue",void 0),U([p()],q.prototype,"increments",void 0),U([p()],q.prototype,"changeEventEmitter",void 0),U([p()],q.prototype,"singleInputRenderer",void 0),U([p()],q.prototype,"rangeInputRenderer",void 0),U([p()],q.prototype,"dropdownSelectedItemsController",void 0),U([p()],q.prototype,"host",void 0),U([h("watchValue")],q.prototype,"emitChangeEventOrClearTimePicker",null),U([h("watchSelectedTimeValue")],q.prototype,"updateValueIfSelectedItemsChange",null),U([h("watchMode")],q.prototype,"resetCurrentValueIfModeChange",null),U([h("componentDidLoad")],q.prototype,"checkTheDefaultValueForRangeMode",null);var G=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class H extends A{constructor(){super((()=>({target:this.singleInputRenderer.getInputRef(),appendableElement:this.singleDropdownRenderer.getDropdownRef(),positionRelativeTo:this.positionRelativeTo,translocation:{X:0,Y:8},placement:["bottom","top"]})),(()=>"custom"))}initValueAndDropdownSource(){this.valueController.resetValue(),this.initDropdownSource()}initDropdownSourceAndInputMaskConfig(){this.valueController.resetValue(),this.initDropdownSource(),this.inputMaskController.initInputMask()}initDropdownSourceAndSelectedItems(){this.initDropdownSource(),"single"===this.mode&&this.dropdownSelectedItemsController.initSelectedItemsByString(this.value)}hideDropdownWhenDisabled(){"single"===this.mode&&this.hide()}initDropdownSource(){this.dropdownSource={hours:this.getSourceHoursStrings(),minutes:this.getSourceMinutesStrings()}}getSourceMinutesStrings(){(this.increments<1||this.increments>59||isNaN(Number(this.increments)))&&(u.warn("The increments should be between 1 and 59."),this.increments=1);const e=[];for(let t=0;t<60;t+=this.increments)e.push(S(t));return e}getSourceHoursStrings(){const e=[];if("12-hour"===this.timeFormat){e.push("12");for(let t=1;t<12;t++)e.push(S(t))}else for(let t=0;t<24;t++)e.push(S(t));return e}}G([p({writable:!0})],H.prototype,"isDropdownShow",void 0),G([p({writable:!0})],H.prototype,"dropdownSource",void 0),G([p()],H.prototype,"mode",void 0),G([p({writable:!0})],H.prototype,"increments",void 0),G([p()],H.prototype,"timeFormat",void 0),G([p()],H.prototype,"value",void 0),G([p()],H.prototype,"positionRelativeTo",void 0),G([p()],H.prototype,"selectedTimeValue",void 0),G([p()],H.prototype,"singleInputRenderer",void 0),G([p()],H.prototype,"rangeInputRenderer",void 0),G([p()],H.prototype,"singleDropdownRenderer",void 0),G([p()],H.prototype,"valueController",void 0),G([p()],H.prototype,"dropdownSelectedItemsController",void 0),G([p()],H.prototype,"inputMaskController",void 0),G([h("watchIncrements")],H.prototype,"initValueAndDropdownSource",null),G([h("watchTimeFormat")],H.prototype,"initDropdownSourceAndInputMaskConfig",null),G([h("componentWillLoad")],H.prototype,"initDropdownSourceAndSelectedItems",null),G([h("watchDisabled")],H.prototype,"hideDropdownWhenDisabled",null);var Y=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class X extends c{constructor(){super(...arguments),this.DROPDOWN_ITEM_DEFAULT_HEIGHT=32,this.initSelectedItemsByString=e=>{this.selectedTimeValue=""!==e&&I(e,this.timeFormat)?this.getClosetTimeValue(e):{}},this.scrollToSelectedElement=e=>{const t=e.closest("ul"),i=Number(e.dataset.index)*this.DROPDOWN_ITEM_DEFAULT_HEIGHT;t.scrollTop=i},this.getClosestMinuteForCurrent=e=>{const t=this.dropdownSource.minutes.filter((t=>Number(t)<=Number(e)));return t[t.length-1]},this.getCurrentTime=e=>{const t=new Date(Date.now()).getHours(),i=S(new Date(Date.now()).getMinutes());return"12-hour"===e?{hour:S(t>12?t-12:0===t?12:t),minute:i,amPm:t>=12?"PM":"AM"}:{hour:S(t),minute:i}},this.selectedElementScrollTop=()=>{("single"===this.mode?this.singleDropdownRenderer.getSelectedItem():this.rangeDropdownRenderer.getSelectedItem()).forEach((e=>{this.scrollToSelectedElement(e)}))}}syncSelectedItemsByValueChange(e){"single"===this.mode&&(!I(e,this.timeFormat)&&e||this.initSelectedItemsByString(e))}syncSelectedItemsPositionWhenDropdownShow(e){e&&(this.disabled||this.selectedElementScrollTop())}syncSelectedItemsPosition(){("single"===this.mode&&Object.keys(this.selectedTimeValue).length>0||"range"===this.mode&&Array.isArray(this.value)&&(this.value[0]||this.value[1]))&&this.selectedElementScrollTop()}setSelectedItems(e){this.selectedTimeValue=e}setSelectedItemsToCurrentTime(){this.selectedTimeValue=this.getCurrentTime(this.timeFormat)}getClosetTimeValue(e){const t=e.replace(" ",":").split(":");return{hour:t[0],minute:this.increments>1?this.getClosestMinuteForCurrent(t[1]):t[1],amPm:"12-hour"===this.timeFormat?t[2]:void 0}}}Y([p({writable:!0})],X.prototype,"selectedTimeValue",void 0),Y([p()],X.prototype,"mode",void 0),Y([p()],X.prototype,"value",void 0),Y([p()],X.prototype,"timeFormat",void 0),Y([p()],X.prototype,"dropdownSource",void 0),Y([p()],X.prototype,"increments",void 0),Y([p()],X.prototype,"disabled",void 0),Y([p()],X.prototype,"singleDropdownRenderer",void 0),Y([p()],X.prototype,"rangeDropdownRenderer",void 0),Y([h("watchValue")],X.prototype,"syncSelectedItemsByValueChange",null),Y([h("watchIsDropdownShow")],X.prototype,"syncSelectedItemsPositionWhenDropdownShow",null),Y([h("componentDidRender")],X.prototype,"syncSelectedItemsPosition",null);var J=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class Q extends E{constructor(){super((e=>{const t=e.singleDropdownRenderer.getDropdownRef(),i=e.rangeDropdownRenderer.getStartDropdownRef(),r=e.rangeDropdownRenderer.getEndDropdownRef();return[{keyCode:"Enter",activeElementInScope:[e.host],callback:e.componentBlurAndHideDropdown},{keyCode:["ArrowUp","ArrowDown"],activeElementInScope:[t,i,r],callback:t=>{e.switchHourOrMinuteFocus(t)}},{keyCode:"Escape",activeElementInScope:[e.host,t,i,r],callback:e.componentBlurAndHideDropdown}]})),this.componentBlurAndHideDropdown=async()=>{"single"===this.mode?(await this.singleInputRenderer.getInputRef().doBlur(),this.singleDropdownController.hide()):(await this.rangeInputRenderer.getStartInputRef().doBlur(),await this.rangeInputRenderer.getEndInputRef().doBlur(),this.startDropdownController.hide(),this.endDropdownController.hide())}}switchHourOrMinuteFocus(e){const t=e.key,i=e.composedPath()[0];let r=null;"LI"===i.tagName&&"menuitem"===i.getAttribute("role")&&(r="ArrowDown"===t?i.nextElementSibling:i.previousElementSibling),r&&r.focus()}}J([p()],Q.prototype,"host",void 0),J([p()],Q.prototype,"mode",void 0),J([p()],Q.prototype,"singleInputRenderer",void 0),J([p()],Q.prototype,"singleDropdownRenderer",void 0),J([p()],Q.prototype,"rangeDropdownRenderer",void 0),J([p()],Q.prototype,"rangeInputRenderer",void 0),J([p()],Q.prototype,"singleDropdownController",void 0),J([p()],Q.prototype,"startDropdownController",void 0),J([p()],Q.prototype,"endDropdownController",void 0);var Z=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class ee extends c{constructor(){super(...arguments),this.isMobileDevice=R()===j.MOBILE,this.onInputChange=e=>{e.host.parentElement.classList.contains("time-picker-input-start")?this.valueController.updateValueByRangeType(e.detail,"start"):this.valueController.updateValueByRangeType(e.detail,"end")},this.timePickerInputFocus=e=>{const t=e.host,i=Array.isArray(this.value)?this.value:["",""];t.parentElement.classList.contains("time-picker-input-start")?this.startDropdownController.showAndScrollPosition(i[0]):this.endDropdownController.showAndScrollPosition(i[1]?i[1]:i[0])},this.timePickerInputBlur=e=>{const t=e.host,i=t.parentElement.classList.contains("time-picker-input-start")?"start":"end";if(I(t.value,this.timeFormat)){if(t.value&&this.increments>1){const{hour:e,minute:i,amPm:r}=this.dropdownSelectedItemsController.getClosetTimeValue(t.value);t.value=`${e}:${i}${r?" "+r:""}`}}else t.value="",this.valueController.updateValueByRangeType("",i)}}getStartInputRef(){return this.startTimeInputRef}getEndInputRef(){return this.endTimeInputRef}render(){const i=Array.isArray(this.value)?this.value[0]:"",r=Array.isArray(this.value)?this.value[1]:"";return e(t,null,e("vega-flex",{class:"v-w-full",gap:"0","align-items":"center",direction:this.isMobileDevice?"col":"row"},e("div",{class:"time-picker-input time-picker-input-start vega-flex-basis-0 vega-flex-grow"},e("vega-input",{"prefix-icon":"clock-face",placeholder:this.getPlaceholderBySourceType("start"),disabled:this.disabled,size:this.size,value:i,ref:e=>(this.handlerEvent(e),this.startTimeInputRef=e),"show-clear-icon":"false"})),e("span",{class:"range-input-divider v-min-w-min vega-flex-shrink-0"}),e("div",{class:"time-picker-input time-picker-input-end vega-flex-basis-0 vega-flex-grow"},e("vega-input",{placeholder:this.getPlaceholderBySourceType("end"),disabled:this.disabled,size:this.size,value:r,ref:e=>(this.handlerEvent(e),this.endTimeInputRef=e),"show-clear-icon":"false"}))),this.rangeClearButtonRenderer.render())}handlerEvent(e){b.addUniqueObserverToNode(e,y,(e=>{this.timePickerInputBlur(e)})),b.addUniqueObserverToNode(e,w,(e=>{this.onInputChange(e)})),b.addUniqueObserverToNode(e,x,(e=>{this.timePickerInputFocus(e)}))}getPlaceholderBySourceType(e){return"start"===e?Array.isArray(this.placeholder)&&this.placeholder[0]?this.placeholder[0]:this.translationSlimmer.t("Start Time"):Array.isArray(this.placeholder)&&this.placeholder[1]?this.placeholder[1]:this.translationSlimmer.t("End Time")}}Z([p()],ee.prototype,"mode",void 0),Z([p()],ee.prototype,"placeholder",void 0),Z([p()],ee.prototype,"disabled",void 0),Z([p()],ee.prototype,"size",void 0),Z([p()],ee.prototype,"positionRelativeTo",void 0),Z([p()],ee.prototype,"timeFormat",void 0),Z([p()],ee.prototype,"increments",void 0),Z([p()],ee.prototype,"value",void 0),Z([p()],ee.prototype,"startDropdownController",void 0),Z([p()],ee.prototype,"endDropdownController",void 0),Z([p()],ee.prototype,"valueController",void 0),Z([p()],ee.prototype,"rangeClearButtonRenderer",void 0),Z([p()],ee.prototype,"rangeDropdownRenderer",void 0),Z([p()],ee.prototype,"dropdownSelectedItemsController",void 0),Z([p()],ee.prototype,"translationSlimmer",void 0);var te=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class ie extends c{constructor(){super(...arguments),this.isMobileDevice=R()===j.MOBILE,this.isTabletDevice=R()===j.TABLET,this.renderStartDropdown=()=>e("vega-time-picker-dropdown",{class:{"vega-time-picker-dropdown start-dropdown":!0,mobile:this.isMobileDevice,tablet:this.isTabletDevice},ref:e=>this.startDropdown=e},e("div",{class:"vega-time-picker-dropdown-container",ref:e=>this.startDropdownContainer=e},e("div",{class:"vega-time-picker-dropdown-panel"},this.renderDropdownList("start")))),this.renderEndDropdown=()=>e("vega-time-picker-dropdown",{class:{"vega-time-picker-dropdown end-dropdown":!0,mobile:this.isMobileDevice,tablet:this.isTabletDevice},ref:e=>this.endDropdown=e},e("div",{class:"vega-time-picker-dropdown-container",ref:e=>this.endDropdownContainer=e},e("div",{class:"vega-time-picker-dropdown-panel"},this.renderDropdownList("end")))),this.renderDropdownList=t=>{const i=this.getTimeArray();return e("ul",{role:"menu","aria-label":"dropdown-ul",class:{"vega-time-picker-panel-column":!0}},i.map(((e,i)=>this.renderDropdownItem(e,t,i))))}}componentDidRenderCallback(){this.startDropdownContainer&&this.startDropdownContainer.parentElement===this.startDropdown&&this.startDropdown.shadowRoot.append(this.startDropdownContainer),this.endDropdownContainer&&this.endDropdownContainer.parentElement===this.endDropdown&&this.endDropdown.shadowRoot.append(this.endDropdownContainer)}getStartDropdownRef(){return this.startDropdown}getEndDropdownRef(){return this.endDropdown}getSelectedItem(){const e=this.startDropdown.shadowRoot,t=this.endDropdown.shadowRoot;let i=[e.querySelector(".vega-dropdown-item-selected"),t.querySelector(".vega-dropdown-item-selected")].filter(F);return 0===i.length&&(i=[e.querySelector(".vega-time-picker-dropdown-panel li:first-child"),t.querySelector(".vega-time-picker-dropdown-panel li:first-child")].filter(F)),i}render(){return e(t,null,this.renderStartDropdown(),this.renderEndDropdown())}renderDropdownItem(t,i,r){return e("li",{key:t,role:"menuitem","aria-label":t,class:{"vega-dropdown-item-selected":this.isItemSelected(t,i)},tabIndex:0===r?0:-1,"data-index":r,onClick:()=>this.onItemClick(t,i),onKeyDown:D()},e("span",{"data-index":r,innerHTML:t}))}onItemClick(e,t){this.valueController.updateValueByRangeType(e,t),"start"===t?(this.startDropdownController.hide(),this.rangeInputRenderer.getEndInputRef().doFocus()):this.endDropdownController.hide()}isItemSelected(e,t){const i=this.value&&Array.isArray(this.value)?this.value:["",""];return"start"===t&&i[0]===e||"end"===t&&i[1]===e}getTimeArray(){const e=[],t=[],i=[],r=this.timeFormat,{hours:o,minutes:n}=this.dropdownSource;if(this.dropdownSource)for(let s=0;s<o.length;s++)for(let a=0;a<n.length;a++){const d=`${o[s]}:${n[a]}`;e.push(d),"12-hour"===r&&(i.push(d+" AM"),t.push(d+" PM"))}return"12-hour"===r?i.concat(t):e}}te([p()],ie.prototype,"timeFormat",void 0),te([p()],ie.prototype,"value",void 0),te([p()],ie.prototype,"dropdownSource",void 0),te([p()],ie.prototype,"valueController",void 0),te([p()],ie.prototype,"rangeInputRenderer",void 0),te([p()],ie.prototype,"startDropdownController",void 0),te([p()],ie.prototype,"endDropdownController",void 0),te([h("componentDidRender")],ie.prototype,"componentDidRenderCallback",null);var re=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class oe extends c{constructor(){super(...arguments),this.onClickClearIcon=()=>{this.valueController.clearRangeTimePicker(),this.endDropdownController.hide(),this.rangeInputRenderer.getStartInputRef().doFocus()}}render(){return e("div",{class:{"vega-time-picker-range-clear-icon":!0,invisible:!this.isInvisible()},"aria-label":"clear input",role:"button",tabindex:this.disabled?-1:0,onClick:this.onClickClearIcon,onKeyDown:D()},e("vega-icon",{icon:"close",class:"v-min-w-min vega-flex-shrink-0"}))}isInvisible(){return!this.disabled&&Array.isArray(this.value)&&(Boolean(this.value[0])||Boolean(this.value[1]))}}re([p()],oe.prototype,"disabled",void 0),re([p()],oe.prototype,"value",void 0),re([p()],oe.prototype,"valueController",void 0),re([p()],oe.prototype,"endDropdownController",void 0),re([p()],oe.prototype,"rangeInputRenderer",void 0);class ne extends M{constructor(e){super(),this.config=e}canEvaluate(e,t){return t?this.isAcceptedInputType(e)&&!t.disabled&&t.visible:this.isAcceptedInputType(e)}shouldShowError(e){return!e.disabled&&e.visible&&(e.touched||e.modified)}evaluate(e){if(!this.isAcceptedInputType(e))throw new Error(`Unexpected type of input: ${typeof e}: ${e}`);const t=this.isStartTimeBeforeEndTime(e[0],e[1]);return{isValid:t,message:t?"":"The end time should be later than start time"}}isAcceptedInputType(e){return Array.isArray(e)&&2===e.length&&e.every((e=>I(e,this.config.timeFormat)))}isStartTimeBeforeEndTime(e,t){const i=new Date,r=`${i.getFullYear()}-${String(i.getMonth()+1).padStart(2,"0")}-${String(i.getDate()).padStart(2,"0")}`;return new Date(`${r}T${C(t)}`)>new Date(`${r}T${C(e)}`)}}var se=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class ae extends c{initInputMask(){const e={type:"custom",options:{mask:"12-hour"===this.timeFormat?"xx:xx xx":"xx:xx",slot:"x",accept:"12-hour"===this.timeFormat?/[0-9|A|P|M]/:/\d/}};"range"===this.mode?(this.rangeInputRenderer.getStartInputRef().maskConfig=e,this.rangeInputRenderer.getEndInputRef().maskConfig=e):this.singleInputRenderer.getInputRef().maskConfig=e}}se([p()],ae.prototype,"timeFormat",void 0),se([p()],ae.prototype,"mode",void 0),se([p()],ae.prototype,"singleInputRenderer",void 0),se([p()],ae.prototype,"rangeInputRenderer",void 0),se([h("componentDidLoad")],ae.prototype,"initInputMask",null);var de=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class le extends A{constructor(e){super((()=>({target:"start"===e?this.rangeInputRenderer.getStartInputRef():this.rangeInputRenderer.getEndInputRef(),appendableElement:"start"===e?this.rangeDropdownRenderer.getStartDropdownRef():this.rangeDropdownRenderer.getEndDropdownRef(),positionRelativeTo:this.positionRelativeTo,translocation:{X:0,Y:8},placement:["bottom","top"],matchTargetWidth:!0})),(()=>"custom"),"isRangeDropdownShow"),this.isRangeDropdownShow=!1,this.rangeDropdownType="start",this.showAndScrollPosition=e=>{if(this.show(),e){const t=("start"===this.rangeDropdownType?this.rangeDropdownRenderer.getStartDropdownRef():this.rangeDropdownRenderer.getEndDropdownRef()).shadowRoot.querySelector(`[aria-label="${e}"]`);t&&this.dropdownSelectedItemsController.scrollToSelectedElement(t)}},this.rangeDropdownType=e}hideDropdownWhenDisabled(){"range"===this.mode&&this.isRangeDropdownShow&&this.hide()}}de([p()],le.prototype,"positionRelativeTo",void 0),de([p()],le.prototype,"mode",void 0),de([p()],le.prototype,"rangeDropdownRenderer",void 0),de([p()],le.prototype,"rangeInputRenderer",void 0),de([p()],le.prototype,"dropdownSelectedItemsController",void 0),de([h("watchDisabled")],le.prototype,"hideDropdownWhenDisabled",null);const pe=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether automatic validation should be implemented for the time picker during user input",payloadValue:e=>!0===e.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether automatic validation should be implemented for the time picker during user input",payloadValue:e=>!1===e.autoValidation},{payloadKey:"MODE_IS_SINGLE",payloadDescription:"Specifies the mode for selecting time in the time picker, `single` indicates the ability to select a single time.",payloadValue:e=>"single"===e.mode},{payloadKey:"MODE_IS_RANGE",payloadDescription:"Specifies the mode for selecting time in the time picker, `range` indicates the ability to select a time range",payloadValue:e=>"range"===e.mode}];var ce=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};const he=class{constructor(e){i(this,e),this.vegaChange=r(this,"vegaChange",7),this.change=r(this,"change",7),this.globalSlimmers={},this.translationSlimmer=new z,this.labelRenderer=new _,this.singleInputRenderer=new B,this.singleDropdownRenderer=new K,this.valueController=new q,this.singleDropdownController=new H,this.dropdownSelectedItemsController=new X,this.keyboardController=new Q,this.formFieldController=new f({propertyRules:[{propertyName:"required",ruleFactory:(e,t,i)=>e?"range"===i?new a({timeFormat:t}):new d({timeFormat:t}):null,dependence:["timeFormat","mode"]},{propertyName:"timeFormat",ruleFactory:(e,t,i)=>e&&t?"range"===i?new a({timeFormat:e}):new d({timeFormat:e}):null,dependence:["required","mode"]},{propertyName:"mode",ruleFactory:(e,t)=>"range"===e?new ne({timeFormat:t}):null,dependence:"timeFormat"}],validationRulesName:"validationRules",defaultValue:e=>"range"===e.mode?["",""]:"",attributeGetter:e=>this[e],inputContainerGetter:()=>this.inputContainerRef,touchableAreaGetter:()=>"single"===this.mode?[this.singleInputRenderer.getInputRef()]:[this.rangeInputRenderer.getStartInputRef(),this.rangeInputRenderer.getEndInputRef()]}),this.rangeInputRenderer=new ee,this.rangeClearButtonRenderer=new oe,this.rangeDropdownRenderer=new ie,this.startDropdownController=new le("start"),this.endDropdownController=new le("end"),this.inputMaskController=new ae,this.inputEventPrevent=new $([w],(()=>this.inputContainerRef)),this.changeEventEmitter=P(he,w),this.vegaComponentUsageRuntimeMetricsSlimmer=new v(pe),this.isMobileDevice=R()===j.MOBILE,this.isTabletDevice=R()===j.TABLET,this.dropdownSource={hours:[],minutes:[]},this.isDropdownShow=!1,this.selectedTimeValue={},this.mode="single",this.required=!1,this.increments=1,this.timeFormat="24-hour",this.value="range"===this.mode?["",""]:"",this.size="default",this.disabled=!1,this.isValid=null,this.autoValidation=!0,this.validationRules=[]}async watchIsDropdownShow(e){}watchSelectedTimeValue(){}watchMode(){}watchIncrements(){}watchTimeFormat(){}watchValue(e,t){}watchDisabled(){}watchValidationRules(){}componentWillLoad(){}componentDidLoad(){}componentDidRender(){}render(){const t="range"===this.mode;return l(e(o,{class:{disabled:this.disabled}},this.labelRenderer.render(),e("div",{class:this.getTimePickerClass(t),ref:e=>this.inputContainerRef=e},t?this.rangeInputRenderer.render():this.singleInputRenderer.render()),t?this.rangeDropdownRenderer.render():this.singleDropdownRenderer.render()),this.host)}getTimePickerClass(e){return{"vega-time-picker-input-container":!0,"range-mode":e,mobile:e&&this.isMobileDevice,tablet:e&&this.isTabletDevice}}get host(){return n(this)}static get watchers(){return{isDropdownShow:["watchIsDropdownShow"],selectedTimeValue:["watchSelectedTimeValue"],mode:["watchMode"],increments:["watchIncrements"],timeFormat:["watchTimeFormat"],value:["watchValue"],disabled:["watchDisabled"],validationRules:["watchValidationRules"]}}};ce([g()],he.prototype,"globalSlimmers",void 0),ce([m()],he.prototype,"translationSlimmer",void 0),ce([m()],he.prototype,"labelRenderer",void 0),ce([m()],he.prototype,"singleInputRenderer",void 0),ce([m()],he.prototype,"singleDropdownRenderer",void 0),ce([m()],he.prototype,"valueController",void 0),ce([m()],he.prototype,"singleDropdownController",void 0),ce([m()],he.prototype,"dropdownSelectedItemsController",void 0),ce([m()],he.prototype,"keyboardController",void 0),ce([m()],he.prototype,"formFieldController",void 0),ce([m()],he.prototype,"rangeInputRenderer",void 0),ce([m()],he.prototype,"rangeClearButtonRenderer",void 0),ce([m()],he.prototype,"rangeDropdownRenderer",void 0),ce([m()],he.prototype,"startDropdownController",void 0),ce([m()],he.prototype,"endDropdownController",void 0),ce([m()],he.prototype,"inputMaskController",void 0),ce([m()],he.prototype,"inputEventPrevent",void 0),ce([m()],he.prototype,"changeEventEmitter",void 0),ce([m()],he.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),ce([s()],he.prototype,"watchValue",null),he.style=':host{display:inline-block;text-align:left;line-height:normal;width:100%}vega-field-label{margin-bottom:8px}vega-input::part(field-error-message){display:none}.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-time-picker-input-container.error vega-input::part(input-container){border-width:0px}.vega-time-picker-input-container.error vega-input::part(input-container):hover{border-width:0px}.vega-time-picker-input-container.error vega-input::part(input-container):focus-within{outline:none}.vega-time-picker-input-container.error{border-radius:8px;border:1px solid rgba(var(--v-border-input-field-danger, 230, 50, 87, 1))}.vega-time-picker-input-container.error .vega-time-picker-range-clear-icon:focus-within{outline:2px solid rgba(var(--v-border-color-danger, 230, 50, 87, 1));outline-offset:2px}.vega-time-picker-input-container.error:hover{border:1px solid rgba(var(--v-border-input-field-danger-hover, 255, 87, 114, 1))}.vega-time-picker-input-container.error: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-hidden{display:none}.range-input-divider{width:1px;height:24px;border-style:solid;border-right-width:1px;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1))}.mobile .range-input-divider{width:100%;height:1px;border-style:solid;border-right-width:0px;border-top-width:1px;border-bottom-width:0px;border-left-width:0px}.mobile .time-picker-input-end vega-input::part(input){padding-left:26px}.range-mode{position:relative;background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:8px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1))}:host(.disabled) .range-mode{background-color:rgba(var(--v-bg-secondary, 245, 247, 247, 1))}:host:not(.disabled) .range-mode:not(.error):hover{border:1px solid rgba(var(--v-border-input-field-hover, 115, 160, 190, 1))}.range-mode vega-input::part(input-container),:host(.disabled) .range-mode vega-input::part(input-container):hover{border-width:0px}.range-mode:not(.error) .time-picker-input-start vega-input::part(input-container):focus-within,.range-mode:not(.error) .time-picker-input-end 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));margin:-1px}.range-mode .vega-time-picker-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%)}.range-mode .vega-time-picker-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}.range-mode.mobile .vega-time-picker-range-clear-icon{top:75%}.range-mode.mobile .time-picker-input{width:100%}vega-time-picker-dropdown.vega-force-hidden{display:none !important}.vega-time-picker-range-clear-icon.invisible{visibility:hidden}';var ue=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};const me=class{constructor(e){i(this,e),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new v}render(){return l(e(o,null),this.host)}get host(){return n(this)}};ue([g()],me.prototype,"globalSlimmers",void 0),ue([m()],me.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),me.style=':host(.vega-time-picker-dropdown){border-radius:12px;position:absolute;overflow:hidden}:host(.vega-force-hidden){display:none !important}.vega-time-picker-dropdown-container{flex-direction:column;position:relative;padding-top:16px;padding-bottom:16px;border:1px solid rgba(var(--v-border-input-field, 171, 198, 216, 1));background-color:rgba(var(--v-bg-primary, 252, 252, 252, 1));border-radius:12px;box-shadow:var(--v-shadow-dropdown-menu, 0px 2px 4px -2px rgba(0, 0, 0, 0.1), 0px 4px 6px -1px rgba(0, 0, 0, 0.1))}.vega-time-picker-dropdown-panel{display:flex;height:224px}.vega-time-picker-dropdown-panel>ul{flex-grow:1;overflow:hidden;padding-left:0px;margin:0px;width:72px;list-style-type:none;scroll-behavior:smooth}.vega-time-picker-dropdown-panel>ul:hover{overflow-y:auto}:host(.mobile) .vega-time-picker-dropdown-panel>ul,:host(.tablet) .vega-time-picker-dropdown-panel>ul{overflow-y:auto;overflow-x:hidden}.vega-time-picker-dropdown-panel>ul:hover::-webkit-scrollbar{width:4px}.vega-time-picker-dropdown-panel>ul:hover::-webkit-scrollbar-thumb{background-color:rgba(var(--v-bg-status-info, 205, 209, 211, 1));border-radius:9999px}.vega-time-picker-panel-column:not(:last-child){border-right-width:1px;border-color:rgba(var(--v-border-color-divider, 171, 198, 216, 1));border-right-style:solid}.vega-time-picker-dropdown-panel>ul>li{padding-top:4px;padding-bottom:4px;padding-left:16px;cursor:pointer;display:flex;align-items:center;width:100%}.vega-time-picker-dropdown-panel>ul>li:focus{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}.vega-time-picker-dropdown-panel>ul>li:hover{background-color:rgba(var(--v-bg-quaternary, 241, 248, 251, 1))}.vega-time-picker-dropdown-panel>ul>li.vega-dropdown-item-selected{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1));color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1))}.vega-time-picker-dropdown-panel>ul>li{color:rgba(var(--v-text-primary, 32, 54, 69, 1));font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px;text-decoration:none;outline:0}@media screen and (min-width: 768px) and (max-width: 1023px){.vega-time-picker-dropdown-panel>ul>li{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){.vega-time-picker-dropdown-panel>ul>li{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){.vega-time-picker-dropdown-panel>ul>li{font-family:"Inter", sans-serif;font-size:16px;font-weight:400;line-height:24px;letter-spacing:0px}}.vega-time-picker-panel-column::after{display:block;height:192px;content:""}.vega-time-picker-dropdown-footer{display:flex;padding-left:16px;padding-right:16px;justify-content:flex-end}.vega-time-picker-dropdown-footer .vega-time-picker-now{flex-grow:1}.horizontal-divider{height:1px;background-color:rgba(var(--v-bg-divider, 171, 198, 216, 1));width:100%;margin-top:12px;margin-bottom:12px}';export{he as vega_time_picker,me as vega_time_picker_dropdown}
@@ -1 +1 @@
1
- import{r as t,c as i,h as e,H as h,g as s}from"./p-21d26bb4.js";import{F as a}from"./p-4d793cb0.js";import{V as l,M as r,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-280cbcdb.js";import{V as d}from"./p-6f90d444.js";import{s as n}from"./p-9b797118.js";import{I as v}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4387d550.js";import{F as u}from"./p-9f002a09.js";import{b as g}from"./p-5773a9a3.js";import{C as _}from"./p-2d0d575f.js";import{c as A}from"./p-86782109.js";import{C as M}from"./p-419697c6.js";import{D as E}from"./p-66759f4e.js";import{f as b,B as w,A as Z}from"./p-e1a2a701.js";import{V as j}from"./p-c9b9322b.js";import{h as I}from"./p-425ba7d6.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-bf953152.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-4ab3df00.js";import"./p-c0291e2e.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-6934013c.js";import"./p-020b04ed.js";import"./p-5f377954.js";import"./p-cc63e827.js";const D=[{type:"visa",iconName:"visa",pattern:l,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var y=function(t,i,e,h){var s,a=arguments.length,l=a<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,i,e,h);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(l=(a<3?s(l):a>3?s(i,e,l):s(i,e))||l);return a>3&&l&&Object.defineProperty(i,e,l),l};const N=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(N,b),this.blurEventEmitter=A(N,w),this.focusEventEmitter=A(N,Z),this.inputCreditCardEventPrevent=new M([b,Z,w],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:j.getIconKey(i),maskConfig:this.getMaskConfig(this.value),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,E.addUniqueObserverToNode(t,b,(t=>{this.handleVegaChange(t)})),E.addUniqueObserverToNode(t,w,(()=>{this.handleVegaBlur()})),E.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaFocus()})),E.addUniqueObserverToNode(t,I,(t=>{const i=t.clipboardData.getData("text");this.inputRef.maskConfig=this.getMaskConfig(i)}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(t){const i=[],e=this.getCreditCardType(t);return e&&(i.push(e.maskConfig),this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),i.push(this.maskConfig))),i}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};j.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),y([f()],N.prototype,"globalSlimmers",void 0),y([v()],N.prototype,"formFieldController",void 0),y([v()],N.prototype,"changeEventEmitter",void 0),y([v()],N.prototype,"blurEventEmitter",void 0),y([v()],N.prototype,"focusEventEmitter",void 0),y([v()],N.prototype,"inputCreditCardEventPrevent",void 0),y([v()],N.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),N.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{N as vega_input_credit_card}
1
+ import{r as t,c as i,h as e,H as h,g as s}from"./p-21d26bb4.js";import{F as a}from"./p-4d793cb0.js";import{V as l,M as r,A as o,D as c}from"./p-3a0a4d15.js";import{R as p}from"./p-280cbcdb.js";import{V as d}from"./p-6f90d444.js";import{s as n}from"./p-519a7d55.js";import{I as v}from"./p-6e1ab235.js";import{V as m,I as f}from"./p-4387d550.js";import{F as u}from"./p-21e180f2.js";import{b as g}from"./p-5773a9a3.js";import{C as _}from"./p-2d0d575f.js";import{c as A}from"./p-eea36d3c.js";import{C as M}from"./p-6b7dca3e.js";import{D as E}from"./p-e7b00bf0.js";import{f as b,B as w,A as Z}from"./p-6e01f0a2.js";import{V as j}from"./p-c9b9322b.js";import{h as I}from"./p-425ba7d6.js";import"./p-7a40e033.js";import"./p-112455b1.js";import"./p-abd7aeaa.js";import"./p-262ec334.js";import"./p-0bb29d98.js";import"./p-331a62d5.js";import"./p-d5776087.js";import"./p-37b05e0b.js";import"./p-6a334573.js";import"./p-4ab3df00.js";import"./p-834434d5.js";import"./p-74168615.js";import"./p-ed45b3b6.js";import"./p-987fbbd0.js";import"./p-52b8f2d2.js";import"./p-d27ae9ff.js";import"./p-138fcf6e.js";import"./p-613ee009.js";import"./p-5f377954.js";import"./p-cc63e827.js";const D=[{type:"visa",iconName:"visa",pattern:l,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999 999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"mastercard",iconName:"mastercard",pattern:r,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"amex",iconName:"amex",pattern:o,maskConfig:{type:"custom",options:{mask:"9999 999999 99999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}},{type:"discover",iconName:"discover",pattern:c,maskConfig:{type:"custom",options:{mask:"9999 9999 9999 9999",slot:"9",accept:/\d/,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")}}}],R=[{payloadKey:"AUTO_VALIDATION_IS_TRUE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!0===t.autoValidation},{payloadKey:"AUTO_VALIDATION_IS_FALSE",payloadDescription:"Determines whether the user's input in the credit card field should be automatically validated",payloadValue:t=>!1===t.autoValidation}];var y=function(t,i,e,h){var s,a=arguments.length,l=a<3?i:null===h?h=Object.getOwnPropertyDescriptor(i,e):h;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,i,e,h);else for(var r=t.length-1;r>=0;r--)(s=t[r])&&(l=(a<3?s(l):a>3?s(i,e,l):s(i,e))||l);return a>3&&l&&Object.defineProperty(i,e,l),l};const N=class{constructor(h){t(this,h),this.vegaChange=i(this,"vegaChange",7),this.change=i(this,"change",7),this.vegaBlur=i(this,"vegaBlur",7),this.blur=i(this,"blur",7),this.vegaFocus=i(this,"vegaFocus",7),this.focus=i(this,"focus",7),this.globalSlimmers={},this.formFieldController=new u({propertyRules:[{propertyName:"required",ruleFactory:t=>t?new p:null},{propertyName:"",ruleFactory:()=>new d}],validationRulesName:"validationRules",defaultValue:"",attributeGetter:t=>this[t],inputContainerGetter:()=>this.inputContainerGetter(),touchableAreaGetter:()=>this.touchableAreaGetter()}),this.changeEventEmitter=A(N,b),this.blurEventEmitter=A(N,w),this.focusEventEmitter=A(N,Z),this.inputCreditCardEventPrevent=new M([b,Z,w],(()=>this.host),!0),this.vegaComponentUsageRuntimeMetricsSlimmer=new m(R),this.maskConfig={type:"custom",options:{mask:"",slot:"9",accept:/[\d\s]/,insertMode:!1,triggerAtInit:a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")},trigger:"blur"},this.required=!1,this.disabled=!1,this.label="",this.hint="",this.size="default",this.placeholder="",this.hideCardNumberOnBlur=!0,this.autoValidation=!0,this.validationRules=[],this.isValid=null,this.value="",this.renderInputContainer=()=>{var t;const i=(null===(t=this.getCreditCardType(this.value))||void 0===t?void 0:t.iconName)||"regular-credit-card";return e("vega-input",{label:this.label,type:"number",prefixIcon:j.getIconKey(i),maskConfig:this.getMaskConfig(this.value),placeholder:this.placeholder,disabled:this.disabled,size:this.size,value:this.value,hint:this.hint,required:this.required,showClearIcon:!1,ref:t=>{this.inputRef=t,E.addUniqueObserverToNode(t,b,(t=>{this.handleVegaChange(t)})),E.addUniqueObserverToNode(t,w,(()=>{this.handleVegaBlur()})),E.addUniqueObserverToNode(t,Z,(()=>{this.handleVegaFocus()})),E.addUniqueObserverToNode(t,I,(t=>{const i=t.clipboardData.getData("text");this.inputRef.maskConfig=this.getMaskConfig(i)}))}})},this.handleVegaChange=t=>{this.value=t.detail},this.handleVegaBlur=()=>{this.blurEventEmitter.emit()},this.handleVegaFocus=()=>{this.focusEventEmitter.emit()},this.inputContainerGetter=()=>this.inputRef.shadowRoot.querySelector(".vega-input-container"),this.touchableAreaGetter=()=>Array.from(this.inputRef.shadowRoot.querySelectorAll("input"))}watchValidationRules(){}watchValue(t){this.changeEventEmitter.emit(t),_.notify(g,{host:this.host,detail:t})}componentDidLoad(){a.isEnabled("VEGA_INPUT_CREDIT_CARD.ENABLE_HIDE_NUMBER_MASK_ON_FIRST_LOAD")&&this.hideCardNumberOnBlur&&this.inputRef.value&&this.value!==this.inputRef.value&&(this.value=this.inputRef.value)}render(){return n(e(h,null,this.renderInputContainer()),this.host)}getCreditCardType(t){return D.filter((i=>i.pattern.test(t)))[0]}getMaskConfig(t){const i=[],e=this.getCreditCardType(t);return e&&(i.push(e.maskConfig),this.hideCardNumberOnBlur&&t.trim().includes(" ")&&(this.maskConfig.options.mask=this.generateDynamicMask(),i.push(this.maskConfig))),i}generateDynamicMask(){const t=this.value.trim().split(" ");return this.maskCardNumber(t).join(" ")}maskCardNumber(t){return t.map(((i,e)=>(e===t.length-1?"9":"X").repeat(i.length)))}get host(){return s(this)}static get watchers(){return{validationRules:["watchValidationRules"],value:["watchValue"]}}};j.register({visa:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#00579F" rx="2"/><path fill="#fff" d="M15.474 15.792h-1.979l1.238-7.653h1.979l-1.238 7.653ZM22.647 8.326A4.877 4.877 0 0 0 20.872 8c-1.954 0-3.33 1.042-3.339 2.532-.016 1.1.986 1.71 1.735 2.076.765.375 1.026.62 1.026.953-.008.513-.619.75-1.189.75-.79 0-1.213-.123-1.857-.408l-.26-.122-.277 1.718c.464.211 1.32.4 2.207.407 2.076 0 3.428-1.026 3.444-2.613.008-.872-.52-1.54-1.66-2.085-.693-.35-1.117-.586-1.117-.944.008-.326.359-.66 1.14-.66a3.362 3.362 0 0 1 1.474.293l.18.082.268-1.653ZM25.279 13.08l.79-2.14c-.008.016.162-.448.26-.733l.138.66s.375 1.831.457 2.214h-1.645ZM27.72 8.14h-1.53c-.472 0-.831.138-1.035.635l-2.94 7.018h2.077l.416-1.148h2.54c.057.269.237 1.148.237 1.148h1.832L27.72 8.14ZM11.842 8.139l-1.938 5.219-.212-1.059c-.358-1.221-1.482-2.548-2.736-3.208l1.775 6.693h2.093l3.11-7.645h-2.092Z"/><path fill="#FAA61A" d="M8.104 8.139H4.92l-.032.154c2.483.635 4.128 2.166 4.804 4.007L9 8.782c-.114-.489-.464-.627-.896-.643Z"/></svg>',autoSize:!0},mastercard:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#000" rx="2"/><path fill="#ED0006" fill-rule="evenodd" d="M18.25 17.157a6.75 6.75 0 0 1-4.426 1.649c-3.769 0-6.824-3.09-6.824-6.903C7 8.091 10.055 5 13.824 5a6.75 6.75 0 0 1 4.426 1.649A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#F9A000" fill-rule="evenodd" d="M18.25 17.157a6.92 6.92 0 0 0 2.398-5.254 6.92 6.92 0 0 0-2.398-5.254A6.75 6.75 0 0 1 22.676 5c3.769 0 6.824 3.09 6.824 6.903 0 3.812-3.055 6.903-6.824 6.903a6.75 6.75 0 0 1-4.426-1.65Z" clip-rule="evenodd"/><path fill="#FF5E00" fill-rule="evenodd" d="M18.25 6.65a6.92 6.92 0 0 1 2.398 5.253 6.92 6.92 0 0 1-2.398 5.254 6.92 6.92 0 0 1-2.398-5.254A6.92 6.92 0 0 1 18.25 6.65Z" clip-rule="evenodd"/></svg>',autoSize:!0},amex:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><g clip-path="url(#a)"><rect width="36" height="24" fill="#016FD0" rx="2"/><path fill="#fff" d="M6.99 18.549v-5.654h5.986l.643.838.663-.838h21.729v5.264s-.569.384-1.226.39H22.754l-.724-.891v.891h-2.373v-1.521s-.325.212-1.025.212h-.808v1.309h-3.593l-.641-.855-.651.855H6.99ZM0 8.634l1.35-3.147h2.334l.767 1.763V5.487h2.902l.456 1.274.442-1.274h13.027v.64s.685-.64 1.81-.64l4.227.015.753 1.74V5.487h2.428l.669 1v-1h2.45v5.654h-2.45l-.64-1.003v1.003h-3.569l-.359-.892h-.959l-.353.892h-2.42c-.968 0-1.587-.628-1.587-.628v.628H17.63l-.725-.892v.892H3.34l-.359-.892h-.956l-.356.892H0V8.634Z"/><path fill="#016FD0" d="M1.827 6.184.006 10.417h1.185l.336-.847H3.48l.335.847h1.211L3.207 6.184h-1.38Zm.673.985.596 1.482H1.903L2.5 7.169ZM5.151 10.416V6.183l1.685.006.98 2.73.956-2.736h1.671v4.233H9.385v-3.12l-1.122 3.12h-.928L6.21 7.296v3.12H5.15ZM11.168 10.416V6.183h3.454v.947h-2.384v.724h2.328v.891h-2.328v.752h2.384v.92h-3.454ZM15.233 6.184v4.233h1.059V8.913h.445l1.27 1.504H19.3l-1.393-1.56a1.29 1.29 0 0 0 1.161-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.059.947h1.21c.29 0 .5.227.5.446 0 .28-.273.445-.485.445h-1.225v-.891ZM20.582 10.416h-1.08V6.183h1.08v4.233ZM23.144 10.416h-.233c-1.129 0-1.814-.889-1.814-2.1 0-1.24.678-2.133 2.103-2.133h1.17v1.003h-1.213c-.578 0-.988.451-.988 1.141 0 .82.468 1.165 1.142 1.165h.279l-.446.924ZM25.448 6.184l-1.82 4.233h1.185l.336-.847h1.953l.334.847h1.211l-1.819-4.233h-1.38Zm.674.985.595 1.482h-1.192l.597-1.482ZM28.77 10.416V6.183h1.345l1.718 2.66v-2.66h1.059v4.233H31.59l-1.762-2.73v2.73H28.77ZM7.715 17.825v-4.233h3.453v.947H8.784v.724h2.329v.89H8.784v.753h2.384v.919H7.715ZM24.636 17.825v-4.233h3.454v.947h-2.384v.724h2.317v.89h-2.317v.753h2.384v.919h-3.454ZM11.303 17.825l1.681-2.09-1.721-2.143h1.333l1.025 1.324 1.029-1.324h1.281l-1.699 2.116 1.685 2.117h-1.333l-.996-1.304-.971 1.304h-1.314ZM16.041 13.592v4.233h1.086v-1.337h1.114c.943 0 1.658-.5 1.658-1.472 0-.806-.56-1.424-1.52-1.424H16.04Zm1.086.957h1.174c.304 0 .522.187.522.488 0 .282-.217.487-.526.487h-1.17v-.975ZM20.359 13.592v4.233h1.058V16.32h.446l1.269 1.504h1.293l-1.393-1.56a1.29 1.29 0 0 0 1.162-1.3c0-.89-.7-1.373-1.48-1.373h-2.355Zm1.058.947h1.21c.29 0 .501.226.501.445 0 .281-.273.446-.486.446h-1.225v-.891ZM28.58 17.825v-.92H30.7c.313 0 .449-.169.449-.354 0-.178-.136-.358-.45-.358h-.957c-.831 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.062l-.446.952H29.94c-.341 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347H28.58ZM32.464 17.825v-.92h2.118c.313 0 .45-.169.45-.354 0-.178-.136-.358-.45-.358h-.957c-.832 0-1.295-.507-1.295-1.268 0-.679.424-1.333 1.66-1.333h2.02l-.404.952h-1.783c-.34 0-.446.179-.446.35 0 .175.13.369.39.369h1.003c.927 0 1.33.526 1.33 1.215 0 .74-.449 1.347-1.38 1.347h-2.256Z"/></g><defs><clipPath id="a"><rect width="36" height="24" fill="#fff" rx="2"/></clipPath></defs></svg>',autoSize:!0},discover:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" fill="#232342" rx="2"/><path fill="#fff" fill-rule="evenodd" d="M30.686 9.61c1.086 0 1.684.484 1.684 1.398a1.307 1.307 0 0 1-1.087 1.397l1.467 1.988h-1.14l-1.25-1.935h-.109v1.935h-.924V9.61h1.359Zm-.435 2.204h.272c.597 0 .869-.269.869-.752 0-.43-.272-.699-.87-.699h-.27v1.45Zm-4.129 2.579h2.608v-.806h-1.684v-1.29h1.63v-.806h-1.63v-1.074h1.684V9.61h-2.608v4.781Zm-2.716-1.559-1.25-3.223h-.978l2.01 4.889h.49l2.01-4.89h-.978l-1.304 3.225Zm-11.029-.805c0 1.343 1.087 2.471 2.445 2.471.435 0 .815-.107 1.195-.269v-1.074c-.271.322-.652.537-1.086.537-.87 0-1.576-.645-1.576-1.504v-.108c-.054-.86.652-1.612 1.521-1.665.435 0 .87.215 1.141.537V9.879c-.326-.214-.76-.268-1.14-.268-1.413-.108-2.5 1.02-2.5 2.418Zm-1.684-.591c-.543-.215-.706-.323-.706-.591.054-.323.326-.591.652-.538.271 0 .543.162.76.376l.49-.644c-.381-.323-.87-.538-1.359-.538-.76-.053-1.412.538-1.467 1.29v.054c0 .644.272 1.02 1.141 1.289.217.054.435.161.652.269a.563.563 0 0 1 .272.483c0 .376-.326.699-.652.699h-.055c-.434 0-.814-.269-.977-.645l-.598.59c.326.592.978.914 1.63.914.869.054 1.575-.59 1.63-1.45v-.162c-.055-.644-.326-.967-1.413-1.396Zm-3.15 2.954h.923V9.611h-.924v4.781ZM3.25 9.611H4.88c1.304.054 2.336 1.128 2.282 2.418 0 .698-.326 1.343-.87 1.826-.488.376-1.086.591-1.684.538H3.25V9.61Zm1.195 3.976c.435.053.924-.108 1.25-.376.326-.323.489-.753.489-1.236 0-.43-.163-.86-.49-1.182-.325-.269-.814-.43-1.249-.376h-.271v3.17h.271Z" clip-rule="evenodd"/><path fill="#FD6020" fill-rule="evenodd" d="M18.788 9.5c-1.358 0-2.499 1.075-2.499 2.471 0 1.344 1.087 2.472 2.5 2.526 1.412.053 2.498-1.075 2.553-2.472C21.287 10.628 20.2 9.5 18.788 9.5Z" clip-rule="evenodd"/></svg>',autoSize:!0},"regular-credit-card":{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="36" height="24" fill="none"><rect width="36" height="24" rx="2" style=\'fill: rgba(var(--v-regular-credit-card-bg, 205, 209, 211, 1))\'/><g clip-path="url(#a)"><path style="fill: rgba(var(--v-regular-credit-card-top, 252, 252, 252, 1))" d="M11 5c-1.103 0-2 .897-2 2v1h18V7c0-1.103-.897-2-2-2H11Zm16 6H9v6c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-6Zm-14.5 4h2c.275 0 .5.225.5.5s-.225.5-.5.5h-2a.501.501 0 0 1-.5-.5c0-.275.225-.5.5-.5Zm3.5.5c0-.275.225-.5.5-.5h4c.275 0 .5.225.5.5s-.225.5-.5.5h-4a.501.501 0 0 1-.5-.5Z"/></g><defs><clipPath id="a"><path d="M9 4h18v16H9z" style=\'fill: rgba(var(--v-regular-credit-card-bottom, 255, 255, 255, 1))\'/></clipPath></defs></svg>',autoSize:!0}}),y([f()],N.prototype,"globalSlimmers",void 0),y([v()],N.prototype,"formFieldController",void 0),y([v()],N.prototype,"changeEventEmitter",void 0),y([v()],N.prototype,"blurEventEmitter",void 0),y([v()],N.prototype,"focusEventEmitter",void 0),y([v()],N.prototype,"inputCreditCardEventPrevent",void 0),y([v()],N.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),N.style=":host{display:inline-block;width:100%;text-align:left;line-height:normal}";export{N as vega_input_credit_card}
@@ -1 +1 @@
1
- import{r as t,h as i,H as s,g as o}from"./p-21d26bb4.js";import{s as e}from"./p-9b797118.js";import{I as r}from"./p-6e1ab235.js";import{V as n,I as a}from"./p-4387d550.js";var h=function(t,i,s,o){var e,r=arguments.length,n=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,i,s,o);else for(var a=t.length-1;a>=0;a--)(e=t[a])&&(n=(r<3?e(n):r>3?e(i,s,n):e(i,s))||n);return r>3&&n&&Object.defineProperty(i,s,n),n};const l=class{constructor(i){t(this,i),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new n,this.dot=!1,this.color="bg-danger",this.count=0,this.offset=[0,0]}render(){return e(i(s,null,i("div",{class:{dot:this.count>0&&this.dot,counter:this.count>0&&!this.dot,"multi-digit":this.count>=10&&!this.dot,"v-bg-danger":"bg-action"!=this.color,"v-bg-action":"bg-action"==this.color,"default-position":this.count>0},style:{right:-this.offset[0]+"px",top:`${this.offset[1]}px`}},this.renderCounter()),i("slot",null)),this.host)}renderCounter(){if(this.count>0&&!this.dot)return i("span",null,this.count>99?"99+":this.count)}get host(){return o(this)}};h([a()],l.prototype,"globalSlimmers",void 0),h([r()],l.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),l.style=':host{display:block;position:relative;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host .dot{display:inline-block;position:absolute;border-radius:9999px;width:9px;height:9px}:host .counter{display:flex;position:absolute;height:20px;min-width:20px;border-radius:9999px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));justify-content:center;align-items:center;font-family:"Inter", sans-serif;font-weight:700;font-size:12px;line-height:15px}:host .default-position{top:0px;right:0px;transform:scale(1) translate(50%, -50%)}:host .multi-digit{padding-left:4px;padding-right:4px}:host .v-bg-danger{background-color:rgba(var(--v-bg-danger, 189, 41, 71, 1))}:host .v-bg-action{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}';export{l as vega_counter_badge}
1
+ import{r as t,h as i,H as s,g as o}from"./p-21d26bb4.js";import{s as e}from"./p-519a7d55.js";import{I as r}from"./p-6e1ab235.js";import{V as n,I as a}from"./p-4387d550.js";var h=function(t,i,s,o){var e,r=arguments.length,n=r<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,i,s,o);else for(var a=t.length-1;a>=0;a--)(e=t[a])&&(n=(r<3?e(n):r>3?e(i,s,n):e(i,s))||n);return r>3&&n&&Object.defineProperty(i,s,n),n};const l=class{constructor(i){t(this,i),this.globalSlimmers={},this.vegaComponentUsageRuntimeMetricsSlimmer=new n,this.dot=!1,this.color="bg-danger",this.count=0,this.offset=[0,0]}render(){return e(i(s,null,i("div",{class:{dot:this.count>0&&this.dot,counter:this.count>0&&!this.dot,"multi-digit":this.count>=10&&!this.dot,"v-bg-danger":"bg-action"!=this.color,"v-bg-action":"bg-action"==this.color,"default-position":this.count>0},style:{right:-this.offset[0]+"px",top:`${this.offset[1]}px`}},this.renderCounter()),i("slot",null)),this.host)}renderCounter(){if(this.count>0&&!this.dot)return i("span",null,this.count>99?"99+":this.count)}get host(){return o(this)}};h([a()],l.prototype,"globalSlimmers",void 0),h([r()],l.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),l.style=':host{display:block;position:relative;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host .dot{display:inline-block;position:absolute;border-radius:9999px;width:9px;height:9px}:host .counter{display:flex;position:absolute;height:20px;min-width:20px;border-radius:9999px;color:rgba(var(--v-text-inverted-primary, 252, 252, 252, 1));justify-content:center;align-items:center;font-family:"Inter", sans-serif;font-weight:700;font-size:12px;line-height:15px}:host .default-position{top:0px;right:0px;transform:scale(1) translate(50%, -50%)}:host .multi-digit{padding-left:4px;padding-right:4px}:host .v-bg-danger{background-color:rgba(var(--v-bg-danger, 189, 41, 71, 1))}:host .v-bg-action{background-color:rgba(var(--v-bg-action, 19, 98, 226, 1))}';export{l as vega_counter_badge}