@dialpad/dialtone-vue 4.10.0 → 4.11.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 (432) hide show
  1. package/dist/{Combobox-DP8tbe6x.js → Combobox-BKj61IcR.js} +5 -5
  2. package/dist/{Combobox-DP8tbe6x.js.map → Combobox-BKj61IcR.js.map} +1 -1
  3. package/dist/Combobox-BOGcBq-6.cjs +3 -0
  4. package/dist/{Combobox-DdBIRmeH.cjs.map → Combobox-BOGcBq-6.cjs.map} +1 -1
  5. package/dist/{Datepicker-CNFVUyyK.js → Datepicker-DOSIyo8a.js} +39 -39
  6. package/dist/{Datepicker-CNFVUyyK.js.map → Datepicker-DOSIyo8a.js.map} +1 -1
  7. package/dist/Datepicker-DfdVsVb9.cjs +2 -0
  8. package/dist/{Datepicker-Df6uR0r_.cjs.map → Datepicker-DfdVsVb9.cjs.map} +1 -1
  9. package/dist/{EmojiPicker-B7AKJlAM.js → EmojiPicker-B_ZVTdOY.js} +2 -2
  10. package/dist/{EmojiPicker-B7AKJlAM.js.map → EmojiPicker-B_ZVTdOY.js.map} +1 -1
  11. package/dist/EmojiPicker-DS8XmAHV.cjs +2 -0
  12. package/dist/{EmojiPicker-KbIfc-GH.cjs.map → EmojiPicker-DS8XmAHV.cjs.map} +1 -1
  13. package/dist/FilterPill-BmYe_SsY.cjs +2 -0
  14. package/dist/{FilterPill-DwapR9JK.cjs.map → FilterPill-BmYe_SsY.cjs.map} +1 -1
  15. package/dist/{FilterPill-BR7FAmMG.js → FilterPill-C4TXD8Tl.js} +5 -5
  16. package/dist/{FilterPill-BR7FAmMG.js.map → FilterPill-C4TXD8Tl.js.map} +1 -1
  17. package/dist/{ForceLinkify-D4FBhBxD.cjs → ForceLinkify-BMmlUc8Q.cjs} +1 -1
  18. package/dist/{ForceLinkify-D4FBhBxD.cjs.map → ForceLinkify-BMmlUc8Q.cjs.map} +1 -1
  19. package/dist/{ForceLinkify-wTXS_wJS.js → ForceLinkify-Cw3Q1Nn7.js} +1 -1
  20. package/dist/{ForceLinkify-wTXS_wJS.js.map → ForceLinkify-Cw3Q1Nn7.js.map} +1 -1
  21. package/dist/{MarkdownRenderer-3CVbodrq.js → MarkdownRenderer-BR-fbldH.js} +1 -1
  22. package/dist/{MarkdownRenderer-3CVbodrq.js.map → MarkdownRenderer-BR-fbldH.js.map} +1 -1
  23. package/dist/{MarkdownRenderer-CaBjENW6.cjs → MarkdownRenderer-CH4L8Evn.cjs} +1 -1
  24. package/dist/{MarkdownRenderer-CaBjENW6.cjs.map → MarkdownRenderer-CH4L8Evn.cjs.map} +1 -1
  25. package/dist/{Presence-CGgyodnC.js → Presence-BkPCvddH.js} +2 -2
  26. package/dist/{Presence-CGgyodnC.js.map → Presence-BkPCvddH.js.map} +1 -1
  27. package/dist/{Presence-DLM3JR-n.cjs → Presence-DG9Kvu5J.cjs} +2 -2
  28. package/dist/{Presence-DLM3JR-n.cjs.map → Presence-DG9Kvu5J.cjs.map} +1 -1
  29. package/dist/ProgressBar-BMycZBZE.cjs +2 -0
  30. package/dist/ProgressBar-BMycZBZE.cjs.map +1 -0
  31. package/dist/ProgressBar-Cj8xqPc0.js +77 -0
  32. package/dist/ProgressBar-Cj8xqPc0.js.map +1 -0
  33. package/dist/{Resizable-F6PU5oKB.js → Resizable-BkijqucD.js} +3 -3
  34. package/dist/{Resizable-F6PU5oKB.js.map → Resizable-BkijqucD.js.map} +1 -1
  35. package/dist/{Resizable-BQsHIvDC.cjs → Resizable-DQoUk81S.cjs} +2 -2
  36. package/dist/{Resizable-BQsHIvDC.cjs.map → Resizable-DQoUk81S.cjs.map} +1 -1
  37. package/dist/{ResizableHandle-VBoudEYy.cjs → ResizableHandle-D2gZ6dg5.cjs} +2 -2
  38. package/dist/{ResizableHandle-VBoudEYy.cjs.map → ResizableHandle-D2gZ6dg5.cjs.map} +1 -1
  39. package/dist/{ResizableHandle-CqIIQvza.js → ResizableHandle-MDdaNR_t.js} +3 -3
  40. package/dist/{ResizableHandle-CqIIQvza.js.map → ResizableHandle-MDdaNR_t.js.map} +1 -1
  41. package/dist/{ResizableUtils-CZdVSd6q.cjs → ResizableUtils-CXU7o9pL.cjs} +1 -1
  42. package/dist/{ResizableUtils-CZdVSd6q.cjs.map → ResizableUtils-CXU7o9pL.cjs.map} +1 -1
  43. package/dist/{ResizableUtils-CrBOa8js.js → ResizableUtils-ChIk3Blc.js} +1 -1
  44. package/dist/{ResizableUtils-CrBOa8js.js.map → ResizableUtils-ChIk3Blc.js.map} +1 -1
  45. package/dist/{RichTextEditor-DLiJCPI6.js → RichTextEditor-BIcaFJQp.js} +15 -15
  46. package/dist/{RichTextEditor-DLiJCPI6.js.map → RichTextEditor-BIcaFJQp.js.map} +1 -1
  47. package/dist/RichTextEditor-D6kCBnLJ.cjs +11 -0
  48. package/dist/{RichTextEditor-ECmStZDK.cjs.map → RichTextEditor-D6kCBnLJ.cjs.map} +1 -1
  49. package/dist/{Scroller-D6f0HvIT.js → Scroller-D6LZtmkL.js} +3 -3
  50. package/dist/{Scroller-D6f0HvIT.js.map → Scroller-D6LZtmkL.js.map} +1 -1
  51. package/dist/Scroller-eXc7l23J.cjs +2 -0
  52. package/dist/{Scroller-EIHN3a26.cjs.map → Scroller-eXc7l23J.cjs.map} +1 -1
  53. package/dist/Slider-B7O2M5_S.cjs +2 -0
  54. package/dist/{Slider-BDgY7gNR.cjs.map → Slider-B7O2M5_S.cjs.map} +1 -1
  55. package/dist/{Slider-Bg9KspmL.js → Slider-oJROUIMS.js} +7 -7
  56. package/dist/{Slider-Bg9KspmL.js.map → Slider-oJROUIMS.js.map} +1 -1
  57. package/dist/Text-BDgOWPw7.cjs +2 -0
  58. package/dist/Text-BDgOWPw7.cjs.map +1 -0
  59. package/dist/{Text-5MobHF6z.js → Text-CfiPqjL0.js} +4 -4
  60. package/dist/Text-CfiPqjL0.js.map +1 -0
  61. package/dist/{TextList-1_ZM5zE3.cjs → TextList-D3HHK2DW.cjs} +1 -1
  62. package/dist/{TextList-1_ZM5zE3.cjs.map → TextList-D3HHK2DW.cjs.map} +1 -1
  63. package/dist/{TextList-DIj84CPZ.js → TextList-DXEov7Ls.js} +1 -1
  64. package/dist/{TextList-DIj84CPZ.js.map → TextList-DXEov7Ls.js.map} +1 -1
  65. package/dist/TextListItem-C2Vc8Gnu.cjs +2 -0
  66. package/dist/{TextListItem-CVjrHr2_.cjs.map → TextListItem-C2Vc8Gnu.cjs.map} +1 -1
  67. package/dist/{TextListItem-BhmijfFO.js → TextListItem-CaFTtZ3G.js} +2 -2
  68. package/dist/{TextListItem-BhmijfFO.js.map → TextListItem-CaFTtZ3G.js.map} +1 -1
  69. package/dist/{Toast-4nsu1oxP.js → Toast-AGiQccuG.js} +3 -3
  70. package/dist/{Toast-4nsu1oxP.js.map → Toast-AGiQccuG.js.map} +1 -1
  71. package/dist/Toast-DImJ0PkZ.cjs +2 -0
  72. package/dist/{Toast--W8p7jzA.cjs.map → Toast-DImJ0PkZ.cjs.map} +1 -1
  73. package/dist/{UseResizableCalculations-CahDXDOn.cjs → UseResizableCalculations-D4xVxWje.cjs} +2 -2
  74. package/dist/{UseResizableCalculations-CahDXDOn.cjs.map → UseResizableCalculations-D4xVxWje.cjs.map} +1 -1
  75. package/dist/{UseResizableCalculations-B-yTU9ZI.js → UseResizableCalculations-DTxD7NKO.js} +2 -2
  76. package/dist/{UseResizableCalculations-B-yTU9ZI.js.map → UseResizableCalculations-DTxD7NKO.js.map} +1 -1
  77. package/dist/common/composables/use-accessible-name-warning.cjs +2 -0
  78. package/dist/common/composables/use-accessible-name-warning.cjs.map +1 -0
  79. package/dist/common/composables/use-accessible-name-warning.js +11 -0
  80. package/dist/common/composables/use-accessible-name-warning.js.map +1 -0
  81. package/dist/common/composables/use-indicator-animation.cjs +1 -1
  82. package/dist/common/composables/use-indicator-animation.cjs.map +1 -1
  83. package/dist/common/composables/use-indicator-animation.js +14 -14
  84. package/dist/common/composables/use-indicator-animation.js.map +1 -1
  85. package/dist/common/composables/useAccessibleNameWarning.d.ts +2 -0
  86. package/dist/common/composables/useAccessibleNameWarning.d.ts.map +1 -0
  87. package/dist/common/composables/useIndicatorAnimation.d.ts +2 -1
  88. package/dist/common/composables/useIndicatorAnimation.d.ts.map +1 -1
  89. package/dist/common/dates/index.cjs +1 -1
  90. package/dist/common/dates/index.cjs.map +1 -1
  91. package/dist/common/dates/index.js +1 -1
  92. package/dist/common/mixins/input-group.cjs +1 -1
  93. package/dist/common/mixins/input-group.cjs.map +1 -1
  94. package/dist/common/mixins/input-group.js +5 -5
  95. package/dist/common/mixins/input.cjs +1 -1
  96. package/dist/common/mixins/input.cjs.map +1 -1
  97. package/dist/common/mixins/input.js +1 -1
  98. package/dist/common/mixins/keyboard-list-navigation.cjs +1 -1
  99. package/dist/common/mixins/keyboard-list-navigation.cjs.map +1 -1
  100. package/dist/common/mixins/keyboard-list-navigation.js +1 -1
  101. package/dist/common/mixins/modal.cjs +1 -1
  102. package/dist/common/mixins/modal.cjs.map +1 -1
  103. package/dist/common/mixins/modal.js +1 -1
  104. package/dist/common/mixins/mode.cjs +1 -1
  105. package/dist/common/mixins/mode.js +1 -1
  106. package/dist/common/owned_classes.d.ts +4 -0
  107. package/dist/common/owned_classes.d.ts.map +1 -0
  108. package/dist/common/utils/index.cjs +1 -2
  109. package/dist/common/utils/index.d.ts +2 -2
  110. package/dist/common/utils/index.d.ts.map +1 -1
  111. package/dist/common/utils/index.js +2 -150
  112. package/dist/component-documentation.json +1 -1
  113. package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts +1 -0
  114. package/dist/components/ComboboxWithPopover/ComboboxWithPopover.vue.d.ts.map +1 -1
  115. package/dist/components/Dropdown/Dropdown.vue.d.ts +1 -0
  116. package/dist/components/Dropdown/Dropdown.vue.d.ts.map +1 -1
  117. package/dist/components/FilterPill/FilterPill.vue.d.ts +2 -0
  118. package/dist/components/FilterPill/FilterPill.vue.d.ts.map +1 -1
  119. package/dist/components/Hovercard/Hovercard.vue.d.ts +4 -0
  120. package/dist/components/Hovercard/Hovercard.vue.d.ts.map +1 -1
  121. package/dist/components/Modal/Modal.vue.d.ts.map +1 -1
  122. package/dist/components/Popover/Popover.vue.d.ts +1 -0
  123. package/dist/components/Popover/Popover.vue.d.ts.map +1 -1
  124. package/dist/components/ProgressBar/ProgressBar.vue.d.ts +66 -0
  125. package/dist/components/ProgressBar/ProgressBar.vue.d.ts.map +1 -0
  126. package/dist/components/ProgressBar/ProgressBarConstants.d.ts +18 -0
  127. package/dist/components/ProgressBar/ProgressBarConstants.d.ts.map +1 -0
  128. package/dist/components/ProgressBar/index.d.ts +3 -0
  129. package/dist/components/ProgressBar/index.d.ts.map +1 -0
  130. package/dist/components/ProgressCircle/ProgressCircle.vue.d.ts +41 -9
  131. package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts +1 -0
  132. package/dist/components/RichTextEditor/Extensions/Variable/VariableComponent.vue.d.ts.map +1 -1
  133. package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts +10 -0
  134. package/dist/components/SegmentedControl/SegmentedControlItem.vue.d.ts.map +1 -1
  135. package/dist/components/SplitButton/SplitButton.vue.d.ts +1 -0
  136. package/dist/components/SplitButton/SplitButton.vue.d.ts.map +1 -1
  137. package/dist/components/Tab/Tab.vue.d.ts +18 -0
  138. package/dist/components/Tab/Tab.vue.d.ts.map +1 -1
  139. package/dist/components/Tab/TabGroup.vue.d.ts +3 -1
  140. package/dist/components/Tab/TabGroup.vue.d.ts.map +1 -1
  141. package/dist/components/Text/modules/slide.d.ts.map +1 -1
  142. package/dist/components/Tooltip/Tooltip.vue.d.ts.map +1 -1
  143. package/dist/dialtone-vue.cjs +1 -1
  144. package/dist/dialtone-vue.js +51 -49
  145. package/dist/{floating-ui.dom-Cqf6X2Wc.js → floating-ui.dom-CuL5LTgX.js} +1 -1
  146. package/dist/{floating-ui.dom-Cqf6X2Wc.js.map → floating-ui.dom-CuL5LTgX.js.map} +1 -1
  147. package/dist/{floating-ui.dom-n1CheoWj.cjs → floating-ui.dom-S7QIcAlj.cjs} +1 -1
  148. package/dist/{floating-ui.dom-n1CheoWj.cjs.map → floating-ui.dom-S7QIcAlj.cjs.map} +1 -1
  149. package/dist/index.d.ts +1 -0
  150. package/dist/lib/avatar/avatar.cjs +1 -1
  151. package/dist/lib/avatar/avatar.cjs.map +1 -1
  152. package/dist/lib/avatar/avatar.js +7 -7
  153. package/dist/lib/badge/badge.cjs +1 -1
  154. package/dist/lib/badge/badge.cjs.map +1 -1
  155. package/dist/lib/badge/badge.js +2 -2
  156. package/dist/lib/banner/banner.cjs +1 -1
  157. package/dist/lib/banner/banner.cjs.map +1 -1
  158. package/dist/lib/banner/banner.js +2 -2
  159. package/dist/lib/breadcrumbs/breadcrumb-item.cjs +1 -1
  160. package/dist/lib/breadcrumbs/breadcrumb-item.cjs.map +1 -1
  161. package/dist/lib/breadcrumbs/breadcrumb-item.js +2 -2
  162. package/dist/lib/breadcrumbs/breadcrumbs.cjs +1 -1
  163. package/dist/lib/breadcrumbs/breadcrumbs.js +1 -1
  164. package/dist/lib/button/button.cjs +1 -1
  165. package/dist/lib/button/button.cjs.map +1 -1
  166. package/dist/lib/button/button.js +6 -6
  167. package/dist/lib/button/button.js.map +1 -1
  168. package/dist/lib/button-group/button-group.cjs +1 -1
  169. package/dist/lib/button-group/button-group.js +1 -1
  170. package/dist/lib/button-group/buttons-decorator.cjs +1 -1
  171. package/dist/lib/button-group/buttons-decorator.js +1 -1
  172. package/dist/lib/card/card.cjs +1 -1
  173. package/dist/lib/card/card.cjs.map +1 -1
  174. package/dist/lib/card/card.js +2 -2
  175. package/dist/lib/checkbox/checkbox.cjs +1 -1
  176. package/dist/lib/checkbox/checkbox.cjs.map +1 -1
  177. package/dist/lib/checkbox/checkbox.js +5 -5
  178. package/dist/lib/checkbox-group/checkboxes-decorator.cjs +1 -1
  179. package/dist/lib/checkbox-group/checkboxes-decorator.js +1 -1
  180. package/dist/lib/chip/chip.cjs +1 -1
  181. package/dist/lib/chip/chip.cjs.map +1 -1
  182. package/dist/lib/chip/chip.js +4 -4
  183. package/dist/lib/codeblock/codeblock.cjs +1 -1
  184. package/dist/lib/codeblock/codeblock.js +1 -1
  185. package/dist/lib/collapsible/collapsible-lazy-show.cjs +1 -1
  186. package/dist/lib/collapsible/collapsible-lazy-show.js +1 -1
  187. package/dist/lib/collapsible/collapsible.cjs +1 -1
  188. package/dist/lib/collapsible/collapsible.cjs.map +1 -1
  189. package/dist/lib/collapsible/collapsible.js +4 -4
  190. package/dist/lib/combobox/combobox-empty-list.cjs +1 -1
  191. package/dist/lib/combobox/combobox-empty-list.js +1 -1
  192. package/dist/lib/combobox/combobox-loading-list.cjs +1 -1
  193. package/dist/lib/combobox/combobox-loading-list.js +1 -1
  194. package/dist/lib/combobox/combobox.cjs +1 -1
  195. package/dist/lib/combobox/combobox.js +1 -1
  196. package/dist/lib/combobox/index.cjs +1 -1
  197. package/dist/lib/combobox/index.js +1 -1
  198. package/dist/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
  199. package/dist/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
  200. package/dist/lib/combobox-multi-select/combobox-multi-select.js +8 -8
  201. package/dist/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
  202. package/dist/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
  203. package/dist/lib/combobox-with-popover/combobox-with-popover.js +7 -7
  204. package/dist/lib/datepicker/datepicker.cjs +1 -1
  205. package/dist/lib/datepicker/datepicker.js +1 -1
  206. package/dist/lib/datepicker/index.cjs +1 -1
  207. package/dist/lib/datepicker/index.js +1 -1
  208. package/dist/lib/description-list/description-list.cjs +1 -1
  209. package/dist/lib/description-list/description-list.js +1 -1
  210. package/dist/lib/dropdown/dropdown-list.cjs +1 -1
  211. package/dist/lib/dropdown/dropdown-list.js +2 -2
  212. package/dist/lib/dropdown/dropdown-separator.cjs +1 -1
  213. package/dist/lib/dropdown/dropdown-separator.js +1 -1
  214. package/dist/lib/dropdown/dropdown.cjs +1 -1
  215. package/dist/lib/dropdown/dropdown.cjs.map +1 -1
  216. package/dist/lib/dropdown/dropdown.js +3 -3
  217. package/dist/lib/dropdown/dropdown.js.map +1 -1
  218. package/dist/lib/emoji/emoji.cjs +1 -1
  219. package/dist/lib/emoji/emoji.js +1 -1
  220. package/dist/lib/emoji-picker/emoji-picker.cjs +1 -1
  221. package/dist/lib/emoji-picker/emoji-picker.js +1 -1
  222. package/dist/lib/emoji-picker/index.cjs +1 -1
  223. package/dist/lib/emoji-picker/index.js +1 -1
  224. package/dist/lib/empty-state/empty-state.cjs +1 -1
  225. package/dist/lib/empty-state/empty-state.cjs.map +1 -1
  226. package/dist/lib/empty-state/empty-state.js +2 -2
  227. package/dist/lib/filter-pill/filter-pill-controlled.cjs +1 -1
  228. package/dist/lib/filter-pill/filter-pill-controlled.cjs.map +1 -1
  229. package/dist/lib/filter-pill/filter-pill-controlled.js +1 -1
  230. package/dist/lib/filter-pill/filter-pill.cjs +1 -1
  231. package/dist/lib/filter-pill/filter-pill.js +1 -1
  232. package/dist/lib/filter-pill/index.cjs +1 -1
  233. package/dist/lib/filter-pill/index.js +1 -1
  234. package/dist/lib/hovercard/hovercard.cjs +1 -1
  235. package/dist/lib/hovercard/hovercard.cjs.map +1 -1
  236. package/dist/lib/hovercard/hovercard.js +2 -2
  237. package/dist/lib/icon/icon.cjs +1 -1
  238. package/dist/lib/icon/icon.js +1 -1
  239. package/dist/lib/image-viewer/image-viewer.cjs +1 -1
  240. package/dist/lib/image-viewer/image-viewer.cjs.map +1 -1
  241. package/dist/lib/image-viewer/image-viewer.js +2 -2
  242. package/dist/lib/input/input.cjs +1 -1
  243. package/dist/lib/input/input.cjs.map +1 -1
  244. package/dist/lib/input/input.js +8 -8
  245. package/dist/lib/input-group/input-group.cjs +1 -1
  246. package/dist/lib/input-group/input-group.cjs.map +1 -1
  247. package/dist/lib/input-group/input-group.js +5 -5
  248. package/dist/lib/item-layout/item-layout.cjs +2 -2
  249. package/dist/lib/item-layout/item-layout.cjs.map +1 -1
  250. package/dist/lib/item-layout/item-layout.js +2 -2
  251. package/dist/lib/keyboard-shortcut/keyboard-shortcut.cjs +1 -1
  252. package/dist/lib/keyboard-shortcut/keyboard-shortcut.js +2 -2
  253. package/dist/lib/kitchen-sink/kitchen-sink-view.cjs +1 -1
  254. package/dist/lib/kitchen-sink/kitchen-sink-view.js +2 -2
  255. package/dist/lib/lazy-show/lazy-show.cjs +1 -1
  256. package/dist/lib/lazy-show/lazy-show.js +1 -1
  257. package/dist/lib/link/link.cjs +1 -1
  258. package/dist/lib/link/link.js +1 -1
  259. package/dist/lib/list-item/list-item.cjs +1 -1
  260. package/dist/lib/list-item/list-item.cjs.map +1 -1
  261. package/dist/lib/list-item/list-item.js +2 -2
  262. package/dist/lib/list-item-group/list-item-group.cjs +1 -1
  263. package/dist/lib/list-item-group/list-item-group.cjs.map +1 -1
  264. package/dist/lib/list-item-group/list-item-group.js +2 -2
  265. package/dist/lib/loader/loader.cjs +1 -1
  266. package/dist/lib/loader/loader.js +1 -1
  267. package/dist/lib/modal/modal.cjs +1 -1
  268. package/dist/lib/modal/modal.cjs.map +1 -1
  269. package/dist/lib/modal/modal.js +9 -9
  270. package/dist/lib/modal/modal.js.map +1 -1
  271. package/dist/lib/mode-directive/mode.cjs +1 -1
  272. package/dist/lib/mode-directive/mode.js +1 -1
  273. package/dist/lib/mode-island/mode-island.cjs +1 -1
  274. package/dist/lib/mode-island/mode-island.js +1 -1
  275. package/dist/lib/motion-text/motion-text.cjs +1 -1
  276. package/dist/lib/motion-text/motion-text.js +1 -1
  277. package/dist/lib/notice/notice-action.cjs +1 -1
  278. package/dist/lib/notice/notice-action.js +1 -1
  279. package/dist/lib/notice/notice-content.cjs +1 -1
  280. package/dist/lib/notice/notice-content.cjs.map +1 -1
  281. package/dist/lib/notice/notice-content.js +3 -3
  282. package/dist/lib/notice/notice-icon.cjs +1 -1
  283. package/dist/lib/notice/notice-icon.cjs.map +1 -1
  284. package/dist/lib/notice/notice-icon.js +2 -2
  285. package/dist/lib/notice/notice.cjs +1 -1
  286. package/dist/lib/notice/notice.js +1 -1
  287. package/dist/lib/pagination/pagination.cjs +1 -1
  288. package/dist/lib/pagination/pagination.js +1 -1
  289. package/dist/lib/popover/popover-header-footer.cjs +1 -1
  290. package/dist/lib/popover/popover-header-footer.cjs.map +1 -1
  291. package/dist/lib/popover/popover-header-footer.js +4 -4
  292. package/dist/lib/popover/popover.cjs +1 -1
  293. package/dist/lib/popover/popover.cjs.map +1 -1
  294. package/dist/lib/popover/popover.js +95 -82
  295. package/dist/lib/popover/popover.js.map +1 -1
  296. package/dist/lib/presence/index.cjs +1 -1
  297. package/dist/lib/presence/index.js +1 -1
  298. package/dist/lib/presence/presence.cjs +1 -1
  299. package/dist/lib/presence/presence.js +1 -1
  300. package/dist/lib/progress-bar/index.cjs +1 -0
  301. package/dist/lib/progress-bar/index.js +2 -0
  302. package/dist/lib/progress-bar/progress-bar.cjs +1 -0
  303. package/dist/lib/progress-bar/progress-bar.js +2 -0
  304. package/dist/lib/progress-circle/progress-circle.cjs +1 -1
  305. package/dist/lib/progress-circle/progress-circle.cjs.map +1 -1
  306. package/dist/lib/progress-circle/progress-circle.js +81 -42
  307. package/dist/lib/progress-circle/progress-circle.js.map +1 -1
  308. package/dist/lib/radio/radio.cjs +1 -1
  309. package/dist/lib/radio/radio.cjs.map +1 -1
  310. package/dist/lib/radio/radio.js +7 -7
  311. package/dist/lib/radio-group/radios-decorator.cjs +1 -1
  312. package/dist/lib/radio-group/radios-decorator.js +1 -1
  313. package/dist/lib/resizable/index.cjs +1 -1
  314. package/dist/lib/resizable/index.js +3 -3
  315. package/dist/lib/resizable/resizable-handle.cjs +1 -1
  316. package/dist/lib/resizable/resizable-handle.js +1 -1
  317. package/dist/lib/resizable/resizable-panel.cjs +1 -1
  318. package/dist/lib/resizable/resizable-panel.js +1 -1
  319. package/dist/lib/resizable/resizable.cjs +1 -1
  320. package/dist/lib/resizable/resizable.js +1 -1
  321. package/dist/lib/rich-text-editor/force-linkify.cjs +1 -1
  322. package/dist/lib/rich-text-editor/force-linkify.js +1 -1
  323. package/dist/lib/rich-text-editor/index.cjs +1 -1
  324. package/dist/lib/rich-text-editor/index.js +1 -1
  325. package/dist/lib/rich-text-editor/markdown-renderer.cjs +1 -1
  326. package/dist/lib/rich-text-editor/markdown-renderer.js +1 -1
  327. package/dist/lib/rich-text-editor/rich-text-editor.cjs +1 -1
  328. package/dist/lib/rich-text-editor/rich-text-editor.js +1 -1
  329. package/dist/lib/root-layout/root-layout.cjs +1 -1
  330. package/dist/lib/root-layout/root-layout.js +1 -1
  331. package/dist/lib/scroller/index.cjs +1 -1
  332. package/dist/lib/scroller/index.js +1 -1
  333. package/dist/lib/scroller/scroller.cjs +1 -1
  334. package/dist/lib/scroller/scroller.js +1 -1
  335. package/dist/lib/segmented-control/segmented-control-item.cjs +1 -1
  336. package/dist/lib/segmented-control/segmented-control-item.cjs.map +1 -1
  337. package/dist/lib/segmented-control/segmented-control-item.js +34 -4
  338. package/dist/lib/segmented-control/segmented-control-item.js.map +1 -1
  339. package/dist/lib/segmented-control/segmented-control.cjs +1 -1
  340. package/dist/lib/segmented-control/segmented-control.cjs.map +1 -1
  341. package/dist/lib/segmented-control/segmented-control.js +1 -1
  342. package/dist/lib/select-menu/select-menu.cjs +1 -1
  343. package/dist/lib/select-menu/select-menu.cjs.map +1 -1
  344. package/dist/lib/select-menu/select-menu.js +8 -8
  345. package/dist/lib/skeleton/skeleton-list-item.cjs +1 -1
  346. package/dist/lib/skeleton/skeleton-list-item.js +1 -1
  347. package/dist/lib/skeleton/skeleton-paragraph.cjs +1 -1
  348. package/dist/lib/skeleton/skeleton-paragraph.js +1 -1
  349. package/dist/lib/skeleton/skeleton-shape.cjs +1 -1
  350. package/dist/lib/skeleton/skeleton-shape.js +1 -1
  351. package/dist/lib/skeleton/skeleton-text.cjs +1 -1
  352. package/dist/lib/skeleton/skeleton-text.js +1 -1
  353. package/dist/lib/skeleton/skeleton.cjs +1 -1
  354. package/dist/lib/skeleton/skeleton.js +1 -1
  355. package/dist/lib/slider/index.cjs +1 -1
  356. package/dist/lib/slider/index.js +1 -1
  357. package/dist/lib/slider/slider.cjs +1 -1
  358. package/dist/lib/slider/slider.js +1 -1
  359. package/dist/lib/split-button/split-button-end.cjs +1 -1
  360. package/dist/lib/split-button/split-button-end.cjs.map +1 -1
  361. package/dist/lib/split-button/split-button-end.js +2 -2
  362. package/dist/lib/split-button/split-button-start.cjs +1 -1
  363. package/dist/lib/split-button/split-button-start.js +1 -1
  364. package/dist/lib/split-button/split-button.cjs +1 -1
  365. package/dist/lib/split-button/split-button.cjs.map +1 -1
  366. package/dist/lib/split-button/split-button.js +5 -5
  367. package/dist/lib/stack/stack.cjs +1 -1
  368. package/dist/lib/stack/stack.js +1 -1
  369. package/dist/lib/tab/tab-group.cjs +1 -1
  370. package/dist/lib/tab/tab-group.cjs.map +1 -1
  371. package/dist/lib/tab/tab-group.js +12 -4
  372. package/dist/lib/tab/tab-group.js.map +1 -1
  373. package/dist/lib/tab/tab-panel.cjs +1 -1
  374. package/dist/lib/tab/tab-panel.cjs.map +1 -1
  375. package/dist/lib/tab/tab-panel.js +2 -2
  376. package/dist/lib/tab/tab.cjs +1 -1
  377. package/dist/lib/tab/tab.cjs.map +1 -1
  378. package/dist/lib/tab/tab.js +36 -6
  379. package/dist/lib/tab/tab.js.map +1 -1
  380. package/dist/lib/text/index.cjs +1 -1
  381. package/dist/lib/text/index.js +1 -1
  382. package/dist/lib/text/text.cjs +1 -1
  383. package/dist/lib/text/text.js +1 -1
  384. package/dist/lib/text-list/index.cjs +1 -1
  385. package/dist/lib/text-list/index.js +2 -2
  386. package/dist/lib/text-list/text-list-item.cjs +1 -1
  387. package/dist/lib/text-list/text-list-item.js +1 -1
  388. package/dist/lib/text-list/text-list.cjs +1 -1
  389. package/dist/lib/text-list/text-list.js +1 -1
  390. package/dist/lib/toast/index.cjs +1 -1
  391. package/dist/lib/toast/index.js +1 -1
  392. package/dist/lib/toast/toast.cjs +1 -1
  393. package/dist/lib/toast/toast.js +1 -1
  394. package/dist/lib/toggle/toggle.cjs +1 -1
  395. package/dist/lib/toggle/toggle.cjs.map +1 -1
  396. package/dist/lib/toggle/toggle.js +4 -4
  397. package/dist/lib/tooltip/tooltip.cjs +1 -1
  398. package/dist/lib/tooltip/tooltip.cjs.map +1 -1
  399. package/dist/lib/tooltip/tooltip.js +6 -6
  400. package/dist/lib/tooltip/tooltip.js.map +1 -1
  401. package/dist/lib/tooltip-directive/tooltip.cjs +1 -1
  402. package/dist/lib/tooltip-directive/tooltip.cjs.map +1 -1
  403. package/dist/lib/tooltip-directive/tooltip.js +2 -2
  404. package/dist/lib/validation-messages/validation-messages.cjs +1 -1
  405. package/dist/lib/validation-messages/validation-messages.cjs.map +1 -1
  406. package/dist/lib/validation-messages/validation-messages.js +4 -4
  407. package/dist/{mode_constants-tb7TL85q.js → mode_constants-B8_1b5T8.js} +1 -1
  408. package/dist/{mode_constants-tb7TL85q.js.map → mode_constants-B8_1b5T8.js.map} +1 -1
  409. package/dist/{mode_constants-CzYJW9ua.cjs → mode_constants-DM0SVbFM.cjs} +1 -1
  410. package/dist/{mode_constants-CzYJW9ua.cjs.map → mode_constants-DM0SVbFM.cjs.map} +1 -1
  411. package/dist/shared/sr_only_close_button.cjs +1 -1
  412. package/dist/shared/sr_only_close_button.js +1 -1
  413. package/dist/utils-BL_SrwnF.js +172 -0
  414. package/dist/utils-BL_SrwnF.js.map +1 -0
  415. package/dist/utils-GofHWJKi.cjs +2 -0
  416. package/dist/{common/utils/index.js.map → utils-GofHWJKi.cjs.map} +1 -1
  417. package/package.json +6 -6
  418. package/dist/Combobox-DdBIRmeH.cjs +0 -3
  419. package/dist/Datepicker-Df6uR0r_.cjs +0 -2
  420. package/dist/EmojiPicker-KbIfc-GH.cjs +0 -2
  421. package/dist/FilterPill-DwapR9JK.cjs +0 -2
  422. package/dist/RichTextEditor-ECmStZDK.cjs +0 -11
  423. package/dist/Scroller-EIHN3a26.cjs +0 -2
  424. package/dist/Slider-BDgY7gNR.cjs +0 -2
  425. package/dist/Text-5MobHF6z.js.map +0 -1
  426. package/dist/Text-DNVNZree.cjs +0 -2
  427. package/dist/Text-DNVNZree.cjs.map +0 -1
  428. package/dist/TextListItem-CVjrHr2_.cjs +0 -2
  429. package/dist/Toast--W8p7jzA.cjs +0 -2
  430. package/dist/common/utils/index.cjs.map +0 -1
  431. /package/dist/{_plugin-vue_export-helper-BTgDAbhb.js → _plugin-vue_export-helper-BecorN_g.js} +0 -0
  432. /package/dist/{_plugin-vue_export-helper-D8jCH6HB.cjs → _plugin-vue_export-helper-CX7YVcP6.cjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../../../common/utils/index.js"],"sourcesContent":["import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants/index.js';\nimport {\n h,\n Comment,\n Text,\n} from 'vue';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is: 'critical' > 'warning' > 'positive' > 'info'.\n * If any message of type 'critical' is present in messages, the input state is considered\n * to be 'critical', then 'warning', then 'positive', and lastly 'info'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.CRITICAL)) {\n return VALIDATION_MESSAGE_TYPES.CRITICAL;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.POSITIVE)) {\n return VALIDATION_MESSAGE_TYPES.POSITIVE;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.INFO)) {\n return VALIDATION_MESSAGE_TYPES.INFO;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\n });\n}\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/**\n * Extracts Vue event listeners from attributes object\n * @param {Object} attrs - The attributes object to extract listeners from\n * @returns {Object} Object containing only Vue event listeners (keys matching on[A-Z])\n */\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.match(/on[A-Z]/));\n return Object.fromEntries(listeners);\n};\n\n/**\n * Extracts non-listener attributes from attributes object\n * @param {Object} attrs - The attributes object to extract non-listeners from\n * @returns {Object} Object containing only non-listener attributes (keys not matching on[A-Z])\n */\nexport const extractNonListeners = (attrs) => {\n const nonListeners = Object.entries(attrs)\n .filter(([key]) => !key.match(/on[A-Z]/));\n return Object.fromEntries(nonListeners);\n};\n\n/**\n * $el works very differently than in vue 2, if the first node in the template is a text node\n * such as a comment it will return that instead of the first actual element. This function\n * will recursively return the first element in the template instead of the first node.\n * @param el\n * @returns {HTMLElement} The first element in the template\n */\nexport const returnFirstEl = (el) => {\n if (el?.nodeType === Node.ELEMENT_NODE) {\n return el;\n } else if (!el?.nodeType) {\n return null;\n } else {\n return returnFirstEl(el?.nextSibling);\n }\n};\n\n/**\n In Vue 3, $attrs includes class and style attributes, but when using inheritAttrs: false\n and manually binding :class=\"$attrs.class\" and :style=\"$attrs.style\" to the root element,\n we need to prevent class/style from being passed to inner elements via v-bind=\"removeClassStyleAttrs($attrs)\".\n This function removes class and style attributes from the attrs object.\n*/\nexport function removeClassStyleAttrs (attrs) {\n const listeners = Object.entries(attrs)\n .filter(([key]) => !['class', 'style'].includes(key));\n return Object.fromEntries(listeners);\n}\n\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9011\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch {\n \n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(', ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\n/**\n * Warns if the component is not mounted properly. Useful for tests.\n * @param {HTMLElement} componentRef - the component reference\n * @param {string} componentName - the component name\n */\n\nexport function warnIfUnmounted (componentRef, componentName) {\n if (typeof process === 'undefined') return;\n if (process.env.NODE_ENV !== 'test') return;\n if (!componentRef || !(componentRef instanceof HTMLElement) || !document?.body) return;\n if (!document.body.contains(componentRef)) {\n console.warn(`The ${componentName} component is not attached to the document body. This may cause issues.`);\n }\n}\n\n/**\n * checks whether the dt-scrollbar is being used on the root element.\n * @param rootElement {HTMLElement}\n * @returns {boolean}\n */\nfunction isDtScrollbarInUse (rootElement = document.documentElement) {\n if (rootElement.hasAttribute('data-overlayscrollbars')) {\n return true;\n }\n return false;\n}\n\n/**\n * This will disable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * @param rootElement {HTMLElement}\n */\nexport function disableRootScrolling (rootElement = document.documentElement) {\n if (isDtScrollbarInUse(rootElement)) {\n rootElement.classList.add('d-scrollbar-disabled');\n } else {\n rootElement.classList.add('d-of-hidden');\n }\n}\n\n/**\n * This will enable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * @param rootElement {HTMLElement}\n */\nexport function enableRootScrolling (rootElement = document.documentElement) {\n if (isDtScrollbarInUse(rootElement)) {\n rootElement.classList.remove('d-scrollbar-disabled');\n } else {\n rootElement.classList.remove('d-of-hidden');\n }\n}\n\n/**\n * This will take a text string e.g \"accessibility-mac\"\n * and convert it to our Fluent Key standard format \"ACCESSIBILITY_MAC\"\n * @param text\n * @returns {string}\n */\nexport function toFluentKeyString (text) {\n return text\n .replaceAll(/[ -]/g, '_')\n .replaceAll(/\\W/g, '')\n .toUpperCase();\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n extractVueListeners,\n extractNonListeners,\n removeClassStyleAttrs,\n returnFirstEl,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n\n"],"mappings":";;;AAWA,IAAI,IAAoB,GACpB,GASE,IAAqB,0IAErB,IAAY,OAAO,gBAAiB,aAAa,eAAe;AAEtE,SAAgB,EAAiB,IAAA,MAAyB;AACxD,QAAO,GAAG,IAAS;;AAUrB,SAAgB,EAAkB,GAAO,GAAM;AAC7C,KAAI,GAAM;EACR,IAAM,IAAO,EAAa,EAAK;AAC/B,SAAO,EAAM,KAAK,IAAI,EAAK,GAAG,EAAM;OAEpC,QAAO,EAAM,EAAa,EAAM,OAAO;;AAmB3C,SAAgB,EAAc,GAAK;CACjC,IAAI;AACJ,MAAK,IAAI,IAAI,GAAG,IAAI,EAAI,QAAQ,IAC9B,KAAI,KAAK,KAAK,IAAI,EAAE,GAAG,EAAI,WAAW,EAAE,GAAG;AAG7C,QAAO;;AAQT,SAAgB,EAAc,GAAK;AACjC,QAAO,KAAK,MAAM,KAAK,QAAQ,GAAG,EAAI;;AAGxC,SAAgB,EAAgB,GAAU;AAKxC,QAJK,IAIE,EAAS,KAAI,MACd,OAAO,KAAY,WACd;EACL;EACA,MAAM;EACP,GAGI,EACP,GAZO,EAAE;;AAeb,SAAgB,EAAyB,GAAmB;CAC1D,IAAM,IAAkB,EAAmB,EAAkB;AAM7D,QAJI,CAAC,KAAqB,CAAC,IAClB,EAAE,GAGJ,EAAkB,QAAO,MAAW,CAAC,CAAC,EAAQ,WAAW,EAAQ,SAAS,EAAgB;;AAQnG,SAAgB,EAAoB,GAAmB;AAkBrD,QAjBK,IAID,EAA0B,GAAmB,EAAyB,SAAS,GAC1E,EAAyB,WAE9B,EAA0B,GAAmB,EAAyB,QAAQ,GACzE,EAAyB,UAE9B,EAA0B,GAAmB,EAAyB,SAAS,GAC1E,EAAyB,WAE9B,EAA0B,GAAmB,EAAyB,KAAK,GACtE,EAAyB,OAG3B,OAhBE;;AAmBX,SAAgB,EAA2B,GAAmB,GAAa;AAKzE,QAJI,CAAC,KAAqB,CAAC,IAClB,KAGF,EAAkB,MAAK,MAAW,GAAS,SAAS,EAAY;;AAGzE,SAAgB,EAAwB,GAAS;AAC/C,QAAO,GAAS,cAAc,EAAmB;;AAOnD,IAAa,KAAgB,MACpB,EAAE,OAAO,EAAE,WAAW,EAAM,MAAM,CAAC,EAG/B,UACJ,IAAI,SAAS,MAAY;AAC9B,GAAU,EAAQ;EAClB;AAQJ,SAAgB,EAAgB,GAAM,IAAY,EAAE,EAAE;AAIpD,QAHK,IAGE,EAAK,EAAU,CAAC,MAAM,MACvB,EAAM,SAAS,KAEf,MAAM,QAAQ,EAAM,SAAS,IAAI,CAAC,EAAM,SAAS,SAAe,KAGlE,EAAM,SAAS,KACd,OAAO,EAAM,YAAa,YAAY,EAAM,SAAS,MAAM,KAAK,GAEnE,GAZgB;;AAoBpB,IAAa,KAAyB,MAC7B,GAAQ,aAAa,CACzB,MAAM,IAAI,CACV,KAAI,MAAQ,EAAK,OAAO,EAAE,CAAC,aAAa,GAAG,EAAK,MAAM,EAAE,CAAC,CACzD,KAAK,GAAG,EAQA,KAAyB,MAC7B,EACJ,QAAQ,oBAAoB,GAAG,MAAM,MAAM,EAAE,aAAa,CAAC,CAC3D,QAAQ,MAAM,GAAG,EAQT,KAAuB,MAAU;CAC5C,IAAM,IAAY,OAAO,QAAQ,EAAM,CACpC,QAAQ,CAAC,OAAS,EAAI,MAAM,UAAU,CAAC;AAC1C,QAAO,OAAO,YAAY,EAAU;GAQzB,KAAuB,MAAU;CAC5C,IAAM,IAAe,OAAO,QAAQ,EAAM,CACvC,QAAQ,CAAC,OAAS,CAAC,EAAI,MAAM,UAAU,CAAC;AAC3C,QAAO,OAAO,YAAY,EAAa;GAU5B,KAAiB,MACxB,GAAI,aAAa,KAAK,eACjB,IACG,GAAI,WAGP,EAAc,GAAI,YAAY,GAF9B;AAYX,SAAgB,EAAuB,GAAO;CAC5C,IAAM,IAAY,OAAO,QAAQ,EAAM,CACpC,QAAQ,CAAC,OAAS,CAAC,CAAC,SAAS,QAAQ,CAAC,SAAS,EAAI,CAAC;AACvD,QAAO,OAAO,YAAY,EAAU;;AAStC,SAAgB,EAAU,GAAM,IAAU,KAAK;AAE7C,CADA,aAAa,EAAM,EACnB,IAAQ,WAAW,GAAM,EAAQ;;AAUnC,SAAgB,EAAiB,GAAS;CACxC,IAAM,IAAW,EAAQ,uBAAuB,EAE1C,IAAQ;EACZ,KAAK,EAAS,MAAM;EACpB,MAAM,EAAS,OAAO;EACtB,QAAQ,EAAS,UAAU,OAAO,eAAe,SAAS,gBAAgB;EAC1E,OAAO,EAAS,SAAS,OAAO,cAAc,SAAS,gBAAgB;EACxE;AAGD,QAFA,EAAM,MAAM,OAAO,OAAO,EAAM,CAAC,MAAK,MAAO,EAAI,EACjD,EAAM,MAAM,OAAO,OAAO,EAAM,CAAC,OAAM,MAAO,EAAI,EAC3C;;AAIT,IAAM,IAAkB,mDAGlB,IAAY,gBAAI,OACpB,mRAMD,EAGK,IAAY,gBAAI,OACpB,qGAED,EAGK,IAAwB,OAC5B,QACA,CACE,CACE,EAAgB,QAChB,EAAU,OACX,CAAC,KAAK,IAAI,EACX,EAAU,OACX,CAAC,KAAK,IAAI,GACX,IACD,EAGK,IAAe,2BAGf,IAA0B,sCAI1B,IAA8B,OAClC,QACA;CACE,EAAkB;CAClB,EAAa;CACb,EAAwB;CACxB;CACD,CAAC,KAAK,IAAI,CACZ,EAIK,IAAuB,6BAIvB,IAAwB,OAC5B,kFAEA,CACE,EAAkB,QAClB,EAAwB,OACzB,CAAC,KAAK,IAAI,GACX,UACD;AAQD,SAAgB,EAAqB,IAAY,GAAG,IAAY,IAAI;AAIlE,KAAI;AACF,SAAW,OACT,mDAEI,EAAU,GAAG,EAAU,mCAE5B;SACK;AAEN,UAAQ,KAAK,0DAA2D;;AAG1E,QAAW,OACT,qCACM,EAAU,GAAG,EAAU,mCAE9B;;AAGH,IAAM,IAAmB,GAAqB,EAGjC,IAAY,IAAI,OAC3B;CACE,EAAwB;CACxB,EAAqB;CACrB,EAAkB;CAClB,EAAiB;CAClB,CAAC,KAAK,IAAI,EACX,KACD;AAOD,SAAgB,EAAe,GAAO;AAGpC,QAFI,CAAC,KAAU,CAAC,CAAC,UAAU,SAAS,CAAC,SAAS,OAAO,EAAM,GAAU,MACrE,IAAQ,EAAM,UAAU,EACjB,EAAiB,KAAK,EAAM,GAAG,OAAO;;AAQ/C,SAAgB,EAAO,GAAO;AAE5B,QADI,CAAC,KAAS,OAAO,KAAU,WAAiB,KACzC,EAAwB,KAAK,EAAM,GAAG,OAAO,KAClD,EAAqB,KAAK,EAAM,GAAG,OAAO;;AAQ9C,SAAgB,EAAgB,GAAO;AAErC,QADI,CAAC,KAAS,OAAO,KAAU,WAAiB,KACzC,EAAkB,KAAK,EAAM,GAAG,OAAO;;AAShD,SAAgB,EAAmB,GAAU;AAC3C,QAAO,EAAS,QAAO,MAAO,CAAC,CAAC,EAAI,CAAC,KAAK,KAAK;;AASjD,SAAgB,EAAuB,GAAK,IAAS,SAAS;AAC5D,QAAO,EAAI,QAAQ,cAAa,MAAQ,EAAK,kBAAkB,EAAO,CAAC;;AASzE,SAAgB,EAAiB,GAAc,GAAe;AACxD,QAAO,UAAY,OACvB,QAAA,IAAA,aAA6B,WACzB,CAAC,KAAgB,EAAE,aAAwB,gBAAgB,CAAC,UAAU,QACrE,SAAS,KAAK,SAAS,EAAa,IACvC,QAAQ,KAAK,OAAO,EAAc,yEAAyE;;AAS/G,SAAS,EAAoB,IAAc,SAAS,iBAAiB;AAInE,QAHA,EAAI,EAAY,aAAa,yBAAyB;;AAUxD,SAAgB,EAAsB,IAAc,SAAS,iBAAiB;AAC5E,CAAI,EAAmB,EAAY,GACjC,EAAY,UAAU,IAAI,uBAAuB,GAEjD,EAAY,UAAU,IAAI,cAAc;;AAQ5C,SAAgB,EAAqB,IAAc,SAAS,iBAAiB;AAC3E,CAAI,EAAmB,EAAY,GACjC,EAAY,UAAU,OAAO,uBAAuB,GAEpD,EAAY,UAAU,OAAO,cAAc;;AAU/C,SAAgB,EAAmB,GAAM;AACvC,QAAO,EACJ,WAAW,SAAS,IAAI,CACxB,WAAW,OAAO,GAAG,CACrB,aAAa;;AAGlB,IAAA,IAAe;CACb;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD"}
1
+ {"version":3,"file":"utils-GofHWJKi.cjs","names":["DEFAULT_VALIDATION_MESSAGE_TYPE","VALIDATION_MESSAGE_TYPES","Comment","Text"],"sources":["../common/owned_classes.js","../common/utils/index.js"],"sourcesContent":["// Element -> Map(owner -> class that owner added).\nconst classOwners = new WeakMap();\n\n/**\n * Adds a class to an element on behalf of an owner. Adding again for the same owner does nothing.\n * @param element {HTMLElement}\n * @param className {string}\n * @param owner {*}\n */\nexport function addOwnedClass (element, className, owner) {\n let owners = classOwners.get(element);\n if (!owners) {\n owners = new Map();\n classOwners.set(element, owners);\n }\n if (owners.has(owner)) return;\n owners.set(owner, className);\n element.classList.add(className);\n}\n\n/**\n * Releases the class an owner added. The class is removed once no remaining owner holds it.\n * @param element {HTMLElement}\n * @param owner {*}\n */\nexport function removeOwnedClass (element, owner) {\n const owners = classOwners.get(element);\n const className = owners?.get(owner);\n if (!className) return;\n owners.delete(owner);\n if (!owners.size) classOwners.delete(element);\n for (const remainingClassName of owners.values()) {\n if (remainingClassName === className) return;\n }\n element.classList.remove(className);\n}\n\n/**\n * @param element {HTMLElement}\n * @returns {boolean} whether any owner holds a class on the element.\n */\nexport function hasClassOwners (element) {\n return classOwners.has(element);\n}\n","import {\n DEFAULT_PREFIX,\n DEFAULT_VALIDATION_MESSAGE_TYPE,\n VALIDATION_MESSAGE_TYPES,\n} from '../constants/index.js';\nimport {\n h,\n Comment,\n Text,\n} from 'vue';\nimport { addOwnedClass, hasClassOwners, removeOwnedClass } from '../owned_classes.js';\n\nlet UNIQUE_ID_COUNTER = 0;\nlet TIMER;\n\n// selector to find focusable not hidden inputs\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN = 'input:not([type=hidden]):not(:disabled)';\n// selector to find focusable not disables elements\nconst FOCUSABLE_SELECTOR_NOT_DISABLED = 'select:not(:disabled),textarea:not(:disabled),button:not(:disabled)';\n// // selector to find focusable not hidden and disabled elements\nconst FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED = `${FOCUSABLE_SELECTOR_NOT_HIDDEN},${FOCUSABLE_SELECTOR_NOT_DISABLED}`;\n// selector to find focusable elements\nconst FOCUSABLE_SELECTOR = `a,frame,iframe,${FOCUSABLE_SELECTOR_NOT_HIDDEN_DISABLED},*[tabindex]`;\n\nconst scheduler = typeof setImmediate === 'function' ? setImmediate : setTimeout;\n\nexport function getUniqueString (prefix = DEFAULT_PREFIX) {\n return `${prefix}${UNIQUE_ID_COUNTER++}`;\n}\n\n/**\n * Returns a random element from array\n * @param array - the array to return a random element from\n * @param {string} seed - use a string to seed the randomization, so it returns the same element each time\n * based on that string.\n * @returns {*} - the random element\n */\nexport function getRandomElement (array, seed) {\n if (seed) {\n const hash = javaHashCode(seed);\n return array[Math.abs(hash) % array.length];\n } else {\n return array[getRandomInt(array.length)];\n }\n}\n\n/**\n * Returns a hash code for a string.\n * (Compatible to Java's String.hashCode())\n * We use this algo to be in sync with android.\n *\n * The hash code for a string object is computed as\n * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]\n * using number arithmetic, where s[i] is the i th character\n * of the given string, n is the length of the string,\n * and ^ indicates exponentiation.\n * (The hash value of the empty string is zero.)\n *\n * @param {string} str a string\n * @return {number} a hash code value for the given string.\n */\nexport function javaHashCode (str) {\n let h;\n for (let i = 0; i < str.length; i++) {\n h = Math.imul(31, h) + str.charCodeAt(i) | 0;\n }\n\n return h;\n}\n\n/**\n * Generate a random integer\n * @param {number} max - max range of integer to generate\n * @returns {number} randomly generated integer between 0 and max\n */\nexport function getRandomInt (max) {\n return Math.floor(Math.random() * max);\n}\n\nexport function formatMessages (messages) {\n if (!messages) {\n return [];\n }\n\n return messages.map(message => {\n if (typeof message === 'string') {\n return {\n message,\n type: DEFAULT_VALIDATION_MESSAGE_TYPE,\n };\n }\n\n return message;\n });\n}\n\nexport function filterFormattedMessages (formattedMessages) {\n const validationState = getValidationState(formattedMessages);\n\n if (!formattedMessages || !validationState) {\n return [];\n }\n\n return formattedMessages.filter(message => !!message.message && message.type === validationState);\n}\n\n/*\n * The priority order of message types is: 'critical' > 'warning' > 'positive' > 'info'.\n * If any message of type 'critical' is present in messages, the input state is considered\n * to be 'critical', then 'warning', then 'positive', and lastly 'info'.\n */\nexport function getValidationState (formattedMessages) {\n if (!formattedMessages) {\n return null;\n }\n\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.CRITICAL)) {\n return VALIDATION_MESSAGE_TYPES.CRITICAL;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.WARNING)) {\n return VALIDATION_MESSAGE_TYPES.WARNING;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.POSITIVE)) {\n return VALIDATION_MESSAGE_TYPES.POSITIVE;\n }\n if (hasFormattedMessageOfType(formattedMessages, VALIDATION_MESSAGE_TYPES.INFO)) {\n return VALIDATION_MESSAGE_TYPES.INFO;\n }\n\n return null;\n}\n\nexport function hasFormattedMessageOfType (formattedMessages, messageType) {\n if (!formattedMessages || !messageType) {\n return false;\n }\n\n return formattedMessages.some(message => message?.type === messageType);\n}\n\nexport function findFirstFocusableNode (element) {\n return element?.querySelector(FOCUSABLE_SELECTOR);\n}\n\n/* html-fragment component:\n * To render html without wrapping in another element as when using v-html.\n * props: html\n */\nexport const htmlFragment = (props) => {\n return h('div', { innerHTML: props.html });\n};\n\nexport const flushPromises = () => {\n return new Promise((resolve) => {\n scheduler(resolve);\n });\n};\n\n/*\n It is very cumbersome to check if a slot is empty in vue 3. Copied this method from the following thread\n https://github.com/vuejs/core/issues/4733. There is an RFC to fix this but not yet being worked on.\n https://github.com/vuejs/rfcs/discussions/453\n*/\nexport function hasSlotContent (slot, slotProps = {}) {\n if (!slot) return false;\n\n\n return slot(slotProps).some((vnode) => {\n if (vnode.type === Comment) return false;\n\n if (Array.isArray(vnode.children) && !vnode.children.length) return false;\n\n return (\n vnode.type !== Text ||\n (typeof vnode.children === 'string' && vnode.children.trim() !== '')\n );\n });\n}\n\n/**\n * Transform a string from kebab-case to PascalCase\n * @param string\n * @returns {string}\n */\nexport const kebabCaseToPascalCase = (string) => {\n return string?.toLowerCase()\n .split('-')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join('');\n};\n\n/**\n * Transform a string from PascalCase to kebab-case\n * @param string\n * @returns {string}\n */\nexport const pascalCaseToKebabCase = (string) => {\n return string\n .replace(/\\.?([A-Z0-9]+)/g, (x, y) => '-' + y.toLowerCase())\n .replace(/^-/, '');\n};\n\n/**\n * Extracts Vue event listeners from attributes object\n * @param {Object} attrs - The attributes object to extract listeners from\n * @returns {Object} Object containing only Vue event listeners (keys matching on[A-Z])\n */\nexport const extractVueListeners = (attrs) => {\n const listeners = Object.entries(attrs)\n .filter(([key]) => key.match(/on[A-Z]/));\n return Object.fromEntries(listeners);\n};\n\n/**\n * Extracts non-listener attributes from attributes object\n * @param {Object} attrs - The attributes object to extract non-listeners from\n * @returns {Object} Object containing only non-listener attributes (keys not matching on[A-Z])\n */\nexport const extractNonListeners = (attrs) => {\n const nonListeners = Object.entries(attrs)\n .filter(([key]) => !key.match(/on[A-Z]/));\n return Object.fromEntries(nonListeners);\n};\n\n/**\n * $el works very differently than in vue 2, if the first node in the template is a text node\n * such as a comment it will return that instead of the first actual element. This function\n * will recursively return the first element in the template instead of the first node.\n * @param el\n * @returns {HTMLElement} The first element in the template\n */\nexport const returnFirstEl = (el) => {\n if (el?.nodeType === Node.ELEMENT_NODE) {\n return el;\n } else if (!el?.nodeType) {\n return null;\n } else {\n return returnFirstEl(el?.nextSibling);\n }\n};\n\n/**\n In Vue 3, $attrs includes class and style attributes, but when using inheritAttrs: false\n and manually binding :class=\"$attrs.class\" and :style=\"$attrs.style\" to the root element,\n we need to prevent class/style from being passed to inner elements via v-bind=\"removeClassStyleAttrs($attrs)\".\n This function removes class and style attributes from the attrs object.\n*/\nexport function removeClassStyleAttrs (attrs) {\n const listeners = Object.entries(attrs)\n .filter(([key]) => !['class', 'style'].includes(key));\n return Object.fromEntries(listeners);\n}\n\n\n/*\n* Set's a global timer to debounce the execution of a function.\n* @param { object } func - the function that is going to be called after timeout\n* @param { number } [timeout=300] timeout\n* */\nexport function debounce (func, timeout = 300) {\n clearTimeout(TIMER);\n TIMER = setTimeout(func, timeout);\n}\n\n/**\n * Checks if the element is out of the viewport\n * https://gomakethings.com/how-to-check-if-any-part-of-an-element-is-out-of-the-viewport-with-vanilla-js/\n * @param {HTMLElement} element The element to check\n * @return {Object} A set of booleans for each side of the element\n */\n\nexport function isOutOfViewPort (element) {\n const bounding = element.getBoundingClientRect();\n\n const isOut = {\n top: bounding.top < 0,\n left: bounding.left < 0,\n bottom: bounding.bottom > (window.innerHeight || document.documentElement.clientHeight),\n right: bounding.right > (window.innerWidth || document.documentElement.clientWidth),\n };\n isOut.any = Object.values(isOut).some(val => val);\n isOut.all = Object.values(isOut).every(val => val);\n return isOut;\n}\n\n// match valid characters for a domain name followed by a dot, e.g. \"dialpad.\"\nconst domainNameRegex = /(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)/;\n\n// match valid TLDs for a hostname (outdated list from ~2017)\nconst tldRegerx = new RegExp(\n '(?:' +\n 'com|ru|org|net|de|jp|uk|br|it|pl|fr|in|au|ir|info|nl|cn|es|cz|kr|ca|eu|ua|co|gr|' +\n 'za|ro|biz|ch|se|tw|mx|vn|hu|be|tr|at|dk|tv|me|ar|sk|no|us|fi|id|cl|xyz|io|pt|by|' +\n 'il|ie|nz|kz|hk|lt|cc|my|sg|club|bg|edu|рф|pk|su|top|th|hr|rs|pe|pro|si|az|lv|pw|' +\n 'ae|ph|online|ng|ee|ws|ve|cat' +\n ')',\n);\n\n// match valid IPv4 addresses, e.g. \"192.158.1.38\"\nconst ipv4Regex = new RegExp(\n '(?:(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])\\\\.){3}' +\n '(?:[0-9]|[1-9]\\\\d|1\\\\d{2}|2[0-4]\\\\d|25[0-5])',\n);\n\n// match hostnames OR IPv4 addresses, e.g. \"dialpad.com\" or \"192.158.1.38\"\nconst hostnameOrIpRegex = new RegExp(\n '(?:' +\n [\n [\n domainNameRegex.source,\n tldRegerx.source,\n ].join('+'),\n ipv4Regex.source,\n ].join('|') +\n ')',\n);\n\n// match URL paths, e.g. \"/news\"\nconst urlPathRegex = /(?:(?:[;/][^#?<>\\s]*)?)/;\n\n// match URL queries and fragments, e.g. \"?cache=1&new=true\" or \"#heading1\"\nconst urlQueryOrFragmentRegex = /(?:(?:\\?[^#<>\\s]+)?(?:#[^<>\\s]+)?)/;\n\n// match complete hostnames or IPv4 addresses without a protocol and with optional\n// URL paths, queries and fragments e.g. \"dialpad.com/news?cache=1#heading1\"\nconst urlWithoutProtocolRegex = new RegExp(\n '\\\\b' +\n [\n hostnameOrIpRegex.source,\n urlPathRegex.source,\n urlQueryOrFragmentRegex.source,\n '(?!\\\\w)',\n ].join('+'),\n);\n\n// match complete hostnames with protocols and optional URL paths, queries and fragments,\n// e.g. \"ws://localhost:9011\" or \"https://dialpad.com/news?cache=1#heading1\"\nconst urlWithProtocolRegex = /\\b[a-z\\d.-]+:\\/\\/[^<>\\s]+/;\n\n// match email addresses with an optional \"mailto:\" prefix and URL queries, e.g.\n// \"hey@dialpad.com\" or \"mailto:hey@dialpad.com?subject=Hi&body=Hey%20there\"\nconst emailAddressRegex = new RegExp(\n '(?:mailto:)?' +\n '[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+(?:\\\\.[a-z0-9!#$%&\\'*+/=?^_`{|}~-]+)*@' +\n [\n hostnameOrIpRegex.source,\n urlQueryOrFragmentRegex.source,\n ].join('+') +\n '(?!\\\\w)',\n);\n\n/**\n * Match phone numbers, e.g. \"765-8813\", \"(778) 765-8813\" or \"+17787658813\".\n * @param {number} minLength\n * @param {number} maxLength\n * @returns {RegExp}\n */\nexport function getPhoneNumberRegex (minLength = 7, maxLength = 15) {\n // Some older browser versions don't support lookbehind, so provide a RegExp\n // version without it. It fails just one test case, so IMO it's still good\n // enough to use. https://caniuse.com/js-regexp-lookbehind\n try {\n return new RegExp(\n '(?:^|(?<=\\\\W))' +\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n } catch {\n \n console.warn('This browser doesn\\'t support regex lookahead/lookbehind');\n }\n\n return new RegExp(\n '(?![\\\\s\\\\-])\\\\+?(?:[0-9()\\\\- \\\\t]' +\n `{${minLength},${maxLength}}` +\n ')(?=\\\\b)(?=\\\\W(?=\\\\W|$)|\\\\s|$)',\n );\n}\n\nconst phoneNumberRegex = getPhoneNumberRegex();\n\n// match all link types\nexport const linkRegex = new RegExp(\n [\n urlWithoutProtocolRegex.source,\n urlWithProtocolRegex.source,\n emailAddressRegex.source,\n phoneNumberRegex.source,\n ].join('|'),\n 'gi',\n);\n\n/**\n * Check if a string is a phone number. Validates only exact matches.\n * @param {string|number} input\n * @returns {boolean}\n */\nexport function isPhoneNumber (input) {\n if (!input || (!['string', 'number'].includes(typeof input))) return false;\n input = input.toString();\n return phoneNumberRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an URL. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isURL (input) {\n if (!input || typeof input !== 'string') return false;\n return urlWithoutProtocolRegex.exec(input)?.[0] === input ||\n urlWithProtocolRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Check if a string is an email address. Validates only exact matches.\n * @param {string} input\n * @returns {boolean}\n */\nexport function isEmailAddress (input) {\n if (!input || typeof input !== 'string') return false;\n return emailAddressRegex.exec(input)?.[0] === input;\n}\n\n/**\n * Concatenate a string removing null or undefined elements\n * avoiding parsing them as string with template strings\n * @param {Array} elements\n * @returns {String}\n */\nexport function safeConcatStrings (elements) {\n return elements.filter(str => !!str).join(', ');\n}\n\n/**\n * Locale safe function to capitalize the first letter of a string.\n * @param {string} str the string to capitalize the first letter of\n * @param {string} locale a string representing the locale to be used. Defaults to 'en-US'\n * @returns The passed in string with the first letter capitalized\n */\nexport function capitalizeFirstLetter (str, locale = 'en-US') {\n return str.replace(/^\\p{CWU}/u, char => char.toLocaleUpperCase(locale));\n}\n\n/**\n * Warns if the component is not mounted properly. Useful for tests.\n * @param {HTMLElement} componentRef - the component reference\n * @param {string} componentName - the component name\n */\n\nexport function warnIfUnmounted (componentRef, componentName) {\n if (typeof process === 'undefined') return;\n if (process.env.NODE_ENV !== 'test') return;\n if (!componentRef || !(componentRef instanceof HTMLElement) || !document?.body) return;\n if (!document.body.contains(componentRef)) {\n console.warn(`The ${componentName} component is not attached to the document body. This may cause issues.`);\n }\n}\n\n/**\n * checks whether the dt-scrollbar is being used on the root element.\n * @param rootElement {HTMLElement}\n * @returns {boolean}\n */\nfunction isDtScrollbarInUse (rootElement = document.documentElement) {\n if (rootElement.hasAttribute('data-overlayscrollbars')) {\n return true;\n }\n return false;\n}\n\n// Shared by ownerless callers, so a legacy disable/enable pair still acts as one owner.\nconst LEGACY_SCROLL_LOCK_OWNER = Symbol('legacyScrollLockOwner');\n\nfunction getRootScrollLockClass (rootElement) {\n return isDtScrollbarInUse(rootElement) ? 'd-scrollbar-disabled' : 'd-of-hidden';\n}\n\n/**\n * This will disable scrolling on the root element regardless of whether you are using dt-scrollbar or not.\n * Each owner holds its own lock; scrolling stays disabled until every owner has called enableRootScrolling.\n * @param rootElement {HTMLElement}\n * @param owner {*} identifies the caller's lock. Ownerless callers share a single owner.\n */\nexport function disableRootScrolling (rootElement = document.documentElement, owner = LEGACY_SCROLL_LOCK_OWNER) {\n addOwnedClass(rootElement, getRootScrollLockClass(rootElement), owner);\n}\n\n/**\n * This will release the owner's scroll lock on the root element regardless of whether you are using dt-scrollbar\n * or not. The class that owner added is removed only when no other owner still holds it.\n * @param rootElement {HTMLElement}\n * @param owner {*} the owner passed to disableRootScrolling. Ownerless callers share a single owner.\n */\nexport function enableRootScrolling (rootElement = document.documentElement, owner = LEGACY_SCROLL_LOCK_OWNER) {\n if (hasClassOwners(rootElement)) {\n removeOwnedClass(rootElement, owner);\n } else if (owner === LEGACY_SCROLL_LOCK_OWNER) {\n // No tracked lock: keep the previous unconditional behavior for ownerless callers.\n rootElement.classList.remove(getRootScrollLockClass(rootElement));\n }\n}\n\n/**\n * This will take a text string e.g \"accessibility-mac\"\n * and convert it to our Fluent Key standard format \"ACCESSIBILITY_MAC\"\n * @param text\n * @returns {string}\n */\nexport function toFluentKeyString (text) {\n return text\n .replaceAll(/[ -]/g, '_')\n .replaceAll(/\\W/g, '')\n .toUpperCase();\n}\n\nexport default {\n getUniqueString,\n getRandomElement,\n getRandomInt,\n formatMessages,\n filterFormattedMessages,\n hasFormattedMessageOfType,\n getValidationState,\n htmlFragment,\n flushPromises,\n kebabCaseToPascalCase,\n extractVueListeners,\n extractNonListeners,\n removeClassStyleAttrs,\n returnFirstEl,\n debounce,\n isOutOfViewPort,\n getPhoneNumberRegex,\n linkRegex,\n isEmailAddress,\n isPhoneNumber,\n isURL,\n safeConcatStrings,\n capitalizeFirstLetter,\n disableRootScrolling,\n enableRootScrolling,\n};\n\n"],"mappings":"qGACA,IAAM,EAAc,IAAI,QAQxB,SAAgB,EAAe,EAAS,EAAW,EAAO,CACxD,IAAI,EAAS,EAAY,IAAI,EAAQ,CAChC,IACH,EAAS,IAAI,IACb,EAAY,IAAI,EAAS,EAAO,EAE9B,GAAO,IAAI,EAAM,GACrB,EAAO,IAAI,EAAO,EAAU,CAC5B,EAAQ,UAAU,IAAI,EAAU,EAQlC,SAAgB,EAAkB,EAAS,EAAO,CAChD,IAAM,EAAS,EAAY,IAAI,EAAQ,CACjC,EAAY,GAAQ,IAAI,EAAM,CAC/B,KAEL,CADA,EAAO,OAAO,EAAM,CACf,EAAO,MAAM,EAAY,OAAO,EAAQ,CAC7C,IAAK,IAAM,KAAsB,EAAO,QAAQ,CAC9C,GAAI,IAAuB,EAAW,OAExC,EAAQ,UAAU,OAAO,EAAU,EAOrC,SAAgB,EAAgB,EAAS,CACvC,OAAO,EAAY,IAAI,EAAQ,CC9BjC,IAAI,EAAoB,EACpB,EASE,EAAqB,yIAErB,EAAY,OAAO,cAAiB,WAAa,aAAe,WAEtE,SAAgB,EAAiB,EAAA,KAAyB,CACxD,MAAO,GAAG,IAAS,MAUrB,SAAgB,EAAkB,EAAO,EAAM,CAC7C,GAAI,EAAM,CACR,IAAM,EAAO,EAAa,EAAK,CAC/B,OAAO,EAAM,KAAK,IAAI,EAAK,CAAG,EAAM,aAEpC,OAAO,EAAM,EAAa,EAAM,OAAO,EAmB3C,SAAgB,EAAc,EAAK,CACjC,IAAI,EACJ,IAAK,IAAI,EAAI,EAAG,EAAI,EAAI,OAAQ,IAC9B,EAAI,KAAK,KAAK,GAAI,EAAE,CAAG,EAAI,WAAW,EAAE,CAAG,EAG7C,OAAO,EAQT,SAAgB,EAAc,EAAK,CACjC,OAAO,KAAK,MAAM,KAAK,QAAQ,CAAG,EAAI,CAGxC,SAAgB,EAAgB,EAAU,CAKxC,OAJK,EAIE,EAAS,IAAI,GACd,OAAO,GAAY,SACd,CACL,UACA,KAAMA,EAAAA,gCACP,CAGI,EACP,CAZO,EAAE,CAeb,SAAgB,EAAyB,EAAmB,CAC1D,IAAM,EAAkB,EAAmB,EAAkB,CAM7D,MAJI,CAAC,GAAqB,CAAC,EAClB,EAAE,CAGJ,EAAkB,OAAO,GAAW,CAAC,CAAC,EAAQ,SAAW,EAAQ,OAAS,EAAgB,CAQnG,SAAgB,EAAoB,EAAmB,CAkBrD,OAjBK,EAID,EAA0B,EAAmBC,EAAAA,yBAAyB,SAAS,CAC1EA,EAAAA,yBAAyB,SAE9B,EAA0B,EAAmBA,EAAAA,yBAAyB,QAAQ,CACzEA,EAAAA,yBAAyB,QAE9B,EAA0B,EAAmBA,EAAAA,yBAAyB,SAAS,CAC1EA,EAAAA,yBAAyB,SAE9B,EAA0B,EAAmBA,EAAAA,yBAAyB,KAAK,CACtEA,EAAAA,yBAAyB,KAG3B,KAhBE,KAmBX,SAAgB,EAA2B,EAAmB,EAAa,CAKzE,MAJI,CAAC,GAAqB,CAAC,EAClB,GAGF,EAAkB,KAAK,GAAW,GAAS,OAAS,EAAY,CAGzE,SAAgB,EAAwB,EAAS,CAC/C,OAAO,GAAS,cAAc,EAAmB,CAOnD,IAAa,EAAgB,IAC3B,EAAA,EAAA,GAAS,MAAO,CAAE,UAAW,EAAM,KAAM,CAAC,CAG/B,MACJ,IAAI,QAAS,GAAY,CAC9B,EAAU,EAAQ,EAClB,CAQJ,SAAgB,EAAgB,EAAM,EAAY,EAAE,CAAE,CAIpD,OAHK,EAGE,EAAK,EAAU,CAAC,KAAM,GACvB,EAAM,OAASC,EAAAA,SAEf,MAAM,QAAQ,EAAM,SAAS,EAAI,CAAC,EAAM,SAAS,OAAe,GAGlE,EAAM,OAASC,EAAAA,MACd,OAAO,EAAM,UAAa,UAAY,EAAM,SAAS,MAAM,GAAK,GAEnE,CAZgB,GAoBpB,IAAa,EAAyB,GAC7B,GAAQ,aAAa,CACzB,MAAM,IAAI,CACV,IAAI,GAAQ,EAAK,OAAO,EAAE,CAAC,aAAa,CAAG,EAAK,MAAM,EAAE,CAAC,CACzD,KAAK,GAAG,CAQA,EAAyB,GAC7B,EACJ,QAAQ,mBAAoB,EAAG,IAAM,IAAM,EAAE,aAAa,CAAC,CAC3D,QAAQ,KAAM,GAAG,CAQT,EAAuB,GAAU,CAC5C,IAAM,EAAY,OAAO,QAAQ,EAAM,CACpC,QAAQ,CAAC,KAAS,EAAI,MAAM,UAAU,CAAC,CAC1C,OAAO,OAAO,YAAY,EAAU,EAQzB,EAAuB,GAAU,CAC5C,IAAM,EAAe,OAAO,QAAQ,EAAM,CACvC,QAAQ,CAAC,KAAS,CAAC,EAAI,MAAM,UAAU,CAAC,CAC3C,OAAO,OAAO,YAAY,EAAa,EAU5B,EAAiB,GACxB,GAAI,WAAa,KAAK,aACjB,EACG,GAAI,SAGP,EAAc,GAAI,YAAY,CAF9B,KAYX,SAAgB,EAAuB,EAAO,CAC5C,IAAM,EAAY,OAAO,QAAQ,EAAM,CACpC,QAAQ,CAAC,KAAS,CAAC,CAAC,QAAS,QAAQ,CAAC,SAAS,EAAI,CAAC,CACvD,OAAO,OAAO,YAAY,EAAU,CAStC,SAAgB,EAAU,EAAM,EAAU,IAAK,CAC7C,aAAa,EAAM,CACnB,EAAQ,WAAW,EAAM,EAAQ,CAUnC,SAAgB,EAAiB,EAAS,CACxC,IAAM,EAAW,EAAQ,uBAAuB,CAE1C,EAAQ,CACZ,IAAK,EAAS,IAAM,EACpB,KAAM,EAAS,KAAO,EACtB,OAAQ,EAAS,QAAU,OAAO,aAAe,SAAS,gBAAgB,cAC1E,MAAO,EAAS,OAAS,OAAO,YAAc,SAAS,gBAAgB,aACxE,CAGD,MAFA,GAAM,IAAM,OAAO,OAAO,EAAM,CAAC,KAAK,GAAO,EAAI,CACjD,EAAM,IAAM,OAAO,OAAO,EAAM,CAAC,MAAM,GAAO,EAAI,CAC3C,EAIT,IAAM,EAAkB,kDAGlB,EAAgB,OACpB,mRAMD,CAGK,EAAgB,OACpB,qGAED,CAGK,EAAwB,OAC5B,MACA,CACE,CACE,EAAgB,OAChB,EAAU,OACX,CAAC,KAAK,IAAI,CACX,EAAU,OACX,CAAC,KAAK,IAAI,CACX,IACD,CAGK,EAAe,0BAGf,EAA0B,qCAI1B,EAA8B,OAClC,MACA,CACE,EAAkB,OAClB,EAAa,OACb,EAAwB,OACxB,UACD,CAAC,KAAK,IAAI,CACZ,CAIK,EAAuB,4BAIvB,EAAwB,OAC5B,gFAEA,CACE,EAAkB,OAClB,EAAwB,OACzB,CAAC,KAAK,IAAI,CACX,UACD,CAQD,SAAgB,EAAqB,EAAY,EAAG,EAAY,GAAI,CAIlE,GAAI,CACF,OAAW,OACT,mDAEI,EAAU,GAAG,EAAU,mCAE5B,MACK,CAEN,QAAQ,KAAK,0DAA2D,CAG1E,OAAW,OACT,qCACM,EAAU,GAAG,EAAU,mCAE9B,CAGH,IAAM,EAAmB,GAAqB,CAGjC,EAAY,IAAI,OAC3B,CACE,EAAwB,OACxB,EAAqB,OACrB,EAAkB,OAClB,EAAiB,OAClB,CAAC,KAAK,IAAI,CACX,KACD,CAOD,SAAgB,EAAe,EAAO,CAGpC,MAFI,CAAC,GAAU,CAAC,CAAC,SAAU,SAAS,CAAC,SAAS,OAAO,EAAM,CAAU,IACrE,EAAQ,EAAM,UAAU,CACjB,EAAiB,KAAK,EAAM,GAAG,KAAO,GAQ/C,SAAgB,EAAO,EAAO,CAE5B,MADI,CAAC,GAAS,OAAO,GAAU,SAAiB,GACzC,EAAwB,KAAK,EAAM,GAAG,KAAO,GAClD,EAAqB,KAAK,EAAM,GAAG,KAAO,EAQ9C,SAAgB,EAAgB,EAAO,CAErC,MADI,CAAC,GAAS,OAAO,GAAU,SAAiB,GACzC,EAAkB,KAAK,EAAM,GAAG,KAAO,EAShD,SAAgB,EAAmB,EAAU,CAC3C,OAAO,EAAS,OAAO,GAAO,CAAC,CAAC,EAAI,CAAC,KAAK,KAAK,CASjD,SAAgB,EAAuB,EAAK,EAAS,QAAS,CAC5D,OAAO,EAAI,QAAQ,YAAa,GAAQ,EAAK,kBAAkB,EAAO,CAAC,CASzE,SAAgB,EAAiB,EAAc,EAAe,CACxD,OAAO,QAAY,KACvB,QAAA,IAAA,WAA6B,SACzB,CAAC,GAAgB,EAAE,aAAwB,cAAgB,CAAC,UAAU,MACrE,SAAS,KAAK,SAAS,EAAa,EACvC,QAAQ,KAAK,OAAO,EAAc,yEAAyE,EAS/G,SAAS,EAAoB,EAAc,SAAS,gBAAiB,CAInE,MAHA,EAAI,EAAY,aAAa,yBAAyB,CAOxD,IAAM,EAA2B,OAAO,wBAAwB,CAEhE,SAAS,EAAwB,EAAa,CAC5C,OAAO,EAAmB,EAAY,CAAG,uBAAyB,cASpE,SAAgB,EAAsB,EAAc,SAAS,gBAAiB,EAAQ,EAA0B,CAC9G,EAAc,EAAa,EAAuB,EAAY,CAAE,EAAM,CASxE,SAAgB,EAAqB,EAAc,SAAS,gBAAiB,EAAQ,EAA0B,CACzG,EAAe,EAAY,CAC7B,EAAiB,EAAa,EAAM,CAC3B,IAAU,GAEnB,EAAY,UAAU,OAAO,EAAuB,EAAY,CAAC,CAUrE,SAAgB,EAAmB,EAAM,CACvC,OAAO,EACJ,WAAW,QAAS,IAAI,CACxB,WAAW,MAAO,GAAG,CACrB,aAAa,CAGlB,IAAA,GAAe,CACb,kBACA,mBACA,eACA,iBACA,0BACA,4BACA,qBACA,eACA,gBACA,wBACA,sBACA,sBACA,wBACA,gBACA,WACA,kBACA,sBACA,YACA,iBACA,gBACA,QACA,oBACA,wBACA,uBACA,sBACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialpad/dialtone-vue",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "description": "Vue component library for Dialpad's design system Dialtone",
5
5
  "files": [
6
6
  "dist"
@@ -47,8 +47,8 @@
47
47
  "overlayscrollbars": "2.10.0",
48
48
  "regex-combined-emojis": "1.6.0",
49
49
  "tippy.js": "6.3.7",
50
- "@dialpad/dialtone-emojis": "1.3.1",
51
- "@dialpad/dialtone-icons": "5.5.1"
50
+ "@dialpad/dialtone-icons": "5.5.1",
51
+ "@dialpad/dialtone-emojis": "1.3.1"
52
52
  },
53
53
  "devDependencies": {
54
54
  "@storybook/addon-a11y": "10.3.0",
@@ -62,12 +62,12 @@
62
62
  "react": "19.2.4",
63
63
  "storybook": "10.3.0",
64
64
  "vue": "^3.3.4",
65
- "@dialpad/dialtone-css": "9.8.0",
66
- "@dialpad/generator-dialtone": "0.1.0"
65
+ "@dialpad/generator-dialtone": "0.1.0",
66
+ "@dialpad/dialtone-css": "9.9.0"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "vue": ">=3.2",
70
- "@dialpad/dialtone-css": "^9.8.0"
70
+ "@dialpad/dialtone-css": "^9.9.0"
71
71
  },
72
72
  "bugs": {
73
73
  "email": "dialtone@dialpad.com"
@@ -1,3 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/constants/sizes.cjs`),t=require(`./common/validators/index.cjs`),n=require(`./common/utils/index.cjs`),r=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),i=require(`./common/mixins/keyboard-list-navigation.cjs`),a=require(`./lib/combobox/combobox-loading-list.cjs`),o=require(`./lib/combobox/combobox-empty-list.cjs`),s=require(`./lib/combobox/combobox-constants.cjs`);let c=require(`vue`);var l={name:`DtCombobox`,components:{ComboboxLoadingList:a.default,ComboboxEmptyList:o.default},mixins:[i.default({indexKey:`highlightIndex`,idKey:`highlightId`,listElementKey:`getListElement`,afterHighlightMethod:`afterHighlight`,beginningOfListMethod:`beginningOfListMethod`,endOfListMethod:`endOfListMethod`,activeItemKey:`activeItemEl`})],props:{label:{type:String,required:!0},showLabel:{type:Boolean,default:!0},size:{type:[String,Number],default:null,validator:n=>n===null||Object.values(s.COMBOBOX_LABEL_SIZES).includes(n)||t.ordinalSizeValidator(e.COMPONENT_SIZES)(n)},description:{type:String,default:``},listId:{type:String,default(){return n.getUniqueString()}},onBeginningOfList:{type:Function,default:null},onEndOfList:{type:Function,default:null},showList:{type:Boolean,default:!1},listRenderedOutside:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},emptyList:{type:Boolean,default:!1},emptyStateMessage:{type:String,default:``},emptyStateClass:{type:[String,Object,Array],default:``},clickOnSelect:{type:Boolean,default:!1}},emits:[`select`,`escape`,`highlight`,`opened`],data(){return{outsideRenderedListRef:null,hasSlotContent:n.hasSlotContent}},computed:{inputProps(){return{label:this.label,showLabel:this.showLabel,size:this.size,description:this.description,role:`combobox`,"aria-label":this.label,"aria-expanded":this.showList.toString(),"aria-owns":this.listId,"aria-haspopup":`listbox`,"aria-activedescendant":this.activeItemId,"aria-controls":this.listId}},listProps(){return{role:`listbox`,id:this.listId,class:`d-ps-relative`,"aria-label":this.label}},beginningOfListMethod(){return this.onBeginningOfList||this.jumpToEnd},endOfListMethod(){return this.onEndOfList||this.jumpToBeginning},activeItemId(){if(!(!this.showList||this.highlightIndex<0||this.loading))return this.highlightId},activeItemEl(){return this.highlightId?this.getListElement().querySelector(`#`+this.highlightId):``}},watch:{showList(e){this.listRenderedOutside||(this.setInitialHighlightIndex(),this.$emit(`opened`,e)),!e&&this.outsideRenderedListRef&&(this.outsideRenderedListRef.removeEventListener(`mousemove`,this.onMouseHighlight),this.outsideRenderedListRef=null)},loading(){this.$nextTick(()=>{this.setInitialHighlightIndex()})},$props:{deep:!0,immediate:!0,handler(){this.validateEmptyListProps()}}},created(){this.validateEmptyListProps()},methods:{onMouseHighlight(e){if(this.loading)return;let t=e.target.closest(`li`);t&&this.highlightId!==t.id&&this.setHighlightId(t.id)},getListElement(){return this.outsideRenderedListRef??this.$refs.listWrapper?.querySelector(`#${this.listId}`)},clearHighlightIndex(){this.showList&&this.getListElement()&&this.setHighlightIndex(-1)},afterHighlight(){this.loading||this.$emit(`highlight`,this.highlightIndex)},onEnterKey(){this.loading||this.emptyList||this.highlightIndex>=0&&(this.$emit(`select`,this.highlightIndex),this.clickOnSelect&&this.activeItemEl?.click())},onEscapeKey(){this.$emit(`escape`)},onOpen(e,t){this.outsideRenderedListRef=t,this.outsideRenderedListRef?.addEventListener(`mousemove`,this.onMouseHighlight),this.$emit(`opened`,e),e&&this.setInitialHighlightIndex()},onKeyValidation(e,t){!this.showList||!this.getListElement()||this[t](e)},setInitialHighlightIndex(){this.showList&&this.$nextTick(()=>{!this.showList||!this.getListElement()||this.setHighlightIndex(this.loading?-1:0)})},validateEmptyListProps(){this.$slots.emptyListItem||this.emptyList&&!this.emptyStateMessage&&console.error(`Invalid props: you must pass both props emptyList and emptyStateMessage to show the
2
- empty message.`)}}},u={"data-qa":`dt-combobox-input-wrapper`};function d(e,t,n,r,i,a){let o=(0,c.resolveComponent)(`combobox-loading-list`),s=(0,c.resolveComponent)(`combobox-empty-list`);return(0,c.openBlock)(),(0,c.createElementBlock)(`div`,{onKeydown:[t[3]||(t[3]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onEscapeKey`),[`stop`]),[`esc`])),t[4]||(t[4]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onEnterKey`),[`exact`]),[`enter`])),t[5]||(t[5]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onUpKey`),[`stop`,`prevent`]),[`up`])),t[6]||(t[6]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onDownKey`),[`stop`,`prevent`]),[`down`])),t[7]||(t[7]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onHomeKey`),[`stop`,`prevent`]),[`home`])),t[8]||(t[8]=(0,c.withKeys)((0,c.withModifiers)(e=>a.onKeyValidation(e,`onEndKey`),[`stop`,`prevent`]),[`end`]))]},[(0,c.createElementVNode)(`div`,u,[(0,c.renderSlot)(e.$slots,`input`,{inputProps:a.inputProps})]),n.showList?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:0,ref:`listWrapper`,"data-qa":`dt-combobox-list-wrapper`,onMouseleave:t[0]||(t[0]=(...e)=>a.clearHighlightIndex&&a.clearHighlightIndex(...e)),onFocusout:t[1]||(t[1]=(...e)=>a.clearHighlightIndex&&a.clearHighlightIndex(...e)),onMousemoveCapture:t[2]||(t[2]=(...e)=>a.onMouseHighlight&&a.onMouseHighlight(...e))},[n.loading&&!n.listRenderedOutside?((0,c.openBlock)(),(0,c.createBlock)(o,(0,c.normalizeProps)((0,c.mergeProps)({key:0},a.listProps)),null,16)):n.emptyList&&(n.emptyStateMessage||i.hasSlotContent(e.$slots.emptyListItem))&&!n.listRenderedOutside?((0,c.openBlock)(),(0,c.createBlock)(s,(0,c.mergeProps)({key:1},a.listProps,{message:n.emptyStateMessage,"item-class":n.emptyStateClass}),{default:(0,c.withCtx)(()=>[(0,c.renderSlot)(e.$slots,`emptyListItem`)]),_:3},16,[`message`,`item-class`])):(0,c.renderSlot)(e.$slots,`list`,{key:2,listProps:a.listProps,opened:a.onOpen,clearHighlightIndex:a.clearHighlightIndex})],544)):(0,c.createCommentVNode)(``,!0)],32)}var f=r.t(l,[[`render`,d]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
3
- //# sourceMappingURL=Combobox-DdBIRmeH.cjs.map
@@ -1,2 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./localization/index.cjs`),n=require(`./lib/button/button.cjs`),r=require(`./lib/stack/stack.cjs`),i=require(`./lib/tooltip/tooltip.cjs`),a=require(`./lib/datepicker/datepicker-constants.cjs`),o=require(`./lib/datepicker/utils.cjs`);let s=require(`vue`),c=require(`@dialpad/dialtone-icons/vue`),l=require(`date-fns`);function u(n,r){let i=(0,s.ref)((0,l.getMonth)(n.selectedDate)),c=(0,s.ref)((0,l.getYear)(n.selectedDate)),u=(0,s.ref)(null),d=(0,s.ref)(0),f=(0,s.ref)([]),p=new t.DialtoneLocalization,m=(0,s.computed)(()=>o.getCalendarDays(i.value,c.value,u.value,n.minDate,n.maxDate,n.weekStartsOn)),h=(0,s.computed)(()=>n.minDate?(0,l.endOfMonth)((0,l.subMonths)(new Date(c.value,i.value,1),1))<(0,l.startOfDay)(n.minDate):!1),g=(0,s.computed)(()=>n.maxDate?(0,l.startOfMonth)((0,l.addMonths)(new Date(c.value,i.value,1),1))>(0,l.startOfDay)(n.maxDate):!1),_=(0,s.computed)(()=>n.minDate?(0,l.endOfMonth)(new Date(c.value-1,i.value,1))<(0,l.startOfDay)(n.minDate):!1),v=(0,s.computed)(()=>n.maxDate?(0,l.startOfMonth)(new Date(c.value+1,i.value,1))>(0,l.startOfDay)(n.maxDate):!1);(0,s.watch)(i,()=>{C(),r(`calendar-days`,m.value)},{immediate:!0}),(0,s.watch)(c,()=>{C(),r(`calendar-days`,m.value)},{immediate:!0}),(0,s.watch)(()=>n.minDate,()=>{r(`calendar-days`,m.value)}),(0,s.watch)(()=>n.maxDate,()=>{r(`calendar-days`,m.value)});function y(e){return o.formatMonth(e,a.INTL_MONTH_FORMAT,p.currentLocale)}function b(e){f.value.includes(e)||f.value.push(e)}function x(){e.returnFirstEl(f.value[0].$el).focus()}function S(t){switch(t.key){case`ArrowLeft`:t.preventDefault(),d.value===0?(d.value=3,e.returnFirstEl(f.value[d.value].$el).focus()):(d.value--,e.returnFirstEl(f.value[d.value].$el).focus());break;case`ArrowRight`:t.preventDefault(),d.value===3?(d.value=0,e.returnFirstEl(f.value[d.value].$el).focus()):(d.value++,e.returnFirstEl(f.value[d.value].$el).focus());break;case`ArrowDown`:t.preventDefault(),r(`focus-first-day`);break;case`Tab`:t.preventDefault(),r(`focus-first-day`);break;case`Escape`:r(`close-datepicker`);break}}function C(){let e=(0,l.getYear)(n.selectedDate),t=(0,l.getMonth)(n.selectedDate);e!==c.value||t!==i.value?u.value=null:u.value=(0,l.getDate)(n.selectedDate)}function w(e){if(e===-1&&h.value||e===1&&g.value)return;(i.value===0&&e===-1||i.value===11&&e===1)&&(c.value+=e);let t=(0,l.set)(n.selectedDate,{month:i.value,year:c.value});i.value=(0,l.getMonth)(e===1?(0,l.addMonths)(t,1):(0,l.subMonths)(t,1))}function T(e){e===-1&&_.value||e===1&&v.value||(c.value+=e)}function E(){w(1)}function D(){w(-1)}function O(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_PREVIOUS_YEAR`)} ${c.value-1}`}function k(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_PREVIOUS_MONTH`)} ${y(i.value-1)}`}function A(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_NEXT_YEAR`)} ${c.value+1}`}function j(){return`${p.$t(`DIALTONE_DATEPICKER_CHANGE_TO`)} ${p.$t(`DIALTONE_DATEPICKER_NEXT_MONTH`)} ${y(i.value+1)}`}return{selectMonth:i,selectYear:c,formattedMonth:y,setDayRef:b,focusMonthYearPicker:x,handleKeyDown:S,changeMonth:w,changeYear:T,goToNextMonth:E,goToPrevMonth:D,isPrevMonthDisabled:h,isNextMonthDisabled:g,isPrevYearDisabled:_,isNextYearDisabled:v,previousYearAriaLabel:O,previousMonthAriaLabel:k,nextYearAriaLabel:A,nextMonthAriaLabel:j}}var d={id:`calendar-heading`,class:`d-datepicker__month-year-title`,"data-qa":`dt-datepicker-heading`},f={__name:`MonthYearPicker`,props:{selectedDate:{type:Date,required:!0},minDate:{type:Date,default:null},maxDate:{type:Date,default:null},weekStartsOn:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=6}},emits:[`calendar-days`,`focus-first-day`,`focus-last-day`,`close-datepicker`],setup(e,{expose:a,emit:o}){let l=e,f=o,p=new t.DialtoneLocalization,{selectMonth:m,selectYear:h,formattedMonth:g,setDayRef:_,focusMonthYearPicker:v,handleKeyDown:y,changeMonth:b,changeYear:x,goToNextMonth:S,goToPrevMonth:C,isPrevMonthDisabled:w,isNextMonthDisabled:T,isPrevYearDisabled:E,isNextYearDisabled:D,previousYearAriaLabel:O,previousMonthAriaLabel:k,nextMonthAriaLabel:A,nextYearAriaLabel:j}=u(l,f);return(0,s.onMounted)(()=>{v()}),a({focusMonthYearPicker:v,goToNextMonth:S,goToPrevMonth:C}),(e,t)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(r.default),{class:`d-datepicker__month-year`,direction:`row`,gap:`50`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(r.default),{as:`nav`,class:`d-datepicker__nav`,direction:`row`,gap:`25`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-start`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_PREVIOUS_YEAR`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`prevYearButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(O)(),disabled:(0,s.unref)(E),kind:`muted`,class:`d-datepicker__nav-btn`,importance:`clear`,size:100,type:`button`,onClick:t[0]||(t[0]=e=>(0,s.unref)(x)(-1)),onKeydown:t[1]||(t[1]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronsLeft),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`]),(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-start`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_PREVIOUS_MONTH`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`prevMonthButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(k)(),disabled:(0,s.unref)(w),class:`d-datepicker__nav-btn`,importance:`clear`,kind:`muted`,size:100,type:`button`,onClick:t[2]||(t[2]=e=>(0,s.unref)(b)(-1)),onKeydown:t[3]||(t[3]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronLeft),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`])]),_:1}),(0,s.createElementVNode)(`div`,d,(0,s.toDisplayString)((0,s.unref)(g)((0,s.unref)(m)))+` `+(0,s.toDisplayString)((0,s.unref)(h)),1),(0,s.createVNode)((0,s.unref)(r.default),{as:`nav`,class:`d-datepicker__nav`,direction:`row`,gap:`25`},{default:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-end`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_NEXT_MONTH`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`nextMonthButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(A)(),disabled:(0,s.unref)(T),class:`d-datepicker__nav-btn`,importance:`clear`,kind:`muted`,size:100,type:`button`,onClick:t[4]||(t[4]=e=>(0,s.unref)(b)(1)),onKeydown:t[5]||(t[5]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronRight),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`]),(0,s.createVNode)((0,s.unref)(i.default),{"fallback-placements":[`top-end`,`auto`],message:(0,s.unref)(p).$t(`DIALTONE_DATEPICKER_NEXT_YEAR`),placement:`top`},{anchor:(0,s.withCtx)(()=>[(0,s.createVNode)((0,s.unref)(n.default),{id:`nextYearButton`,ref:e=>{e&&(0,s.unref)(_)(e)},"aria-label":(0,s.unref)(j)(),disabled:(0,s.unref)(D),class:`d-datepicker__nav-btn`,importance:`clear`,kind:`muted`,size:100,type:`button`,onClick:t[6]||(t[6]=e=>(0,s.unref)(x)(1)),onKeydown:t[7]||(t[7]=e=>(0,s.unref)(y)(e))},{icon:(0,s.withCtx)(({iconSize:e})=>[(0,s.createVNode)((0,s.unref)(c.DtIconChevronsRight),{size:e},null,8,[`size`])]),_:1},8,[`aria-label`,`disabled`])]),_:1},8,[`message`])]),_:1})]),_:1}))}};function p(n,r){let i=(0,s.ref)(null),c=(0,s.ref)(0),l=(0,s.ref)([]),u=new t.DialtoneLocalization,d=(0,s.computed)(()=>o.getWeekDayNames(u.currentLocale,n.weekStartsOn));(0,s.watch)(()=>n.calendarDays,()=>{c.value=0,l.value=[],i.value=null});function f(e){return u.$t(`DIALTONE_DATEPICKER_SELECT_DAY`)+` ${o.formatDate(e.value,a.INTL_MONTH_FORMAT,u.currentLocale)}`}function p(e,t){!l.value.some(t=>t.el===e)&&!t.disabled&&l.value.push({el:e,day:t})}function m(t){switch(t.key){case`ArrowUp`:t.preventDefault(),c.value-=7;try{e.returnFirstEl(l.value[c.value].el.$el).focus()}catch{let t=o.calculatePrevFocusDate(l.value[c.value+7].day.value);r(`go-to-prev-month`),(0,s.nextTick)(()=>{e.returnFirstEl(l.value[t-1].el.$el).focus(),c.value+=t-1})}break;case`ArrowDown`:t.preventDefault(),c.value+=7;try{e.returnFirstEl(l.value[c.value].el.$el).focus()}catch{let t=o.calculateNextFocusDate(l.value[c.value-7].day.value);r(`go-to-next-month`),(0,s.nextTick)(()=>{e.returnFirstEl(l.value[t-1].el.$el).focus(),c.value+=t-1})}break;case`ArrowLeft`:t.preventDefault(),c.value>0?(--c.value,e.returnFirstEl(l.value[c.value].el.$el).focus()):(r(`go-to-prev-month`),g());break;case`ArrowRight`:t.preventDefault(),c.value<l.value.length-1?(c.value+=1,e.returnFirstEl(l.value[c.value].el.$el).focus()):(r(`go-to-next-month`),h());break;case`Tab`:t.preventDefault(),r(`focus-month-year-picker`);break;case`Escape`:r(`close-datepicker`);break}}function h(){c.value=0,(0,s.nextTick)(()=>{e.returnFirstEl(l.value[c.value].el.$el).focus()})}function g(){(0,s.nextTick)(()=>{c.value=l.value.length-1,e.returnFirstEl(l.value[c.value].el.$el).focus()})}function _(e){e.disabled||(i.value=e.text,r(`select-date`,e.value))}return{selectedDay:i,weekDays:d,dayAriaLabel:f,setDayRef:p,handleKeyDown:m,focusFirstDay:h,selectDay:_}}var m={class:`d-datepicker__calendar`,"aria-labelledby":`calendar-heading`,"data-qa":`dt-datepicker-calendar`},h=[`title`,`aria-label`],g={__name:`Calendar`,props:{calendarDays:{type:Array,required:!0},weekStartsOn:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=6}},emits:[`select-date`,`focus-month-year-picker`,`close-datepicker`,`go-to-next-month`,`go-to-prev-month`],setup(e,{expose:t,emit:r}){let{selectedDay:i,weekDays:a,dayAriaLabel:o,setDayRef:c,handleKeyDown:l,focusFirstDay:u,selectDay:d}=p(e,r);return t({focusFirstDay:u}),(t,r)=>((0,s.openBlock)(),(0,s.createElementBlock)(`table`,m,[(0,s.createElementVNode)(`thead`,null,[(0,s.createElementVNode)(`tr`,null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)((0,s.unref)(a),e=>((0,s.openBlock)(),(0,s.createElementBlock)(`th`,{key:e,scope:`col`,class:`d-datepicker__cell d-datepicker__cell--header`},[(0,s.createElementVNode)(`span`,{class:`d-datepicker__weekday`,"data-qa":`dt-datepicker-weekday`,title:e,"aria-label":e},(0,s.toDisplayString)(e),9,h)]))),128))])]),(0,s.createElementVNode)(`tbody`,null,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.calendarDays,(e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)(`tr`,{key:t,"data-qa":`dt-datepicker-week`},[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(e.days,(e,a)=>((0,s.openBlock)(),(0,s.createElementBlock)(`td`,{key:t+a,class:`d-datepicker__cell`,role:`listbox`},[(0,s.createVNode)((0,s.unref)(n.default),{ref_for:!0,ref:t=>{t&&(0,s.unref)(c)(t,e)},class:(0,s.normalizeClass)([`d-datepicker__day`,{"d-datepicker__day--disabled":e.disabled,"d-datepicker__day--selected":(0,s.unref)(i)?e.text===(0,s.unref)(i)&&!e.disabled:e.selected}]),size:200,kind:`muted`,importance:`clear`,disabled:e.disabled,type:`button`,"aria-selected":(0,s.unref)(i)?e.text===(0,s.unref)(i)&&!e.disabled:e.selected,"aria-label":(0,s.unref)(o)(e),role:`option`,onClick:t=>(0,s.unref)(d)(e),onKeydown:r[0]||(r[0]=e=>(0,s.unref)(l)(e))},{default:(0,s.withCtx)(()=>[(0,s.createTextVNode)((0,s.toDisplayString)(e.text),1)]),_:2},1032,[`disabled`,`class`,`aria-selected`,`aria-label`,`onClick`])]))),128))]))),128))])]))}},_={class:`d-datepicker__hd`,"data-qa":`dt-datepicker-header`},v={class:`d-datepicker__bd`,"data-qa":`dt-datepicker-body`},y=Object.assign({name:`DtDatepicker`},{__name:`Datepicker`,props:{selectedDate:{type:Date,default:()=>new Date},minDate:{type:Date,default:null},maxDate:{type:Date,default:null,validator:(e,t)=>e&&t.minDate&&e<t.minDate?(console.warn(`[DtDatepicker]: maxDate must be after or equal to minDate.`),!1):!0},weekStartsOn:{type:Number,default:0,validator:e=>Number.isInteger(e)&&e>=0&&e<=6}},emits:[`selected-date`,`close-datepicker`],setup(t){let n=(0,s.ref)([]);function i(e){n.value=e}return(0,s.onMounted)(()=>{e.warnIfUnmounted(e.returnFirstEl((0,s.getCurrentInstance)().proxy.$el),`datepicker`)}),(e,a)=>((0,s.openBlock)(),(0,s.createBlock)((0,s.unref)(r.default),{class:`d-datepicker`,gap:`100`},{default:(0,s.withCtx)(()=>[(0,s.createElementVNode)(`div`,_,[(0,s.createVNode)(f,{ref:`monthYearPicker`,"selected-date":t.selectedDate,"min-date":t.minDate,"max-date":t.maxDate,"week-starts-on":t.weekStartsOn,onCalendarDays:i,onFocusFirstDay:a[0]||(a[0]=t=>e.$refs.calendar.focusFirstDay()),onFocusLastDay:a[1]||(a[1]=t=>e.$refs.calendar.focusLastDay()),onCloseDatepicker:a[2]||(a[2]=t=>e.$emit(`close-datepicker`))},null,8,[`selected-date`,`min-date`,`max-date`,`week-starts-on`])]),(0,s.createElementVNode)(`div`,v,[(0,s.createVNode)(g,{ref:`calendar`,"calendar-days":n.value,"week-starts-on":t.weekStartsOn,onSelectDate:a[3]||(a[3]=t=>e.$emit(`selected-date`,t)),onFocusMonthYearPicker:a[4]||(a[4]=t=>e.$refs.monthYearPicker.focusMonthYearPicker()),onCloseDatepicker:a[5]||(a[5]=t=>e.$emit(`close-datepicker`)),onGoToNextMonth:a[6]||(a[6]=t=>e.$refs.monthYearPicker.goToNextMonth()),onGoToPrevMonth:a[7]||(a[7]=t=>e.$refs.monthYearPicker.goToPrevMonth())},null,8,[`calendar-days`,`week-starts-on`])])]),_:1}))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return y}});
2
- //# sourceMappingURL=Datepicker-Df6uR0r_.cjs.map
@@ -1,2 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./localization/index.cjs`),n=require(`./lib/button/button.cjs`),r=require(`./lib/tooltip/tooltip.cjs`),i=require(`./lib/input/input.cjs`),a=require(`./lib/tab/tab-group.cjs`),o=require(`./lib/tab/tab.cjs`),s=require(`./lib/emoji-picker/emoji-picker-constants.cjs`);let c=require(`vue`),l=require(`@dialpad/dialtone-icons/vue`),u=require(`@dialpad/dialtone-emojis`);var d={class:`d-emoji-picker__search d-emoji-picker__alignment`,"data-qa":`dt-emoji-picker-search`},f={__name:`EmojiSearch`,props:{searchPlaceholderLabel:{type:String,required:!0},modelValue:{type:String,default:``}},emits:[`update:modelValue`,`focus-emoji-selector`,`focus-tabset`,`select-first-emoji`],setup(e,{expose:t,emit:r}){let a=r,o=(0,c.ref)(null);function s(){a(`update:modelValue`,``),u()}function u(){o.value.focus()}return(0,c.onMounted)(()=>{u()}),t({focusSearchInput:u}),(t,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,d,[(0,c.createVNode)((0,c.unref)(i.default),{id:`searchInput`,ref_key:`searchInput`,ref:o,placeholder:e.searchPlaceholderLabel,"model-value":e.modelValue,"onUpdate:modelValue":r[0]||(r[0]=e=>t.$emit(`update:modelValue`,e)),onKeydown:[r[1]||(r[1]=(0,c.withKeys)(e=>t.$emit(`focus-tabset`),[`up`])),r[2]||(r[2]=(0,c.withKeys)((0,c.withModifiers)(e=>t.$emit(`focus-emoji-selector`),[`prevent`]),[`down`])),r[3]||(r[3]=(0,c.withKeys)(e=>t.$emit(`select-first-emoji`),[`enter`]))]},(0,c.createSlots)({startIcon:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(l.DtIconSearch),{size:`200`})]),_:2},[e.modelValue.length>0?{name:`endIcon`,fn:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(n.default),{importance:`clear`,size:100,class:`d-emoji-picker__search-x-button`,circle:``,kind:`muted`,onClick:s},{icon:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(l.DtIconClose),{size:`200`})]),_:1})]),key:`0`}:void 0]),1032,[`placeholder`,`model-value`])]))}},p={class:`d-emoji-picker__tabset`,"data-qa":`dt-emoji-picker-tabset`},m={__name:`EmojiTabset`,props:{showRecentlyUsedTab:{type:Boolean,default:!1},showCustomEmojisTab:{type:Boolean,default:!1},scrollIntoTab:{type:Number,required:!0},emojiFilter:{type:String,default:``},tabSetLabels:{type:Array,required:!0}},emits:[`selected-tabset`,`focus-search-input`,`focus-skin-selector`],setup(t,{expose:n,emit:r}){let i=t,s=r,u=[{label:i.tabSetLabels[0],icon:l.DtIconClock},{label:i.tabSetLabels[1],icon:l.DtIconSatisfied},{label:i.tabSetLabels[2],icon:l.DtIconLivingThing},{label:i.tabSetLabels[3],icon:l.DtIconFood},{label:i.tabSetLabels[4],icon:l.DtIconObject},{label:i.tabSetLabels[5],icon:l.DtIconTransportation},{label:i.tabSetLabels[6],icon:l.DtIconLightbulb},{label:i.tabSetLabels[7],icon:l.DtIconHeart},{label:i.tabSetLabels[8],icon:l.DtIconFlag},{label:i.tabSetLabels[9],icon:l.DtIconDialpadStar}],d=(0,c.computed)(()=>{let e=i.showRecentlyUsedTab?u:u.slice(1);return i.showCustomEmojisTab||e.pop(),e.map((e,t)=>({...e,id:(t+1).toString(),panelId:(t+1).toString()}))}),f=(0,c.computed)(()=>i.emojiFilter.length>0),m=(0,c.ref)(`1`),h=(0,c.ref)([]);(0,c.watch)(()=>i.scrollIntoTab,()=>{f.value||(m.value=(i.scrollIntoTab+1).toString())}),(0,c.watch)(f,()=>{f.value&&(m.value=null)});function g(e){let t=parseInt(e);m.value=e,s(`selected-tabset`,t)}function _(t){h.value.push(e.returnFirstEl(t.$el))}function v(){h.value[0].focus()}function y(e,t){e.key===`Enter`&&(g(t),h.value[t-1].blur()),e.key===`Tab`&&(e.preventDefault(),e.shiftKey?s(`focus-skin-selector`):s(`focus-search-input`)),e.key===`ArrowDown`&&s(`focus-search-input`)}return n({focusTabset:v}),(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,p,[(0,c.createVNode)((0,c.unref)(a.default),{selected:m.value,size:200,spread:`equal`,"tab-list-class":`d-emoji-picker__tabset-list`},{tabs:(0,c.withCtx)(()=>[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(d.value,(e,t)=>((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(o.default),{id:e.id,key:e.id,ref_for:!0,ref:e=>{e&&_(e)},label:e.label,"panel-id":e.panelId,tabindex:t+1,"aria-controls":`d-emoji-picker-list`,onKeydown:t=>y(t,e.id),onClickCapture:(0,c.withModifiers)(t=>g(e.id),[`stop`])},{default:(0,c.withCtx)(()=>[((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(e.icon),{size:`400`}))]),_:2},1032,[`id`,`label`,`panel-id`,`tabindex`,`onKeydown`,`onClickCapture`]))),128))]),_:1},8,[`selected`])]))}};function h(){let e=(0,c.ref)([]),t=(0,c.ref)([]),n=(0,c.ref)(!1),r=(0,c.ref)(!0);function i(t,n){d(t,n-1)||(e.value[t-1]?d(t-1,e.value[t-1].length-1):d(e.value.length-1,e.value[e.value.length-1].length-1))}function a(e,t){d(e,t+1)||d(e+1,0)||d(0,0)}function o(e,n){d(0,n-1)||d(0,t.value.length-1)}function l(e,t){d(0,t+1)||d(0,0)}function u(e,t,r){n.value?e===`left`?o(t,r):e===`right`&&l(t,r):e===`left`?i(t,r):e===`right`&&a(t,r)}function d(r,i){let a=n.value?t.value?.[i]:e.value?.[r]?.[i];return a?(a.focus(),!0):!1}function f(t,n,r){e.value[n]||(e.value[n]=[]),e.value[n][r]=t}function p(e,n){t.value[n]=e}function m(e,n){if(r.value=!1,e===s.ARROW_KEYS.ARROW_UP){let e=n%9;if(!d(0,n-9)){let n=t.value.length-t.value.length%9+e;d(0,n),d(0,n)||d(0,t.value.length-1)}}if(e===s.ARROW_KEYS.ARROW_DOWN&&!d(0,n+9)){let e=n%9;t.value?.[n+(9-e)]?d(0,t.value.length-1):d(0,e)}e===s.ARROW_KEYS.ARROW_LEFT&&u(`left`,0,n),e===s.ARROW_KEYS.ARROW_RIGHT&&u(`right`,0,n)}function h(t,n,r){if(t===`ArrowUp`){let t=r%9;if(n===0){let n=9-e.value[e.value.length-1].length%9,r=e.value[e.value.length-1].length+n-(9-t);d(e.value.length-1,r)||d(e.value.length-1,e.value[e.value.length-1].length-1);return}if(!d(n,r-9)){let r=n-1<0?0:n-1,i=e.value[r].length;d(r,i-i%9+t)||d(n-1,e.value[n-1].length-1)}}if(t===`ArrowDown`&&!d(n,r+9)){let t=r%9;e.value?.[n]?.[r+(9-t)]?d(n,e.value[n].length-1):d(n+1,t)||d(0,t)||d(0,e.value[0].length-1)}t===`ArrowLeft`&&u(`left`,n,r),t===`ArrowRight`&&u(`right`,n,r)}return{emojiFilteredRefs:t,isFiltering:n,hoverFirstEmoji:r,setEmojiRef:f,setFilteredRef:p,focusEmoji:d,handleArrowNavigationFiltered:m,handleArrowNavigation:h}}var g={class:`d-emoji-picker__selector`,"data-qa":`dt-emoji-picker-selector`},_={key:0,class:`d-emoji-picker__search-label d-emoji-picker__alignment`,"data-qa":`dt-emoji-picker-search-results-label`},v={"data-qa":`dt-emoji-picker-sticky-label`},y={key:0},b={class:`d-emoji-picker__tab`},x=[`aria-label`,`onClick`,`onFocusin`,`onMouseover`,`onKeydown`],S=[`alt`,`aria-label`,`title`,`src`],C={key:2,class:`d-emoji-picker__alignment`},w={class:`d-emoji-picker__tab`,"data-qa":`filtered-emojis`},T=[`aria-label`,`onClick`,`onFocusin`,`onMouseover`,`onKeydown`],E=[`alt`,`aria-label`,`title`,`src`],D={__name:`EmojiSelector`,props:{emojiFilter:{type:String,default:``},skinTone:{type:String,required:!0},tabsetLabels:{type:Array,required:!0},selectedTabset:{type:Object,required:!0},searchResultsLabel:{type:String,required:!0},searchNoResultsLabel:{type:String,required:!0},recentlyUsedEmojis:{type:Array,default:()=>[]},customEmojis:{type:Array,default:()=>[]}},emits:[`highlighted-emoji`,`selected-emoji`,`scroll-into-tab`,`scroll-bottom-reached`,`focus-skin-selector`,`focus-search-input`],setup(e,{expose:t,emit:n}){let r=e,i=n,{emojiFilteredRefs:a,isFiltering:o,hoverFirstEmoji:l,setEmojiRef:d,setFilteredRef:f,focusEmoji:p,handleArrowNavigationFiltered:m,handleArrowNavigation:D}=h(),O=(0,c.ref)(null),k=(0,c.ref)(null),A=(0,c.ref)(null),j=[`Recently used`,`People`,`Nature`,`Food`,`Activity`,`Travel`,`Objects`,`Symbols`,`Flags`,`Custom`],M=(0,c.computed)(()=>{let e=r.tabsetLabels.map(e=>({label:e,ref:(0,c.ref)(null)}));return r.recentlyUsedEmojis&&!r.recentlyUsedEmojis.length&&(e=r.tabsetLabels.slice(1).map(e=>({label:e,ref:(0,c.ref)(null)}))),r.customEmojis&&!r.customEmojis.length&&e.pop(),e}),N=(0,c.ref)(M.value[0].label),P=(0,c.computed)(()=>{let e=r.recentlyUsedEmojis.length?j.slice():j.slice(1);return r.customEmojis&&!r.customEmojis.length&&e.pop(),e}),F=(0,c.ref)([]),I=(0,c.computed)(()=>[...u.emojisGrouped[`People${r.skinTone}`],...u.emojisGrouped.Nature,...u.emojisGrouped.Food,...u.emojisGrouped[`Activity${r.skinTone}`],...u.emojisGrouped.Travel,...u.emojisGrouped[`Objects${r.skinTone}`],...u.emojisGrouped.Symbols,...u.emojisGrouped.Flags]),L=V(()=>{a.value=[],B()}),R=()=>{let e=k.value;e.scrollTop+e.clientHeight>=e.scrollHeight&&i(`scroll-bottom-reached`)};(0,c.watch)(I,()=>{B()},{immediate:!0}),(0,c.watch)(()=>r.recentlyUsedEmojis,()=>{u.emojisGrouped[`Recently used`]=r.recentlyUsedEmojis},{immediate:!0}),(0,c.watch)(()=>r.customEmojis,()=>{u.emojisGrouped.Custom=r.customEmojis},{immediate:!0}),(0,c.watch)(()=>r.emojiFilter,()=>{G(),r.emojiFilter?o.value=!0:(o.value=!1,Z(null)),L()}),(0,c.watch)(()=>r.selectedTabset,e=>{W(e.tabId)},{deep:!0});function z(e,t=!1){l.value=t,i(`highlighted-emoji`,e)}function B(){let e=r.emojiFilter.toLowerCase();F.value=I.value.filter(t=>{let n=t.name.toLowerCase().includes(e),r=t.keywords.some(t=>t.toLowerCase().includes(e));return n||r}),(0,c.nextTick)(()=>{e&&z(F.value[0],!0)})}function V(e,t=300){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>e(...r),t)}}function H(e){return e.date_added?e.image:s.CDN_URL+e.unicode_character+`.png`}function U(e){e.target.parentNode.style.display=`none`}function W(e,t=!0){let n=M.value[e-1].ref.value[0];(0,c.nextTick)(()=>{let r=k.value;r.scrollTop=e===1?0:n.offsetTop-15,t&&p(e-1,0)})}function G(){let e=k.value;e.scrollTop=0}function K(){k.value.addEventListener(`scroll`,R)}function q(){A.value=new IntersectionObserver(async e=>{e.forEach(e=>{let{target:t}=e,n=parseInt(t.dataset.index);e.isIntersecting&&t.offsetTop<=O.value.offsetTop+50?(N.value=M.value[n-1]?.label??M.value[0]?.label,i(`scroll-into-tab`,n-1)):e.boundingClientRect.bottom<=O.value?.getBoundingClientRect().bottom?(i(`scroll-into-tab`,n),N.value=M.value[n]?.label):n===1&&(i(`scroll-into-tab`,n),N.value=M.value[0]?.label)})}),A.value.observe(O.value),Array.from(k.value.children).forEach((e,t)=>{A.value.observe(e),e.dataset.index=t})}let J=(e,t,n)=>{if(e.preventDefault(),Object.values(s.ARROW_KEYS).includes(e.key)){m(e.key,t);return}switch(e.key){case`Tab`:i(`focus-skin-selector`);break;case`Enter`:X(n,e);break;default:break}},Y=(e,t,n,r)=>{if(e.preventDefault(),Object.values(s.ARROW_KEYS).includes(e.key)){D(e.key,t,n);return}switch(e.key){case`Tab`:e.shiftKey?p(t,0)&&t>0?W(t,!0):(W(1,!1),i(`focus-search-input`)):p(t+1,0)?W(t+1+1,!1):i(`focus-skin-selector`);break;case`Enter`:X(r,e);break;default:break}};function X(e,t){i(`selected-emoji`,{...e,shift_key:t.shiftKey})}function Z(e){i(`highlighted-emoji`,e)}function Q(){p(0,0)}function $(){W(P.value.length,!0)}return(0,c.onMounted)(()=>{q(),K()}),(0,c.onBeforeUnmount)(()=>{A.value.disconnect(),k.value.removeEventListener(`scroll`,R)}),t({focusEmojiSelector:Q,focusLastEmoji:$}),(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,g,[(0,c.createElementVNode)(`div`,{id:`d-emoji-picker-list`,ref_key:`listRef`,ref:k,class:`d-emoji-picker__list`},[e.emojiFilter?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,_,(0,c.toDisplayString)(F.value.length>0?e.searchResultsLabel:e.searchNoResultsLabel),1)):((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:1,ref_key:`tabCategoryRef`,ref:O,class:`d-emoji-picker__category d-emoji-picker__alignment`},[(0,c.createElementVNode)(`p`,v,(0,c.toDisplayString)(N.value),1)],512)),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(M.value,(t,r)=>(0,c.withDirectives)(((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{key:r,ref_for:!0,ref:t.ref,"data-qa":`dt-emoji-picker-group`,class:`d-emoji-picker__alignment`},[r?((0,c.openBlock)(),(0,c.createElementBlock)(`p`,y,(0,c.toDisplayString)(t.label),1)):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,b,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)((0,c.unref)(u.emojisGrouped)[P.value[r]+e.skinTone]?(0,c.unref)(u.emojisGrouped)[P.value[r]+e.skinTone]:(0,c.unref)(u.emojisGrouped)[P.value[r]],(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:e.shortname,ref_for:!0,ref:e=>{e&&(0,c.unref)(d)(e,r,t)},"data-qa":`dt-emoji-picker-emoji`,type:`button`,"aria-label":e.name,onClick:t=>X(e,t),onFocusin:t=>Z(e),onFocusout:n[0]||(n[0]=e=>Z(null)),onMouseover:t=>Z(e),onMouseleave:n[1]||(n[1]=e=>Z(null)),onKeydown:n=>Y(n,r,t,e)},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:e.name,"aria-label":e.name,title:e.name,src:H(e),onError:U},null,40,S)],40,x))),128))])])),[[c.vShow,!e.emojiFilter]])),128)),e.emojiFilter?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,C,[(0,c.createElementVNode)(`div`,w,[((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(F.value,(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`button`,{key:e.shortname,ref_for:!0,ref:e=>{e&&(0,c.unref)(f)(e,t)},"data-qa":`dt-emoji-picker-emoji`,type:`button`,"aria-label":e.name,class:(0,c.normalizeClass)({"hover-emoji":t===0&&(0,c.unref)(l)}),onClick:t=>X(e,t),onFocusin:t=>Z(e),onFocusout:n[2]||(n[2]=e=>Z(null)),onMouseover:t=>z(e),onMouseleave:n[3]||(n[3]=e=>z(null)),onKeydown:n=>J(n,t,e)},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:e.name,"aria-label":e.name,title:e.name,src:`${(0,c.unref)(s.CDN_URL)+e.unicode_character}.png`},null,8,E)],42,T))),128))])])):(0,c.createCommentVNode)(``,!0)],512)]))}},O={"data-qa":`skin-selector`},k={class:`d-emoji-picker__skin-list`,"data-qa":`dt-emoji-picker-skin-list`},A=[`onKeydown`,`onClick`],j=[`alt`,`aria-label`,`title`,`src`],M={class:`d-emoji-picker__skin-selected`},N=[`aria-label`],P=[`alt`,`aria-label`,`title`,`src`],F={__name:`EmojiSkinSelector`,props:{skinTone:{type:String,required:!0},isHovering:{type:Boolean,default:!1},skinSelectorButtonTooltipLabel:{type:String,required:!0}},emits:[`skin-tone`,`focus-tabset`,`focus-last-emoji`],setup(e,{expose:t,emit:n}){let i=e,a=n,o=[{name:`:wave_tone1:`,unicode_output:`1f44b-1f3fb`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.LIGHT,skinCode:`_tone1`},{name:`:wave_tone2:`,unicode_output:`1f44b-1f3fc`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.MEDIUM_LIGHT,skinCode:`_tone2`},{name:`:wave_tone3:`,unicode_output:`1f44b-1f3fd`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.MEDIUM,skinCode:`_tone3`},{name:`:wave_tone4:`,unicode_output:`1f44b-1f3fe`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.MEDIUM_DARK,skinCode:`_tone4`},{name:`:wave_tone5:`,unicode_output:`1f44b-1f3ff`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.DARK,skinCode:`_tone5`},{name:`:wave:`,unicode_output:`1f44b`,skinTone:s.EMOJI_PICKER_SKIN_TONE_MODIFIERS.DEFAULT,skinCode:``}],l=(0,c.ref)(!1),u=(0,c.ref)(null),d=(0,c.ref)([]);(0,c.watchEffect)(()=>i.isHovering&&(l.value=!1));let f=(0,c.computed)(()=>o.find(e=>e.skinTone===i.skinTone)),p=(0,c.ref)(f.value);(0,c.watchEffect)(()=>f.value&&(p.value=f.value));function m(e){d.value.push(e)}function h(){u.value.focus()}function g(e){p.value=e,l.value=!1,a(`skin-tone`,e.skinTone),(0,c.nextTick)(()=>h())}let _=(e,t,n)=>{e.preventDefault(),e.key===`ArrowLeft`&&(n===0&&d.value[d.value.length-1]?.focus(),d.value[n-1]?.focus()),e.key===`ArrowRight`&&d.value[n+1]?.focus(),e.key===`Enter`&&(t?g(t):v()),e.key===`Tab`&&(e.shiftKey?a(`focus-last-emoji`):a(`focus-tabset`))};function v(){l.value=!l.value,(0,c.nextTick)(()=>d.value[0].focus())}return t({focusSkinSelector:h}),(t,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,O,[(0,c.withDirectives)((0,c.createElementVNode)(`div`,k,[((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(o,(e,t)=>(0,c.createElementVNode)(`button`,{ref_for:!0,ref:e=>{e&&m(e)},key:e.name,"data-qa":`dt-emoji-picker-skin-option`,class:(0,c.normalizeClass)({selected:p.value.skinCode===e.skinCode}),onKeydown:n=>_(n,e,t),onClick:t=>g(e)},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:e.name,"aria-label":e.name,title:e.name,src:`${(0,c.unref)(s.CDN_URL)+e.unicode_output}.png`},null,8,j)],42,A)),64))],512),[[c.vShow,l.value]]),(0,c.withDirectives)((0,c.createElementVNode)(`div`,M,[(0,c.createVNode)((0,c.unref)(r.default),{placement:`top-end`},{anchor:(0,c.withCtx)(()=>[(0,c.createElementVNode)(`button`,{ref_key:`skinSelectorRef`,ref:u,"data-qa":`dt-emoji-picker-skin-toggle`,"aria-label":e.skinSelectorButtonTooltipLabel,tabindex:`-1`,onClick:v,onKeydown:n[0]||(n[0]=e=>_(e))},[(0,c.createElementVNode)(`img`,{class:`d-icon d-icon--size-500`,alt:p.value.name,"aria-label":p.value.name,title:p.value.name,src:`${(0,c.unref)(s.CDN_URL)+p.value.unicode_output}.png`,"data-qa":`dt-emoji-picker-skin-image`},null,8,P)],40,N)]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.skinSelectorButtonTooltipLabel)+` `,1)]),_:1})],512),[[c.vShow,!l.value]])]))}},I={class:`d-emoji-picker__data`,"data-qa":`dt-emoji-picker-description`},L=[`alt`,`aria-label`,`title`,`src`],R={__name:`EmojiDescription`,props:{emoji:{type:Object,default:null}},setup(e){function t(e){return e.date_added?e.image:`${s.CDN_URL+e.unicode_character}.png`}return(n,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,I,[e.emoji?((0,c.openBlock)(),(0,c.createElementBlock)(`img`,{key:0,class:`d-icon d-icon--size-500`,alt:e.emoji.name,"aria-label":e.emoji.name,title:e.emoji.name,src:t(e.emoji)},null,8,L)):(0,c.createCommentVNode)(``,!0),(0,c.createElementVNode)(`div`,null,(0,c.toDisplayString)(e.emoji?.name),1)]))}},z={class:`d-emoji-picker`,"data-qa":`dt-emoji-picker`},B={class:`d-emoji-picker--header`,"data-qa":`dt-emoji-picker-header`},V={class:`d-emoji-picker--body`,"data-qa":`dt-emoji-picker-body`},H={class:`d-emoji-picker--footer`,"data-qa":`dt-emoji-picker-footer`},U=Object.assign({name:`DtEmojiPicker`},{__name:`EmojiPicker`,props:{recentlyUsedEmojis:{type:Array,default:()=>[]},customEmojis:{type:Array},skinTone:{type:String,default:`Default`},searchQuery:{type:String,default:``},showSearch:{type:Boolean,default:!0},showAddEmojiButton:{type:Boolean,default:!1}},emits:[`selected-emoji`,`scroll-bottom-reached`,`skin-tone`,`close`,`add-emoji`],setup(e,{emit:r}){let i=e,a=r,o=(0,c.ref)(i.searchQuery.value),s=(0,c.ref)(null),l=(0,c.ref)({}),u=(0,c.ref)(0),d=(0,c.computed)(()=>i.recentlyUsedEmojis?.length>0),p=(0,c.computed)(()=>i.customEmojis?.length>0),h=new t.DialtoneLocalization,g=[h.$t(`DIALTONE_EMOJI_PICKER_TABSET_RECENTLY_USED_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_SMILEYS_AND_PEOPLE_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_NATURE_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_FOOD_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_ACTIVITY_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_TRAVEL_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_OBJECTS_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_SYMBOLS_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_FLAGS_LABEL`),h.$t(`DIALTONE_EMOJI_PICKER_TABSET_CUSTOM_LABEL`)],_=h.$t(`DIALTONE_EMOJI_PICKER_SEARCH_PLACEHOLDER_LABEL`),v=h.$t(`DIALTONE_EMOJI_PICKER_SEARCH_RESULTS_LABEL`),y=h.$t(`DIALTONE_EMOJI_PICKER_SEARCH_NO_RESULTS_LABEL`),b=h.$t(`DIALTONE_EMOJI_PICKER_SKIN_SELECTOR_BUTTON_TOOLTIP_LABEL`),x=h.$t(`DIALTONE_EMOJI_PICKER_ADD_EMOJI_LABEL`);(0,c.watch)(()=>i.searchQuery,e=>{o.value=e});function S(e){o.value=``,l.value={...l.value,tabId:e}}function C(e){u.value=e}function w(e){s.value=e}return(t,r)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,z,[(0,c.createElementVNode)(`div`,B,[(0,c.createVNode)(m,{ref:`tabsetRef`,"emoji-filter":o.value,"show-custom-emojis-tab":p.value,"show-recently-used-tab":d.value,"scroll-into-tab":u.value,"tab-set-labels":g,onFocusSkinSelector:r[0]||(r[0]=e=>t.$refs.skinSelectorRef.focusSkinSelector()),onFocusSearchInput:r[1]||(r[1]=n=>e.showSearch?t.$refs.searchInputRef.focusSearchInput():t.$refs.emojiSelectorRef.focusEmojiSelector()),onSelectedTabset:S,onKeydown:r[2]||(r[2]=(0,c.withKeys)(e=>a(`close`),[`esc`]))},null,8,[`emoji-filter`,`show-custom-emojis-tab`,`show-recently-used-tab`,`scroll-into-tab`])]),(0,c.createElementVNode)(`div`,V,[e.showSearch?((0,c.openBlock)(),(0,c.createBlock)(f,{key:0,ref:`searchInputRef`,modelValue:o.value,"onUpdate:modelValue":r[3]||(r[3]=e=>o.value=e),"search-placeholder-label":(0,c.unref)(_),onSelectFirstEmoji:r[4]||(r[4]=e=>a(`selected-emoji`,s.value)),onFocusTabset:r[5]||(r[5]=e=>t.$refs.tabsetRef.focusTabset()),onFocusEmojiSelector:r[6]||(r[6]=e=>t.$refs.emojiSelectorRef.focusEmojiSelector()),onKeydown:r[7]||(r[7]=(0,c.withKeys)(e=>a(`close`),[`esc`]))},null,8,[`modelValue`,`search-placeholder-label`])):(0,c.createCommentVNode)(``,!0),(0,c.createVNode)(D,{ref:`emojiSelectorRef`,"emoji-filter":o.value,"skin-tone":e.skinTone,"tabset-labels":g,"search-results-label":(0,c.unref)(v),"search-no-results-label":(0,c.unref)(y),"recently-used-emojis":e.recentlyUsedEmojis,"custom-emojis":e.customEmojis,"selected-tabset":l.value,onScrollIntoTab:C,onHighlightedEmoji:w,onSelectedEmoji:r[8]||(r[8]=e=>a(`selected-emoji`,e)),onFocusSkinSelector:r[9]||(r[9]=e=>t.$refs.skinSelectorRef.focusSkinSelector()),onFocusSearchInput:r[10]||(r[10]=n=>e.showSearch?t.$refs.searchInputRef.focusSearchInput():t.$refs.tabsetRef.focusTabset()),onKeydown:r[11]||(r[11]=(0,c.withKeys)(e=>a(`close`),[`esc`])),onScrollBottomReached:r[12]||(r[12]=e=>a(`scroll-bottom-reached`))},null,8,[`emoji-filter`,`skin-tone`,`search-results-label`,`search-no-results-label`,`recently-used-emojis`,`custom-emojis`,`selected-tabset`])]),(0,c.createElementVNode)(`div`,H,[e.showAddEmojiButton&&!s.value?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(n.default),{key:0,importance:`outlined`,"aria-label":(0,c.unref)(x),class:`d-emoji-picker__add-emoji`,onClick:r[13]||(r[13]=e=>a(`add-emoji`))},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(x)),1)]),_:1},8,[`aria-label`])):(0,c.createCommentVNode)(``,!0),(0,c.createVNode)(R,{emoji:s.value},null,8,[`emoji`]),(0,c.createVNode)(F,{ref:`skinSelectorRef`,"is-hovering":!!s.value,"skin-selector-button-tooltip-label":(0,c.unref)(b),"skin-tone":e.skinTone,onSkinTone:r[14]||(r[14]=e=>a(`skin-tone`,e)),onFocusTabset:r[15]||(r[15]=e=>t.$refs.tabsetRef.focusTabset()),onFocusLastEmoji:r[16]||(r[16]=e=>t.$refs.emojiSelectorRef.focusLastEmoji()),onKeydown:r[17]||(r[17]=(0,c.withKeys)(e=>a(`close`),[`esc`]))},null,8,[`is-hovering`,`skin-selector-button-tooltip-label`,`skin-tone`])])]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}});
2
- //# sourceMappingURL=EmojiPicker-KbIfc-GH.cjs.map
@@ -1,2 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/constants/index.cjs`),t=require(`./common/validators/index.cjs`),n=require(`./common/utils/index.cjs`),r=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),i=require(`./mode_constants-CzYJW9ua.cjs`),a=require(`./Text-DNVNZree.cjs`),o=require(`./localization/index.cjs`),s=require(`./lib/button/button-constants.cjs`),c=require(`./lib/button/button.cjs`),l=require(`./lib/checkbox/checkbox.cjs`),u=require(`./lib/checkbox-group/checkbox-group.cjs`),d=require(`./lib/list-item/list-item.cjs`),f=require(`./lib/stack/stack.cjs`),p=require(`./lib/popover/popover-constants.cjs`),m=require(`./lib/popover/popover.cjs`),h=require(`./lib/dropdown/dropdown.cjs`),g=require(`./lib/filter-pill/filter-pill-constants.cjs`),_=require(`./lib/filter-pill/filter-pill-controlled.cjs`),v=require(`./lib/list-item-group/list-item-group.cjs`);let y=require(`vue`),b=require(`@dialpad/dialtone-icons/vue`);var x={key:0,role:`none`,class:`d-filter-pill__menu-group`},S=(0,y.defineComponent)({name:`DtFilterPillOptionGroup`,__name:`FilterPillOptionGroup`,props:{heading:{type:String,default:null}},setup(e){return(t,n)=>e.heading?((0,y.openBlock)(),(0,y.createElementBlock)(`li`,x,[(0,y.createVNode)((0,y.unref)(v.default),{heading:e.heading,"heading-class":`d-filter-pill__menu-heading`},{heading:(0,y.withCtx)(()=>[(0,y.createVNode)((0,y.unref)(a.t),{variant:`label-xs`,size:100,strength:`medium`,tone:`tertiary`,density:500},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(e.heading),1)]),_:1})]),default:(0,y.withCtx)(()=>[(0,y.renderSlot)(t.$slots,`default`)]),_:3},8,[`heading`])])):(0,y.renderSlot)(t.$slots,`default`,{key:1})}}),C={name:`DtFilterPill`,components:{DtCheckboxGroup:u.default,DtCheckbox:l.default,DtPopover:m.default,DtButton:c.default,DtIconClose:b.DtIconClose,DtIconCheck:b.DtIconCheck,DtIconChevronDown:b.DtIconChevronDown,DtDropdown:h.default,DtFilterPillOptionGroup:S,DtListItem:d.default,DtStack:f.default,DtText:a.t},mixins:[_.default],props:{options:{type:Array,default:void 0},selected:{type:[String,Array],default:void 0},neutralValue:{type:String,default:void 0},open:{type:[Boolean,null],default:null},anchorEndClass:{type:[String,Array,Object],default:``},optionEndClass:{type:[String,Array,Object],default:``},headerContentClass:{type:[String,Array,Object],default:``},useDropdown:{type:Boolean,default:!1},deferSelection:{type:Boolean,default:!1},modelValue:{type:Array,default:()=>[]},startTooltipText:{type:String,default:``},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},showClear:{type:Boolean,default:!0},label:{type:String,default:void 0},endTooltipText:{type:String,default:``},popoverAppendTo:{type:[e.HTML_ELEMENT_TYPE,String],default:`body`,validator:e=>p.POPOVER_APPEND_TO_VALUES.includes(e)||e instanceof HTMLElement},popoverFallbackPlacements:{type:Array,default:()=>[`auto`]},popoverMaxHeight:{type:String,default:``},overlayMinInlineSize:{type:String,default:`anchor`,validator:t.ordinalSizeValidator(g.FILTER_PILL_OVERLAY_MIN_INLINE_SIZE_VALUES)},popoverMaxWidth:{type:String,default:``},popoverPadding:{type:String,default:void 0,validator:e=>Object.keys(p.POPOVER_PADDING_CLASSES).some(t=>t===e)},popoverPlacement:{type:String,default:`bottom-start`},labelClass:{type:[String,Array,Object],default:``},popoverContentClass:{type:[String,Array,Object],default:``},popoverHeaderClass:{type:[String,Array,Object],default:``},popoverFooterClass:{type:[String,Array,Object],default:``},popoverDialogClass:{type:[String,Array,Object],default:``},dropdownListClass:{type:[String,Array,Object],default:``},contentMode:i.t,size:{type:[String,Number],default:200,validator:t.ordinalSizeValidator(s.BUTTON_SIZE_MODIFIERS)}},emits:[`update:selected`,`selection-change`,`update:open`,`opened`,`clear`,`open`,`update:modelValue`,`apply`],data(){return{isOpen:!1,i18n:new o.DialtoneLocalization,filters:Array.isArray(this.options)?[]:this.modelValue,pendingFilters:null,overlayResizeObserver:null}},computed:{overlayUseDropdown(){return this.controlledAtBirth?this.controlledDropdown:this.useDropdown},overlayComponent(){return this.overlayUseDropdown?`dt-dropdown`:`dt-popover`},overlayProps(){let e={"append-to":this.popoverAppendTo,"fallback-placements":this.popoverFallbackPlacements,"max-height":this.popoverMaxHeight,"max-width":this.popoverMaxWidth,modal:!0,placement:this.popoverPlacement};if(this.controlledAtBirth&&(e.visibilityChangeCallback=this.onControlledVisibility,e.forwardAnchorArrowKeys=!0),this.overlayUseDropdown)e[`list-class`]=this.dropdownListClass;else{let t=this.popoverPadding===void 0;e.padding=t?`none`:this.popoverPadding,e[`content-class`]=t?[`d-filter-pill__popover-content`,this.popoverContentClass]:this.popoverContentClass,e[`header-wrapper-class`]=t?[p.POPOVER_HEADER_FOOTER_PADDING_CLASSES.large,this.popoverHeaderClass]:this.popoverHeaderClass,e[`header-class`]=this.headerContentClass,e[`footer-wrapper-class`]=t?[p.POPOVER_HEADER_FOOTER_PADDING_CLASSES.large,this.popoverFooterClass]:this.popoverFooterClass,e[`dialog-class`]=this.popoverDialogClass}return e},buttonKind(){return this.isActive&&!this.disabled?`default`:`muted`},resolvedStartTooltipText(){return this.readOnly?this.startTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_READ_ONLY_TOOLTIP`):this.startTooltipText},clearButtonAriaLabel(){return this.endTooltipText||this.i18n.$t(`DIALTONE_FILTER_PILL_CLEAR_BUTTON_LABEL`)},clearButtonTitle(){if(!this.endTooltipText)return this.clearButtonAriaLabel},activeFilters(){return this.filters.filter(e=>e.active).map(e=>e.name)},allFiltersActive(){return this.filters.length>1&&this.activeFilters.length===this.filters.length},activeFilterList(){return this.allFiltersActive?`All`:this.activeFilters[0]??``},activeFilterLabel(){return this.allFiltersActive?this.i18n.$t(`DIALTONE_FILTER_PILL_ALL_LABEL`):this.activeFilterList},activeFilterOverflowTitle(){let e=this.controlledAtBirth?this.controlledState.values.length-1:this.activeFilters.length-1;return this.i18n.$t(`DIALTONE_FILTER_PILL_OVERFLOW_TITLE`,{count:e})},activeFilterOverflow(){return this.activeFilters.length<=1||this.allFiltersActive?``:`+`+(this.activeFilters.length-1)},isActive(){return this.controlledAtBirth?this.controlledState.valid&&this.controlledState.isActive:this.activeFilterList.length>0},hasClear(){return this.controlledAtBirth?!this.readOnly&&this.showClear&&this.controlledContractValid&&this.controlledState.valid&&this.isActive:!this.readOnly&&this.showClear&&this.activeFilterList.length>0},displayFilters(){return this.deferSelection&&this.pendingFilters?this.pendingFilters:this.filters},pendingActiveFilters(){return this.pendingFilters?this.pendingFilters.filter(e=>e.active).map(e=>e.name):[]},cancelButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_CANCEL_BUTTON_LABEL`)},applyButtonLabel(){return this.i18n.$t(`DIALTONE_FILTER_PILL_APPLY_BUTTON_LABEL`)},clearIconSize(){return String(this.size)===`100`?`100`:s.BUTTON_ICON_SIZES[String(this.size)]}},watch:{overlayMinInlineSize:{handler:`observeOverlayAnchor`,flush:`post`},overlayUseDropdown:{handler:`observeOverlayAnchor`,flush:`post`},hasClear:{handler:`observeOverlayAnchor`,flush:`post`},popoverMaxWidth:{handler:`syncOverlayMinInlineSize`,flush:`post`},isOpen:[{handler:`syncOverlayMinInlineSize`,flush:`post`},function(e){this.controlledAtBirth||(this.$emit(`open`,e),this.deferSelection&&(e?this.pendingFilters=JSON.parse(JSON.stringify(this.filters)):this.pendingFilters=null))}],filters:{deep:!0,handler(e){this.controlledAtBirth||this.$emit(`update:modelValue`,e)}}},mounted(){this.observeOverlayAnchor(),!this.controlledAtBirth&&!(this.modelValue?.length||this.$slots.content)&&console.warn(`Please provide content through the v-model or the "content" slot.`),this.deferSelection&&this.useDropdown&&console.warn(`deferSelection has no effect when useDropdown is true.`)},beforeUnmount(){this.overlayResizeObserver?.disconnect()},methods:{hasSlotContent:n.hasSlotContent,observeOverlayAnchor(){this.overlayResizeObserver?.disconnect(),this.overlayResizeObserver=null,this.overlayMinInlineSize===`anchor`&&typeof ResizeObserver<`u`&&(this.overlayResizeObserver=new ResizeObserver(()=>this.syncOverlayMinInlineSize()),[this.$el,...this.getAnchorControls()].forEach(e=>this.overlayResizeObserver.observe(e))),this.syncOverlayMinInlineSize()},getAnchorControls(){return[this.$el.querySelector(`[data-qa="dt-filter-pill__button"]`),this.$refs.clearButton?.$el].filter(Boolean)},measureAnchorInlineSize(){let e=this.getAnchorControls();if(!e.length)return 0;let[t,n]=/^(vertical|sideways)/.test(getComputedStyle(this.$el).writingMode)?[`top`,`bottom`]:[`left`,`right`],r=e.map(e=>e.getBoundingClientRect());return Math.max(...r.map(e=>e[n]))-Math.min(...r.map(e=>e[t]))},resolveOverlayMinInlineSize(){let e=String(this.overlayMinInlineSize??`0`);return e=e===`anchor`?`${this.measureAnchorInlineSize()}px`:e===`0`?`0px`:`var(--dt-layout-${e})`,e&&this.popoverMaxWidth&&this.popoverMaxWidth!==`none`?`min(${e}, ${this.popoverMaxWidth})`:e},syncOverlayMinInlineSize(){let e=this.$refs.overlay;if(!e)return;let t=this.overlayUseDropdown?e.$refs.popover:e,n=t?.popoverContentEl;if(!n)return;let r=this.resolveOverlayMinInlineSize();n.style.minInlineSize!==r&&(n.style.minInlineSize=r,t.tip?.popperInstance?.update())},clearFilter(e){if(this.controlledAtBirth){let t=this.controlledDropdown?this.neutralValue??null:[];this.controlledDraft=null,this.commitControlled(t,`clear`,!0,e),this.reconcileCheckboxes();return}this.filters.forEach(e=>delete e.active),this.$emit(`clear`,e)},openPopover(){if(this.controlledAtBirth){this.requestControlledOpen(!0);return}this.readOnly||(this.isOpen=!0)},selectFilter(e,t){this.filters.forEach(t=>{t.active=t===e}),t()},applySelection(){if(this.controlledAtBirth)return this.applyControlledSelection();this.pendingFilters&&(this.filters.forEach((e,t)=>{this.pendingFilters[t]?e.active=this.pendingFilters[t].active:delete e.active}),this.$emit(`apply`),this.isOpen=!1)},cancelSelection(){if(this.controlledAtBirth){this.closeControlled();return}this.isOpen=!1}}},w={class:`sr-only`,"data-qa":`dt-filter-pill__accessible-label`},T={key:0,class:`d-filter-pill__label-start`,"data-qa":`dt-filter-pill__label-start`,"aria-hidden":`true`},E=[`title`],D=[`title`,`textContent`],O=[`title`,`textContent`],k=[`title`,`textContent`],A=[`id`];function j(e,t,n,r,i,a){let o=(0,y.resolveComponent)(`dt-icon-chevron-down`),s=(0,y.resolveComponent)(`dt-button`),c=(0,y.resolveComponent)(`dt-checkbox`),l=(0,y.resolveComponent)(`dt-checkbox-group`),u=(0,y.resolveComponent)(`dt-stack`),d=(0,y.resolveComponent)(`dt-text`),f=(0,y.resolveComponent)(`dt-icon-check`),p=(0,y.resolveComponent)(`dt-list-item`),m=(0,y.resolveComponent)(`dt-filter-pill-option-group`),h=(0,y.resolveComponent)(`dt-icon-close`),g=(0,y.resolveDirective)(`dt-tooltip`);return(0,y.openBlock)(),(0,y.createElementBlock)(`div`,(0,y.mergeProps)({class:[`d-filter-pill`,{"d-filter-pill--read-only":n.readOnly}]},e.legacyRootAttrs(),{"data-qa":`dt-filter-pill`}),[((0,y.openBlock)(),(0,y.createBlock)((0,y.resolveDynamicComponent)(a.overlayComponent),(0,y.mergeProps)({ref:`overlay`,open:i.isOpen},a.overlayProps,{"aria-label":e.controlledAtBirth&&!e.$slots.content?n.label:void 0,"content-mode":n.contentMode,"onUpdate:open":e.onOverlayTerminalOpen,onOpened:e.onOverlayOpened,onKeydown:e.onOverlayKeydown}),(0,y.createSlots)({anchor:(0,y.withCtx)(t=>[(0,y.withDirectives)(((0,y.openBlock)(),(0,y.createBlock)(s,(0,y.mergeProps)({ref:`primaryButton`},e.anchorAttributes(t),{active:a.isActive,"aria-disabled":n.readOnly||void 0,class:[`d-filter-pill__primary`,{"d-filter-pill--selected":a.isActive}],disabled:n.disabled,kind:a.buttonKind,size:n.size,"data-qa":`dt-filter-pill__button`,importance:`outlined`,onClick:a.openPopover,onKeydown:(0,y.withKeys)((0,y.withModifiers)(e.onAnchorArrow,[`prevent`]),[`up`,`down`])}),(0,y.createSlots)({default:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{class:(0,y.normalizeClass)([`d-filter-pill__label`,n.labelClass]),"data-qa":`dt-filter-pill__label`},[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`default`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledAnchorBindings)),()=>[(0,y.createElementVNode)(`span`,w,(0,y.toDisplayString)(e.controlledAccessibleLabel),1),e.controlledDropdown||!a.isActive||n.label?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,T,(0,y.toDisplayString)(e.controlledDropdown||!a.isActive?e.controlledDisplayLabel:n.label),1)):(0,y.createCommentVNode)(``,!0),!e.controlledDropdown&&a.isActive?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:1,class:(0,y.normalizeClass)([`d-filter-pill__label-end`,{"d-filter-pill__label-end--standalone":!n.label}]),"data-qa":`dt-filter-pill__label-end`,"aria-hidden":`true`},(0,y.toDisplayString)(e.controlledDisplayLabel),3)):(0,y.createCommentVNode)(``,!0),e.controlledOverflow?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:2,class:`d-filter-pill__label-end-overflow`,"data-qa":`dt-filter-pill__overflow`,title:a.activeFilterOverflowTitle},(0,y.toDisplayString)(e.controlledOverflow),9,E)):(0,y.createCommentVNode)(``,!0),a.hasSlotContent(e.$slots.anchorEnd,e.controlledAnchorBindings)?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:3,class:(0,y.normalizeClass)([`d-filter-pill__anchor-end`,n.anchorEndClass]),"data-qa":`dt-filter-pill__anchor-end`},[(0,y.renderSlot)(e.$slots,`anchorEnd`,(0,y.normalizeProps)((0,y.guardReactiveProps)(e.controlledAnchorBindings)))],2)):(0,y.createCommentVNode)(``,!0)]):(0,y.renderSlot)(e.$slots,`default`,{key:1,label:n.label,filters:i.filters,activeFilters:a.activeFilters,activeFilterList:a.activeFilterList,activeFilterOverflow:a.activeFilterOverflow},()=>[(0,y.createElementVNode)(`span`,{class:`d-filter-pill__label-start`,title:n.label,textContent:(0,y.toDisplayString)(n.label)},null,8,D),a.activeFilterList?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:0,class:`d-filter-pill__label-end`,title:a.activeFilterLabel,textContent:(0,y.toDisplayString)(a.activeFilterLabel)},null,8,O)):(0,y.createCommentVNode)(``,!0),a.activeFilterOverflow?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:1,class:`d-filter-pill__label-end-overflow`,title:a.activeFilterOverflowTitle,textContent:(0,y.toDisplayString)(a.activeFilterOverflow)},null,8,k)):(0,y.createCommentVNode)(``,!0)])],2)]),_:2},[e.$slots.startIcon?{name:`startIcon`,fn:(0,y.withCtx)(({iconSize:t})=>[(0,y.renderSlot)(e.$slots,`startIcon`,{iconSize:t})]),key:`0`}:void 0,n.readOnly?void 0:{name:`endIcon`,fn:(0,y.withCtx)(({iconSize:e})=>[(0,y.createVNode)(o,{size:e,class:`d-filter-pill__icon`,"data-qa":`dt-filter-pill__icon`},null,8,[`size`])]),key:`1`}]),1040,[`active`,`aria-disabled`,`class`,`disabled`,`kind`,`size`,`onClick`,`onKeydown`])),[[g,a.resolvedStartTooltipText]])]),_:2},[a.overlayUseDropdown?void 0:{name:`content`,fn:(0,y.withCtx)(({close:t})=>[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`content`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledContentBindings)),()=>[(0,y.createVNode)(l,{"model-value":e.checkboxRenderValues,"aria-label":n.label,name:n.label||`filter-pill`,disabled:!e.controlledCanSelect},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(e.controlledState.options,t=>((0,y.openBlock)(),(0,y.createBlock)(c,{id:e.controlledOptionId(t.value),key:t.value,label:t.label,value:t.value,"data-qa":`dt-filter-pill__checkbox`,"onUpdate:modelValue":n=>e.toggleControlledOption(t.value,n)},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(t.label)+` `,1),e.$slots.optionEnd?((0,y.openBlock)(),(0,y.createElementBlock)(`span`,{key:0,class:(0,y.normalizeClass)([`d-filter-pill__option-end`,n.optionEndClass])},[(0,y.renderSlot)(e.$slots,`optionEnd`,{option:t,selected:e.controlledRowSelected(t.value)})],2)):(0,y.createCommentVNode)(``,!0)]),_:2},1032,[`id`,`label`,`value`,`onUpdate:modelValue`]))),128))]),_:3},8,[`model-value`,`aria-label`,`name`,`disabled`])]):(0,y.renderSlot)(e.$slots,`content`,{key:1,close:t,apply:a.applySelection,cancel:a.cancelSelection,pendingFilters:i.pendingFilters},()=>[n.modelValue?.length?((0,y.openBlock)(),(0,y.createBlock)(l,{key:0,"model-value":n.deferSelection?a.pendingActiveFilters:a.activeFilters,"aria-label":n.label,name:n.label||`filter-pill`},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(a.displayFilters,e=>((0,y.openBlock)(),(0,y.createBlock)(c,{key:e.name,label:e.name,value:e.name,"onUpdate:modelValue":t=>e.active=t},null,8,[`label`,`value`,`onUpdate:modelValue`]))),128))]),_:1},8,[`model-value`,`aria-label`,`name`])):(0,y.createCommentVNode)(``,!0)])]),key:`0`},!a.overlayUseDropdown&&e.$slots.headerContent?{name:`headerContent`,fn:(0,y.withCtx)(({close:t})=>[(0,y.renderSlot)(e.$slots,`headerContent`,{close:e.controlledAtBirth?e.closeControlled:t})]),key:`1`}:void 0,!a.overlayUseDropdown&&(n.deferSelection||e.$slots.footerContent)?{name:`footerContent`,fn:(0,y.withCtx)(({close:t})=>[(0,y.renderSlot)(e.$slots,`footerContent`,{close:e.controlledAtBirth?e.closeControlled:t,apply:a.applySelection,cancel:a.cancelSelection},()=>[n.deferSelection?((0,y.openBlock)(),(0,y.createBlock)(u,{key:0,direction:`row`,gap:`400`,justify:`end`,"data-qa":`dt-filter-pill__deferred-footer`},{default:(0,y.withCtx)(()=>[(0,y.createVNode)(s,{importance:`clear`,kind:`muted`,size:200,"data-qa":`dt-filter-pill__cancel-button`,onClick:a.cancelSelection},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(a.cancelButtonLabel),1)]),_:1},8,[`onClick`]),(0,y.createVNode)(s,{importance:`primary`,size:200,"data-qa":`dt-filter-pill__apply-button`,onClick:a.applySelection},{default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(a.applyButtonLabel),1)]),_:1},8,[`onClick`])]),_:1})):(0,y.createCommentVNode)(``,!0)])]),key:`2`}:void 0,a.overlayUseDropdown?{name:`list`,fn:(0,y.withCtx)(({close:t})=>[e.controlledAtBirth?(0,y.renderSlot)(e.$slots,`content`,(0,y.normalizeProps)((0,y.mergeProps)({key:0},e.controlledContentBindings)),()=>[e.$slots.headerContent?((0,y.openBlock)(),(0,y.createElementBlock)(`li`,{key:0,role:`presentation`,class:(0,y.normalizeClass)([`d-filter-pill__menu-heading`,n.headerContentClass])},[(0,y.createVNode)(d,{variant:`label-xs`,size:100,strength:`medium`,tone:`tertiary`,density:500},{default:(0,y.withCtx)(()=>[(0,y.renderSlot)(e.$slots,`headerContent`)]),_:3})],2)):(0,y.createCommentVNode)(``,!0),((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(e.controlledState.sections,(t,r)=>((0,y.openBlock)(),(0,y.createBlock)(m,{key:r,heading:t.group},{default:(0,y.withCtx)(()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(t.rows,t=>((0,y.openBlock)(),(0,y.createBlock)(p,{id:e.controlledOptionId(t.option.value),key:t.option.value,role:`menuitemradio`,"data-qa":`dt-filter-pill__option`,"navigation-type":`arrow-keys`,selected:e.controlledRowSelected(t.option.value),disabled:!e.controlledCanSelect||t.disabled,"aria-describedby":t.description?e.controlledDescriptionId(t.option.value):void 0,onClick:n=>e.selectControlledOption(t.option.value)},(0,y.createSlots)({selected:(0,y.withCtx)(()=>[(0,y.createVNode)(f,{size:`200`,class:(0,y.normalizeClass)({"d-filter-pill__selection-indicator--hidden":!e.controlledRowSelected(t.option.value)}),"aria-hidden":`true`,"data-qa":`dt-filter-pill__selection-indicator`},null,8,[`class`])]),default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(t.option.label)+` `,1)]),_:2},[t.description?{name:`subtitle`,fn:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{id:e.controlledDescriptionId(t.option.value),"aria-hidden":`true`,"data-qa":`dt-filter-pill__option-description`},(0,y.toDisplayString)(t.description),9,A)]),key:`0`}:void 0,e.$slots.optionEnd?{name:`end`,fn:(0,y.withCtx)(()=>[(0,y.createElementVNode)(`span`,{class:(0,y.normalizeClass)([`d-filter-pill__option-end`,n.optionEndClass])},[(0,y.renderSlot)(e.$slots,`optionEnd`,{option:t.option,selected:e.controlledRowSelected(t.option.value)})],2)]),key:`1`}:void 0]),1032,[`id`,`selected`,`disabled`,`aria-describedby`,`onClick`]))),128))]),_:2},1032,[`heading`]))),128))]):(0,y.renderSlot)(e.$slots,`content`,{key:1,close:t},()=>[((0,y.openBlock)(!0),(0,y.createElementBlock)(y.Fragment,null,(0,y.renderList)(i.filters,e=>((0,y.openBlock)(),(0,y.createBlock)(p,{key:e.name,role:`menuitem`,"navigation-type":`arrow-keys`,selected:e.active,onClick:n=>a.selectFilter(e,t)},{selected:(0,y.withCtx)(()=>[(0,y.createVNode)(f,{size:`200`,class:(0,y.normalizeClass)({"d-filter-pill__selection-indicator--hidden":!e.active}),"aria-hidden":`true`,"data-qa":`dt-filter-pill__selection-indicator`},null,8,[`class`])]),default:(0,y.withCtx)(()=>[(0,y.createTextVNode)((0,y.toDisplayString)(e.name)+` `,1)]),_:2},1032,[`selected`,`onClick`]))),128))])]),key:`3`}:void 0]),1040,[`open`,`aria-label`,`content-mode`,`onUpdate:open`,`onOpened`,`onKeydown`])),a.hasClear?(0,y.withDirectives)(((0,y.openBlock)(),(0,y.createBlock)(s,{key:0,ref:`clearButton`,active:a.isActive,"aria-label":a.clearButtonAriaLabel,class:(0,y.normalizeClass)([`d-filter-pill__clear`,{"d-filter-pill__clear--selected":a.isActive}]),disabled:n.disabled,kind:a.buttonKind,size:n.size,title:a.clearButtonTitle,"data-qa":`dt-filter-pill__clear-button`,importance:`outlined`,onClick:a.clearFilter},{icon:(0,y.withCtx)(()=>[(0,y.createVNode)(h,{size:a.clearIconSize},null,8,[`size`])]),_:1},8,[`active`,`aria-label`,`class`,`disabled`,`kind`,`size`,`title`,`onClick`])),[[g,n.endTooltipText]]):(0,y.createCommentVNode)(``,!0)],16)}var M=r.t(C,[[`render`,j]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return M}});
2
- //# sourceMappingURL=FilterPill-DwapR9JK.cjs.map
@@ -1,11 +0,0 @@
1
- const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./common/utils/index.cjs`),n=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`),r=require(`./common/emoji/index.cjs`),i=require(`./lib/avatar/avatar.cjs`),a=require(`./lib/badge/badge.cjs`),o=require(`./Text-DNVNZree.cjs`),s=require(`./localization/index.cjs`),c=require(`./lib/link/link.cjs`),l=require(`./lib/button/button.cjs`),u=require(`./lib/list-item/list-item.cjs`),d=require(`./lib/stack/stack.cjs`),f=require(`./lib/popover/popover.cjs`),p=require(`./lib/emoji/emoji.cjs`),ee=require(`./lib/input/input.cjs`),m=require(`./node_modules/@tiptap/vue-3.cjs`),h=require(`./floating-ui.dom-n1CheoWj.cjs`),te=require(`./ForceLinkify-D4FBhBxD.cjs`),g=require(`./lib/rich-text-editor/rich-text-editor-constants.cjs`),_=require(`./MarkdownRenderer-CaBjENW6.cjs`);let v=require(`vue`),ne=require(`@dialpad/dialtone-icons/vue`),y=require(`regex-combined-emojis`),b=require(`@tiptap/core`),x=require(`@tiptap/pm/state`),re=require(`@tiptap/pm/tables`),S=require(`@tiptap/extension-blockquote`);S=e.t(S);let C=require(`@tiptap/extension-code-block`);C=e.t(C);let w=require(`@tiptap/extension-code`);w=e.t(w);let T=require(`@tiptap/extension-document`);T=e.t(T);let E=require(`@tiptap/extensions`),D=require(`@tiptap/extension-hard-break`);D=e.t(D);let O=require(`@tiptap/extension-paragraph`);O=e.t(O);let k=require(`@tiptap/extension-bold`);k=e.t(k);let A=require(`@tiptap/extension-list`),j=require(`@tiptap/extension-italic`);j=e.t(j);let M=require(`@tiptap/extension-link`);M=e.t(M);let N=require(`@tiptap/extension-strike`);N=e.t(N);let P=require(`@tiptap/extension-underline`);P=e.t(P);let F=require(`@tiptap/extension-text`);F=e.t(F);let I=require(`@tiptap/extension-text-align`);I=e.t(I);let L=require(`@tiptap/extension-table`),R=require(`@tiptap/extension-text-style`),z=require(`@tiptap/suggestion`);z=e.t(z);let B=require(`@tiptap/extension-image`);B=e.t(B);let V=require(`@tiptap/extension-mention`);V=e.t(V);let H=require(`@dialpad/dialtone-icons/vue/hash`);H=e.t(H);let U=require(`@dialpad/dialtone-icons/vue/lock`);U=e.t(U);let W=require(`deep-equal`);W=e.t(W);function ie(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var ae=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,shouldShow:a,appendTo:o,getReferencedVirtualElement:s,options:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&(0,b.isTextSelection)(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(`bubbleMenu`);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`&&this.updateOptions(t.options)},this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=c?.scrollTarget??window,this.getReferencedVirtualElement=s,this.floatingUIOptions={...this.floatingUIOptions,...c},this.element.tabIndex=0,a&&(this.shouldShow=a),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(h.a(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(h.l(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(h.c(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(h.t(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(h.u(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(h.n(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(h.o(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(h.s(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=(0,b.posToDOMRect)(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof x.NodeSelection){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof re.CellSelection){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():ie(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){let e=this.virtualElement;e&&h.i(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},oe=e=>new x.Plugin({key:typeof e.pluginKey==`string`?new x.PluginKey(e.pluginKey):e.pluginKey,view:t=>new ae({view:t,...e})}),se=(0,v.defineComponent)({name:`BubbleMenu`,inheritAttrs:!1,props:{pluginKey:{type:[String,Object],default:`bubbleMenu`},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null},getReferencedVirtualElement:{type:Function,default:void 0}},setup(e,{slots:t,attrs:n}){let r=(0,v.ref)(null);return(0,v.onMounted)(()=>{let{editor:t,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}=e,u=r.value;u&&(u.style.visibility=`hidden`,u.style.position=`absolute`,u.remove(),(0,v.nextTick)(()=>{t.registerPlugin(oe({editor:t,element:u,options:n,pluginKey:i,resizeDelay:a,appendTo:o,shouldShow:s,getReferencedVirtualElement:c,updateDelay:l}))}))}),(0,v.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,v.h)(`div`,{ref:r,...n},t.default?.call(t))}}),ce=class{constructor({editor:e,element:t,view:n,updateDelay:r=250,resizeDelay:i=60,options:a,appendTo:o,shouldShow:s}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(`floatingMenu`);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`&&this.updateOptions(t.options)},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.updateDelay=r,this.resizeDelay=i,this.appendTo=o,this.scrollTarget=a?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...a},this.element.tabIndex=0,s&&(this.shouldShow=s),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return(0,b.getText)(e,{textSerializers:(0,b.getTextSerializersFromSchema)(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(h.a(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(h.l(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(h.c(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(h.t(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(h.u(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(h.n(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(h.o(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(h.s(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=(0,b.posToDOMRect)(this.view,e.from,e.to);h.i({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),this.isVisible=!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},le=e=>new x.Plugin({key:typeof e.pluginKey==`string`?new x.PluginKey(e.pluginKey):e.pluginKey,view:t=>new ce({view:t,...e})});(0,v.defineComponent)({name:`FloatingMenu`,inheritAttrs:!1,props:{pluginKey:{type:null,default:`floatingMenu`},editor:{type:Object,required:!0},updateDelay:{type:Number,default:void 0},resizeDelay:{type:Number,default:void 0},options:{type:Object,default:()=>({})},appendTo:{type:[Object,Function],default:void 0},shouldShow:{type:Function,default:null}},setup(e,{slots:t,attrs:n}){let r=(0,v.ref)(null);return(0,v.onMounted)(()=>{let{pluginKey:t,editor:n,updateDelay:i,resizeDelay:a,options:o,appendTo:s,shouldShow:c}=e,l=r.value;l&&(l.style.visibility=`hidden`,l.style.position=`absolute`,l.remove(),n.registerPlugin(le({pluginKey:t,editor:n,element:l,updateDelay:i,resizeDelay:a,options:o,appendTo:s,shouldShow:c})))}),(0,v.onBeforeUnmount)(()=>{let{pluginKey:t,editor:n}=e;n.unregisterPlugin(t)}),()=>(0,v.h)(`div`,{ref:r,...n},t.default?.call(t))}});var G=e=>({default:null,parseHTML:t=>t.getAttribute(e),renderHTML:t=>t[e]?{[e]:t[e]}:{}}),ue=()=>{let e=G(`style`);return e.renderHTML=e=>e.style?{style:de(e.style)}:{},e};function de(e){return e.replace(/(?<![a-z-])width\s*:\s*([^;]+);?/gi,(e,t)=>/^\s*0\s*[a-z%]*\s*(!important)?\s*$/i.test(t)?`width: 100%;`:e)}var fe=L.Table.extend({addAttributes(){return{...this.parent?.(),border:G(`border`),cellpadding:G(`cellpadding`),cellspacing:G(`cellspacing`),style:ue()}},renderHTML({HTMLAttributes:e}){return[`table`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e),[`tbody`,0]]}}),pe=L.TableRow.extend({addAttributes(){return{...this.parent?.(),style:G(`style`)}}}),K={style:G(`style`),valign:G(`valign`),width:G(`width`)},me=L.TableCell.extend({addAttributes(){return{...this.parent?.(),...K}}}),he=L.TableHeader.extend({addAttributes(){return{...this.parent?.(),...K}}}),ge=R.TextStyle.extend({parseHTML(){return[...this.parent?.()||[],{tag:`div`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?{}:!1},{tag:`a`,consuming:!1,getAttrs:e=>e.hasAttribute(`style`)?{}:!1}]}}),_e={name:`EmojiComponent`,components:{NodeViewWrapper:m.NodeViewWrapper,DtEmoji:p.default},props:m.nodeViewProps};function ve(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-emoji`),s=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(s,{class:`d-d-inline-block d-va-bottom d-lh0`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{size:`500`,code:e.node.attrs.code},null,8,[`code`])]),_:1})}var ye=n.t(_e,[[`render`,ve]]),be={name:`SuggestionList`,components:{DtListItem:u.default},props:{items:{type:Array,required:!0},command:{type:Function,required:!0},itemComponent:{type:Object,required:!0},itemType:{type:String,required:!0}},data(){return{selectedIndex:0}},watch:{items(){this.selectedIndex=0}},methods:{onKeyDown({event:e}){return e.key===`ArrowUp`?(this.upHandler(),!0):e.key===`ArrowDown`?(this.downHandler(),!0):e.key===`Enter`||e.key===`Tab`?(this.selectHandler(),!0):!1},upHandler(){this.selectedIndex=(this.selectedIndex+this.items.length-1)%this.items.length,this.scrollActiveElementIntoView()},downHandler(){this.selectedIndex=(this.selectedIndex+1)%this.items.length,this.scrollActiveElementIntoView()},async scrollActiveElementIntoView(){await this.$nextTick();let e=this.$refs.suggestionList.querySelector(`.d-list-item--highlighted`);e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(e){let t=this.items[e];switch(this.itemType){case`emoji`:this.command(t);return;case`mention`:this.command({name:t.name,id:t.id,avatarSrc:t.avatarSrc,contactKey:t.contactKey});break;case`channel`:this.command({name:t.name,id:t.id,locked:t.locked,channelKey:t.channelKey});break;case`slash-command`:this.command({command:t.command});break}}}},xe={class:`d-popover__dialog d-suggestion-list__container`},Se={ref:`suggestionList`,class:`d-suggestion-list`};function Ce(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-list-item`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,xe,[(0,v.withDirectives)((0,v.createElementVNode)(`ul`,Se,[((0,v.openBlock)(!0),(0,v.createElementBlock)(v.Fragment,null,(0,v.renderList)(n.items,(e,t)=>((0,v.openBlock)(),(0,v.createBlock)(o,{key:e.id,class:(0,v.normalizeClass)([`d-suggestion-list__item`,{"d-list-item--highlighted":t===i.selectedIndex}]),"navigation-type":`arrow-keys`,onClick:e=>a.selectItem(t),onKeydown:(0,v.withModifiers)(a.onKeyDown,[`prevent`])},{default:(0,v.withCtx)(()=>[((0,v.openBlock)(),(0,v.createBlock)((0,v.resolveDynamicComponent)(n.itemComponent),{item:e},null,8,[`item`]))]),_:2},1032,[`class`,`onClick`,`onKeydown`]))),128))],512),[[v.vShow,n.items.length]])])}var we=n.t(be,[[`render`,Ce]]),q=`top-start`;function Te(){return{getBoundingClientRect:()=>({width:0,height:0,x:0,y:0,top:0,left:0,right:0,bottom:0})}}function J(e){return{getBoundingClientRect:e}}async function Ee(e,t,n={}){if(!e||!t?.getBoundingClientRect)return;let{placement:r=q,middleware:i=[h.c(0),h.a(),h.l({padding:8})]}=n,{x:a,y:o}=await h.i(t,e,{placement:r,middleware:i});Object.assign(e.style,{left:`${a}px`,top:`${o}px`})}function De(e,t={}){let{zIndex:n=`650`}=t;e.style.position=`absolute`,e.style.zIndex=n,e.style.display=`none`}function Oe(e){e&&(e.style.display=`block`)}function ke(e){e&&(e.style.display=`none`)}function Ae(e,t){return n=>{n.key===`Escape`&&t()&&e()}}function je(e){document.addEventListener(`keydown`,e)}function Me(e){document.removeEventListener(`keydown`,e)}function Ne(e,t,n,r){return new m.VueRenderer(e,{props:{itemComponent:(0,v.markRaw)(t),itemType:n,...r},editor:r.editor})}function Pe(e){e.escHandler&&Me(e.escHandler),e.floatingEl?.remove(),e.component?.destroy()}function Y(e,t,n={}){let{listComponent:r=we,placement:i=q,zIndex:a=`650`}=n;return()=>{let n=null,o=null,s=!1,c=Te(),l=null;function u(){Ee(o,c,{placement:i})}function d(){o&&(Oe(o),s=!0,u())}function f(){o&&(ke(o),s=!1)}return{onStart:i=>{n=Ne(r,e,t,i),i.clientRect&&(o=n.element,De(o,{zIndex:a}),document.body.appendChild(o),c=J(i.clientRect),l=Ae(f,()=>s),je(l),i.items.length>0&&d())},onUpdate(e){n?.updateProps(e),e.items.length>0?d():f(),e.clientRect&&(c=J(e.clientRect),u())},onKeyDown(e){if(s)return n?.ref?.onKeyDown(e)},onExit(){Pe({escHandler:l,floatingEl:o,component:n}),l=null,o=null,n=null}}}}var Fe={name:`EmojiSuggestion`,components:{DtEmoji:p.default,DtStack:d.default},props:{item:{type:Object,required:!0}}};function Ie(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-emoji`),s=(0,v.resolveComponent)(`dt-stack`);return(0,v.openBlock)(),(0,v.createBlock)(s,{direction:`row`,gap:`100`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{size:`200`,code:n.item.code},null,8,[`code`]),(0,v.createTextVNode)(` `+(0,v.toDisplayString)(n.item.code),1)]),_:1})}var Le=n.t(Fe,[[`render`,Ie]]),Re=20,ze=(e,t,n)=>{let r=e.shortname?.replaceAll(`:`,``),i=t.shortname?.replaceAll(`:`,``),a=r.startsWith(n),o=i.startsWith(n);return a&&!o?-1:!a&&o?1:r.localeCompare(i)},Be={items:({query:e})=>{if(e.length<2)return[];let t=Object.values(r.getEmojiData());return e=e.toLowerCase(),t.filter(t=>[t.name,t.shortname?.replaceAll(`:`,``),...t.keywords||[]].some(t=>t&&t.startsWith(e))).splice(0,Re).sort((t,n)=>ze(t,n,e)).map(e=>({code:e.shortname}))},command:({editor:e,range:t,props:n})=>{e.view.state.selection.$to.nodeAfter?.text?.startsWith(` `)&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:`emoji`,attrs:n}]).run(),window.getSelection()?.collapseToEnd()},render:Y(Le,`emoji`)},Ve=/(:\w+:)$/,He=RegExp(y.emojiPattern+`$`),Ue=e=>{if(e&&r.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},We=e=>[...e.matchAll(r.emojiShortCodeRegex)].filter(e=>r.codeToEmojiData(e[0])).map(e=>({index:e.index,text:e[0],match:e})),Ge=b.Node.create({name:`emoji`,addOptions(){return{HTMLAttributes:{}}},group:`inline`,inline:!0,selectable:!1,atom:!0,addNodeView(){return m.VueNodeViewRenderer(ye)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:`emoji-component`}]},renderText({node:e}){let t=e.attrs.code??``,n=t?r.codeToEmojiData(t):void 0;return n?r.stringToUnicode(n.unicode_output):t},renderHTML({HTMLAttributes:e}){return[`emoji-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]},addInputRules(){return[new b.InputRule({find:e=>{let t=e.match(Ve)||e.match(He);if(t)return Ue(t)},handler:({state:e,range:t,match:n})=>{let{tr:r}=e,i=t.from,a=t.to;r.replaceWith(i,a,this.type.create({code:n[0]}))}})]},addPasteRules(){return[(0,b.nodePasteRule)({find:We,type:this.type,getAttributes(e){return{code:e[0]}}}),(0,b.nodePasteRule)({find:r.emojiRegex,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[(0,z.default)({char:`:`,pluginKey:new x.PluginKey(`emoji`),editor:this.editor,...this.options.suggestion,...Be})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let n=!1,{selection:r}=t,{empty:i,anchor:a}=r;return i?(t.doc.nodesBetween(a-1,a,(t,r)=>{if(t.type.name===this.name)return n=!0,e.insertText(``,r,r+t.nodeSize),!1}),n):!1})}}});function Ke(e,t,n=()=>!0){let r=[];t.lastIndex=0;let i;for(;i=t.exec(e);)n(e,i)&&r.push(i);return r}function qe(e,t){return![`#`,`@`].includes(e.charAt(t.index))&&![`#`,`@`].includes(e.charAt(t.index-1))}function Je(e){let t=RegExp(`(?:`+[`[!?.,:;'"]`,`(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$`].join(`|`),`g`);return e.replace(t,``)}function Ye(e,t){let n=e.slice(0,t+1).search(/\S+\s*$/),r=e.slice(t).search(/\s/);if(r<0){let t=e.slice(n);return{text:t,from:n,to:n+t.length}}return{text:e.slice(n,r+t),from:n,to:r+t}}function X(e,t,n,r){let i=Ye(e,t);if(r.lastIndex=0,!r.test(i.text))return i;let a=n===`left`?i.from-1:i.to+1;return a<=0||a>=e.length||a===t?i:X(e,a,n,r)}function Xe(e,t,n,r){let i=(0,b.getMarksBetween)(Math.max(e.from-1,0),Math.min(e.to+1,t.content.size),t);for(let e of i)e.mark.type===r&&n.removeMark(e.from,e.to,r)}var Z=t.getPhoneNumberRegex(1,15);function Q(e,n,r,i,a,o){if(!e)return;let s=r-n-1;s=s<0?0:s;let c=i-n,l=X(e,s,`left`,Z),u=X(e,c,`right`,Z);Ke(e.slice(l.from,u.to),t.linkRegex,qe).forEach(e=>{let t=Je(e[0]),r=n+l.from+e.index+1,i=r+t.length;a.addMark(r,i,o.create())})}function Ze(e){let t=!1;return new x.Plugin({key:new x.PluginKey(`autolink`),appendTransaction:(n,r,i)=>{let a=n.some(e=>e.docChanged)&&!r.doc.eq(i.doc);if(t&&!a)return;let{tr:o}=i,{textContent:s}=i.doc;if(!t||!r.doc.textContent)return Q(s,0,0,s.length,o,e.type),t=!0,o;t=!0;let c=(0,b.getChangedRanges)((0,b.combineTransactionSteps)(r.doc,[...n]));return c.length?(c.forEach(({oldRange:t,newRange:n})=>{if(n.from===n.to){Q(s,0,0,s.length,o,e.type);return}Xe(n,i.doc,o,e.type),(0,b.findChildrenInRange)(i.doc,n,e=>e.isTextblock).forEach(({node:r,pos:i})=>{Q(r.textContent,i,t.from,n.to,o,e.type)})}),o):(Q(s,0,0,s.length,o,e.type),o)}})}var Qe={class:`d-link d-c-text d-d-inline-block d-wb-break-all`,rel:`noopener noreferrer nofollow`},$e=b.Mark.create({name:`CustomLink`,renderHTML({HTMLAttributes:e}){return[`a`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e,Qe)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Ze({type:this.type})]}}),et=b.Mark.create({name:`LinkPhoneNumbers`,renderHTML({HTMLAttributes:e}){return[`a`,(0,b.mergeAttributes)(e,{class:`d-link d-c-pointer d-d-inline-block d-wb-break-all`,rel:`noopener noreferrer nofollow`})]},addProseMirrorPlugins(){let e=this.editor,t=this.type;return[new x.Plugin({key:new x.PluginKey(`phoneClick`),props:{handleClick(n,r,i){let{state:a}=n,o=a.doc.resolve(r);if(!o.marks().some(e=>e.type===t))return!1;let s=(0,b.getMarkRange)(o,t),c=s?a.doc.textBetween(s.from,s.to):``;return i.preventDefault(),e.emit(`phone-click`,{phoneNumber:c}),!0}}})]}}),tt=B.default.extend({name:`ConfigurableImage`,addAttributes(){return{src:{default:``},alt:{default:void 0},title:{default:void 0},width:{default:void 0},height:{default:void 0},style:{default:void 0}}}}).configure({inline:!0,allowBase64:!0}),nt=new Set(`address.article.aside.blockquote.dd.details.dialog.div.dl.dt.fieldset.figcaption.figure.footer.form.h1.h2.h3.h4.h5.h6.header.hgroup.hr.li.main.nav.ol.p.pre.section.table.ul`.split(`.`)),rt=O.default.extend({parseHTML(){return[{tag:`div`,getAttrs:e=>{for(let t of e.children)if(nt.has(t.tagName.toLowerCase()))return!1;return null}}]},renderHTML({HTMLAttributes:e}){return[`div`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e),0]}}),it={name:`MentionComponent`,components:{NodeViewWrapper:m.NodeViewWrapper,DtLink:c.default},props:m.nodeViewProps,computed:{text(){return`@`+this.$props.node.attrs.name}},methods:{getMentionData(){return{name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,avatarSrc:this.$props.node.attrs.avatarSrc,contactKey:this.$props.node.attrs.contactKey}},handleClick(){this.$props.editor.emit(`mention-click`,this.getMentionData())},handleMouseEnter(e){this.$props.editor.emit(`mention-hover`,{...this.getMentionData(),event:e})},handleMouseLeave(e){this.$props.editor.emit(`mention-leave`,{...this.getMentionData(),event:e})}}};function at(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-link`),s=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(s,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{tone:`mention`,onClick:(0,v.withModifiers)(a.handleClick,[`prevent`]),onMouseenter:a.handleMouseEnter,onMouseleave:a.handleMouseLeave,onFocusin:a.handleMouseEnter,onFocusout:a.handleMouseLeave},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.text),1)]),_:1},8,[`onClick`,`onMouseenter`,`onMouseleave`,`onFocusin`,`onFocusout`])]),_:1})}var ot=n.t(it,[[`render`,at]]),st=V.default.extend({addNodeView(){return m.VueNodeViewRenderer(ot)},parseHTML(){return[{tag:`mention-component`}]},addAttributes(){return{name:{default:``},avatarSrc:{default:``},id:{default:``},contactKey:{default:``}}},renderText({node:e}){return`@${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return[`mention-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:`@`,pluginKey:new x.PluginKey(`mentionSuggestion`)}}),ct={name:`ChannelComponent`,components:{NodeViewWrapper:m.NodeViewWrapper,DtLink:c.default,DtIconLock:ne.DtIconLock,DtStack:d.default},props:m.nodeViewProps,computed:{text(){return this.$props.node.attrs.locked?this.$props.node.attrs.name:`#`+this.$props.node.attrs.name}},methods:{handleClick(){let e={name:this.$props.node.attrs.name,id:this.$props.node.attrs.id,locked:this.$props.node.attrs.locked,channelKey:this.$props.node.attrs.channelKey};this.$props.editor.emit(`channel-click`,e)}}};function lt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-icon-lock`),s=(0,v.resolveComponent)(`dt-stack`),c=(0,v.resolveComponent)(`dt-link`),l=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(l,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(c,{tone:`mention`,onClick:(0,v.withModifiers)(a.handleClick,[`prevent`])},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(s,{direction:`row`,gap:`0`},{default:(0,v.withCtx)(()=>[e.$props.node.attrs.locked?((0,v.openBlock)(),(0,v.createBlock)(o,{key:0,size:`200`})):(0,v.createCommentVNode)(``,!0),(0,v.createElementVNode)(`span`,null,(0,v.toDisplayString)(a.text),1)]),_:1})]),_:1},8,[`onClick`])]),_:1})}var ut=n.t(ct,[[`render`,lt]]),dt=V.default.extend({name:`channel`,addNodeView(){return m.VueNodeViewRenderer(ut)},parseHTML(){return[{tag:`channel-component`}]},addAttributes(){return{name:{default:``},id:{default:``},locked:{default:!1},channelKey:{default:``}}},renderText({node:e}){return`#${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return[`channel-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:`#`,pluginKey:new x.PluginKey(`channelSuggestion`)}}),ft={name:`SlashCommandsComponent`,components:{NodeViewWrapper:m.NodeViewWrapper},props:{...m.nodeViewProps},emits:[`selected-command`],computed:{text(){return`/`+this.$props.node.attrs.command}},created(){let e=this.$props.node.attrs.command;this.$emit(`selected-command`,e);let t=this.editor?.storage?.[`slash-commands`]?.onSelectedCommand;t&&typeof t==`function`&&t(e)}};function pt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(o,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.text),1)]),_:1})}var mt=n.t(ft,[[`render`,pt]]),ht=(e,t)=>[...e.matchAll(t)].map(e=>{let t=e[2];return t.endsWith(` `)||(t+=` `),{index:e.index,text:t,match:e}}),gt=V.default.extend({name:`slash-commands`,group:`inline`,inline:!0,addOptions(){return{...this.parent?.(),onSelectedCommand:null}},addStorage(){return{onSelectedCommand:this.options.onSelectedCommand}},addNodeView(){return m.VueNodeViewRenderer(mt)},parseHTML(){return[{tag:`command-component`}]},addAttributes(){return{command:{default:``},parametersExample:{default:``},description:{default:``}}},renderText({node:e}){return`/${e.attrs.command}`},renderHTML({HTMLAttributes:e}){return[`command-component`,(0,b.mergeAttributes)(this.options.HTMLAttributes,e)]},addInputRules(){let e=this.options.suggestion?.items({query:``}).map(e=>e.command);return[(0,b.nodeInputRule)({find:RegExp(`^((?:\\/)(${e.join(`|`)})) $`),type:this.type,getAttributes(e){return{command:e[2]}}})]},addPasteRules(){let e=this.options.suggestion?.items({query:``}).map(e=>e.command),t=RegExp(`^((?:\\/)(${e.join(`|`)})) ?$`,`g`);return[(0,b.nodePasteRule)({find:e=>ht(e,t),type:this.type,getAttributes(e){return{command:e[0].trim()}}})]}}).configure({suggestion:{char:`/`,pluginKey:new x.PluginKey(`slashCommandSuggestion`)}}),_t=100,vt={name:`VariableComponent`,components:{DtBadge:a.default,DtButton:l.default,DtPopover:f.default,DtInput:ee.default,NodeViewWrapper:m.NodeViewWrapper},props:m.nodeViewProps,data(){return{i18n:new s.DialtoneLocalization,MAX_VARIABLE_ALT_LENGTH:_t}},computed:{altText:{get(){return this.node?.attrs?.altText||``},set(e){this.updateAttributes({altText:e})}},variableId(){return this.node?.attrs?.id},placeholder(){return this.variableData?.placeholder||``},variableItems(){return this.extension?.options?.variableItems||[]},variableData(){return this.variableItems.find(e=>e.id===this.variableId)},enableAltText(){return this.node?.attrs?.enableAltText},badgeLabel(){return`{} ${this.placeholder}`},placeholderText(){return`Replaces ${this.placeholder}`}}};function yt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-badge`),s=(0,v.resolveComponent)(`dt-button`),c=(0,v.resolveComponent)(`dt-input`),l=(0,v.resolveComponent)(`dt-popover`),u=(0,v.resolveComponent)(`node-view-wrapper`);return(0,v.openBlock)(),(0,v.createBlock)(u,{class:`d-d-inline-block`},{default:(0,v.withCtx)(()=>[a.enableAltText?((0,v.openBlock)(),(0,v.createBlock)(l,{key:0,padding:`small`,"navigation-type":`arrow-keys`,placement:`top-start`,modal:!1},{anchor:(0,v.withCtx)(({attrs:e})=>[(0,v.createVNode)(s,(0,v.mergeProps)(e,{kind:`unstyled`}),{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{text:a.badgeLabel,contenteditable:`false`},null,8,[`text`])]),_:1},16)]),content:(0,v.withCtx)(({close:e})=>[(0,v.createVNode)(c,{modelValue:a.altText,"onUpdate:modelValue":t[0]||(t[0]=e=>a.altText=e),class:`d-p-100 d-w332`,label:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_LABEL`),placeholder:a.placeholderText,validate:{length:{description:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_VALIDATE_DESCRIPTION`),message:i.i18n.$t(`DIALTONE_EDITOR_VARIABLE_VALIDATE_MESSAGE`),max:i.MAX_VARIABLE_ALT_LENGTH,warn:i.MAX_VARIABLE_ALT_LENGTH,limitMaxLength:!0}},onKeyup:(0,v.withKeys)(t=>e(),[`enter`])},null,8,[`modelValue`,`label`,`placeholder`,`validate`,`onKeyup`])]),_:1})):((0,v.openBlock)(),(0,v.createBlock)(o,{key:1,text:a.badgeLabel,contenteditable:`false`},null,8,[`text`]))]),_:1})}var bt=n.t(vt,[[`render`,yt]]),xt=b.Node.create({name:`variable`,group:`inline`,inline:!0,selectable:!0,atom:!0,addOptions(){return{HTMLAttributes:{},variableItems:[]}},addNodeView(){return m.VueNodeViewRenderer(bt)},addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute(`data-variable-id`),renderHTML:e=>e.id?{"data-variable-id":e.id}:{}},altText:{default:``,parseHTML:e=>e.getAttribute(`data-alt-text`),renderHTML:e=>e.altText?{"data-alt-text":e.altText}:{}},enableAltText:{default:!0,parseHTML:e=>e.getAttribute(`data-enable-alt-text`)===`true`,renderHTML:e=>({"data-enable-alt-text":String(e.enableAltText)})}}},parseHTML(){return[{tag:`variable`}]},renderText({node:e}){return e.attrs.altText},renderHTML({node:e,HTMLAttributes:t}){return[`variable`,(0,b.mergeAttributes)(this.options.HTMLAttributes,t,{"data-variable-id":e.attrs.id,"data-alt-text":e.attrs.altText,"data-enable-alt-text":String(e.attrs.enableAltText)})]},addCommands(){return{insertVariable:(e={})=>({commands:t})=>t.insertContent({type:this.name,attrs:{id:e.id||null,altText:e.altText||``,enableAltText:e.enableAltText}})}}}),St={name:`MentionSuggestion`,components:{DtAvatar:i.default,DtStack:d.default,DtText:o.t},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name},avatarSrc(){return this.item.avatarSrc},presence(){return this.item.presence},status(){return this.item.status},presenceText(){return this.item.presenceText},presenceFontColorClass(){return{active:`d-mention-suggestion__presence--active`,busy:`d-mention-suggestion__presence--busy`,away:`d-mention-suggestion__presence--away`,offline:`d-mention-suggestion__presence--busy`}[this.presence]},showDetails(){return this.item.showDetails}}},Ct={class:`d-mention-suggestion__name`};function wt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-avatar`),s=(0,v.resolveComponent)(`dt-text`),c=(0,v.resolveComponent)(`dt-stack`);return(0,v.openBlock)(),(0,v.createBlock)(c,{direction:`row`,class:`d-mention-suggestion__container`,gap:`100`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{"full-name":a.name,"image-src":a.avatarSrc,"image-alt":a.name,"show-presence":a.showDetails,presence:a.presence,size:200},null,8,[`full-name`,`image-src`,`image-alt`,`show-presence`,`presence`]),(0,v.createVNode)(c,{class:`d-mention-suggestion__details-container`,gap:`1`},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`span`,Ct,(0,v.toDisplayString)(a.name),1),a.showDetails?((0,v.openBlock)(),(0,v.createBlock)(c,{key:0,direction:`row`,gap:`50`},{default:(0,v.withCtx)(()=>[a.presenceText?((0,v.openBlock)(),(0,v.createBlock)(s,{key:0,kind:`label`,size:200,strength:`normal`,class:(0,v.normalizeClass)([`d-mention-suggestion__presence`,[a.presenceFontColorClass]])},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.presenceText),1)]),_:1},8,[`class`])):(0,v.createCommentVNode)(``,!0),a.status&&a.presenceText?((0,v.openBlock)(),(0,v.createBlock)(s,{key:1,kind:`label`,size:200,strength:`normal`,as:`div`,class:`d-mention-suggestion__divider`},{default:(0,v.withCtx)(()=>[...t[0]||(t[0]=[(0,v.createTextVNode)(` • `,-1)])]),_:1})):(0,v.createCommentVNode)(``,!0),a.status?((0,v.openBlock)(),(0,v.createBlock)(s,{key:2,kind:`label`,size:200,strength:`normal`,as:`div`,class:`d-mention-suggestion__status`},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.status),1)]),_:1})):(0,v.createCommentVNode)(``,!0)]),_:1})):(0,v.createCommentVNode)(``,!0)]),_:1})]),_:1})}var Tt={allowSpaces:!0,render:Y(n.t(St,[[`render`,wt]]),`mention`)},Et={name:`ChannelSuggestion`,components:{DtStack:d.default,DtIconHash:H.default,DtIconLock:U.default},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function $(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-icon-hash`),s=(0,v.resolveComponent)(`dt-icon-lock`),c=(0,v.resolveComponent)(`dt-stack`);return(0,v.openBlock)(),(0,v.createBlock)(c,{direction:`row`,gap:`100`},{default:(0,v.withCtx)(()=>[n.item.locked?((0,v.openBlock)(),(0,v.createBlock)(s,{key:1,size:`300`})):((0,v.openBlock)(),(0,v.createBlock)(o,{key:0,size:`300`})),(0,v.createElementVNode)(`span`,null,(0,v.toDisplayString)(a.name),1)]),_:1})}var Dt={allowSpaces:!0,render:Y(n.t(Et,[[`render`,$]]),`channel`)},Ot={name:`SlashCommandSuggestion`,components:{DtText:o.t},props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}},kt={key:0};function At(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-text`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,null,[(0,v.createVNode)(o,{kind:`body`,size:300,density:300,as:`div`},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`span`,null,`/`+(0,v.toDisplayString)(a.command),1),a.parametersExample?((0,v.openBlock)(),(0,v.createElementBlock)(`span`,kt,(0,v.toDisplayString)(a.parametersExample),1)):(0,v.createCommentVNode)(``,!0)]),_:1}),(0,v.createVNode)(o,{kind:`body`,size:200,tone:`tertiary`,as:`div`},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(a.description),1)]),_:1})])}var jt={allowSpaces:!0,startOfLine:!0,render:Y(n.t(Ot,[[`render`,At]]),`slash-command`)},Mt={name:`DtRichTextEditor`,components:{EditorContent:m.EditorContent,BubbleMenu:se,DtButton:l.default,DtStack:d.default},props:{modelValue:{type:[Object,String],default:``},editable:{type:Boolean,default:!0},allowTyping:{type:Boolean,default:!0},pasteRichText:{type:Boolean,default:!0},allowLineBreaks:{type:Boolean,default:!1},inputAriaLabel:{type:String,required:!0},inputClass:{type:String,default:``},autoFocus:{type:[Boolean,String,Number],default:!1,validator(e){return typeof e==`string`?g.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:`html`,validator(e){return g.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:``},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},linkPhoneNumbers:{type:Array,default:null},mentionSuggestion:{type:Object,default:null},channelSuggestion:{type:Object,default:null},slashCommandSuggestion:{type:Object,default:null},allowBlockquote:{type:Boolean,default:!0},allowBold:{type:Boolean,default:!0},allowBulletList:{type:Boolean,default:!0},allowItalic:{type:Boolean,default:!0},allowStrike:{type:Boolean,default:!0},allowUnderline:{type:Boolean,default:!0},allowCode:{type:Boolean,default:!0},allowCodeblock:{type:Boolean,default:!0},allowInlineImages:{type:Boolean,default:!1},allowFontColor:{type:Boolean,default:!1},allowBackgroundColor:{type:Boolean,default:!1},allowFontSize:{type:Boolean,default:!1},allowFontFamily:{type:Boolean,default:!1},allowLineHeight:{type:Boolean,default:!1},allowVariable:{type:Boolean,default:!1},variableItems:{type:Array,default:()=>[]},additionalExtensions:{type:Array,default:()=>[]},showLinkBubbleMenu:{type:Boolean,default:!0},preserveWhitespace:{type:[Boolean,String],default:`full`},useDivTags:{type:Boolean,default:!1},allowTables:{type:Boolean,default:!1},allowTextAlign:{type:Boolean,default:!0},allowImageResize:{type:Boolean,default:!1}},emits:[`update:modelValue`,`json-input`,`html-input`,`text-input`,`markdown-input`,`blur`,`focus`,`enter`,`edit-link`,`selected`,`selected-command`,`mention-click`,`mention-hover`,`mention-leave`,`channel-click`,`phone-click`,`link-click`],data(){return{editor:null,appendTo:()=>t.returnFirstEl(this.$refs.editor.$el).getRootNode()?.querySelector(`body`),floatingOptions:{placement:`top-start`},i18n:new s.DialtoneLocalization}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){let e=[T.default,F.default,E.UndoRedo,D.default];e.push(this.useDivTags?rt:O.default),this.allowBold&&e.push(k.default),this.allowBlockquote&&e.push(S.default),this.allowBulletList&&(e.push(A.BulletList),e.push(A.ListItem.extend({renderText({node:e}){return e.textContent}})),e.push(A.OrderedList)),this.allowItalic&&e.push(j.default),this.allowStrike&&e.push(N.default),this.allowUnderline&&e.push(P.default),this.placeholder&&e.push(E.Placeholder.configure({placeholder:this.placeholder}));let t=this,n=b.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:e})=>t.allowLineBreaks?!1:(e.commands.first(({commands:e})=>[()=>e.newlineInCode(),()=>t.allowBulletList&&e.splitListItem(`listItem`),()=>e.createParagraphNear(),()=>e.liftEmptyBlock(),()=>e.splitBlock()]),!0),Enter:()=>t.allowLineBreaks?!1:(t.$emit(`enter`),!0)}}});if(e.push(n),this.link&&e.push(M.default.extend({inclusive:!1,addKeyboardShortcuts(){return{"Mod-k":()=>(t.$emit(`edit-link`),!0)}}}).configure({HTMLAttributes:{class:`d-link d-wb-break-all`},openOnClick:!1,autolink:!this.customLink,protocols:g.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&e.push(this.getExtension($e,this.customLink)),this.linkPhoneNumbers!==null&&e.push(et),this.mentionSuggestion){let t={...this.mentionSuggestion,...Tt};e.push(st.configure({suggestion:t}))}if(this.channelSuggestion){let t={...this.channelSuggestion,...Dt};e.push(dt.configure({suggestion:t}))}if(this.slashCommandSuggestion){let t={...this.slashCommandSuggestion,...jt};e.push(gt.configure({suggestion:t,onSelectedCommand:e=>{this.$emit(`selected-command`,e)}}))}return this.allowVariable&&e.push(xt.configure({variableItems:this.variableItems})),e.push(Ge),this.allowTextAlign&&e.push(I.default.configure({types:[`paragraph`]})),this.allowCode&&e.push(w.default),this.allowCodeblock&&e.push(C.default.extend({renderText({node:e,pos:t,range:n}){let r=n?.from??0,i=n?.to??t+e.nodeSize;if(r<=t&&i>=t+e.nodeSize)return`\`\`\`\n${e.textContent}\n\`\`\``;let a=Math.max(0,r-t-1),o=Math.min(e.textContent.length,i-t-1);return e.textContent.slice(a,o)},addCommands(){return{...this.parent?.(),toggleCodeBlock:(e={})=>({state:t,chain:n,commands:r})=>{let i=t.schema.nodes[this.name],{$from:a,$to:o}=t.selection,s=[];return t.doc.nodesBetween(a.pos,o.pos,(e,t)=>{if(e.isTextblock)return s.push({node:e,pos:t}),!1}),s.length<=1?r.toggleNode(this.name,`paragraph`,e):s.every(({node:e})=>e.type===i)?r.toggleNode(this.name,`paragraph`):n().setNode(this.name,e).command(({tr:e})=>{for(let n=s.length-1;n>0;n--){let r=e.mapping.map(s[n].pos),a=r-1;e.doc.resolve(a).parent.type===i&&e.replaceWith(a,r+1,t.schema.text(`
2
- `))}return!0}).run()}}}}).configure({HTMLAttributes:{class:`d-rich-text-editor__code-block`}})),this.allowInlineImages&&e.push(tt.configure({resize:{enabled:this.allowImageResize,alwaysPreserveAspectRatio:!0}})),(this.allowFontFamily||this.allowFontColor||this.allowFontSize||this.allowBackgroundColor||this.allowLineHeight)&&(e.push(R.TextStyleKit.configure({textStyle:!1,color:this.allowFontColor,backgroundColor:this.allowBackgroundColor,fontFamily:this.allowFontFamily,fontSize:this.allowFontSize,lineHeight:this.allowLineHeight})),e.push(ge)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),this.allowTables&&e.push(fe.configure({resizable:!0}),pe,he,me,E.Gapcursor),e},inputAttrs(){let e={"aria-label":this.inputAriaLabel,"aria-multiline":!0,role:`textbox`};return this.editable||(e[`aria-readonly`]=!0),e}},watch:{editable(e){this.editor.setEditable(e),this.updateEditorAttributes({"aria-readonly":!e})},inputClass(e){this.updateEditorAttributes({class:e})},inputAriaLabel(e){this.updateEditorAttributes({"aria-label":e})},extensions(){this.destroyEditor(),this.createEditor()},modelValue(e){this.processValue(e)},linkPhoneNumbers(){this._applyPhoneMarks()}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},mounted(){t.warnIfUnmounted(t.returnFirstEl(this.$el),this.$options.name),this.processValue(this.modelValue,!1)},methods:{createEditor(){this.editor=new m.Editor({autofocus:this.autoFocus,content:this.modelValue,editable:this.editable,extensions:this.extensions,shouldRerenderOnTransaction:!1,parseOptions:{preserveWhitespace:this.preserveWhitespace},editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handleDOMEvents:{click:(e,t)=>{if(!this.link||t.button!==0)return!1;let n=t.target?.closest?.(`a`);return n?(this.editor.emit(`link-click`,{href:n.href,text:n.textContent,event:t}),t.defaultPrevented):!1}},handleKeyDown:(e,t)=>{if(this.allowTyping)return!1;let n=[`Backspace`];return!this.allowLineBreaks&&!t.shiftKey&&n.push(`Enter`),!n.includes(t.key)},handlePaste:(e,t)=>{let n=t.clipboardData||window.clipboardData,r=n.getData(`text/plain`),i=n.getData(`text/html`);return this.processPasteData(e,r,i)},transformPastedHTML(e){return e.replace(/<hr[^>]*\/?>/gi,`<p><br></p>`).replace(/(<\/\w+>)((<br \/>)+)/g,`$2$1`).replace(/(<br[^>]*>\s*)+<\/p>(\s*)$/i,`</p>$2`)}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e}){return this.showLinkBubbleMenu&&e.isActive(`link`)},getSelectedLinkText(e){let{view:t,state:n}=e,{from:r,to:i}=t.state.selection,a=n.doc.textBetween(r,i,``),o=this.editor.state.doc.nodeAt(r);return o&&o.marks?.at(0)?.type?.name===`link`?o.textContent:a},editLink(){let e=this.getSelectedLinkText(this.editor),t={href:this.editor.getAttributes(`link`).href,text:e};this.$emit(`edit-link`,t)},removeLink(){this.editor?.chain()?.focus()?.unsetLink()?.run()},openLink(){this.editor?.chain()?.focus();let e=this.editor.getAttributes(`link`).href;window.open(e,`_blank`)},forceLinkifyPendingText(){!this.editor||!this.link||this.customLink||te.t(this.editor)},setLink(e,t,n,r=g.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){if(!e){this.removeLink();return}r.find(t=>t.test(e))||(e=`${i}${e}`),this.editor.chain().focus().extendMarkRange(`link`).run();let a=this.editor?.view?.state?.selection,o=t||e;this.editor.chain().focus().insertContent(o).setTextSelection({from:a.from,to:a.from+o.length}).setLink({href:e,class:n.class}).run()},processValue(e,t=!0){if(!this.editor)return;let n=this.getOutput();if(!(t&&(0,W.default)(e,n))){if(typeof e==`string`&&this.outputFormat===`text`){let t=RegExp(`(${y.emojiPattern})`,`g`);e=e?.replace(t,`<emoji-component code="$1"></emoji-component>`)}this.editor.commands.setContent(e,{emitUpdate:!1,parseOptions:{preserveWhitespace:this.preserveWhitespace}}),this._applyPhoneMarks()}},_applyPhoneMarks(){if(!this.editor)return;let e=this.editor.schema.marks.LinkPhoneNumbers;if(!e)return;let{tr:t,doc:n}=this.editor.state;t.removeMark(0,n.content.size,e),this.linkPhoneNumbers?.length&&n.descendants((n,r)=>{if(!(!n.isText||!n.text))for(let i of this.linkPhoneNumbers){let a=0,o;for(;(o=n.text.indexOf(i,a))!==-1;)t.addMark(r+o,r+o+i.length,e.create()),a=o+i.length}}),this.editor.view.dispatch(t)},destroyEditor(){this.editor.destroy()},insertPlainTextWithHardBreaks(e,t){let n=(this.pasteRichText?t:t.replace(/\r\n/g,`
3
- `).replace(/\n\n/g,`
4
- `)).replace(/[\r\n]+$/,``).split(/\r?\n/),r=[];for(let e=0;e<n.length;e++)e>0&&r.push({type:`hardBreak`}),n[e]&&r.push({type:`text`,text:n[e]});this.editor.chain().focus().insertContent(r).run()},shouldPreserveLineBreaks(e,t){return this.pasteRichText?!t&&e&&this.hasBlankLines(e):!!e},processPasteData(e,t,n){if(this.shouldPreserveLineBreaks(t,n))return this.insertPlainTextWithHardBreaks(e,t),!0;if(this.shouldHandlePreformattedHTML(n)){let t=this.extractPreformattedText(n);if(t&&t.includes(`
5
- `))return this.insertPlainTextWithHardBreaks(e,t),!0}return!1},shouldHandlePreformattedHTML(e){return this.pasteRichText&&e&&this.containsPreformattedContent(e)},containsPreformattedContent(e){let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelectorAll(`*`);for(let e of n)if(this.hasPreWhitespace(e)&&this.hasLineBreaks(e))return!0;return!1},hasPreWhitespace(e){let t=e.getAttribute(`style`)||``,n=e.style.whiteSpace||``,r=n===`pre`||n===`pre-wrap`,i=t.includes(`white-space: pre`);return r||i},hasLineBreaks(e){return e.textContent&&e.textContent.includes(`
6
- `)},hasBlankLines(e){return e.includes(`
7
-
8
- `)||/\n\s*\n/.test(e)},extractPreformattedText(e){let t=document.createElement(`div`);return t.innerHTML=e,this.walkAndExtractText(t)},walkAndExtractText(e){let t=``;if(e.nodeType===Node.TEXT_NODE)t+=e.textContent;else if(e.nodeType===Node.ELEMENT_NODE)if(this.hasPreWhitespace(e))t+=e.textContent;else for(let n of e.childNodes)t+=this.walkAndExtractText(n);return t},triggerInputChangeEvents(){let e=this.getOutput();this.$emit(`update:modelValue`,e);let t=this.editor.getJSON();this.$emit(`json-input`,t);let n=this.editor.getHTML();this.$emit(`html-input`,n);let r=this.editor.getText({blockSeparator:`
9
- `});this.$emit(`text-input`,r);let i=_.t(t,this.extensions);this.$emit(`markdown-input`,i)},addEditorListeners(){this.editor.on(`create`,()=>{this.triggerInputChangeEvents()}),this.editor.on(`update`,()=>{this.triggerInputChangeEvents()}),this.editor.on(`selectionUpdate`,({editor:e})=>{this.$emit(`selected`,this.getSelectedLinkText(e))}),this.editor.on(`focus`,({event:e})=>{this.$emit(`focus`,e)}),this.editor.on(`blur`,({event:e})=>{this.$emit(`blur`,e)}),this.editor.on(`mention-click`,e=>{this.$emit(`mention-click`,e)}),this.editor.on(`mention-hover`,e=>{this.$emit(`mention-hover`,e)}),this.editor.on(`mention-leave`,e=>{this.$emit(`mention-leave`,e)}),this.editor.on(`channel-click`,e=>{this.$emit(`channel-click`,e)}),this.editor.on(`phone-click`,e=>{this.$emit(`phone-click`,e)}),this.editor.on(`link-click`,e=>{this.$emit(`link-click`,e)})},getOutput(){switch(this.outputFormat){case`json`:return this.editor.getJSON();case`html`:return this.editor.getHTML();case`markdown`:return _.t(this.editor.getJSON(),this.extensions);default:return this.editor.getText({blockSeparator:`
10
- `})}},getExtension(e,t){return typeof t==`boolean`?e:e.configure?.(t)},updateEditorAttributes(e){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...e}}})},focusEditor(){this.editor.commands.focus()}}},Nt={class:`d-popover__dialog`};function Pt(e,t,n,r,i,a){let o=(0,v.resolveComponent)(`dt-button`),s=(0,v.resolveComponent)(`dt-stack`),c=(0,v.resolveComponent)(`bubble-menu`),l=(0,v.resolveComponent)(`editor-content`);return(0,v.openBlock)(),(0,v.createElementBlock)(`div`,null,[i.editor&&n.link?((0,v.openBlock)(),(0,v.createBlock)(c,{key:0,editor:i.editor,"should-show":a.bubbleMenuShouldShow,options:i.floatingOptions,"append-to":i.appendTo,style:{visibility:`visible`}},{default:(0,v.withCtx)(()=>[(0,v.createElementVNode)(`div`,Nt,[(0,v.createVNode)(s,{direction:`row`,class:`d-rich-text-editor-bubble-menu__button-stack`,gap:`0`},{default:(0,v.withCtx)(()=>[(0,v.createVNode)(o,{kind:`muted`,importance:`clear`,onClick:a.editLink},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(i.i18n.$t(`DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL`)),1)]),_:1},8,[`onClick`]),(0,v.createVNode)(o,{kind:`muted`,importance:`clear`,onClick:a.openLink},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(i.i18n.$t(`DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL`)),1)]),_:1},8,[`onClick`]),(0,v.createVNode)(o,{kind:`critical`,importance:`clear`,onClick:a.removeLink},{default:(0,v.withCtx)(()=>[(0,v.createTextVNode)((0,v.toDisplayString)(i.i18n.$t(`DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL`)),1)]),_:1},8,[`onClick`])]),_:1})])]),_:1},8,[`editor`,`should-show`,`options`,`append-to`])):(0,v.createCommentVNode)(``,!0),(0,v.createVNode)(l,(0,v.mergeProps)({ref:`editor`,editor:i.editor,class:`d-rich-text-editor`,"data-qa":`dt-rich-text-editor`},a.attrs),null,16,[`editor`])])}var Ft=n.t(Mt,[[`render`,Pt]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return Ft}});
11
- //# sourceMappingURL=RichTextEditor-ECmStZDK.cjs.map
@@ -1,2 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./_plugin-vue_export-helper-D8jCH6HB.cjs`);let n=require(`vue`);var r={__name:`CoreScroller`,props:{items:{type:Array,required:!0},keyField:{type:String,default:`id`},direction:{type:String,default:`vertical`,validator:e=>[`vertical`,`horizontal`].includes(e)},itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:`size`},buffer:{type:Number,default:200},enableHover:{type:Boolean,default:!0},listTag:{type:String,default:`div`},itemTag:{type:String,default:`div`},listClass:{type:[String,Object,Array],default:``},itemClass:{type:[String,Object,Array],default:``}},emits:[`user-position`,`scroll-start`,`scroll-end`],setup(e,{expose:t,emit:r}){let i=e,a=r,o=(0,n.reactive)(new Map),s=(0,n.reactive)(new Map),c=(0,n.ref)([]),l=(0,n.ref)(null),u=(0,n.ref)(!1),d=(0,n.ref)(null),f=(0,n.ref)(null),p=(0,n.ref)(null),m=(0,n.ref)(`blockStart`),h=0,g=0,_=!1,v=0,y=null,b=null,x=0,S=0,C=(0,n.computed)(()=>{if(i.itemSize===null){let e={"-1":{accumulator:0}},t=i.items,n=i.sizeField,r=i.minItemSize,a=1e4,o=0,s;for(let i=0,c=t.length;i<c;i++)s=t[i][n]||r,s<a&&(a=s),o+=s,e[i]={accumulator:o,size:s};return b=a,e}return[]}),w=(0,n.computed)(()=>i.items.length&&typeof i.items[0]!=`object`),T=(0,n.computed)(()=>{let e={};for(let t=0,n=i.items.length;t<n;t++)e[i.items[t][i.keyField]]=t;return e});(0,n.watch)(C,()=>{j(!1)},{deep:!0}),(0,n.onMounted)(()=>{(0,n.nextTick)(()=>{j(!0),u.value=!0})});let E=(e,t,r,i,a)=>{let o=(0,n.shallowReactive)({item:r,position:0,nr:(0,n.markRaw)({id:S++,index:t,used:!0,key:i,type:a})});return e.value.push(o),o},D=(e,t=!1)=>{let n=s,r=e.nr.type,i=n.get(r);i||(i=[],n.set(r,i)),i.push(e),t||(e.nr.used=!1,e.position=-9999)},O=()=>{let e=i.direction===`vertical`,t;return t=e?{start:d.value.scrollTop,end:d.value.scrollTop+d.value.clientHeight}:{start:d.value.scrollLeft,end:d.value.scrollLeft+d.value.clientWidth},t},k=()=>{throw setTimeout(()=>{console.error(`It seems the scroller element isn't scrolling, so it tries to render all the items at once.`,`Scroller:`,d),console.error(`Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.`)}),Error(`Rendered items limit reached`)},A=()=>{c.value.sort((e,t)=>e.nr.index-t.nr.index)},j=(e,t=!1)=>{if(!d.value)return;let n=i.itemSize,r=b,l=w.value?null:i.keyField,u=i.items,m=u.length,_=C.value,S=o,j=s,M=c,N=T,P,F,I,L,R;if(!m)P=F=L=R=I=0;else{let e=O();if(t){let t=e.start-v.value;if(t<0&&(t=-t),n===null&&t<r.value||t<n)return{continuous:!0}}v=e.start;let a=i.buffer;e.start-=a,e.end+=a;let o=i.direction===`vertical`?`scrollHeight`:`scrollWidth`;if(f.value&&(e.start-=f.value[o]),p.value&&(e.end+=p.value[o]),n===null){let t,n=0,r=m-1,i=~~(m/2),a;do a=i,t=_[i]?.accumulator,t<e.start?n=i:i<m-1&&_[i+1]?.accumulator>e.start&&(r=i),i=~~((n+r)/2);while(i!==a);for(i<0&&(i=0),P=i,I=_[m-1]?.accumulator,F=i;F<m&&_[F]?.accumulator<e.end;F++);for(F===-1?F=u.length-1:(F++,F>m&&(F=m)),L=h;L<m&&_[L]?.accumulator<e.start;L++);for(R=L;R<m&&_[R]?.accumulator<e.end;R++);}else{P=~~(e.start/n);let t=P%1;P-=t,F=Math.ceil(e.end/n),L=Math.max(0,Math.floor(e.start/n)),R=Math.floor(e.end/n),P<0&&(P=0),F>m&&(F=m),L<0&&(L=0),R>m&&(R=m),I=Math.ceil(m/1)*n}}F-P>1e3&&k(),x=I;let z,B=P<=g&&F>=P;if(B)for(let t=0,n=M.value.length;t<n;t++)z=M.value[t],z?.nr.used&&(e&&(z.nr.index=N[z.item[l]]),(z.nr.index==null||z.nr.index<P||z.nr.index>=F)&&D(z));let V=B?null:new Map,H,U,W;for(let e=P;e<F;e++){H=u[e];let t=l?H?.[l]:H;if(t==null)throw Error(`Key is ${t} on item (keyField is '${l}')`);if(z=S.get(t),!n&&!_[e]?.size){z&&D(z);continue}U=H.type;let r=j.get(U),i=!1;if(!z)B?z=r&&r.length?r.pop():E(M,e,H,t,U):(W=V.get(U)||0,(!r||W>=r.length)&&(z=E(M,e,H,t,U),D(z,!0),r=j.get(U)),z=r[W],V.set(U,W+1)),S.delete(z.nr.key),z.nr.used=!0,z.nr.index=e,z.nr.key=t,z.nr.type=U,S.set(t,z),i=!0;else if(!z.nr.used&&(z.nr.used=!0,i=!0,r)){let e=r.indexOf(z);e!==-1&&r.splice(e,1)}z.item=H,i&&(e===u.length-1&&a(`scroll-end`),e===0&&a(`scroll-start`)),n===null?(z.position=_[e-1]?.accumulator,z.offset=0):(z.position=Math.floor(e)*n,z.offset=e%1*n)}return h=P,g=F,clearTimeout(y),y=setTimeout(A,300),{continuous:B}},M=e=>{let t=i.direction===`vertical`?{scroll:`scrollTop`,start:`top`}:{scroll:`scrollLeft`,start:`left`},n=d.value,r=t.scroll;n[r]=e},N=e=>{let t;t=i.itemSize===null?e>0?C.value[e-1]?.accumulator:0:Math.floor(e)*i.itemSize,M(t)},P=()=>{let e=d.value;m.value!==`middle`&&(m.value=`middle`,a(`user-position`,`middle`)),e.scrollTop===0&&(m.value=`blockStart`,a(`user-position`,`blockStart`),a(`user-position`,`top`)),e.scrollTop+e.clientHeight===e.scrollHeight&&(m.value=`blockEnd`,a(`user-position`,`blockEnd`),a(`user-position`,`bottom`)),_||(_=!0,requestAnimationFrame(()=>{_=!1,j(!1,!0)}))};return t({scrollToItem:N,_updateVisibleItems:j}),(t,r)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{ref_key:`scroller`,ref:d,class:(0,n.normalizeClass)([`vue-recycle-scroller`,{ready:u.value,[`direction-${e.direction}`]:!0}]),onScrollPassive:P},[t.$slots.before?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:0,ref_key:`before`,ref:f,"data-qa":`dt-scroller-before`,class:`vue-recycle-scroller__slot`},[(0,n.renderSlot)(t.$slots,`before`)],512)):(0,n.createCommentVNode)(``,!0),((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.listTag),{ref:`wrapper`,style:(0,n.normalizeStyle)({[e.direction===`vertical`?`minHeight`:`minWidth`]:`${(0,n.unref)(x)}px`}),"data-qa":`dt-scroller-item-wrapper`,class:(0,n.normalizeClass)([`vue-recycle-scroller__item-wrapper`,e.listClass])},{default:(0,n.withCtx)(()=>[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(c.value,r=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.itemTag),(0,n.mergeProps)({key:r.nr.id,"data-qa":`dt-scroller-item`,style:u.value?{transform:`translate${e.direction===`vertical`?`Y`:`X`}(${r.position}px) translate${e.direction===`vertical`?`X`:`Y`}(${r.offset}px)`,width:void 0,height:void 0}:null,class:[`vue-recycle-scroller__item-view`,[e.itemClass,{hover:i.enableHover&&l.value===r.nr.key}]]},(0,n.toHandlers)(i.enableHover?{mouseenter:()=>{l.value=r.nr.key},mouseleave:()=>{l.value=null}}:{})),{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`default`,{item:r.item,index:r.nr.index,active:r.nr.used})]),_:2},1040,[`style`,`class`]))),128)),e.items.length?(0,n.createCommentVNode)(``,!0):(0,n.renderSlot)(t.$slots,`empty`,{key:0})]),_:3},8,[`style`,`class`])),t.$slots.after?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:1,ref_key:`after`,ref:p,"data-qa":`dt-scroller-after`,class:`vue-recycle-scroller__slot`},[(0,n.renderSlot)(t.$slots,`after`)],512)):(0,n.createCommentVNode)(``,!0)],34))}},i={name:`DynamicScroller`,components:{CoreScroller:r,DtScrollerItem:{name:`DtScrollerItem`,inject:[`vscrollData`,`vscrollParent`,`vscrollResizeObserver`],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},tag:{type:String,default:`div`}},computed:{id(){if(this.vscrollData.simpleArray)return this.index;if(this.vscrollData.keyField in this.item)return this.item[this.vscrollData.keyField];throw Error(`keyField '${this.vscrollData.keyField}' not found in your item. You should set a valid keyField prop on your Scroller`)},size(){return this.vscrollData.sizes[this.id]||0},finalActive(){return this.active&&this.vscrollData.active}},watch:{watchData:`updateWatchData`,id(t,n){if(e.returnFirstEl(this.$el).$_vs_id=this.id,this.size||this.onDataUpdate(),this.$_sizeObserved){let e=this.vscrollData.sizes[n],r=this.vscrollData.sizes[t];e!=null&&e!==r&&this.applySize(e)}},finalActive(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created(){if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver))for(let e in this.sizeDependencies)this.$watch(()=>this.sizeDependencies[e],this.onDataUpdate)},mounted(){this.finalActive&&(this.updateSize(),this.observeSize())},beforeUnmount(){this.unobserveSize()},methods:{updateSize(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData(){this.watchData&&!this.vscrollResizeObserver?this.$_watchData=this.$watch(`item`,()=>{this.onDataUpdate()},{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate({force:e}){!this.finalActive&&e&&(this.$_pendingVScrollUpdate=this.id),(this.$_forceNextVScrollUpdate===this.id||e||!this.size)&&this.updateSize()},onDataUpdate(){this.updateSize()},computeSize(t){this.$nextTick(()=>{if(this.id===t){let t=e.returnFirstEl(this.$el).offsetWidth,n=e.returnFirstEl(this.$el).offsetHeight;this.applyWidthHeight(t,n)}this.$_pendingSizeUpdate=null})},applyWidthHeight(e,t){let n=~~(this.vscrollParent.direction===`vertical`?t:e);n&&this.size!==n&&this.applySize(n)},applySize(e){this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.vscrollData.sizes[this.id]=e},observeSize(){this.vscrollResizeObserver&&(this.$_sizeObserved||(this.vscrollResizeObserver.observe(e.returnFirstEl(this.$el)),this.$el.$_vs_id=this.id,this.$el.$_vs_onResize=this.onResize,this.$_sizeObserved=!0))},unobserveSize(){this.vscrollResizeObserver&&this.$_sizeObserved&&(this.vscrollResizeObserver.unobserve(e.returnFirstEl(this.$el)),this.$el.$_vs_onResize=void 0,this.$_sizeObserved=!1)},onResize(e,t,n){this.id===e&&this.applyWidthHeight(t,n)}},render(){return(0,n.h)(this.tag,this.$slots.default())}}},provide(){return typeof ResizeObserver<`u`&&(this.$_resizeObserver=new ResizeObserver(e=>{requestAnimationFrame(()=>{if(Array.isArray(e)){for(let t of e)if(t.target&&t.target.$_vs_onResize){let e,n;if(t.borderBoxSize){let r=t.borderBoxSize[0];e=r.inlineSize,n=r.blockSize}else e=t.contentRect.width,n=t.contentRect.height;t.target.$_vs_onResize(t.target.$_vs_id,e,n)}}})})),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},inheritAttrs:!1,props:{items:{type:Array,required:!0},dynamic:{type:Boolean,default:!1},keyField:{type:String,default:`id`},direction:{type:String,default:`vertical`,validator:e=>[`vertical`,`horizontal`].includes(e)},listTag:{type:String,default:`div`},itemTag:{type:String,default:`div`},minItemSize:{type:[Number,String]}},data(){return{vscrollData:{active:!0,sizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{simpleArray(){return this.items.length&&typeof this.items[0]!=`object`},itemsWithSize(){let e=[],{items:t,keyField:n,simpleArray:r}=this,i=this.vscrollData.sizes,a=t.length;for(let o=0;o<a;o++){let a=t[o],s=r?o:a[n],c=i[s];c===void 0&&!this.$_undefinedMap[s]&&(c=0),e.push({item:a,[n]:s,size:c})}return e}},watch:{simpleArray:{handler(e){this.vscrollData.simpleArray=e},immediate:!0},itemsWithSize(t,n){let r=e.returnFirstEl(this.$el).scrollTop,i=0,a=0,o=Math.min(t.length,n.length);for(let e=0;e<o&&!(i>=r);e++)i+=n[e].size||this.minItemSize,a+=t[e].size||this.minItemSize;let s=a-i;s!==0&&(e.returnFirstEl(this.$el).scrollTop+=s)}},beforeCreate(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated(){this.vscrollData.active=!0},deactivated(){this.vscrollData.active=!1},methods:{dynamicScrollerUpdateItems(){let e=this.$refs.scroller;e&&e._updateVisibleItems(!0)},dynamicScrollerUpdateItemsFromBottom(){let e=this.$refs.scroller;e&&e._updateVisibleItems(!1,!0)},scrollToItem(e){let t=this.$refs.scroller;t&&t.scrollToItem(e)},scrollToBottom(){if(this.$_scrollingToBottom)return;this.$_scrollingToBottom=!0;let t=e.returnFirstEl(this.$el);this.$nextTick(()=>{t.scrollTop=t.scrollHeight+5e3;let e=()=>{t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame(()=>{t.scrollTop=t.scrollHeight+5e3,this.$_undefinedSizes===0?this.$_scrollingToBottom=!1:requestAnimationFrame(e)})};requestAnimationFrame(e)})}}};function a(e,t,r,i,a,o){let s=(0,n.resolveComponent)(`dt-scroller-item`),c=(0,n.resolveComponent)(`core-scroller`);return(0,n.openBlock)(),(0,n.createBlock)(c,(0,n.mergeProps)({ref:`scroller`,items:o.itemsWithSize,"min-item-size":r.minItemSize,direction:r.direction,"key-field":r.keyField,"list-tag":r.listTag,"item-tag":r.itemTag},e.$attrs),(0,n.createSlots)({default:(0,n.withCtx)(({item:t,index:r,active:i})=>[(0,n.createVNode)(s,{item:t,active:i,"size-dependencies":[t.message],"data-index":r},{default:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`default`,(0,n.normalizeProps)((0,n.guardReactiveProps)({item:t.item,index:r,active:i,itemWithSize:t})))]),_:2},1032,[`item`,`active`,`size-dependencies`,`data-index`])]),_:2},[e.$slots.before?{name:`before`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`before`)]),key:`0`}:void 0,e.$slots.empty?{name:`empty`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`empty`)]),key:`1`}:void 0,e.$slots.after?{name:`after`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(e.$slots,`after`)]),key:`2`}:void 0]),1040,[`items`,`min-item-size`,`direction`,`key-field`,`list-tag`,`item-tag`])}var o=t.t(i,[[`render`,a]]),s=Object.assign({name:`DtScroller`},{__name:`Scroller`,props:{buffer:{type:Number,default:200},direction:{type:String,default:`vertical`,validator:e=>[`vertical`,`horizontal`].includes(e)},dynamic:{type:Boolean,default:!1},itemSize:{type:Number,default:null},itemTag:{type:String,default:`div`},items:{type:Array,required:!0},keyField:{type:String,default:`id`},listTag:{type:String,default:`div`},minItemSize:{type:[Number,String],default:null},scrollerHeight:{type:[String,Number],default:`100%`},scrollerWidth:{type:[String,Number],default:`100%`}},emits:[`user-position`,`scroll-start`,`scroll-end`],setup(e,{expose:t,emit:i}){let a=e;(0,n.provide)(`emit`,i);let s=(0,n.ref)(null),c=(0,n.computed)(()=>({width:typeof a.scrollerWidth==`number`?`${a.scrollerWidth}px`:a.scrollerWidth,height:typeof a.scrollerHeight==`number`?`${a.scrollerHeight}px`:a.scrollerHeight}));(0,n.watch)(a,()=>{p()},{deep:!0,immediate:!0});function l(){s.value&&s.value.scrollToBottom()}function u(e){s.value&&s.value.scrollToItem(e)}function d(){s.value&&(a.dynamic?s.value.dynamicScrollerUpdateItems():s.value._updateVisibleItems(!0))}function f(){s.value&&(a.dynamic?s.value.dynamicScrollerUpdateItemsFromBottom():s.value._updateVisibleItems(!1,!0))}function p(){a.dynamic&&!a.minItemSize&&console.error(`scroller error: 'minItemSize' is required on 'dynamic' mode.`),!a.dynamic&&!a.itemSize&&console.error(`scroller error: 'itemSize' is required.`)}return t({scrollToBottom:l,scrollToItem:u,updateItems:d,updateItemsFromBottom:f}),(t,i)=>((0,n.openBlock)(),(0,n.createBlock)((0,n.resolveDynamicComponent)(e.dynamic?o:r),{ref_key:`scroller`,ref:s,"data-qa":`dt-scroller`,items:e.items,"item-size":e.itemSize,"min-item-size":e.minItemSize,buffer:e.buffer,direction:e.direction,"key-field":e.keyField,"list-tag":e.listTag,"item-tag":e.itemTag,style:(0,n.normalizeStyle)(c.value),tabindex:`0`,onUserPosition:i[0]||(i[0]=e=>t.$emit(`user-position`,e)),onScrollStart:i[1]||(i[1]=e=>t.$emit(`scroll-start`)),onScrollEnd:i[2]||(i[2]=e=>t.$emit(`scroll-end`))},(0,n.createSlots)({default:(0,n.withCtx)(({item:e,index:r,active:i})=>[(0,n.renderSlot)(t.$slots,`default`,(0,n.normalizeProps)((0,n.guardReactiveProps)({item:e,index:r,active:i})))]),_:2},[t.$slots.before?{name:`before`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`before`)]),key:`0`}:void 0,t.$slots.empty?{name:`empty`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`empty`)]),key:`1`}:void 0,t.$slots.after?{name:`after`,fn:(0,n.withCtx)(()=>[(0,n.renderSlot)(t.$slots,`after`)]),key:`2`}:void 0]),1064,[`items`,`item-size`,`min-item-size`,`buffer`,`direction`,`key-field`,`list-tag`,`item-tag`,`style`]))}});Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
2
- //# sourceMappingURL=Scroller-EIHN3a26.cjs.map
@@ -1,2 +0,0 @@
1
- require(`./chunk-Bmb41Sf3.cjs`);const e=require(`./common/utils/index.cjs`),t=require(`./lib/text/text-constants.cjs`),n=require(`./Text-DNVNZree.cjs`),r=require(`./floating-ui.dom-n1CheoWj.cjs`),i=require(`./lib/slider/utils.cjs`);let a=require(`vue`);var o=[`horizontal`,`vertical`],s=[`always`,`never`,`tooltip`],c=[`start`,`end`],l=10,u=32,d=0;function f(e,{isRange:t,hasAccessibleName:n}){process.env.NODE_ENV!==`production`&&((0,a.watch)(()=>t.value&&!e.getValueText,e=>{e&&console.info(`[Dialtone] DtSlider in range mode: provide getValueText to give each thumb a distinct screen-reader description.`)},{immediate:!0}),(0,a.watch)(()=>n.value,e=>{e||console.info(`[Dialtone] DtSlider: provide a label prop (set showLabel to false to hide it visually) or aria-label for accessibility.`)},{immediate:!0}),(0,a.watch)(()=>e.minGapSteps!==Math.round(e.minGapSteps),t=>{t&&console.info(`[Dialtone] DtSlider: minGapSteps (${e.minGapSteps}) is not a whole number — it will be rounded to ${Math.round(e.minGapSteps)}.`)},{immediate:!0}),(0,a.watch)(()=>e.min>e.max,t=>{t&&console.info(`[Dialtone] DtSlider: min (${e.min}) is greater than max (${e.max}) — every value will collapse to max.`)},{immediate:!0}))}function p(e){let t=(0,a.ref)(!1);function n(){t.value=!!e.value&&getComputedStyle(e.value).direction===`rtl`}let r=null;return(0,a.onMounted)(()=>{if(n(),typeof MutationObserver<`u`&&e.value){r=new MutationObserver(n);let t={attributes:!0,attributeFilter:[`dir`,`style`,`class`]};for(let n=e.value;n;n=n.parentElement)r.observe(n,t);r.observe(document.documentElement,t)}}),(0,a.onBeforeUnmount)(()=>{r?.disconnect()}),{isRtl:t}}function m(e,t,{isRange:n,activeSnapValue:r}){function i(e,t){return r?.value[e]===t}function o(e){let t=String(e),n=t.search(/e/i);if(n!==-1){let e=t.slice(0,n),r=parseInt(t.slice(n+1),10),i=e.indexOf(`.`),a=i===-1?0:e.length-i-1;return Math.max(0,a-r)}let r=t.indexOf(`.`);return r===-1?0:t.length-r-1}function s(t){return Math.min(e.max,Math.max(e.min,t))}function c(t){if(e.step<=0)return Math.min(e.max,Math.max(e.min,t));let n=Math.round((t-e.min)/e.step),r=Math.max(o(e.min),o(e.step));return Math.min(e.max,Math.max(e.min,parseFloat((e.min+n*e.step).toFixed(r))))}function l(e){return e.length===2&&e[0]>e[1]?[e[1],e[0]]:e}function u(t,n=null){if(t.length!==2)return t;let r=Math.round(e.minGapSteps)*e.step;if(r<=0)return t;let[i,a]=t;if(a-i>=r)return t;n===0?a=Math.min(e.max,i+r):n===1?i=Math.max(e.min,a-r):i+r<=e.max?a=i+r:a-r>=e.min?i=a-r:(a=e.max,i=Math.max(e.min,a-r));let s=Math.max(o(e.min),o(e.max),o(e.step),n===null?0:o(t[n]));return n!==0&&(i=Math.min(e.max,Math.max(e.min,parseFloat(i.toFixed(s))))),n!==1&&(a=Math.min(e.max,Math.max(e.min,parseFloat(a.toFixed(s))))),[i,a]}function d(e,t=null){let n=e.map((e,n)=>n===t||Number.isFinite(e)?e:f());return n=n.map((e,n)=>n===t?e:s(e)),n=n.map((e,n)=>n===t?e:c(e)),n=n.length===2&&t===null?l(n):n,u(n,t)}function f(){return(e.min+e.max)/2}function p(e,t=null){let n;return n=Array.isArray(e)?e.length>=2?[e[0],e[1]]:e.length===1?[e[0]]:[f()]:e==null?[f()]:[e],d(n,t)}let m=(0,a.ref)(p(e.modelValue)),h=(0,a.ref)([...m.value]),g=(0,a.computed)(()=>n.value?[...m.value]:m.value[0]);function _(t){return e.max===e.min?0:(t-e.min)/(e.max-e.min)*100}function v(t,n){if(e.step<=0)return t;let r=(t-e.min)/e.step,i=n?Math.ceil(r-1e-9):Math.floor(r+1e-9);return e.min+i*e.step}function y(t){if(!n.value||t!==1||m.value.length<2)return e.min;let r=Math.round(e.minGapSteps)*e.step,i=Math.min(e.max,m.value[0]+r);return Math.min(e.max,v(i,!0))}function b(t){if(!n.value||t!==0||m.value.length<2)return e.max;let r=Math.round(e.minGapSteps)*e.step,i=Math.max(e.min,m.value[1]-r);return Math.max(e.min,v(i,!1))}function x(t){if(e.step<=0)return`any`;let n=m.value[t];if(n===void 0)return e.step;let r=(n-e.min)/e.step;return Math.abs(r-Math.round(r))>1e-9?`any`:e.step}let S=!1;function C(e){process.env.NODE_ENV===`production`||S||(S=!0,console.info(`[Dialtone] DtSlider: ${e}`))}function w(t,n){if(e.getValueText)try{let r=e.getValueText(t,n);if(typeof r==`string`)return r;C(`getValueText must return a string synchronously (got ${typeof r}) — falling back to the raw value.`)}catch(e){C(`getValueText threw — falling back to the raw value. ${e}`)}return`${e.prefix}${t}${e.suffix}`}return(0,a.watch)(()=>e.modelValue,e=>{if(e==null)return;let n=m.value,r=Array.isArray(e)?e:[e],a=n.findIndex((e,t)=>r[t]===e&&i(t,e)),o=p(e,a===-1?null:a);if(o.length!==n.length||o.some((e,t)=>e!==n[t])){let e=n.length!==h.value.length||n.some((e,t)=>e!==h.value[t]);m.value=o,e||(h.value=[...o])}(o.length!==r.length||o.some((e,t)=>e!==r[t]))&&t(`update:modelValue`,Array.isArray(e)?[...o]:o[0])},{deep:!0}),(0,a.watch)(()=>[e.min,e.max,e.step,e.minGapSteps],()=>{let r=m.value,a=r.length!==h.value.length||r.some((e,t)=>e!==h.value[t]),o=r.findIndex((t,n)=>i(n,t)&&t>=e.min&&t<=e.max),s=d(r,o===-1?null:o);if(s.length!==r.length||s.some((e,t)=>e!==r[t])){m.value=s;let e=n.value?[...s]:s[0];if(t(`update:modelValue`,e),a)return;h.value=[...s],t(`change`,e)}}),(0,a.onMounted)(()=>{if(e.modelValue===void 0||e.modelValue===null)return;let n=Array.isArray(e.modelValue)?e.modelValue:[e.modelValue],r=m.value;(r.length!==n.length||r.some((e,t)=>e!==n[t]))&&t(`update:modelValue`,Array.isArray(e.modelValue)?[...r]:r[0])}),{internalValues:m,lastCommittedValues:h,currentValue:g,decimalPlaces:o,snapToStep:c,thumbPercent:_,thumbNativeMin:y,thumbNativeMax:b,thumbNativeStep:x,formatValue:w}}var h=10,g=2;function _(e,{controlRef:t,isVertical:n}){let r=(0,a.computed)(()=>{if(e.snapPoints==null)return[];if(typeof e.snapPoints==`number`){let t=e.snapPoints;return!Number.isFinite(t)||t<=0?[]:i.generateInterval(e.min,e.max,t,`snapPoints`)}return Array.isArray(e.snapPoints)?e.snapPoints.filter(t=>Number.isFinite(t)&&t>=e.min&&t<=e.max):[]}),o=(0,a.ref)({});function s(i,a){let s=r.value;if(!s.length||!t.value)return delete o.value[a],null;let c=t.value.getBoundingClientRect(),l=n.value?c.height:c.width;if(!l)return null;let u=h/l*(e.max-e.min),d=o.value[a];if(d!=null&&s.includes(d)){let e=u*g;if(Math.abs(d-i)<=e)return d}let f=null,p=1/0;for(let e of s){let t=Math.abs(e-i);t<=u&&t<p&&(f=e,p=t)}return f==null?delete o.value[a]:o.value[a]=f,f}return{activeSnapValue:o,findMagneticSnapPoint:s}}var v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`]);function y(e,t,{controlRef:n,thumbRefs:r,internalValues:o,isRange:s,isVertical:c,decimalPlaces:l,snapToStep:u,lastCommittedValues:d,findMagneticSnapPoint:f,activeSnapValue:p,isRtl:m}){let h=(0,a.ref)(!1),g=(0,a.ref)(null),_=(0,a.ref)(null),y=(0,a.ref)(null),b=(0,a.ref)(null),x=(0,a.ref)(null),S=!1,C=null,w=!1;(0,a.watch)(()=>e.disabled,e=>{e&&(y.value=null,b.value=null)}),(0,a.watch)(()=>o.value.length,(e,t)=>{let n=y.value===1||document.activeElement===r.value[1];e===1&&t===2&&n&&(0,a.nextTick)(()=>r.value[0]?.focus()),g.value!==null&&g.value>=e&&(g.value=null)});function T(n,i,{allowSnap:a=!1}={}){let c=Math.min(e.max,Math.max(e.min,i)),d=a?f(c,n):null;c=d??u(c);let m=[...o.value];if(s.value){let t=Math.max(0,Math.round(e.minGapSteps)*e.step);if(c=n===0?Math.min(c,(m[1]??e.max)-t):Math.max(c,(m[0]??e.min)+t),!(d!=null&&c===d)){let t=Math.max(l(e.min),l(e.step));c=parseFloat(c.toFixed(t)),c=Math.min(e.max,Math.max(e.min,c))}d!=null&&c!==d&&delete p.value[n]}if(m[n]===c){let e=r.value[n];e&&e.value!==String(c)&&(e.value=String(c));return}m[n]=c,o.value=m,t(`update:modelValue`,s.value?[...m]:m[0])}function E(){let e=o.value,n=d.value;(e.length!==n.length||e.some((e,t)=>e!==n[t]))&&(d.value=[...e],t(`change`,s.value?[...e]:e[0]))}let D=0;function O(t){let r=n.value.getBoundingClientRect(),i=c.value?r.height:r.width,a=i-2*D,o;if(c.value){let e=r.bottom-t.clientY;o=a>0?(e-D)/a:e/i}else{let e=t.clientX-r.left;o=a>0?(e-D)/a:e/i,m.value&&(o=1-o)}return o=Math.min(1,Math.max(0,o)),e.min+o*(e.max-e.min)}function k(e){if(!s.value||o.value.length<2)return 0;let[t,n]=o.value;return t===n?_.value===0?1:0:Math.abs(e-t)<=Math.abs(e-n)?0:1}function A(e,t){if(!s.value)return e;let[n,r]=o.value;return n===r?e===0&&t>n?1:e===1&&t<r?0:e:e}function j(t){if(e.disabled||t.pointerType===`mouse`&&t.button!==0||h.value&&t.pointerId!==C)return;t.preventDefault(),D=i.measureEdgeInsetPx(n.value);let a=O(t),c=k(a),[l,u]=o.value;w=s.value&&o.value.length===2&&l===u,x.value===c&&(x.value=null),g.value=c,_.value=c,h.value=!0,C=t.pointerId,n.value.setPointerCapture(t.pointerId),b.value=null,T(c,a,{allowSnap:!0});let d=r.value[c];d&&document.activeElement!==d?(S=!0,d.focus()):y.value===c&&(y.value=null)}function M(t){if(!h.value||g.value===null||t.pointerId!==C)return;if(e.disabled){P();return}if(t.buttons===0){P();return}let n=O(t),r=w?A(g.value,n):g.value;r!==g.value&&(delete p.value[g.value],x.value===r&&(x.value=null),g.value=r,_.value=r),T(r,n,{allowSnap:!0})}function N(t){if(e.step<=0)return!1;let n=(t-e.min)/e.step;return Math.abs(n-Math.round(n))>1e-9}function P(e){if(!h.value||e&&e.pointerId!==C)return;h.value=!1,C=null;let t=g.value;t!==null&&N(o.value[t])&&T(t,o.value[t]),E(),g.value=null,p.value={}}function F(e,t){T(e,Number(t.target.value))}function I(e,t,n,r){return e===`PageUp`?1:e===`PageDown`?-1:t?e===`ArrowUp`||e===n?1:e===`ArrowDown`||e===r?-1:0:0}function L(){return e.step<=0?e.largeStep:Math.max(1,Math.round(e.largeStep/e.step))*e.step}function R(e,t){y.value!==e&&(y.value=e);let n=m.value,r=n?`ArrowLeft`:`ArrowRight`,i=n?`ArrowRight`:`ArrowLeft`,a=I(t.key,t.shiftKey,r,i);a!==0&&(t.preventDefault(),T(e,o.value[e]+a*L())),t.key===`Escape`?x.value=e:v.has(t.key)&&x.value===e&&(x.value=null)}function z(e,n){S?S=!1:(x.value===e&&(x.value=null),y.value=e),t(`focus`,n)}function B(e,n){y.value=null,E(),t(`blur`,n)}function ee(e){x.value===e&&(x.value=null),b.value=e}function te(e){b.value===e&&(b.value=null)}function V(t){return e.readout===`always`?!0:x.value===t?!1:g.value===t||y.value===t||b.value===t}return{isDragging:h,activeThumbIndex:g,focusedThumbIndex:y,hoveredThumbIndex:b,updateThumbValue:T,commitIfChanged:E,onPointerDown:j,onPointerMove:M,onPointerUp:P,onThumbInput:F,onThumbKeydown:R,onThumbFocus:z,onThumbBlur:B,onThumbHitPointerEnter:ee,onThumbHitPointerLeave:te,isReadoutOpen:V}}function b(e,{isVertical:t,isRange:n,internalValues:r,thumbPercent:i,isRtl:o,markEdgeOffsetPx:s,formatValue:c}){function l(e,n){let r=t.value?{bottom:`${e}%`}:{insetInlineStart:`${e}%`};return n&&(r.transform=n),r}function u(){return o.value?`50%`:`-50%`}let d=`var(--slider-edge-inset)`,f=`calc(${d} + (100% - ${d} * 2) * `;function p(e){return`${f}${e/100})`}function m(e){return`calc((100% - ${d} * 2) * ${e/100})`}function h(e,{verticalTransform:n,horizontalTransform:r}){let a=i(e);return t.value?{bottom:p(a),transform:n}:{insetInlineStart:p(a),transform:r}}function g(e){return h(e,{verticalTransform:`translate(${u()}, 50%)`,horizontalTransform:`translate(${u()}, -50%)`})}function _(e){return h(e,{verticalTransform:`translateY(50%)`,horizontalTransform:`translateX(${u()})`})}function v(e){let t=o.value?-1:1;return e===`start`?`translateX(${t}px)`:`translateX(calc(${o.value?`100%`:`-100%`} + ${-t}px))`}function y(e,n){let r=t.value?{bottom:p(e)}:{insetInlineStart:p(e)};return n&&(r.transform=n),r}function b(e,n,r){if(r&&!t.value)return l(e,v(r));let i=t.value?0:s.value[n];return i?y(e,`translateX(calc(${u()} + ${i}px))`):y(e)}function x(e,n,r){if(r&&!t.value)return l(e,v(r));let i=t.value?0:n;return i?y(e,`translateX(calc(${u()} + ${i}px))`):y(e)}return{thumbPositionStyle:g,tickPositionStyle:_,markStyle:b,readoutStyle:x,mergedReadoutPct:(0,a.computed)(()=>{if(!n.value||r.value.length!==2)return 0;let[e,t]=r.value;return(i(e)+i(t))/2}),mergedReadoutText:(0,a.computed)(()=>{if(!n.value||r.value.length!==2)return``;let[e,t]=r.value;return`${c(e,0)}–${c(t,1)}`}),indicatorStyle:(0,a.computed)(()=>{if(n.value&&r.value.length===2){let[e,n]=r.value,a=i(e),o=i(n);return t.value?{bottom:p(a),height:m(o-a)}:{insetInlineStart:p(a),width:m(o-a)}}let a=i(r.value[0]??e.min);if(typeof e.fillOrigin==`number`){let n=i(Math.min(e.max,Math.max(e.min,e.fillOrigin))),r=Math.min(a,n),o=Math.abs(a-n);return t.value?{bottom:p(r),height:m(o)}:{insetInlineStart:p(r),width:m(o)}}let o=e.fillOrigin===`end`;return t.value?o?{top:0,height:`calc(100% - ${p(a)})`}:{bottom:0,height:p(a)}:o?{insetInlineEnd:0,width:`calc(100% - ${p(a)})`}:{insetInlineStart:0,width:p(a)}})}}function x(e,{isVertical:t,thumbPercent:n}){let r=(0,a.computed)(()=>{let t=typeof e.showTicks==`number`?e.showTicks:e.step;return!t||t<=0?[]:i.generateInterval(e.min,e.max,t,`ticks`)});function o(t){return`${e.prefix}${t}${e.suffix}`}let s=(0,a.computed)(()=>{let t=e.showMarks===!0?[e.min,e.max]:e.showMarks;return Array.isArray(t)?t.filter(i.isValidMark).map(t=>{let r=typeof t==`number`?t:t.value,i=typeof t==`number`?o(t):t.text??o(r),a=r===e.min?`start`:r===e.max?`end`:null;return{text:i,pct:n(r),edge:a}}):[]});return{computedTickValues:r,computedMarks:s,reservesAnnotationSpace:(0,a.computed)(()=>!t.value&&(s.value.length>0||e.readout===`always`))}}function S(e,{controlRef:t,isVertical:n,isRange:r,internalValues:o,thumbPercent:s,isRtl:c,isReadoutOpen:l,computedMarks:u,formatValue:d}){let f=(0,a.ref)([]),p=(0,a.ref)([]),m=(0,a.ref)(null),h=(0,a.ref)([]),g=(0,a.ref)([]),_=(0,a.ref)(!1),v=(0,a.ref)([]),y=(0,a.ref)([]),b=(0,a.ref)(0);function x(e,t,n=0){return!(e.right+n<t.left||e.left-n>t.right||e.bottom+n<t.top||e.top-n>t.bottom)}let S=0,C=0;function w(e,r){if(!r||!t.value)return null;let a=r.getBoundingClientRect(),o=t.value.getBoundingClientRect(),s=C;if(n.value){let t=a.bottom-a.top,n=s+(o.bottom-o.top-2*s)*(e/100),r=o.bottom-n;return{left:a.left,right:a.right,top:r-t/2,bottom:r+t/2}}let l=a.right-a.left,u=s+(o.right-o.left-2*s)*(i.mirrorPct(e,c.value)/100),d=o.left+u;return{left:d-l/2,right:d+l/2,top:a.top,bottom:a.bottom}}function T(e){return p.value.find(t=>t&&Number(t.dataset.readoutIndex)===e)}function E(t,n){return e.readout===`tooltip`?h.value[n]?.getBoundingClientRect()??null:w(s(t),T(n))}async function D(){let n=++S;if(await(0,a.nextTick)(),n!==S)return;t.value&&(C=i.measureEdgeInsetPx(t.value));let c=_.value;if(e.readout!==`tooltip`&&r.value&&o.value.length===2&&l(0)&&l(1)){let[e,t]=o.value,n=w(s(e),T(0)),r=w(s(t),T(1));_.value=!!(n&&r&&x(n,r,4))}else _.value=!1;_.value!==c&&(await(0,a.nextTick)(),n!==S)||(j(),O())}function O(){let r=e.readout===`always`&&!!t.value&&!n.value,a=r?t.value.getBoundingClientRect():null;function s(e,t){if(!e||!r)return 0;let n=e.getBoundingClientRect();return i.edgeClampOffset(n.left-t,n.right-t,a,0)}function c(){let e=s(m.value,b.value);e!==b.value&&(b.value=e),y.value.some(Boolean)&&(y.value=o.value.map(()=>0))}function u(){b.value&&(b.value=0);let e=o.value.map((e,t)=>l(t)?s(T(t),y.value[t]||0):0);i.sameValues(e,y.value)||(y.value=e)}_.value?c():u()}function k(){let[e,t]=o.value;return(s(e)+s(t))/2}function A(){if(_.value){let e=w(k(),m.value);return e?[e]:[]}return o.value.map((e,t)=>l(t)?E(e,t):null).filter(Boolean)}function j(){let e=f.value;if(!e.length)return;let r=A(),a=u.value.map(()=>!1),o=u.value.map(()=>0),s=!!t.value&&!n.value,c=s?t.value.getBoundingClientRect():null;e.forEach(e=>{if(!e)return;let t=Number(e.dataset.markIndex),n=v.value[t]||0,l=e.getBoundingClientRect(),u=l.left-n,d=l.right-n,f=s?i.edgeClampOffset(u,d,c,32):0;if(o[t]=f,r.length){let e={top:l.top,bottom:l.bottom,left:u+f,right:d+f};a[t]=r.some(t=>x(e,t,4))}}),i.sameValues(a,g.value)||(g.value=a),i.sameValues(o,v.value)||(v.value=o)}let M=(0,a.computed)(()=>o.value.map((e,t)=>l(t))),N=(0,a.computed)(()=>o.value.map((e,t)=>d(e,t))),P=null;return(0,a.watch)([M,u,n,c],()=>D(),{deep:!0}),(0,a.watch)([o,N,()=>e.readoutClass],()=>{e.readout!==`tooltip`&&D()},{deep:!0}),(0,a.onMounted)(()=>{(0,a.nextTick)(D),typeof ResizeObserver<`u`&&t.value&&(P=new ResizeObserver(()=>{D()}),P.observe(t.value))}),(0,a.onBeforeUnmount)(()=>{P?.disconnect()}),{markElRefs:f,readoutElRefs:p,mergedReadoutElRef:m,tooltipElRefs:h,markCollisionHidden:g,readoutMerged:_,markEdgeOffsetPx:v,readoutEdgeOffsetPx:y,mergedReadoutEdgeOffsetPx:b,readoutVisibility:M,formattedValues:N,updateCollisions:D}}var C={visibilityProperty:!0,opacityProperty:!0,checkVisibilityCSS:!0,checkOpacity:!0};function w(e){if(e.checkVisibility)return e.checkVisibility(C);if(!e.getClientRects().length||getComputedStyle(e).visibility!==`visible`)return!1;for(let t=e;t;t=t.parentElement){let e=getComputedStyle(t);if(e.opacity===`0`||e.contentVisibility===`hidden`)return!1}return!0}function T(e,t){return e.left===t.left&&e.top===t.top&&e.right===t.right&&e.bottom===t.bottom}var E=(e,t,n)=>Math.min(n,Math.max(t,e));function D(e,{thumbVisualRefs:t,tooltipElRefs:n,isVertical:o,isRtl:s,readoutVisibility:c,formattedValues:l,onPosition:u}){let d=new Map;function f(t){return e.readout===`tooltip`&&!e.disabled&&c.value[t]}function p(e){let t=d.get(e);t&&(d.delete(e),t.cleanup?.(),t.tooltip.matches(`:popover-open`)&&t.tooltip.hidePopover())}function m(e,t,n){if(typeof n.showPopover!=`function`)return;let a=0,c=!0,l=null,m=null,h,g={anchor:t,tooltip:n,update:b,cleanup:null},_=()=>d.get(e)===g;function v(){return c||!w(t)?`hidden`:`visible`}function y(){n.style.visibility=`hidden`,n.showPopover()}async function b(){if(!_())return;if(!n.matches(`:popover-open`)){if(!f(e)||!t.isConnected||!n.isConnected||!w(t)){p(e);return}y()}let d=++a,h=t.getBoundingClientRect();l=h;let g=parseFloat(getComputedStyle(n).paddingBlockStart)||0,b={boundary:[],padding:g*2},x=n.firstElementChild,S=()=>_()&&d===a,C=await r.i(t,n,{strategy:`fixed`,placement:o.value?s.value?`left`:`right`:`top`,middleware:[r.c(g),r.a(b),r.l(b),r.u({...b,apply({availableWidth:e,availableHeight:t}){S()&&(x.style.maxInlineSize=`${Math.max(0,e-g*2)}px`,x.style.maxBlockSize=`${Math.max(0,t-g*2)}px`)}}),r.o()]});if(!S())return;let T=n.offsetWidth,D=n.offsetHeight,O=C.placement;c=C.middlewareData.hide?.referenceHidden;let k=v();n.dataset.side=O,Object.assign(n.style,{left:`${C.x}px`,top:`${C.y}px`,visibility:k}),O===`top`||O===`bottom`?n.style.setProperty(`--slider-tooltip-arrow-x`,`${E(h.left+h.width/2-C.x,g,T-g)}px`):n.style.setProperty(`--slider-tooltip-arrow-y`,`${E(h.top+h.height/2-C.y,g,D-g)}px`);let A=[C.x,C.y,T,D,O,k];(!m||!i.sameValues(A,m))&&(m=A,u())}function x(){!n.matches(`:popover-open`)||!l||!T(t.getBoundingClientRect(),l)?b():n.style.visibility=v(),_()&&(h=requestAnimationFrame(x))}d.set(e,g),y();let S=r.r(t,n,b,{layoutShift:!1});x(),g.cleanup=()=>{S(),cancelAnimationFrame(h)}}function h(){for(let[e,r]of d)(!f(e)||t.value[e]!==r.anchor||n.value[e]!==r.tooltip)&&p(e);c.value.forEach((e,r)=>{let i=t.value[r],a=n.value[r];!i||!a||!f(r)||(d.has(r)?d.get(r).update():m(r,i,a))})}(0,a.watch)([()=>e.readout,()=>e.disabled,o,s,l,c],h,{flush:`post`}),(0,a.onMounted)(h),(0,a.onBeforeUnmount)(()=>{for(let e of d.keys())p(e)})}var O=[`data-disabled`,`data-orientation`,`data-dragging`],k=[`onPointerenter`,`onPointerleave`],A=[`min`,`max`,`step`,`value`,`disabled`,`name`,`aria-labelledby`,`aria-label`,`aria-describedby`,`aria-errormessage`,`aria-details`,`aria-invalid`,`aria-valuetext`,`aria-orientation`,`onInput`,`onKeydown`,`onFocus`,`onBlur`],j=[`data-mark-index`],M=[`data-readout-index`],N={class:`d-slider__tooltip-content`},P=(0,a.defineComponent)({name:`DtSlider`,inheritAttrs:!1,__name:`Slider`,props:{modelValue:{type:[Number,Array],default:void 0,validator:e=>!Array.isArray(e)||e.length===2},min:{type:Number,default:0,validator:Number.isFinite},max:{type:Number,default:100,validator:Number.isFinite},step:{type:Number,default:1,validator:Number.isFinite},snapPoints:{type:[Number,Array],default:void 0,validator:e=>Number.isFinite(e)||Array.isArray(e)&&e.every(Number.isFinite)},disabled:{type:Boolean,default:!1},orientation:{type:String,default:`horizontal`,validator:e=>o.includes(e)},fillOrigin:{type:[Number,String],default:`start`,validator:e=>typeof e==`number`||c.includes(e)},showTicks:{type:[Boolean,Number],default:!1},minGapSteps:{type:Number,default:0},label:{type:String,default:``},showLabel:{type:Boolean,default:!0},labelSize:{type:[String,Number],default:null,validator:e=>t.TEXT_SIZE_MODIFIERS.label.includes(String(e))},labelStrength:{type:String,default:null,validator:e=>Object.keys(t.TEXT_STRENGTH_MODIFIERS).includes(e)},getValueText:{type:Function,default:null},prefix:{type:String,default:``},suffix:{type:String,default:``},name:{type:String,default:``},largeStep:{type:Number,default:10},bodyClass:{type:[String,Array,Object],default:``},labelClass:{type:[String,Array,Object],default:``},startClass:{type:[String,Array,Object],default:``},endClass:{type:[String,Array,Object],default:``},readout:{type:String,default:`tooltip`,validator:e=>s.includes(e)},readoutClass:{type:[String,Array,Object],default:``},showMarks:{type:[Array,Boolean],default:!1,validator:e=>typeof e==`boolean`||Array.isArray(e)&&e.every(i.isValidMark)}},emits:[`update:modelValue`,`change`,`focus`,`blur`],setup(t,{expose:r,emit:i}){let o=t,s=i,c=(0,a.useSlots)(),l=(0,a.useAttrs)(),u=`slider-label-${e.getUniqueString()}`,d=(0,a.ref)(null),h=(0,a.ref)([]),g=(0,a.ref)([]),v=(0,a.computed)(()=>Array.isArray(o.modelValue)),C=(0,a.computed)(()=>o.orientation===`vertical`),{isRtl:w}=p(d),{activeSnapValue:T,findMagneticSnapPoint:E}=_(o,{controlRef:d,isVertical:C}),{internalValues:P,lastCommittedValues:F,currentValue:I,decimalPlaces:L,snapToStep:R,thumbPercent:z,thumbNativeMin:B,thumbNativeMax:ee,thumbNativeStep:te,formatValue:V}=m(o,s,{isRange:v,activeSnapValue:T});function H(e){return e.some(e=>{if(typeof e==`string`)return e.trim()!==``;if(e.type===a.Comment)return!1;if(typeof e.children==`string`)return e.children.trim()!==``;if(Array.isArray(e.children))return H(e.children);if(e.children&&typeof e.children.default==`function`){let t=e.children.default();return H(Array.isArray(t)?t:[t])}return!1})}let ne=(0,a.computed)(()=>c.label?H(c.label({value:I.value})):!!o.label?.trim()),U=(0,a.computed)(()=>o.showLabel&&ne.value),W=(0,a.computed)(()=>U.value?u:l[`aria-labelledby`]),G=(0,a.computed)(()=>{if(!U.value)return!o.showLabel&&o.label?o.label:l[`aria-label`]}),re=(0,a.computed)(()=>U.value||!!(String(G.value??``).trim()||String(W.value??``).trim())),ie=(0,a.computed)(()=>o.labelSize??300),ae=[`aria-label`,`aria-labelledby`,`aria-describedby`,`aria-errormessage`,`aria-details`,`aria-invalid`],oe=(0,a.computed)(()=>{let t=e.removeClassStyleAttrs(l);return Object.fromEntries(Object.entries(t).filter(([e])=>!ae.includes(e)))}),{isDragging:K,activeThumbIndex:se,focusedThumbIndex:ce,onPointerDown:q,onPointerMove:J,onPointerUp:Y,onThumbInput:le,onThumbKeydown:ue,onThumbFocus:de,onThumbBlur:fe,onThumbHitPointerEnter:pe,onThumbHitPointerLeave:me,isReadoutOpen:he}=y(o,s,{controlRef:d,thumbRefs:h,internalValues:P,isRange:v,isVertical:C,decimalPlaces:L,snapToStep:R,lastCommittedValues:F,findMagneticSnapPoint:E,activeSnapValue:T,isRtl:w}),{computedTickValues:ge,computedMarks:X,reservesAnnotationSpace:_e}=x(o,{isVertical:C,thumbPercent:z}),{markElRefs:ve,readoutElRefs:ye,mergedReadoutElRef:be,tooltipElRefs:Z,markCollisionHidden:xe,readoutMerged:Q,markEdgeOffsetPx:Se,readoutEdgeOffsetPx:Ce,mergedReadoutEdgeOffsetPx:we,readoutVisibility:Te,formattedValues:Ee,updateCollisions:De}=S(o,{controlRef:d,isVertical:C,isRange:v,internalValues:P,thumbPercent:z,isRtl:w,isReadoutOpen:he,computedMarks:X,formatValue:V}),{thumbPositionStyle:$,tickPositionStyle:Oe,markStyle:ke,readoutStyle:Ae,mergedReadoutPct:je,mergedReadoutText:Me,indicatorStyle:Ne}=b(o,{isVertical:C,isRange:v,internalValues:P,thumbPercent:z,isRtl:w,markEdgeOffsetPx:Se,formatValue:V});function Pe(e){return e===o.min?`start`:e===o.max?`end`:null}D(o,{thumbVisualRefs:g,tooltipElRefs:Z,isVertical:C,isRtl:w,readoutVisibility:Te,formattedValues:Ee,onPosition:De}),f(o,{isRange:v,hasAccessibleName:re});function Fe(){h.value[0]?.focus()}function Ie(){h.value.find(e=>e===document.activeElement)?.blur()}return r({focus:Fe,blur:Ie}),(r,i)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,(0,a.mergeProps)(oe.value,{class:[`d-slider`,r.$attrs.class,{"d-slider--disabled":t.disabled,"d-slider--vertical":C.value,"d-slider--inverted":t.fillOrigin===`end`,"d-slider--dragging":(0,a.unref)(K)}],style:r.$attrs.style,"data-disabled":t.disabled||void 0,"data-orientation":t.orientation,"data-dragging":(0,a.unref)(K)||void 0,"data-qa":`dt-slider`}),[t.showLabel?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,id:u,class:(0,a.normalizeClass)([`d-slider__label`,t.labelClass]),"data-qa":`dt-slider-label`},[(0,a.renderSlot)(r.$slots,`label`,{value:(0,a.unref)(I)},()=>[t.label?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(n.t),{key:0,kind:`label`,size:ie.value,strength:t.labelStrength,tone:t.disabled?`disabled`:`secondary`},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(t.label),1)]),_:1},8,[`size`,`strength`,`tone`])):(0,a.createCommentVNode)(``,!0)])],2)):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{class:(0,a.normalizeClass)([`d-slider__body`,t.bodyClass,{"d-slider__body--reserve-annotation-space":(0,a.unref)(_e)}]),"data-qa":`dt-slider-body`},[(0,a.unref)(e.hasSlotContent)(r.$slots.start)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,class:(0,a.normalizeClass)([`d-slider__start`,t.startClass]),"data-qa":`dt-slider-start`},[(0,a.renderSlot)(r.$slots,`start`)],2)):(0,a.createCommentVNode)(``,!0),(0,a.createElementVNode)(`div`,{ref_key:`controlRef`,ref:d,class:`d-slider__control`,style:(0,a.normalizeStyle)(C.value?{touchAction:`pan-x`}:{touchAction:`pan-y`}),"data-qa":`dt-slider-control`,onPointerdown:i[0]||(i[0]=(...e)=>(0,a.unref)(q)&&(0,a.unref)(q)(...e)),onPointermove:i[1]||(i[1]=(...e)=>(0,a.unref)(J)&&(0,a.unref)(J)(...e)),onPointerup:i[2]||(i[2]=(...e)=>(0,a.unref)(Y)&&(0,a.unref)(Y)(...e)),onPointercancel:i[3]||(i[3]=(...e)=>(0,a.unref)(Y)&&(0,a.unref)(Y)(...e))},[i[4]||(i[4]=(0,a.createElementVNode)(`div`,{class:`d-slider__track`,"data-qa":`dt-slider-track`},null,-1)),(0,a.createElementVNode)(`div`,{class:`d-slider__indicator`,style:(0,a.normalizeStyle)((0,a.unref)(Ne)),"data-qa":`dt-slider-indicator`},null,4),t.showTicks?((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:0},(0,a.renderList)((0,a.unref)(ge),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:t,class:`d-slider__tick`,style:(0,a.normalizeStyle)((0,a.unref)(Oe)(e)),"data-qa":`dt-slider-tick`},null,4))),128)):(0,a.createCommentVNode)(``,!0),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`thumb-visual-${t}`,ref_for:!0,ref:e=>{g.value[t]=e},class:(0,a.normalizeClass)([`d-slider__thumb-visual`,{"d-slider__thumb-visual--focused":(0,a.unref)(ce)===t,"d-slider__thumb-visual--active":(0,a.unref)(se)===t}]),style:(0,a.normalizeStyle)((0,a.unref)($)(e)),"data-qa":`dt-slider-thumb-visual`},null,6))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`thumb-hit-${t}`,class:`d-slider__thumb-hit`,style:(0,a.normalizeStyle)({...(0,a.unref)($)(e),touchAction:C.value?`pan-x`:`pan-y`}),"data-qa":`dt-slider-thumb-hit`,onPointerenter:e=>(0,a.unref)(pe)(t),onPointerleave:e=>(0,a.unref)(me)(t)},null,44,k))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`input`,{key:`thumb-input-${n}`,ref_for:!0,ref:e=>{h.value[n]=e},type:`range`,class:`d-slider__thumb`,min:(0,a.unref)(B)(n),max:(0,a.unref)(ee)(n),step:(0,a.unref)(te)(n),value:e,disabled:t.disabled,name:t.name||void 0,"aria-labelledby":W.value,"aria-label":G.value,"aria-describedby":(0,a.unref)(l)[`aria-describedby`],"aria-errormessage":(0,a.unref)(l)[`aria-errormessage`],"aria-details":(0,a.unref)(l)[`aria-details`],"aria-invalid":(0,a.unref)(l)[`aria-invalid`],"aria-valuetext":(0,a.unref)(V)(e,n),"aria-orientation":C.value?`vertical`:void 0,"data-qa":`dt-slider-thumb`,onInput:e=>(0,a.unref)(le)(n,e),onKeydown:e=>(0,a.unref)(ue)(n,e),onFocus:e=>(0,a.unref)(de)(n,e),onBlur:e=>(0,a.unref)(fe)(n,e)},null,40,A))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(X),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`mark-${t}`,ref_for:!0,ref_key:`markElRefs`,ref:ve,class:(0,a.normalizeClass)([`d-slider__mark`,{"d-slider__mark--collision-hidden":(0,a.unref)(xe)[t]}]),style:(0,a.normalizeStyle)((0,a.unref)(ke)(e.pct,t,e.edge)),"data-mark-index":t,"data-qa":`dt-slider-mark`},(0,a.toDisplayString)(e.text),15,j))),128)),t.readout===`always`?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:1},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)((0,a.unref)(P),(e,n)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`readout-${n}`,ref_for:!0,ref_key:`readoutElRefs`,ref:ye,class:(0,a.normalizeClass)([`d-slider__readout`,(0,a.unref)(Q)?`d-slider__readout--hide`:`d-slider__readout--show`,t.readoutClass]),style:(0,a.normalizeStyle)((0,a.unref)(Ae)((0,a.unref)(z)(e),(0,a.unref)(Ce)[n],Pe(e))),"data-readout-index":n,"aria-hidden":`true`,"data-qa":`dt-slider-thumb-readout`},(0,a.toDisplayString)((0,a.unref)(V)(e,n)),15,M))),128)),(0,a.unref)(Q)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:0,ref_key:`mergedReadoutElRef`,ref:be,class:(0,a.normalizeClass)([`d-slider__readout`,`d-slider__readout--show`,t.readoutClass]),style:(0,a.normalizeStyle)((0,a.unref)(Ae)((0,a.unref)(je),(0,a.unref)(we))),"aria-hidden":`true`,"data-qa":`dt-slider-thumb-readout-merged`},(0,a.toDisplayString)((0,a.unref)(Me)),7)):(0,a.createCommentVNode)(``,!0)],64)):(0,a.createCommentVNode)(``,!0),t.readout===`tooltip`?((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,{key:2},(0,a.renderList)((0,a.unref)(P),(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:`readout-tooltip-${t}`,ref_for:!0,ref:e=>{(0,a.unref)(Z)[t]=e},class:`d-tooltip d-slider__readout-tooltip`,popover:`manual`,inert:``,"aria-hidden":`true`,"data-qa":`dt-slider-thumb-readout-tooltip`},[(0,a.createElementVNode)(`span`,N,(0,a.toDisplayString)((0,a.unref)(V)(e,t)),1)]))),128)):(0,a.createCommentVNode)(``,!0)],36),(0,a.unref)(e.hasSlotContent)(r.$slots.end)?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:1,class:(0,a.normalizeClass)([`d-slider__end`,t.endClass]),"data-qa":`dt-slider-end`},[(0,a.renderSlot)(r.$slots,`end`)],2)):(0,a.createCommentVNode)(``,!0)],2)],16,O))}});Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return P}});
2
- //# sourceMappingURL=Slider-BDgY7gNR.cjs.map