@dialpad/dialtone 9.126.6 → 9.127.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 (449) hide show
  1. package/README.md +1 -1
  2. package/dist/tokens/doc.json +23168 -23168
  3. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
  4. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
  5. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +7 -7
  6. package/dist/vue2/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
  7. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
  8. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
  9. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js +5 -5
  10. package/dist/vue2/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
  11. package/dist/vue2/lib/datepicker/datepicker.cjs +1 -1
  12. package/dist/vue2/lib/datepicker/datepicker.cjs.map +1 -1
  13. package/dist/vue2/lib/datepicker/datepicker.js +10 -10
  14. package/dist/vue2/lib/datepicker/datepicker.js.map +1 -1
  15. package/dist/vue2/lib/dropdown/dropdown.cjs +1 -1
  16. package/dist/vue2/lib/dropdown/dropdown.cjs.map +1 -1
  17. package/dist/vue2/lib/dropdown/dropdown.js +24 -26
  18. package/dist/vue2/lib/dropdown/dropdown.js.map +1 -1
  19. package/dist/vue2/lib/emoji-picker/emoji-picker.cjs.map +1 -1
  20. package/dist/vue2/lib/emoji-picker/emoji-picker.js +1 -0
  21. package/dist/vue2/lib/emoji-picker/emoji-picker.js.map +1 -1
  22. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs +2 -2
  23. package/dist/vue2/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  24. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js +33 -29
  25. package/dist/vue2/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  26. package/dist/vue2/lib/toast/toast.cjs.map +1 -1
  27. package/dist/vue2/lib/toast/toast.js.map +1 -1
  28. package/dist/vue2/localization/de-DE.cjs +1 -13
  29. package/dist/vue2/localization/de-DE.cjs.map +1 -1
  30. package/dist/vue2/localization/de-DE.js +1 -13
  31. package/dist/vue2/localization/de-DE.js.map +1 -1
  32. package/dist/vue2/localization/es-LA.cjs +1 -13
  33. package/dist/vue2/localization/es-LA.cjs.map +1 -1
  34. package/dist/vue2/localization/es-LA.js +1 -13
  35. package/dist/vue2/localization/es-LA.js.map +1 -1
  36. package/dist/vue2/localization/fr-FR.cjs +1 -13
  37. package/dist/vue2/localization/fr-FR.cjs.map +1 -1
  38. package/dist/vue2/localization/fr-FR.js +1 -13
  39. package/dist/vue2/localization/fr-FR.js.map +1 -1
  40. package/dist/vue2/localization/it-IT.cjs +1 -13
  41. package/dist/vue2/localization/it-IT.cjs.map +1 -1
  42. package/dist/vue2/localization/it-IT.js +1 -13
  43. package/dist/vue2/localization/it-IT.js.map +1 -1
  44. package/dist/vue2/localization/ja-JP.cjs +1 -8
  45. package/dist/vue2/localization/ja-JP.cjs.map +1 -1
  46. package/dist/vue2/localization/ja-JP.js +1 -8
  47. package/dist/vue2/localization/ja-JP.js.map +1 -1
  48. package/dist/vue2/localization/nl-NL.cjs +1 -13
  49. package/dist/vue2/localization/nl-NL.cjs.map +1 -1
  50. package/dist/vue2/localization/nl-NL.js +1 -13
  51. package/dist/vue2/localization/nl-NL.js.map +1 -1
  52. package/dist/vue2/localization/pt-BR.cjs +1 -13
  53. package/dist/vue2/localization/pt-BR.cjs.map +1 -1
  54. package/dist/vue2/localization/pt-BR.js +1 -13
  55. package/dist/vue2/localization/pt-BR.js.map +1 -1
  56. package/dist/vue2/localization/ru-RU.cjs +1 -23
  57. package/dist/vue2/localization/ru-RU.cjs.map +1 -1
  58. package/dist/vue2/localization/ru-RU.js +1 -23
  59. package/dist/vue2/localization/ru-RU.js.map +1 -1
  60. package/dist/vue2/localization/zh-CN.cjs +1 -8
  61. package/dist/vue2/localization/zh-CN.cjs.map +1 -1
  62. package/dist/vue2/localization/zh-CN.js +1 -8
  63. package/dist/vue2/localization/zh-CN.js.map +1 -1
  64. package/dist/vue2/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
  65. package/dist/vue2/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  66. package/dist/vue2/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
  67. package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +1 -1
  68. package/dist/vue2/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
  69. package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +1 -1
  70. package/dist/vue2/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
  71. package/dist/vue3/common/mixins/index.cjs +1 -1
  72. package/dist/vue3/common/mixins/index.js +8 -10
  73. package/dist/vue3/common/mixins/index.js.map +1 -1
  74. package/dist/vue3/common/utils/index.cjs +1 -1
  75. package/dist/vue3/common/utils/index.cjs.map +1 -1
  76. package/dist/vue3/common/utils/index.js +42 -38
  77. package/dist/vue3/common/utils/index.js.map +1 -1
  78. package/dist/vue3/component-documentation.json +1 -1
  79. package/dist/vue3/dialtone-vue.cjs +1 -1
  80. package/dist/vue3/dialtone-vue.js +298 -299
  81. package/dist/vue3/lib/attachment-carousel/attachment-carousel.cjs +1 -1
  82. package/dist/vue3/lib/attachment-carousel/attachment-carousel.cjs.map +1 -1
  83. package/dist/vue3/lib/attachment-carousel/attachment-carousel.js +86 -110
  84. package/dist/vue3/lib/attachment-carousel/attachment-carousel.js.map +1 -1
  85. package/dist/vue3/lib/banner/banner.cjs +2 -2
  86. package/dist/vue3/lib/banner/banner.cjs.map +1 -1
  87. package/dist/vue3/lib/banner/banner.js +27 -38
  88. package/dist/vue3/lib/banner/banner.js.map +1 -1
  89. package/dist/vue3/lib/breadcrumbs/breadcrumbs.cjs +1 -1
  90. package/dist/vue3/lib/breadcrumbs/breadcrumbs.cjs.map +1 -1
  91. package/dist/vue3/lib/breadcrumbs/breadcrumbs.js +20 -18
  92. package/dist/vue3/lib/breadcrumbs/breadcrumbs.js.map +1 -1
  93. package/dist/vue3/lib/button/button.cjs +1 -1
  94. package/dist/vue3/lib/button/button.cjs.map +1 -1
  95. package/dist/vue3/lib/button/button.js +26 -24
  96. package/dist/vue3/lib/button/button.js.map +1 -1
  97. package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs +1 -1
  98. package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.cjs.map +1 -1
  99. package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js +36 -41
  100. package/dist/vue3/lib/callbar-button-with-dropdown/callbar-button-with-dropdown.js.map +1 -1
  101. package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.cjs +1 -1
  102. package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.cjs.map +1 -1
  103. package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.js +35 -37
  104. package/dist/vue3/lib/callbar-button-with-popover/callbar-button-with-popover.js.map +1 -1
  105. package/dist/vue3/lib/chip/chip.cjs +1 -1
  106. package/dist/vue3/lib/chip/chip.cjs.map +1 -1
  107. package/dist/vue3/lib/chip/chip.js +54 -57
  108. package/dist/vue3/lib/chip/chip.js.map +1 -1
  109. package/dist/vue3/lib/combobox/combobox-constants.cjs +1 -1
  110. package/dist/vue3/lib/combobox/combobox-constants.cjs.map +1 -1
  111. package/dist/vue3/lib/combobox/combobox-constants.js +2 -2
  112. package/dist/vue3/lib/combobox/combobox-constants.js.map +1 -1
  113. package/dist/vue3/lib/combobox/combobox-empty-list.cjs.map +1 -1
  114. package/dist/vue3/lib/combobox/combobox-empty-list.js.map +1 -1
  115. package/dist/vue3/lib/combobox/combobox-loading-list.cjs.map +1 -1
  116. package/dist/vue3/lib/combobox/combobox-loading-list.js.map +1 -1
  117. package/dist/vue3/lib/combobox/combobox.cjs +2 -2
  118. package/dist/vue3/lib/combobox/combobox.cjs.map +1 -1
  119. package/dist/vue3/lib/combobox/combobox.js +20 -20
  120. package/dist/vue3/lib/combobox/combobox.js.map +1 -1
  121. package/dist/vue3/lib/combobox/index.cjs +1 -1
  122. package/dist/vue3/lib/combobox/index.js +3 -3
  123. package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs +1 -1
  124. package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.cjs.map +1 -1
  125. package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js +119 -124
  126. package/dist/vue3/lib/combobox-multi-select/combobox-multi-select.js.map +1 -1
  127. package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.cjs +1 -1
  128. package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.cjs.map +1 -1
  129. package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.js +76 -80
  130. package/dist/vue3/lib/combobox-with-popover/combobox-with-popover.js.map +1 -1
  131. package/dist/vue3/lib/contact-centers-row/contact-centers-row.cjs +1 -1
  132. package/dist/vue3/lib/contact-centers-row/contact-centers-row.cjs.map +1 -1
  133. package/dist/vue3/lib/contact-centers-row/contact-centers-row.js +68 -63
  134. package/dist/vue3/lib/contact-centers-row/contact-centers-row.js.map +1 -1
  135. package/dist/vue3/lib/contact-row/contact-row.cjs +1 -1
  136. package/dist/vue3/lib/contact-row/contact-row.cjs.map +1 -1
  137. package/dist/vue3/lib/contact-row/contact-row.js +32 -48
  138. package/dist/vue3/lib/contact-row/contact-row.js.map +1 -1
  139. package/dist/vue3/lib/datepicker/datepicker-constants.cjs +1 -1
  140. package/dist/vue3/lib/datepicker/datepicker-constants.cjs.map +1 -1
  141. package/dist/vue3/lib/datepicker/datepicker-constants.js +2 -3
  142. package/dist/vue3/lib/datepicker/datepicker-constants.js.map +1 -1
  143. package/dist/vue3/lib/datepicker/datepicker.cjs +1 -1
  144. package/dist/vue3/lib/datepicker/datepicker.cjs.map +1 -1
  145. package/dist/vue3/lib/datepicker/datepicker.js +264 -349
  146. package/dist/vue3/lib/datepicker/datepicker.js.map +1 -1
  147. package/dist/vue3/lib/datepicker/formatUtils.cjs +1 -1
  148. package/dist/vue3/lib/datepicker/formatUtils.cjs.map +1 -1
  149. package/dist/vue3/lib/datepicker/formatUtils.js +21 -20
  150. package/dist/vue3/lib/datepicker/formatUtils.js.map +1 -1
  151. package/dist/vue3/lib/datepicker/utils.cjs +1 -1
  152. package/dist/vue3/lib/datepicker/utils.cjs.map +1 -1
  153. package/dist/vue3/lib/datepicker/utils.js +12 -11
  154. package/dist/vue3/lib/datepicker/utils.js.map +1 -1
  155. package/dist/vue3/lib/description-list/description-list.cjs +1 -1
  156. package/dist/vue3/lib/description-list/description-list.cjs.map +1 -1
  157. package/dist/vue3/lib/description-list/description-list.js +10 -10
  158. package/dist/vue3/lib/description-list/description-list.js.map +1 -1
  159. package/dist/vue3/lib/dropdown/dropdown.cjs +1 -1
  160. package/dist/vue3/lib/dropdown/dropdown.cjs.map +1 -1
  161. package/dist/vue3/lib/dropdown/dropdown.js +36 -46
  162. package/dist/vue3/lib/dropdown/dropdown.js.map +1 -1
  163. package/dist/vue3/lib/editor/editor.cjs +1 -1
  164. package/dist/vue3/lib/editor/editor.cjs.map +1 -1
  165. package/dist/vue3/lib/editor/editor.js +169 -186
  166. package/dist/vue3/lib/editor/editor.js.map +1 -1
  167. package/dist/vue3/lib/editor/index.cjs +1 -1
  168. package/dist/vue3/lib/editor/index.js +2 -2
  169. package/dist/vue3/lib/emoji-picker/emoji-picker-constants.cjs +1 -1
  170. package/dist/vue3/lib/emoji-picker/emoji-picker-constants.cjs.map +1 -1
  171. package/dist/vue3/lib/emoji-picker/emoji-picker-constants.js +7 -20
  172. package/dist/vue3/lib/emoji-picker/emoji-picker-constants.js.map +1 -1
  173. package/dist/vue3/lib/emoji-picker/emoji-picker.cjs +1 -1
  174. package/dist/vue3/lib/emoji-picker/emoji-picker.cjs.map +1 -1
  175. package/dist/vue3/lib/emoji-picker/emoji-picker.js +419 -477
  176. package/dist/vue3/lib/emoji-picker/emoji-picker.js.map +1 -1
  177. package/dist/vue3/lib/emoji-picker/index.cjs +1 -1
  178. package/dist/vue3/lib/emoji-picker/index.js +3 -4
  179. package/dist/vue3/lib/emoji-row/emoji-row-constants.cjs +1 -1
  180. package/dist/vue3/lib/emoji-row/emoji-row-constants.cjs.map +1 -1
  181. package/dist/vue3/lib/emoji-row/emoji-row-constants.js +6 -7
  182. package/dist/vue3/lib/emoji-row/emoji-row-constants.js.map +1 -1
  183. package/dist/vue3/lib/emoji-row/emoji-row.cjs +1 -1
  184. package/dist/vue3/lib/emoji-row/emoji-row.cjs.map +1 -1
  185. package/dist/vue3/lib/emoji-row/emoji-row.js +53 -43
  186. package/dist/vue3/lib/emoji-row/emoji-row.js.map +1 -1
  187. package/dist/vue3/lib/feed-item-pill/feed-item-pill.cjs +1 -1
  188. package/dist/vue3/lib/feed-item-pill/feed-item-pill.cjs.map +1 -1
  189. package/dist/vue3/lib/feed-item-pill/feed-item-pill.js +52 -53
  190. package/dist/vue3/lib/feed-item-pill/feed-item-pill.js.map +1 -1
  191. package/dist/vue3/lib/general-row/general-row.cjs +1 -1
  192. package/dist/vue3/lib/general-row/general-row.cjs.map +1 -1
  193. package/dist/vue3/lib/general-row/general-row.js +133 -118
  194. package/dist/vue3/lib/general-row/general-row.js.map +1 -1
  195. package/dist/vue3/lib/group-row/group-row.cjs +1 -1
  196. package/dist/vue3/lib/group-row/group-row.cjs.map +1 -1
  197. package/dist/vue3/lib/group-row/group-row.js +53 -39
  198. package/dist/vue3/lib/group-row/group-row.js.map +1 -1
  199. package/dist/vue3/lib/icon/icon-constants.cjs.map +1 -1
  200. package/dist/vue3/lib/icon/icon-constants.js.map +1 -1
  201. package/dist/vue3/lib/icon/icon.cjs +1 -1
  202. package/dist/vue3/lib/icon/icon.cjs.map +1 -1
  203. package/dist/vue3/lib/icon/icon.js +15 -11
  204. package/dist/vue3/lib/icon/icon.js.map +1 -1
  205. package/dist/vue3/lib/image-viewer/image-viewer.cjs +1 -1
  206. package/dist/vue3/lib/image-viewer/image-viewer.cjs.map +1 -1
  207. package/dist/vue3/lib/image-viewer/image-viewer.js +51 -47
  208. package/dist/vue3/lib/image-viewer/image-viewer.js.map +1 -1
  209. package/dist/vue3/lib/ivr-node/ivr-node-constants.cjs +1 -1
  210. package/dist/vue3/lib/ivr-node/ivr-node-constants.cjs.map +1 -1
  211. package/dist/vue3/lib/ivr-node/ivr-node-constants.js +24 -24
  212. package/dist/vue3/lib/ivr-node/ivr-node-constants.js.map +1 -1
  213. package/dist/vue3/lib/ivr-node/ivr-node.cjs +1 -1
  214. package/dist/vue3/lib/ivr-node/ivr-node.cjs.map +1 -1
  215. package/dist/vue3/lib/ivr-node/ivr-node.js +80 -76
  216. package/dist/vue3/lib/ivr-node/ivr-node.js.map +1 -1
  217. package/dist/vue3/lib/message-input/message-input-link.cjs +1 -1
  218. package/dist/vue3/lib/message-input/message-input-link.cjs.map +1 -1
  219. package/dist/vue3/lib/message-input/message-input-link.js +100 -77
  220. package/dist/vue3/lib/message-input/message-input-link.js.map +1 -1
  221. package/dist/vue3/lib/message-input/message-input-topbar.cjs +1 -1
  222. package/dist/vue3/lib/message-input/message-input-topbar.cjs.map +1 -1
  223. package/dist/vue3/lib/message-input/message-input-topbar.js +126 -94
  224. package/dist/vue3/lib/message-input/message-input-topbar.js.map +1 -1
  225. package/dist/vue3/lib/message-input/message-input.cjs +1 -1
  226. package/dist/vue3/lib/message-input/message-input.cjs.map +1 -1
  227. package/dist/vue3/lib/message-input/message-input.js +272 -296
  228. package/dist/vue3/lib/message-input/message-input.js.map +1 -1
  229. package/dist/vue3/lib/modal/modal.cjs +1 -2
  230. package/dist/vue3/lib/modal/modal.cjs.map +1 -1
  231. package/dist/vue3/lib/modal/modal.js +64 -79
  232. package/dist/vue3/lib/modal/modal.js.map +1 -1
  233. package/dist/vue3/lib/notice/notice-action.cjs +1 -1
  234. package/dist/vue3/lib/notice/notice-action.cjs.map +1 -1
  235. package/dist/vue3/lib/notice/notice-action.js +38 -39
  236. package/dist/vue3/lib/notice/notice-action.js.map +1 -1
  237. package/dist/vue3/lib/notice/notice.cjs +1 -1
  238. package/dist/vue3/lib/notice/notice.cjs.map +1 -1
  239. package/dist/vue3/lib/notice/notice.js +37 -49
  240. package/dist/vue3/lib/notice/notice.js.map +1 -1
  241. package/dist/vue3/lib/pagination/pagination.cjs +1 -1
  242. package/dist/vue3/lib/pagination/pagination.cjs.map +1 -1
  243. package/dist/vue3/lib/pagination/pagination.js +72 -81
  244. package/dist/vue3/lib/pagination/pagination.js.map +1 -1
  245. package/dist/vue3/lib/popover/popover-header-footer.cjs +1 -1
  246. package/dist/vue3/lib/popover/popover-header-footer.cjs.map +1 -1
  247. package/dist/vue3/lib/popover/popover-header-footer.js +44 -45
  248. package/dist/vue3/lib/popover/popover-header-footer.js.map +1 -1
  249. package/dist/vue3/lib/popover/popover.cjs +1 -1
  250. package/dist/vue3/lib/popover/popover.cjs.map +1 -1
  251. package/dist/vue3/lib/popover/popover.js +26 -37
  252. package/dist/vue3/lib/popover/popover.js.map +1 -1
  253. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs +3 -3
  254. package/dist/vue3/lib/rich-text-editor/rich-text-editor.cjs.map +1 -1
  255. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js +187 -181
  256. package/dist/vue3/lib/rich-text-editor/rich-text-editor.js.map +1 -1
  257. package/dist/vue3/lib/settings-menu-button/settings-menu-button.cjs.map +1 -1
  258. package/dist/vue3/lib/settings-menu-button/settings-menu-button.js.map +1 -1
  259. package/dist/vue3/lib/time-pill/time-pill.cjs.map +1 -1
  260. package/dist/vue3/lib/time-pill/time-pill.js.map +1 -1
  261. package/dist/vue3/lib/toast/toast.cjs +1 -1
  262. package/dist/vue3/lib/toast/toast.cjs.map +1 -1
  263. package/dist/vue3/lib/toast/toast.js +83 -127
  264. package/dist/vue3/lib/toast/toast.js.map +1 -1
  265. package/dist/vue3/lib/unread-pill/unread-pill.cjs +1 -1
  266. package/dist/vue3/lib/unread-pill/unread-pill.cjs.map +1 -1
  267. package/dist/vue3/lib/unread-pill/unread-pill.js +25 -14
  268. package/dist/vue3/lib/unread-pill/unread-pill.js.map +1 -1
  269. package/dist/vue3/localization/de-DE.cjs +157 -0
  270. package/dist/vue3/localization/de-DE.cjs.map +1 -0
  271. package/dist/vue3/localization/de-DE.js +160 -0
  272. package/dist/vue3/localization/de-DE.js.map +1 -0
  273. package/dist/vue3/localization/en-US.cjs +175 -0
  274. package/dist/vue3/localization/en-US.cjs.map +1 -0
  275. package/dist/vue3/localization/en-US.js +178 -0
  276. package/dist/vue3/localization/en-US.js.map +1 -0
  277. package/dist/vue3/localization/es-LA.cjs +157 -0
  278. package/dist/vue3/localization/es-LA.cjs.map +1 -0
  279. package/dist/vue3/localization/es-LA.js +160 -0
  280. package/dist/vue3/localization/es-LA.js.map +1 -0
  281. package/dist/vue3/localization/fr-FR.cjs +157 -0
  282. package/dist/vue3/localization/fr-FR.cjs.map +1 -0
  283. package/dist/vue3/localization/fr-FR.js +160 -0
  284. package/dist/vue3/localization/fr-FR.js.map +1 -0
  285. package/dist/vue3/localization/index.cjs +2 -0
  286. package/dist/vue3/localization/index.cjs.map +1 -0
  287. package/dist/vue3/localization/index.js +82 -0
  288. package/dist/vue3/localization/index.js.map +1 -0
  289. package/dist/vue3/localization/it-IT.cjs +157 -0
  290. package/dist/vue3/localization/it-IT.cjs.map +1 -0
  291. package/dist/vue3/localization/it-IT.js +160 -0
  292. package/dist/vue3/localization/it-IT.js.map +1 -0
  293. package/dist/vue3/localization/ja-JP.cjs +157 -0
  294. package/dist/vue3/localization/ja-JP.cjs.map +1 -0
  295. package/dist/vue3/localization/ja-JP.js +160 -0
  296. package/dist/vue3/localization/ja-JP.js.map +1 -0
  297. package/dist/vue3/localization/nl-NL.cjs +157 -0
  298. package/dist/vue3/localization/nl-NL.cjs.map +1 -0
  299. package/dist/vue3/localization/nl-NL.js +160 -0
  300. package/dist/vue3/localization/nl-NL.js.map +1 -0
  301. package/dist/vue3/localization/pt-BR.cjs +157 -0
  302. package/dist/vue3/localization/pt-BR.cjs.map +1 -0
  303. package/dist/vue3/localization/pt-BR.js +160 -0
  304. package/dist/vue3/localization/pt-BR.js.map +1 -0
  305. package/dist/vue3/localization/ru-RU.cjs +157 -0
  306. package/dist/vue3/localization/ru-RU.cjs.map +1 -0
  307. package/dist/vue3/localization/ru-RU.js +160 -0
  308. package/dist/vue3/localization/ru-RU.js.map +1 -0
  309. package/dist/vue3/localization/zh-CN.cjs +157 -0
  310. package/dist/vue3/localization/zh-CN.cjs.map +1 -0
  311. package/dist/vue3/localization/zh-CN.js +160 -0
  312. package/dist/vue3/localization/zh-CN.js.map +1 -0
  313. package/dist/vue3/shared/sr_only_close_button.cjs +1 -1
  314. package/dist/vue3/shared/sr_only_close_button.cjs.map +1 -1
  315. package/dist/vue3/shared/sr_only_close_button.js +27 -25
  316. package/dist/vue3/shared/sr_only_close_button.js.map +1 -1
  317. package/dist/vue3/types/common/mixins/index.d.ts +0 -1
  318. package/dist/vue3/types/common/sr_only_close_button.vue.d.ts +8 -15
  319. package/dist/vue3/types/common/sr_only_close_button.vue.d.ts.map +1 -1
  320. package/dist/vue3/types/common/utils/index.d.ts +1 -0
  321. package/dist/vue3/types/common/utils/index.d.ts.map +1 -1
  322. package/dist/vue3/types/components/banner/banner.vue.d.ts +0 -33
  323. package/dist/vue3/types/components/banner/banner.vue.d.ts.map +1 -1
  324. package/dist/vue3/types/components/breadcrumbs/breadcrumbs.vue.d.ts +2 -0
  325. package/dist/vue3/types/components/breadcrumbs/breadcrumbs.vue.d.ts.map +1 -1
  326. package/dist/vue3/types/components/button/button.vue.d.ts +2 -0
  327. package/dist/vue3/types/components/button/button.vue.d.ts.map +1 -1
  328. package/dist/vue3/types/components/chip/chip.vue.d.ts +3 -15
  329. package/dist/vue3/types/components/chip/chip.vue.d.ts.map +1 -1
  330. package/dist/vue3/types/components/combobox/combobox.vue.d.ts.map +1 -1
  331. package/dist/vue3/types/components/combobox/combobox_constants.d.ts +2 -2
  332. package/dist/vue3/types/components/combobox/index.d.ts +1 -1
  333. package/dist/vue3/types/components/datepicker/composables/useCalendar.d.ts.map +1 -1
  334. package/dist/vue3/types/components/datepicker/composables/useMonthYearPicker.d.ts +5 -1
  335. package/dist/vue3/types/components/datepicker/composables/useMonthYearPicker.d.ts.map +1 -1
  336. package/dist/vue3/types/components/datepicker/datepicker.vue.d.ts.map +1 -1
  337. package/dist/vue3/types/components/datepicker/datepicker_constants.d.ts +0 -1
  338. package/dist/vue3/types/components/datepicker/datepicker_constants.d.ts.map +1 -1
  339. package/dist/vue3/types/components/datepicker/formatUtils.d.ts +5 -5
  340. package/dist/vue3/types/components/datepicker/formatUtils.d.ts.map +1 -1
  341. package/dist/vue3/types/components/datepicker/modules/calendar.vue.d.ts +0 -4
  342. package/dist/vue3/types/components/datepicker/modules/calendar.vue.d.ts.map +1 -1
  343. package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts +0 -12
  344. package/dist/vue3/types/components/datepicker/modules/month-year-picker.vue.d.ts.map +1 -1
  345. package/dist/vue3/types/components/datepicker/utils.d.ts +1 -0
  346. package/dist/vue3/types/components/datepicker/utils.d.ts.map +1 -1
  347. package/dist/vue3/types/components/dropdown/dropdown.vue.d.ts +0 -24
  348. package/dist/vue3/types/components/dropdown/dropdown.vue.d.ts.map +1 -1
  349. package/dist/vue3/types/components/emoji_picker/emoji_picker_constants.d.ts +0 -13
  350. package/dist/vue3/types/components/emoji_picker/modules/emoji_tabset.vue.d.ts.map +1 -1
  351. package/dist/vue3/types/components/icon/icon.vue.d.ts +1 -0
  352. package/dist/vue3/types/components/icon/icon_constants.d.ts.map +1 -1
  353. package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts +3 -8
  354. package/dist/vue3/types/components/image_viewer/image_viewer.vue.d.ts.map +1 -1
  355. package/dist/vue3/types/components/modal/modal.vue.d.ts +3 -35
  356. package/dist/vue3/types/components/modal/modal.vue.d.ts.map +1 -1
  357. package/dist/vue3/types/components/notice/notice.vue.d.ts +1 -34
  358. package/dist/vue3/types/components/notice/notice.vue.d.ts.map +1 -1
  359. package/dist/vue3/types/components/notice/notice_action.vue.d.ts +7 -35
  360. package/dist/vue3/types/components/notice/notice_action.vue.d.ts.map +1 -1
  361. package/dist/vue3/types/components/pagination/pagination.vue.d.ts +5 -24
  362. package/dist/vue3/types/components/pagination/pagination.vue.d.ts.map +1 -1
  363. package/dist/vue3/types/components/popover/popover.vue.d.ts +0 -33
  364. package/dist/vue3/types/components/popover/popover.vue.d.ts.map +1 -1
  365. package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts +5 -10
  366. package/dist/vue3/types/components/popover/popover_header_footer.vue.d.ts.map +1 -1
  367. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts +2 -0
  368. package/dist/vue3/types/components/rich_text_editor/rich_text_editor.vue.d.ts.map +1 -1
  369. package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts +2 -46
  370. package/dist/vue3/types/components/toast/layouts/toast_layout_alternate.vue.d.ts.map +1 -1
  371. package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts +1 -34
  372. package/dist/vue3/types/components/toast/layouts/toast_layout_default.vue.d.ts.map +1 -1
  373. package/dist/vue3/types/components/toast/toast.vue.d.ts +4 -115
  374. package/dist/vue3/types/components/toast/toast.vue.d.ts.map +1 -1
  375. package/dist/vue3/types/index.d.ts +1 -0
  376. package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts +3 -11
  377. package/dist/vue3/types/recipes/buttons/callbar_button_with_dropdown/callbar_button_with_dropdown.vue.d.ts.map +1 -1
  378. package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts +3 -10
  379. package/dist/vue3/types/recipes/buttons/callbar_button_with_popover/callbar_button_with_popover.vue.d.ts.map +1 -1
  380. package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts +4 -8
  381. package/dist/vue3/types/recipes/cards/ivr_node/ivr_node.vue.d.ts.map +1 -1
  382. package/dist/vue3/types/recipes/cards/ivr_node/ivr_node_constants.d.ts +7 -7
  383. package/dist/vue3/types/recipes/cards/ivr_node/ivr_node_constants.d.ts.map +1 -1
  384. package/dist/vue3/types/recipes/comboboxes/combobox_multi_select/combobox_multi_select.vue.d.ts.map +1 -1
  385. package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts +1 -25
  386. package/dist/vue3/types/recipes/comboboxes/combobox_with_popover/combobox_with_popover.vue.d.ts.map +1 -1
  387. package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts +3 -41
  388. package/dist/vue3/types/recipes/conversation_view/attachment_carousel/attachment_carousel.vue.d.ts.map +1 -1
  389. package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts +6 -25
  390. package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/image_carousel.vue.d.ts.map +1 -1
  391. package/dist/vue3/types/recipes/conversation_view/attachment_carousel/media_components/progress_bar.vue.d.ts +2 -2
  392. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts +6 -49
  393. package/dist/vue3/types/recipes/conversation_view/editor/editor.vue.d.ts.map +1 -1
  394. package/dist/vue3/types/recipes/conversation_view/editor/index.d.ts +1 -1
  395. package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts +6 -2
  396. package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row.vue.d.ts.map +1 -1
  397. package/dist/vue3/types/recipes/conversation_view/emoji_row/emoji_row_constants.d.ts.map +1 -1
  398. package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts +3 -8
  399. package/dist/vue3/types/recipes/conversation_view/feed_item_pill/feed_item_pill.vue.d.ts.map +1 -1
  400. package/dist/vue3/types/recipes/conversation_view/feed_item_row/feed_item_row.vue.d.ts +1 -1
  401. package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts +6 -1
  402. package/dist/vue3/types/recipes/conversation_view/message_input/extensions/meeting_pill/MeetingPill.vue.d.ts.map +1 -1
  403. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts +12 -88
  404. package/dist/vue3/types/recipes/conversation_view/message_input/message_input.vue.d.ts.map +1 -1
  405. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts +11 -1
  406. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_link.vue.d.ts.map +1 -1
  407. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts +13 -1
  408. package/dist/vue3/types/recipes/conversation_view/message_input/message_input_topbar.vue.d.ts.map +1 -1
  409. package/dist/vue3/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts +5 -8
  410. package/dist/vue3/types/recipes/leftbar/contact_centers_row/contact_centers_row.vue.d.ts.map +1 -1
  411. package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts +0 -18
  412. package/dist/vue3/types/recipes/leftbar/contact_row/contact_row.vue.d.ts.map +1 -1
  413. package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts +9 -27
  414. package/dist/vue3/types/recipes/leftbar/general_row/general_row.vue.d.ts.map +1 -1
  415. package/dist/vue3/types/recipes/leftbar/group_row/group_row.vue.d.ts +11 -21
  416. package/dist/vue3/types/recipes/leftbar/group_row/group_row.vue.d.ts.map +1 -1
  417. package/dist/vue3/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts +6 -2
  418. package/dist/vue3/types/recipes/leftbar/unread_pill/unread_pill.vue.d.ts.map +1 -1
  419. package/package.json +4 -4
  420. package/dist/vue3/common/mixins/sr-only-close-button.cjs +0 -3
  421. package/dist/vue3/common/mixins/sr-only-close-button.cjs.map +0 -1
  422. package/dist/vue3/common/mixins/sr-only-close-button.js +0 -44
  423. package/dist/vue3/common/mixins/sr-only-close-button.js.map +0 -1
  424. package/dist/vue3/lib/contact-row/contact-row-constants.cjs +0 -2
  425. package/dist/vue3/lib/contact-row/contact-row-constants.cjs.map +0 -1
  426. package/dist/vue3/lib/contact-row/contact-row-constants.js +0 -5
  427. package/dist/vue3/lib/contact-row/contact-row-constants.js.map +0 -1
  428. package/dist/vue3/lib/emoji/emoji-constants.cjs +0 -2
  429. package/dist/vue3/lib/emoji/emoji-constants.cjs.map +0 -1
  430. package/dist/vue3/lib/emoji/emoji-constants.js +0 -5
  431. package/dist/vue3/lib/emoji/emoji-constants.js.map +0 -1
  432. package/dist/vue3/lib/group-row/group-row-constants.cjs +0 -2
  433. package/dist/vue3/lib/group-row/group-row-constants.cjs.map +0 -1
  434. package/dist/vue3/lib/group-row/group-row-constants.js +0 -8
  435. package/dist/vue3/lib/group-row/group-row-constants.js.map +0 -1
  436. package/dist/vue3/lib/time-pill/time-pill-constants.cjs +0 -2
  437. package/dist/vue3/lib/time-pill/time-pill-constants.cjs.map +0 -1
  438. package/dist/vue3/lib/time-pill/time-pill-constants.js +0 -8
  439. package/dist/vue3/lib/time-pill/time-pill-constants.js.map +0 -1
  440. package/dist/vue3/types/common/mixins/sr_only_close_button.d.ts +0 -30
  441. package/dist/vue3/types/common/mixins/sr_only_close_button.d.ts.map +0 -1
  442. package/dist/vue3/types/components/emoji/emoji_constants.d.ts +0 -3
  443. package/dist/vue3/types/components/emoji/emoji_constants.d.ts.map +0 -1
  444. package/dist/vue3/types/recipes/conversation_view/time_pill/time_pill_constants.d.ts +0 -6
  445. package/dist/vue3/types/recipes/conversation_view/time_pill/time_pill_constants.d.ts.map +0 -1
  446. package/dist/vue3/types/recipes/leftbar/contact_row/contact_row_constants.d.ts +0 -3
  447. package/dist/vue3/types/recipes/leftbar/contact_row/contact_row_constants.d.ts.map +0 -1
  448. package/dist/vue3/types/recipes/leftbar/group_row/group_row_constants.d.ts +0 -6
  449. package/dist/vue3/types/recipes/leftbar/group_row/group_row_constants.d.ts.map +0 -1
@@ -1,25 +1,24 @@
1
1
  import { POPOVER_ROLES as w, POPOVER_PADDING_CLASSES as C, POPOVER_CONTENT_WIDTHS as P, POPOVER_STICKY_VALUES as S, POPOVER_INITIAL_FOCUS_STRINGS as A, POPOVER_APPEND_TO_VALUES as _, POPOVER_HEADER_FOOTER_PADDING_CLASSES as L } from "./popover-constants.js";
2
- import { getUniqueString as b, hasSlotContent as T, warnIfUnmounted as k, returnFirstEl as l, isOutOfViewPort as M, disableRootScrolling as I, enableRootScrolling as x } from "../../common/utils/index.js";
2
+ import { getUniqueString as O, hasSlotContent as T, warnIfUnmounted as k, returnFirstEl as l, isOutOfViewPort as I, disableRootScrolling as M, enableRootScrolling as x } from "../../common/utils/index.js";
3
3
  import B from "../../common/mixins/modal.js";
4
4
  import { getPopperOptions as N, createTippyPopover as V } from "./tippy-utils.js";
5
5
  import D from "./popover-header-footer.js";
6
- import q from "../../common/mixins/sr-only-close-button.js";
7
- import F from "../../shared/sr_only_close_button.js";
8
- import { resolveComponent as y, openBlock as a, createElementBlock as H, createBlock as p, Teleport as W, createElementVNode as E, withModifiers as g, createCommentVNode as c, resolveDynamicComponent as z, normalizeClass as f, withCtx as m, withKeys as h, renderSlot as v, createVNode as K, mergeProps as j, toHandlers as G } from "vue";
6
+ import q from "../../shared/sr_only_close_button.js";
7
+ import { resolveComponent as y, openBlock as a, createElementBlock as F, createBlock as p, Teleport as H, createElementVNode as E, withModifiers as g, createCommentVNode as c, resolveDynamicComponent as W, normalizeClass as f, withCtx as m, withKeys as h, renderSlot as v, createVNode as z, mergeProps as K, toHandlers as G } from "vue";
9
8
  import { _ as U } from "../../_plugin-vue_export-helper-CHgC5LLL.js";
10
- import R from "../lazy-show/lazy-show.js";
11
- const Y = {
9
+ import j from "../lazy-show/lazy-show.js";
10
+ const R = {
12
11
  compatConfig: { MODE: 3 },
13
12
  name: "DtPopover",
14
13
  /********************
15
14
  * CHILD COMPONENTS *
16
15
  ********************/
17
16
  components: {
18
- SrOnlyCloseButton: F,
19
- DtLazyShow: R,
17
+ SrOnlyCloseButton: q,
18
+ DtLazyShow: j,
20
19
  PopoverHeaderFooter: D
21
20
  },
22
- mixins: [B, q],
21
+ mixins: [B],
23
22
  props: {
24
23
  /**
25
24
  * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.
@@ -83,14 +82,6 @@ const Y = {
83
82
  type: String,
84
83
  default: null
85
84
  },
86
- /**
87
- * A set of props to be passed into the popover's header close button.
88
- * Requires an 'ariaLabel' property, when the header popover is visible
89
- */
90
- closeButtonProps: {
91
- type: Object,
92
- default: () => ({})
93
- },
94
85
  /**
95
86
  * Padding size class for the popover content.
96
87
  * @values none, small, medium, large
@@ -145,7 +136,7 @@ const Y = {
145
136
  id: {
146
137
  type: String,
147
138
  default() {
148
- return b();
139
+ return O();
149
140
  }
150
141
  },
151
142
  /**
@@ -407,7 +398,7 @@ const Y = {
407
398
  return this.isOutsideViewport && this.modal ? "calc(100vh - var(--dt-space-300))" : this.maxHeight;
408
399
  },
409
400
  labelledBy() {
410
- return this.ariaLabelledby || !this.ariaLabel && b("DtPopover__anchor");
401
+ return this.ariaLabelledby || !this.ariaLabel && O("DtPopover__anchor");
411
402
  }
412
403
  },
413
404
  watch: {
@@ -487,7 +478,7 @@ const Y = {
487
478
  var s;
488
479
  const t = (s = e == null ? void 0 : e[0]) == null ? void 0 : s.target;
489
480
  if (!t) return;
490
- const o = M(t);
481
+ const o = I(t);
491
482
  this.isOutsideViewport = o.bottom || o.top;
492
483
  },
493
484
  popperOptions() {
@@ -554,7 +545,7 @@ const Y = {
554
545
  if (this.modal) {
555
546
  const o = (e = this.anchorEl) == null ? void 0 : e.closest("body, .tippy-box");
556
547
  if (!o) return;
557
- ((t = o.tagName) == null ? void 0 : t.toLowerCase()) === "body" ? (I(this.anchorEl.getRootNode().host), this.tip.setProps({ offset: this.offset })) : o.classList.add("d-zi-popover");
548
+ ((t = o.tagName) == null ? void 0 : t.toLowerCase()) === "body" ? (M(this.anchorEl.getRootNode().host), this.tip.setProps({ offset: this.offset })) : o.classList.add("d-zi-popover");
558
549
  }
559
550
  },
560
551
  /*
@@ -676,11 +667,11 @@ const Y = {
676
667
  this.$emit("mouseleave-popover-anchor");
677
668
  }
678
669
  }
679
- }, Z = ["id", "data-qa", "tabindex"], X = ["data-qa"];
680
- function J(e, t, o, s, r, n) {
681
- const d = y("popover-header-footer"), u = y("sr-only-close-button"), O = y("dt-lazy-show");
682
- return a(), H("div", null, [
683
- o.modal && r.isOpen ? (a(), p(W, {
670
+ }, Y = ["id", "data-qa", "tabindex"], Z = ["data-qa"];
671
+ function X(e, t, o, s, r, n) {
672
+ const d = y("popover-header-footer"), u = y("sr-only-close-button"), b = y("dt-lazy-show");
673
+ return a(), F("div", null, [
674
+ o.modal && r.isOpen ? (a(), p(H, {
684
675
  key: 0,
685
676
  to: "body"
686
677
  }, [
@@ -690,7 +681,7 @@ function J(e, t, o, s, r, n) {
690
681
  }, ["prevent", "stop"]))
691
682
  })
692
683
  ])) : c("", !0),
693
- (a(), p(z(o.elementType), {
684
+ (a(), p(W(o.elementType), {
694
685
  ref: "popover",
695
686
  class: f(["d-popover", { "d-popover__anchor--opened": r.isOpen }]),
696
687
  "data-qa": "dt-popover-container"
@@ -720,8 +711,8 @@ function J(e, t, o, s, r, n) {
720
711
  "aria-haspopup": o.role
721
712
  }
722
713
  })
723
- ], 40, Z),
724
- K(O, j({
714
+ ], 40, Y),
715
+ z(b, K({
725
716
  id: o.id,
726
717
  ref: "content",
727
718
  role: o.role,
@@ -752,14 +743,13 @@ function J(e, t, o, s, r, n) {
752
743
  "content-class": o.headerClass,
753
744
  type: "header",
754
745
  "show-close-button": o.showCloseButton,
755
- "close-button-props": o.closeButtonProps,
756
746
  onClose: n.closePopover
757
747
  }, {
758
748
  content: m(() => [
759
749
  v(e.$slots, "headerContent", { close: n.closePopover })
760
750
  ]),
761
751
  _: 3
762
- }, 8, ["class", "content-class", "show-close-button", "close-button-props", "onClose"])) : c("", !0),
752
+ }, 8, ["class", "content-class", "show-close-button", "onClose"])) : c("", !0),
763
753
  E("div", {
764
754
  ref: "popover__content",
765
755
  "data-qa": e.$attrs["data-qa"] ? `${e.$attrs["data-qa"]}-content` : "dt-popover-content",
@@ -770,7 +760,7 @@ function J(e, t, o, s, r, n) {
770
760
  ])
771
761
  }, [
772
762
  v(e.$slots, "content", { close: n.closePopover })
773
- ], 10, X),
763
+ ], 10, Z),
774
764
  r.hasSlotContent(e.$slots.footerContent) ? (a(), p(d, {
775
765
  key: 1,
776
766
  ref: "popover__footer",
@@ -783,11 +773,10 @@ function J(e, t, o, s, r, n) {
783
773
  ]),
784
774
  _: 3
785
775
  }, 8, ["class", "content-class"])) : c("", !0),
786
- e.showVisuallyHiddenClose ? (a(), p(u, {
776
+ o.showCloseButton ? c("", !0) : (a(), p(u, {
787
777
  key: 2,
788
- "visually-hidden-close-label": e.visuallyHiddenCloseLabel,
789
778
  onClose: n.closePopover
790
- }, null, 8, ["visually-hidden-close-label", "onClose"])) : c("", !0)
779
+ }, null, 8, ["onClose"]))
791
780
  ]),
792
781
  _: 3
793
782
  }, 16, ["id", "role", "data-qa", "aria-hidden", "aria-labelledby", "aria-label", "aria-modal", "transition", "show", "appear", "class", "style", "css", "tabindex", "onMouseenter", "onMouseleave"])
@@ -796,8 +785,8 @@ function J(e, t, o, s, r, n) {
796
785
  }, 8, ["class"]))
797
786
  ]);
798
787
  }
799
- const ae = /* @__PURE__ */ U(Y, [["render", J]]);
788
+ const re = /* @__PURE__ */ U(R, [["render", X]]);
800
789
  export {
801
- ae as default
790
+ re as default
802
791
  };
803
792
  //# sourceMappingURL=popover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n :close-button-props=\"closeButtonProps\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"showVisuallyHiddenClose\"\n :visually-hidden-close-label=\"visuallyHiddenCloseLabel\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButtonMixin from '@/common/mixins/sr_only_close_button';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin, SrOnlyCloseButtonMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * A set of props to be passed into the popover's header close button.\n * Requires an 'ariaLabel' property, when the header popover is visible\n */\n closeButtonProps: {\n type: Object,\n default: () => ({}),\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': event => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': event => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : returnFirstEl(this.$refs.content?.$el).focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","ModalMixin","SrOnlyCloseButtonMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","hasSlotContent","event","modal","_a","offset","placement","open","contentAppear","isOpen","isPrev","warnIfUnmounted","returnFirstEl","externalAnchorEl","_b","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","_c","element","disableRootScrolling","enableRootScrolling","result","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover","_hoisted_1","_hoisted_2","_createElementBlock","$props","$data","_createBlock","_Teleport","_createElementVNode","_cache","_withModifiers","_createCommentVNode","_resolveDynamicComponent","_normalizeClass","_withCtx","$options","_ctx","args","_withKeys","$event","_renderSlot","_createVNode","_component_dt_lazy_show","_mergeProps","_toHandlers","_component_popover_header_footer","_component_sr_only_close_button"],"mappings":";;;;;;;;;;AAoJA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA;AAAA;AAAA;AAAA,EAKN,YAAY;AAAA,IACV,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA,EACD;AAAA,EAED,QAAQ,CAACC,GAAYC,CAAsB;AAAA,EAE3C,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA,IAKD,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA,IAMD,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW,CAACC,MACHC,EAAc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Ac,eAACW,EAAM,OAAC,aAAa,UAD3CV,EAcwBmB,GAAA;AAAA,cAlHhC,KAAA;AAAA,cAsGU,KAAI;AAAA,cACJ,MAAK;AAAA,cACJ,OAxGXZ,EAwGkBR,EAAqC,sCAACD,EAAO,OAAA,CAAA;AAAA,cACpD,iBAAeA,EAAW;AAAA;cAEhB,WAET,MAGE;AAAA,gBAHFgB,EAGEJ,EAAA,QAAA,iBAAA,EADC,OAAOD,EAAY,cAAA;AAAA;cA/GlC,GAAA;AAAA,iDAAAJ,EAAA,IAAA,EAAA;AAAA,YAoHgBK,EAAuB,gCAD/BV,EAIEoB,GAAA;AAAA,cAvHV,KAAA;AAAA,cAqHW,+BAA6BV,EAAwB;AAAA,cACrD,SAAOD,EAAY;AAAA,uEAtH9BJ,EAAA,IAAA,EAAA;AAAA;UAAA,GAAA;AAAA;;MAAA,GAAA;AAAA;;;;"}
1
+ {"version":3,"file":"popover.js","sources":["../../../components/popover/popover.vue"],"sourcesContent":["<!-- eslint-disable vuejs-accessibility/mouse-events-have-key-events -->\n<template>\n <div>\n <Teleport\n v-if=\"modal && isOpen\"\n to=\"body\"\n >\n <div\n class=\"d-modal--transparent\"\n @click.prevent.stop\n />\n </Teleport>\n <component\n :is=\"elementType\"\n ref=\"popover\"\n :class=\"['d-popover', { 'd-popover__anchor--opened': isOpen }]\"\n data-qa=\"dt-popover-container\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/no-static-element-interactions -->\n <div\n :id=\"!ariaLabelledby && labelledBy\"\n ref=\"anchor\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-anchor` : 'dt-popover-anchor'\"\n :tabindex=\"openOnContext ? 0 : undefined\"\n @click.capture=\"defaultToggleOpen\"\n @contextmenu=\"onContext\"\n @keydown.up.prevent=\"onArrowKeyPress\"\n @keydown.down.prevent=\"onArrowKeyPress\"\n @keydown.escape.capture=\"closePopover\"\n @keydown.enter=\"$emit('keydown', $event)\"\n @keydown.space=\"$emit('keydown', $event)\"\n @mouseenter=\"onMouseEnter\"\n @mouseleave=\"onMouseLeave\"\n >\n <!-- @slot Anchor element that activates the popover. Usually a button. -->\n <slot\n name=\"anchor\"\n :attrs=\"{\n 'aria-expanded': isOpen.toString(),\n 'aria-controls': id,\n 'aria-haspopup': role,\n }\"\n />\n </div>\n <dt-lazy-show\n :id=\"id\"\n ref=\"content\"\n :role=\"role\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}__dialog` : 'dt-popover'\"\n :aria-hidden=\"`${!isOpen}`\"\n :aria-labelledby=\"labelledBy\"\n :aria-label=\"ariaLabel\"\n :aria-modal=\"`${!modal}`\"\n :transition=\"transition\"\n :show=\"isOpen\"\n :appear=\"toAppear\"\n :class=\"['d-popover__dialog', { 'd-popover__dialog--modal': modal }, dialogClass]\"\n :style=\"{\n 'max-height': calculatedMaxHeight,\n 'max-width': maxWidth,\n }\"\n :css=\"$attrs.css\"\n :tabindex=\"contentTabindex\"\n v-on=\"popoverListeners\"\n @mouseenter=\"onMouseEnterAnchor\"\n @mouseleave=\"onMouseLeaveAnchor\"\n >\n <popover-header-footer\n v-if=\"hasSlotContent($slots.headerContent) || showCloseButton\"\n ref=\"popover__header\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"headerClass\"\n type=\"header\"\n :show-close-button=\"showCloseButton\"\n @close=\"closePopover\"\n >\n <template #content>\n <!-- @slot Slot for popover header content -->\n <slot\n name=\"headerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <div\n ref=\"popover__content\"\n :data-qa=\"$attrs['data-qa'] ? `${$attrs['data-qa']}-content` : 'dt-popover-content'\"\n :class=\"[\n 'd-popover__content',\n POPOVER_PADDING_CLASSES[padding],\n contentClass,\n ]\"\n >\n <!-- @slot Slot for the content that is displayed in the popover when it is open. -->\n <slot\n name=\"content\"\n :close=\"closePopover\"\n />\n </div>\n <popover-header-footer\n v-if=\"hasSlotContent($slots.footerContent)\"\n ref=\"popover__footer\"\n type=\"footer\"\n :class=\"POPOVER_HEADER_FOOTER_PADDING_CLASSES[padding]\"\n :content-class=\"footerClass\"\n >\n <template #content>\n <!-- @slot Slot for the footer content. -->\n <slot\n name=\"footerContent\"\n :close=\"closePopover\"\n />\n </template>\n </popover-header-footer>\n <sr-only-close-button\n v-if=\"!showCloseButton\"\n @close=\"closePopover\"\n />\n </dt-lazy-show>\n </component>\n </div>\n</template>\n\n<script>\n/* eslint-disable max-lines */\nimport {\n POPOVER_APPEND_TO_VALUES,\n POPOVER_CONTENT_WIDTHS,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n POPOVER_INITIAL_FOCUS_STRINGS,\n POPOVER_PADDING_CLASSES,\n POPOVER_ROLES,\n POPOVER_STICKY_VALUES,\n} from './popover_constants';\nimport { getUniqueString, hasSlotContent, isOutOfViewPort, warnIfUnmounted, disableRootScrolling, enableRootScrolling, returnFirstEl } from '@/common/utils';\nimport { DtLazyShow } from '@/components/lazy_show';\nimport ModalMixin from '@/common/mixins/modal';\nimport { createTippyPopover, getPopperOptions } from './tippy_utils';\nimport PopoverHeaderFooter from './popover_header_footer.vue';\nimport SrOnlyCloseButton from '@/common/sr_only_close_button.vue';\n\n/**\n * A Popover displays a content overlay when its anchor element is activated.\n * @see https://dialtone.dialpad.com/components/popover.html\n */\nexport default {\n compatConfig: { MODE: 3 },\n name: 'DtPopover',\n\n /********************\n * CHILD COMPONENTS *\n ********************/\n components: {\n SrOnlyCloseButton,\n DtLazyShow,\n PopoverHeaderFooter,\n },\n\n mixins: [ModalMixin],\n\n props: {\n /**\n * Controls whether the popover is shown. Leaving this null will have the popover trigger on click by default.\n * If you set this value, the default trigger behavior will be disabled, and you can control it as you need.\n * Supports v-model\n * @values null, true, false\n */\n open: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Opens the popover on right click (context menu). If you set this value to `true`,\n * the default trigger behavior will be disabled.\n * @values true, false\n */\n openOnContext: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Element type (tag name) of the root element of the component.\n */\n elementType: {\n type: String,\n default: 'div',\n },\n\n /**\n * Named transition when the content display is toggled.\n * @see DtLazyShow\n */\n transition: {\n type: String,\n default: 'fade',\n },\n\n /**\n * ARIA role for the content of the popover. Defaults to \"dialog\".\n * <a class=\"d-link\" href=\"https://www.w3.org/TR/wai-aria/#aria-haspopup\" target=\"_blank\">aria-haspopup</a>\n */\n role: {\n type: String,\n default: 'dialog',\n validator: (role) => {\n return POPOVER_ROLES.includes(role);\n },\n },\n\n /**\n * ID of the element that serves as the label for the popover content.\n * Defaults to the \"anchor\" element; this exists to provide a different\n * ID of the label element if, for example, the anchor slot contains\n * other items that do not serve as a label. You should provide this\n * or ariaLabel, but not both.\n */\n ariaLabelledby: {\n type: String,\n default: null,\n },\n\n /**\n * Descriptive label for the popover content. You should provide this\n * or ariaLabelledby, but not both.\n */\n ariaLabel: {\n type: String,\n default: null,\n },\n\n /**\n * Padding size class for the popover content.\n * @values none, small, medium, large\n */\n padding: {\n type: String,\n default: 'large',\n validator: (padding) => {\n return Object.keys(POPOVER_PADDING_CLASSES).some((item) => item === padding);\n },\n },\n\n /**\n * Additional class name for the content wrapper element.\n */\n contentClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Width configuration for the popover content. When its value is 'anchor',\n * the popover content will have the same width as the anchor.\n * @values null, anchor\n */\n contentWidth: {\n type: String,\n default: '',\n validator: contentWidth => POPOVER_CONTENT_WIDTHS.includes(contentWidth),\n },\n\n /**\n * Whether to apply transition on initial render in the content lazy show component.\n */\n contentAppear: {\n type: Boolean,\n default: null,\n },\n\n /**\n * Tabindex value for the content. Passing null, no tabindex attribute will be set.\n */\n contentTabindex: {\n type: Number || null,\n default: -1,\n },\n\n /**\n * External anchor id to use in those cases the anchor can't be provided via the slot.\n * For instance, using the combobox's input as the anchor for the popover.\n */\n externalAnchor: {\n type: String,\n default: '',\n },\n\n /**\n * The id of the tooltip\n */\n id: {\n type: String,\n default () { return getUniqueString(); },\n },\n\n /**\n * Displaces the content box from its anchor element\n * by the specified number of pixels.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#offset\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n */\n offset: {\n type: Array,\n default: () => [0, 4],\n },\n\n /**\n * Determines if the popover hides upon clicking the\n * anchor or outside the content box.\n * @values true, false\n */\n hideOnClick: {\n type: Boolean,\n default: true,\n },\n\n /**\n * Determines modal state. If enabled popover has a modal overlay\n * preventing interaction with elements below it, but it is invisible.\n * @values true, false\n */\n modal: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover does not fit in the direction described by \"placement\",\n * it will attempt to change its direction to the \"fallbackPlacements\".\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/flip/#fallbackplacements\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * */\n fallbackPlacements: {\n type: Array,\n default: () => {\n return ['auto'];\n },\n },\n\n /**\n * The direction the popover displays relative to the anchor.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#placement\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values top, top-start, top-end,\n * right, right-start, right-end,\n * left, left-start, left-end,\n * bottom, bottom-start, bottom-end,\n * auto, auto-start, auto-end\n */\n placement: {\n type: String,\n default: 'bottom-end',\n },\n\n /**\n * If set to false the dialog will display over top of the anchor when there is insufficient space.\n * If set to true it will never move from its position relative to the anchor and will clip instead.\n * <a\n * class=\"d-link\"\n * href=\"https://popper.js.org/docs/v2/modifiers/prevent-overflow/#tether\"\n * target=\"_blank\"\n * >\n * Popper.js docs\n * </a>\n * @values true, false\n */\n tether: {\n type: Boolean,\n default: true,\n },\n\n /**\n * If the popover sticks to the anchor. This is usually not needed, but can be needed\n * if the reference element's position is animating, or to automatically update the popover\n * position in those cases the DOM layout changes the reference element's position.\n * `true` enables it, `reference` only checks the \"reference\" rect for changes and `popper` only\n * checks the \"popper\" rect for changes.\n * <a\n * class=\"d-link\"\n * href=\"https://atomiks.github.io/tippyjs/v6/all-props/#sticky\"\n * target=\"_blank\"\n * >\n * Tippy.js docs\n * </a>\n * @values true, false, reference, popper\n */\n sticky: {\n type: [Boolean, String],\n default: false,\n validator: (sticky) => {\n return POPOVER_STICKY_VALUES.includes(sticky);\n },\n },\n\n /**\n * Determines maximum height for the popover before overflow.\n * Possible units rem|px|em\n */\n maxHeight: {\n type: String,\n default: '',\n },\n\n /**\n * Determines maximum width for the popover before overflow.\n * Possible units rem|px|%|em\n */\n maxWidth: {\n type: String,\n default: '',\n },\n\n /**\n * Determines visibility for close button\n * @values true, false\n */\n showCloseButton: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Additional class name for the header content wrapper element.\n */\n headerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the footer content wrapper element.\n */\n footerClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * Additional class name for the dialog element.\n */\n dialogClass: {\n type: [String, Array, Object],\n default: '',\n },\n\n /**\n * The element that is focused when the popover is opened. This can be an\n * HTMLElement within the popover, a string starting with '#' which will\n * find the element by ID. 'first' which will automatically focus\n * the first element, or 'dialog' which will focus the dialog window itself.\n * If the dialog is modal this prop cannot be 'none'.\n * @values none, dialog, first\n */\n initialFocusElement: {\n type: [String, HTMLElement],\n default: 'first',\n validator: initialFocusElement => {\n return POPOVER_INITIAL_FOCUS_STRINGS.includes(initialFocusElement) ||\n (initialFocusElement instanceof HTMLElement) ||\n initialFocusElement.startsWith('#');\n },\n },\n\n /**\n * If the popover should open pressing up or down arrow key on the anchor element.\n * This can be set when not passing open prop.\n * @values true, false\n */\n openWithArrowKeys: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets the element to which the popover is going to append to.\n * 'body' will append to the nearest body (supports shadow DOM).\n * 'root' will try append to the iFrame's parent body if it is contained in an iFrame\n * and has permissions to access it, else, it'd default to 'parent'.\n * @values 'body', 'parent', 'root', HTMLElement\n */\n appendTo: {\n type: [HTMLElement, String],\n default: 'body',\n validator: appendTo => {\n return POPOVER_APPEND_TO_VALUES.includes(appendTo) ||\n (appendTo instanceof HTMLElement);\n },\n },\n },\n\n emits: [\n /**\n * Native keydown event\n *\n * @event keydown\n * @type {KeyboardEvent}\n */\n 'keydown',\n\n /**\n * Event fired to sync the open prop with the parent component\n * @event update:open\n */\n 'update:open',\n\n /**\n * Emitted when popover is shown or hidden\n *\n * @event opened\n * @type {Boolean | Array}\n */\n 'opened',\n\n /**\n * Emitted when the mouse enters the popover\n *\n * @event mouseenter-popover\n */\n 'mouseenter-popover',\n\n /**\n * Emitted when the mouse leaves the popover\n *\n * @event mouseleave-popover\n */\n 'mouseleave-popover',\n\n /**\n * Emitted when the mouse enters the popover anchor\n *\n * @event mouseenter-popover-anchor\n */\n 'mouseenter-popover-anchor',\n\n /**\n * Emitted when the mouse leaves the popover anchor\n *\n * @event mouseleave-popover-anchor\n */\n 'mouseleave-popover-anchor',\n ],\n\n data () {\n return {\n POPOVER_PADDING_CLASSES,\n POPOVER_HEADER_FOOTER_PADDING_CLASSES,\n intersectionObserver: null,\n isOutsideViewport: false,\n isOpen: false,\n toAppear: false,\n anchorEl: null,\n popoverContentEl: null,\n hasSlotContent,\n };\n },\n\n computed: {\n popoverListeners () {\n return {\n keydown: event => {\n this.onKeydown(event);\n },\n\n 'after-leave': event => {\n this.onLeaveTransitionComplete();\n },\n\n 'after-enter': event => {\n this.onEnterTransitionComplete();\n },\n };\n },\n\n calculatedMaxHeight () {\n if (this.isOutsideViewport && this.modal) {\n return `calc(100vh - var(--dt-space-300))`;\n }\n return this.maxHeight;\n },\n\n labelledBy () {\n // aria-labelledby should be set only if aria-labelledby is passed as a prop, or if\n // there is no aria-label and the labelledby should point to the anchor.\n return this.ariaLabelledby || (!this.ariaLabel && getUniqueString('DtPopover__anchor'));\n },\n },\n\n watch: {\n $props: {\n immediate: true,\n deep: true,\n handler () {\n this.validateProps();\n },\n },\n\n modal (modal) {\n this.tip?.setProps({\n zIndex: modal ? 650 : this.calculateAnchorZindex(),\n });\n },\n\n offset (offset) {\n this.tip?.setProps({\n offset,\n });\n },\n\n sticky (sticky) {\n this.tip?.setProps({\n sticky,\n });\n },\n\n fallbackPlacements () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n tether () {\n this.tip?.setProps({\n popperOptions: this.popperOptions(),\n });\n },\n\n placement (placement) {\n this.tip?.setProps({\n placement,\n });\n },\n\n open: {\n handler: function (open) {\n if (open !== null) {\n this.isOpen = open;\n }\n if (open === true) {\n this.toAppear = true;\n }\n },\n\n immediate: true,\n },\n\n contentAppear: {\n handler: function (contentAppear) {\n if (contentAppear !== null) {\n this.toAppear = contentAppear;\n }\n },\n },\n\n isOpen (isOpen, isPrev) {\n if (isOpen) {\n this.initTippyInstance();\n this.tip.show();\n } else if (!isOpen && isPrev !== isOpen) {\n this.removeEventListeners();\n this.tip.hide();\n }\n },\n },\n\n mounted () {\n warnIfUnmounted(returnFirstEl(this.$el), this.$options.name);\n\n const externalAnchorEl = this.externalAnchor\n ? this.$refs.anchor.getRootNode().querySelector(`#${this.externalAnchor}`)\n : null;\n this.anchorEl = externalAnchorEl ?? this.$refs.anchor.children[0];\n this.popoverContentEl = returnFirstEl(this.$refs.content?.$el);\n\n if (this.isOpen) {\n this.initTippyInstance();\n this.tip.show();\n }\n\n // rootMargin here must be greater than the margin of the height we are setting in calculatedMaxHeight which\n // currently is var(--dt-space-300) (4px). If not the intersectionObserver will continually trigger in an infinite\n // loop.\n // threshold 1.0 makes this trigger every time the dialog \"touches\" the edge of the viewport.\n this.intersectionObserver = new IntersectionObserver(this.hasIntersectedViewport);\n this.intersectionObserver.observe(this.popoverContentEl);\n },\n\n beforeUnmount () {\n this.tip?.destroy();\n this.intersectionObserver?.disconnect();\n this.removeReferences();\n this.removeEventListeners();\n },\n\n /******************\n * METHODS *\n ******************/\n methods: {\n\n hasIntersectedViewport (entries) {\n const dialog = entries?.[0]?.target;\n if (!dialog) return;\n const isOut = isOutOfViewPort(dialog);\n this.isOutsideViewport = isOut.bottom || isOut.top;\n },\n\n popperOptions () {\n return getPopperOptions({\n fallbackPlacements: this.fallbackPlacements,\n tether: this.tether,\n hasHideModifierEnabled: true,\n });\n },\n\n validateProps () {\n if (this.modal && this.initialFocusElement === 'none') {\n console.error('If the popover is modal you must set the ' +\n 'initialFocusElement prop. Possible values: \"dialog\", \"first\", HTMLElement');\n }\n },\n\n calculateAnchorZindex () {\n // if a modal is currently active render at modal-element z-index, otherwise at popover z-index\n if (returnFirstEl(this.$el).getRootNode()\n .querySelector('.d-modal[aria-hidden=\"false\"], .d-modal--transparent[aria-hidden=\"false\"]') ||\n // Special case because we don't have any dialtone drawer component yet. Render at 650 when\n // anchor of popover is within a drawer.\n this.anchorEl?.closest('.d-zi-drawer')) {\n return 650;\n } else {\n return 300;\n }\n },\n\n defaultToggleOpen (e) {\n if (this.openOnContext) { return; }\n\n // Only use default toggle behaviour if the user has not set the open prop.\n // Check that the anchor element specifically was clicked.\n if (this.open === null || this.open === undefined) {\n if ((!this.anchorEl?.contains(e.target) && !this.anchorEl?.isEqualNode(e.target)) || this.anchorEl?.disabled) {\n return;\n }\n\n this.toggleOpen();\n }\n },\n\n async onContext (event) {\n if (!this.openOnContext) { return; }\n\n event.preventDefault();\n\n this.isOpen = true;\n await this.$nextTick();\n this.tip.setProps({\n placement: 'right-start',\n getReferenceClientRect: () => ({\n width: 0,\n height: 0,\n top: event.clientY,\n bottom: event.clientY,\n left: event.clientX,\n right: event.clientX,\n }),\n });\n },\n\n toggleOpen () {\n this.isOpen = !this.isOpen;\n },\n\n onArrowKeyPress (e) {\n if (this.open !== null) { return; }\n if (this.openWithArrowKeys && this.anchorEl?.contains(e.target)) {\n if (!this.isOpen) {\n this.isOpen = true;\n }\n }\n\n this.$emit('keydown', e);\n },\n\n addEventListeners () {\n window.addEventListener('dt-popover-close', this.closePopover);\n // align popover content width when contentWidth is 'anchor'\n if (this.contentWidth === 'anchor') {\n window.addEventListener('resize', this.onResize);\n }\n },\n\n removeEventListeners () {\n window.removeEventListener('dt-popover-close', this.closePopover);\n if (this.contentWidth === 'anchor') {\n window.removeEventListener('resize', this.onResize);\n }\n },\n\n closePopover () {\n this.isOpen = false;\n },\n\n /*\n * Prevents scrolling outside of the currently opened modal popover by:\n * - when anchor is not within another popover: setting the body to overflow: hidden\n * - when anchor is within another popover: set the popover dialog container to it's non-modal z-index\n * since it is no longer the active modal. This puts it underneath the overlay and prevents scrolling.\n **/\n preventScrolling () {\n if (this.modal) {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n disableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.add('d-zi-popover');\n }\n }\n },\n\n /*\n * Resets the prevent scrolling properties set in preventScrolling() back to normal.\n **/\n enableScrolling () {\n const element = this.anchorEl?.closest('body, .tippy-box');\n if (!element) return;\n if (element.tagName?.toLowerCase() === 'body') {\n enableRootScrolling(this.anchorEl.getRootNode().host);\n this.tip.setProps({ offset: this.offset });\n } else {\n element.classList.remove('d-zi-popover');\n }\n },\n\n removeReferences () {\n this.anchorEl = null;\n this.popoverContentEl = null;\n this.tip = null;\n },\n\n async onShow () {\n if (this.contentWidth === 'anchor') {\n await this.setPopoverContentAnchorWidth();\n }\n\n if (this.contentWidth === null) {\n this.popoverContentEl.style.width = 'auto';\n }\n\n this.addEventListeners();\n },\n\n async onLeaveTransitionComplete () {\n if (this.modal) {\n await this.focusFirstElement(this.$refs.anchor);\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.enableScrolling();\n }\n this.tip?.unmount();\n this.$emit('opened', false);\n if (this.open !== null) {\n this.$emit('update:open', false);\n }\n },\n\n async onEnterTransitionComplete () {\n this.focusInitialElement();\n // await next tick in case the user wants to change focus themselves.\n await this.$nextTick();\n this.preventScrolling();\n this.$emit('opened', true, this.$refs.popover__content);\n if (this.open !== null) {\n this.$emit('update:open', true);\n }\n },\n\n focusInitialElement () {\n if (this.initialFocusElement === 'dialog') {\n returnFirstEl(this.$refs.content?.$el)?.focus();\n }\n // find by ID\n if (this.initialFocusElement.startsWith('#')) {\n this.focusInitialElementById();\n }\n if (this.initialFocusElement === 'first') {\n this.focusFirstElementIfNeeded(this.$refs.popover__content);\n }\n if (this.initialFocusElement instanceof HTMLElement) {\n this.initialFocusElement.focus();\n }\n },\n\n focusInitialElementById () {\n const result = returnFirstEl(this.$refs.content?.$el)?.querySelector(this.initialFocusElement);\n if (result) {\n result.focus();\n } else {\n console.warn('Could not find the element specified in dt-popover prop \"initialFocusElement\". ' +\n 'Defaulting to focusing the dialog.');\n }\n result ? result.focus() : returnFirstEl(this.$refs.content?.$el).focus();\n },\n\n onResize () {\n this.closePopover();\n },\n\n onClickOutside () {\n if (!this.hideOnClick) return;\n // If a popover is opened inside of this one, do not hide on click out\n const innerModals = this.popoverContentEl?.querySelector('.d-popover__anchor--opened');\n if (!innerModals) {\n this.closePopover();\n }\n },\n\n onKeydown (e) {\n if (e.key === 'Tab') {\n if (this.modal) {\n this.focusTrappedTabPress(e, this.popoverContentEl);\n }\n }\n if (e.key === 'Escape') {\n this.closePopover();\n }\n\n this.$emit('keydown', e);\n },\n\n async setPopoverContentAnchorWidth () {\n await this.$nextTick();\n this.popoverContentEl.style.width = `${this.anchorEl?.clientWidth}px`;\n },\n\n focusFirstElementIfNeeded (domEl) {\n const focusableElements = this._getFocusableElements(domEl, true);\n if (focusableElements.length !== 0) {\n this.focusFirstElement(domEl);\n } else if (this.showCloseButton) {\n this.$refs.popover__header?.focusCloseButton();\n } else {\n // if there are no focusable elements at all focus the dialog itself\n returnFirstEl(this.$refs.content?.$el).focus();\n }\n },\n\n /**\n * Return's the anchor ClientRect object relative to the window.\n * Refer to: https://atomiks.github.io/tippyjs/v6/all-props/#getreferenceclientrect for more information\n * @param error\n */\n getReferenceClientRect (error) {\n const anchorReferenceRect = this.anchorEl?.getBoundingClientRect();\n\n if (this.appendTo !== 'root' || error) return anchorReferenceRect;\n\n const anchorOwnerDocument = this.anchorEl?.ownerDocument;\n const anchorParentWindow = anchorOwnerDocument?.defaultView || anchorOwnerDocument?.parentWindow;\n const anchorIframe = anchorParentWindow?.frameElement;\n\n if (!anchorIframe) return anchorReferenceRect;\n\n const iframeReferenceRect = anchorIframe.getBoundingClientRect();\n\n return {\n width: anchorReferenceRect?.width,\n height: anchorReferenceRect?.height,\n top: iframeReferenceRect?.top + anchorReferenceRect?.top,\n left: iframeReferenceRect?.left + anchorReferenceRect?.left,\n right: iframeReferenceRect?.right + anchorReferenceRect?.right,\n bottom: iframeReferenceRect?.bottom + anchorReferenceRect?.bottom,\n };\n },\n\n initTippyInstance () {\n let internalAppendTo = null;\n let iFrameError = false;\n\n switch (this.appendTo) {\n case 'body':\n internalAppendTo = this.anchorEl?.getRootNode()?.querySelector('body');\n break;\n\n case 'root':\n // Try to attach the popover to root document, fallback to parent is fail\n try {\n internalAppendTo = window.parent.document.body;\n } catch (err) {\n console.error('Could not attach the popover to iframe parent window: ', err);\n internalAppendTo = 'parent';\n iFrameError = true;\n }\n break;\n\n default:\n internalAppendTo = this.appendTo;\n break;\n }\n\n this.tip = createTippyPopover(this.anchorEl, {\n popperOptions: this.popperOptions(),\n contentElement: this.popoverContentEl,\n placement: this.placement,\n offset: this.offset,\n sticky: this.sticky,\n appendTo: internalAppendTo,\n interactive: true,\n trigger: 'manual',\n getReferenceClientRect: () => this.getReferenceClientRect(iFrameError),\n // We have to manage hideOnClick functionality manually to handle\n // popover within popover situations.\n hideOnClick: false,\n zIndex: this.modal ? 650 : this.calculateAnchorZindex(),\n onClickOutside: this.onClickOutside,\n onShow: this.onShow,\n });\n },\n\n onMouseEnter () {\n this.$emit('mouseenter-popover');\n },\n\n onMouseLeave () {\n this.$emit('mouseleave-popover');\n },\n\n onMouseEnterAnchor () {\n this.$emit('mouseenter-popover-anchor');\n },\n\n onMouseLeaveAnchor () {\n this.$emit('mouseleave-popover-anchor');\n },\n },\n};\n</script>\n"],"names":["_sfc_main","SrOnlyCloseButton","DtLazyShow","PopoverHeaderFooter","ModalMixin","role","POPOVER_ROLES","padding","POPOVER_PADDING_CLASSES","item","contentWidth","POPOVER_CONTENT_WIDTHS","getUniqueString","sticky","POPOVER_STICKY_VALUES","initialFocusElement","POPOVER_INITIAL_FOCUS_STRINGS","appendTo","POPOVER_APPEND_TO_VALUES","POPOVER_HEADER_FOOTER_PADDING_CLASSES","hasSlotContent","event","modal","_a","offset","placement","open","contentAppear","isOpen","isPrev","warnIfUnmounted","returnFirstEl","externalAnchorEl","_b","entries","dialog","isOut","isOutOfViewPort","getPopperOptions","_c","element","disableRootScrolling","enableRootScrolling","result","domEl","error","anchorReferenceRect","anchorOwnerDocument","anchorParentWindow","anchorIframe","iframeReferenceRect","internalAppendTo","iFrameError","err","createTippyPopover","_hoisted_1","_hoisted_2","_createElementBlock","$props","$data","_createBlock","_Teleport","_createElementVNode","_cache","_withModifiers","_createCommentVNode","_resolveDynamicComponent","_normalizeClass","_withCtx","$options","_ctx","args","_withKeys","$event","_renderSlot","_createVNode","_component_dt_lazy_show","_mergeProps","_toHandlers","_component_popover_header_footer","_component_sr_only_close_button"],"mappings":";;;;;;;;;AAiJA,MAAKA,IAAU;AAAA,EACb,cAAc,EAAE,MAAM,EAAG;AAAA,EACzB,MAAM;AAAA;AAAA;AAAA;AAAA,EAKN,YAAY;AAAA,IACV,mBAAAC;AAAA,IACA,YAAAC;AAAA,IACA,qBAAAC;AAAA,EACD;AAAA,EAED,QAAQ,CAACC,CAAU;AAAA,EAEnB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOD,eAAe;AAAA,MACb,MAAM;AAAA,MACN,SAAS;AAAA,IACV;AAAA;AAA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A,gBAAeA,EAAY;AAAA;;cAOlHgB,EAGEJ,EAAA,QAAA,WAAA,EADC,OAAOD,EAAY,cAAA;AAAA,YAhGhC,GAAA,IAAAb,CAAA;AAAA,YAoGgBG,EAAc,eAACW,EAAM,OAAC,aAAa,UAD3CV,EAcwBmB,GAAA;AAAA,cAjHhC,KAAA;AAAA,cAqGU,KAAI;AAAA,cACJ,MAAK;AAAA,cACJ,OAvGXZ,EAuGkBR,EAAqC,sCAACD,EAAO,OAAA,CAAA;AAAA,cACpD,iBAAeA,EAAW;AAAA;cAEhB,WAET,MAGE;AAAA,gBAHFgB,EAGEJ,EAAA,QAAA,iBAAA,EADC,OAAOD,EAAY,cAAA;AAAA;cA9GlC,GAAA;AAAA,iDAAAJ,EAAA,IAAA,EAAA;AAAA,YAmHiBP,EAAe,kBAnHhCO,EAAA,IAAA,EAAA,UAkHQL,EAGEoB,GAAA;AAAA,cArHV,KAAA;AAAA,cAoHW,SAAOX,EAAY;AAAA;;UApH9B,GAAA;AAAA;;MAAA,GAAA;AAAA;;;;"}
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../../node_modules/@tiptap/vue-3.cjs"),u=require("@tiptap/core"),I=require("@tiptap/extension-blockquote"),q=require("@tiptap/extension-code-block"),$=require("@tiptap/extension-code"),A=require("@tiptap/extension-document"),N=require("@tiptap/extension-hard-break"),P=require("@tiptap/extension-paragraph"),j=require("@tiptap/extension-placeholder"),H=require("@tiptap/extension-bold"),F=require("@tiptap/extension-bullet-list"),K=require("@tiptap/extension-italic"),W=require("@tiptap/extension-link"),U=require("@tiptap/extension-list-item"),z=require("@tiptap/extension-ordered-list"),X=require("@tiptap/extension-strike"),J=require("@tiptap/extension-underline"),Y=require("@tiptap/extension-text"),G=require("@tiptap/extension-text-align"),Q=require("@tiptap/extension-history"),Z=require("@tiptap/extension-text-style"),ee=require("@tiptap/extension-color"),te=require("@tiptap/extension-font-family"),g=require("@tiptap/pm/state"),ne=require("@tiptap/suggestion"),D=require("regex-combined-emojis"),o=require("vue"),h=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),V=require("../emoji/emoji.cjs"),f=require("../../common/emoji/index.cjs"),oe=require("@dialpad/dialtone-emojis"),re=require("../list-item/list-item.cjs"),x=require("../stack/stack.cjs"),b=require("tippy.js"),k=require("../../common/utils/index.cjs"),ie=require("@tiptap/extension-image"),B=require("@tiptap/extension-mention"),O=require("../link/link.cjs"),C=require("./rich-text-editor-constants.cjs"),se=require("../avatar/avatar.cjs"),ae=require("@dialpad/dialtone-icons/vue3/hash"),ce=require("@dialpad/dialtone-icons/vue3/lock"),le=require("deep-equal"),de=require("../button/button.cjs"),ue={compatConfig:{MODE:3},name:"EmojiComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtEmoji:V.default},props:d.nodeViewProps};function me(e,t,r,n,i,s){const a=o.resolveComponent("dt-emoji"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block d-va-bottom d-lh0"},{default:o.withCtx(()=>[o.createVNode(a,{size:"500",code:e.node.attrs.code},null,8,["code"])]),_:1})}const he=h._(ue,[["render",me]]),pe={compatConfig:{MODE:3},name:"SuggestionList",components:{DtListItem:re.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();const e=this.$refs.suggestionList.querySelector(".d-list-item--highlighted");e&&e.scrollIntoView({behaviour:"smooth",block:"center"})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(e){const 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});break;case"channel":this.command({name:t.name,id:t.id});break;case"slash-command":this.command({command:t.command});break}}}},fe={class:"d-popover__dialog d-suggestion-list__container"},ge={ref:"suggestionList",class:"d-suggestion-list"};function _e(e,t,r,n,i,s){const a=o.resolveComponent("dt-list-item");return o.openBlock(),o.createElementBlock("div",fe,[o.withDirectives(o.createElementVNode("ul",ge,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.items,(c,l)=>(o.openBlock(),o.createBlock(a,{key:c.id,class:o.normalizeClass(["d-suggestion-list__item",{"d-list-item--highlighted":l===i.selectedIndex}]),"navigation-type":"arrow-keys",onClick:m=>s.selectItem(l),onKeydown:o.withModifiers(s.onKeyDown,["prevent"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.itemComponent),{item:c},null,8,["item"]))]),_:2},1032,["class","onClick","onKeydown"]))),128))],512),[[o.vShow,r.items.length]])])}const E=h._(pe,[["render",_e]]),ke={compatConfig:{MODE:3},name:"EmojiSuggestion",components:{DtEmoji:V.default,DtStack:x.default},props:{item:{type:Object,required:!0}}};function we(e,t,r,n,i,s){const a=o.resolveComponent("dt-emoji"),c=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(c,{direction:"row",gap:"400"},{default:o.withCtx(()=>[o.createVNode(a,{size:"200",code:r.item.code},null,8,["code"]),o.createTextVNode(" "+o.toDisplayString(r.item.code),1)]),_:1})}const ye=h._(ke,[["render",we]]),T={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){function t(r){r.keyCode===27&&e()}return{onShow(){document.addEventListener("keydown",t)},onHide(){document.removeEventListener("keydown",t)}}}},Ce=20,xe={items:({query:e})=>{if(e.length<2)return[];const t=Object.values(oe.emojisIndexed);return e=e.toLowerCase(),t.filter(n=>[n.name,n.shortname.replaceAll(":",""),...n.keywords].some(i=>i.startsWith(e))).splice(0,Ce).map(n=>({code:n.shortname}))},command:({editor:e,range:t,props:r})=>{var s,a;const n=e.view.state.selection.$to.nodeAfter;((s=n==null?void 0:n.text)==null?void 0:s.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:"emoji",attrs:r}]).run(),(a=window.getSelection())==null||a.collapseToEnd()},render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(ye),itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),t==null||t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},be=/(:\w+:)$/,Ee=new RegExp(D.emojiPattern+"$"),Te=e=>{if(e&&f.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},Se=e=>[...e.matchAll(f.emojiShortCodeRegex)].filter(r=>f.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),ve=u.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return d.VueNodeViewRenderer(he)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:e}){return f.stringToUnicode(f.codeToEmojiData(e.attrs.code).unicode_output)},renderHTML({HTMLAttributes:e}){return["emoji-component",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){return[new u.InputRule({find:e=>{const t=e.match(be)||e.match(Ee);if(t)return Te(t)},handler:({state:e,range:t,match:r,commands:n,chain:i,can:s})=>{const{tr:a}=e,c=t.from,l=t.to;a.replaceWith(c,l,this.type.create({code:r[0]}))}})]},addPasteRules(){return[u.nodePasteRule({find:Se,type:this.type,getAttributes(e){return{code:e[0]}}}),u.nodePasteRule({find:f.emojiRegex,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[ne({char:":",pluginKey:new g.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...xe})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:i,anchor:s}=n;return i?(t.doc.nodesBetween(s-1,s,(a,c)=>{if(a.type.name===this.name)return r=!0,e.insertText("",c,c+a.nodeSize),!1}),r):!1})}}});function Be(e,t,r=()=>!0){const n=[];t.lastIndex=0;let i;for(;i=t.exec(e);)r(e,i)&&n.push(i);return n}function Re(e,t){return!["#","@"].includes(e.charAt(t.index))&&!["#","@"].includes(e.charAt(t.index-1))}function Le(e){const t=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return e.replace(t,"")}function Pe(e,t){const r=e.slice(0,t+1).search(/\S+\s*$/),n=e.slice(t).search(/\s/);if(n<0){const i=e.slice(r);return{text:i,from:r,to:r+i.length}}return{text:e.slice(r,n+t),from:r,to:n+t}}function v(e,t,r,n){const i=Pe(e,t);if(n.lastIndex=0,!n.test(i.text))return i;const s=r==="left"?i.from-1:i.to+1;return s<=0||s>=e.length||s===t?i:v(e,s,r,n)}function De(e,t,r,n){const i=Math.max(e.from-1,0),s=Math.min(e.to+1,t.content.size),a=u.getMarksBetween(i,s,t);for(const c of a)c.mark.type===n&&r.removeMark(c.from,c.to,n)}const R=k.getPhoneNumberRegex(1,15);function L(e,t,r,n,i,s){if(!e)return;let a=r-t-1;a=a<0?0:a;const c=n-t,l=v(e,a,"left",R),m=v(e,c,"right",R),p=e.slice(l.from,m.to);Be(p,k.linkRegex,Re).forEach(S=>{const _=Le(S[0]),y=t+l.from+S.index+1,M=y+_.length;i.addMark(y,M,s.create())})}function Ve(e){let t=!1;return new g.Plugin({key:new g.PluginKey("autolink"),appendTransaction:(r,n,i)=>{const s=r.some(p=>p.docChanged)&&!n.doc.eq(i.doc);if(t&&!s)return;const{tr:a}=i,{textContent:c}=i.doc;t||L(c,0,0,c.length,a,e.type),t=!0;const l=u.combineTransactionSteps(n.doc,[...r]);return u.getChangedRanges(l).forEach(({oldRange:p,newRange:w})=>{De(w,i.doc,a,e.type),u.findChildrenInRange(i.doc,w,_=>_.isTextblock).forEach(({node:_,pos:y})=>{L(_.textContent,y,p.from,w.to,a,e.type)})}),a}})}const Oe={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},Me=u.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:e}){return["a",u.mergeAttributes(this.options.HTMLAttributes,e,Oe)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Ve({type:this.type})]}}),Ie=ie.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}),qe=P.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),$e={compatConfig:{MODE:3},name:"MentionComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:O.default},props:d.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}}};function Ae(e,t,r,n,i,s){const a=o.resolveComponent("dt-link"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"mention"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})]),_:1})}const Ne=h._($e,[["render",Ae]]),je=B.extend({addNodeView(){return d.VueNodeViewRenderer(Ne)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""}}},renderText({node:e}){return`@${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["mention-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"@",pluginKey:new g.PluginKey("mentionSuggestion")}}),He={compatConfig:{MODE:3},name:"ChannelComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:O.default},props:d.nodeViewProps,computed:{text(){return"#"+this.$props.node.attrs.name}}};function Fe(e,t,r,n,i,s){const a=o.resolveComponent("dt-link"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"mention"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})]),_:1})}const Ke=h._(He,[["render",Fe]]),We=B.extend({name:"channel",addNodeView(){return d.VueNodeViewRenderer(Ke)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1}}},renderText({node:e}){return`#${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["channel-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"#",pluginKey:new g.PluginKey("channelSuggestion")}}),Ue={compatConfig:{MODE:3},name:"SlashCommandsComponent",components:{NodeViewWrapper:d.NodeViewWrapper},props:{...d.nodeViewProps},emits:["selected-command"],computed:{text(){return"/"+this.$props.node.attrs.command}},created(){var r,n,i;const e=this.$props.node.attrs.command;this.$emit("selected-command",e);const t=(i=(n=(r=this.editor)==null?void 0:r.storage)==null?void 0:n["slash-commands"])==null?void 0:i.onSelectedCommand;t&&typeof t=="function"&&t(e)}};function ze(e,t,r,n,i,s){const a=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(a,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})}const Xe=h._(Ue,[["render",ze]]),Je=(e,t)=>[...e.matchAll(t)].map(n=>{let i=n[2];return i.endsWith(" ")||(i+=" "),{index:n.index,text:i,match:n}}),Ye=B.extend({name:"slash-commands",group:"inline",inline:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),onSelectedCommand:null}},addStorage(){return{onSelectedCommand:this.options.onSelectedCommand}},addNodeView(){return d.VueNodeViewRenderer(Xe)},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",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){var r;const e=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),t=new RegExp(`^((?:\\/)(${e.join("|")})) $`);return[u.nodeInputRule({find:t,type:this.type,getAttributes(n){return{command:n[2]}}})]},addPasteRules(){var r;const e=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),t=new RegExp(`^((?:\\/)(${e.join("|")})) ?$`,"g");return[u.nodePasteRule({find:n=>Je(n,t),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new g.PluginKey("slashCommandSuggestion")}}),Ge={compatConfig:{MODE:3},name:"MentionSuggestion",components:{DtAvatar:se.default,DtStack:x.default},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-recipe-contact-row--active",busy:"d-recipe-contact-row--busy",away:"d-recipe-contact-row--away",offline:"d-recipe-contact-row--busy"}[this.presence]},showDetails(){return this.item.showDetails}}},Qe={class:"d-mention-suggestion__name"},Ze={key:1,class:"d-mention-suggestion__divider"},et={key:2,class:"d-mention-suggestion__status"};function tt(e,t,r,n,i,s){const a=o.resolveComponent("dt-avatar"),c=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(c,{direction:"row",class:"d-mention-suggestion__container",gap:"400"},{default:o.withCtx(()=>[o.createVNode(a,{"full-name":s.name,"image-src":s.avatarSrc,"image-alt":s.name,"show-presence":s.showDetails,presence:s.presence,size:"sm"},null,8,["full-name","image-src","image-alt","show-presence","presence"]),o.createVNode(c,{class:"d-mention-suggestion__details-container",gap:"100"},{default:o.withCtx(()=>[o.createElementVNode("span",Qe,o.toDisplayString(s.name),1),s.showDetails?(o.openBlock(),o.createBlock(c,{key:0,direction:"row",gap:"300",class:"d-label--sm-plain"},{default:o.withCtx(()=>[s.presenceText?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["d-mention-suggestion__presence",[s.presenceFontColorClass]])},o.toDisplayString(s.presenceText),3)):o.createCommentVNode("",!0),s.status&&s.presenceText?(o.openBlock(),o.createElementBlock("div",Ze," • ")):o.createCommentVNode("",!0),s.status?(o.openBlock(),o.createElementBlock("div",et,o.toDisplayString(s.status),1)):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1})}const nt=h._(Ge,[["render",tt]]),ot={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(nt),itemType:"mention",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},rt={compatConfig:{MODE:3},name:"ChannelSuggestion",components:{DtStack:x.default,DtIconHash:ae,DtIconLock:ce},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function it(e,t,r,n,i,s){const a=o.resolveComponent("dt-icon-hash"),c=o.resolveComponent("dt-icon-lock"),l=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(l,{direction:"row",gap:"400"},{default:o.withCtx(()=>[r.item.locked?(o.openBlock(),o.createBlock(c,{key:1,size:"300"})):(o.openBlock(),o.createBlock(a,{key:0,size:"300"})),o.createElementVNode("span",null,o.toDisplayString(s.name),1)]),_:1})}const st=h._(rt,[["render",it]]),at={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{props:{itemComponent:o.markRaw(st),itemType:"channel",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},ct={compatConfig:{MODE:3},name:"SlashCommandSuggestion",props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}},lt={class:"d-body--md-compact"},dt={key:0},ut={class:"d-body--sm d-fc-tertiary"};function mt(e,t,r,n,i,s){return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",lt,[o.createElementVNode("span",null,"/"+o.toDisplayString(s.command),1),s.parametersExample?(o.openBlock(),o.createElementBlock("span",dt,o.toDisplayString(s.parametersExample),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",ut,o.toDisplayString(s.description),1)])}const ht=h._(ct,[["render",mt]]),pt={allowSpaces:!0,startOfLine:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(E,{parent:void 0,props:{itemComponent:o.markRaw(ht),itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[T]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},ft={compatConfig:{MODE:3},name:"DtRichTextEditor",components:{EditorContent:d.EditorContent,BubbleMenu:d.BubbleMenu,DtButton:de.default,DtStack:x.default},props:{modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},preventTyping:{type:Boolean,default:!1},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"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:"html",validator(e){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:""},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},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},allowFontFamily:{type:Boolean,default:!1},additionalExtensions:{type:Array,default:()=>[]},hideLinkBubbleMenu:{type:Boolean,default:!1},useDivTags:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","update:modelValue","blur","focus","enter","edit-link","selected","selected-command"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var e;return(e=k.returnFirstEl(this.$refs.editor.$el).getRootNode())==null?void 0:e.querySelector("body")},placement:"top-start"}}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){const e=[A,Y,Q,N];e.push(this.useDivTags?qe:P),this.allowBlockquote&&e.push(I),this.allowBold&&e.push(H),this.allowBulletList&&(e.push(F),e.push(U.extend({renderText({node:n}){return n.textContent}})),e.push(z)),this.allowItalic&&e.push(K),this.allowStrike&&e.push(X),this.allowUnderline&&e.push(J),this.placeholder&&e.push(j.configure({placeholder:this.placeholder}));const t=this,r=u.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:n})=>t.allowLineBreaks?!1:(n.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>t.allowBulletList&&i.splitListItem("listItem"),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),!0),Enter:()=>t.allowLineBreaks?!1:(t.$emit("enter"),!0)}}});if(e.push(r),this.link&&e.push(W.extend({inclusive:!1}).configure({HTMLAttributes:{class:"d-link d-wb-break-all"},openOnClick:!1,autolink:!0,protocols:C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&e.push(this.getExtension(Me,this.customLink)),this.mentionSuggestion){const n={...this.mentionSuggestion,...ot};e.push(je.configure({suggestion:n}))}if(this.channelSuggestion){const n={...this.channelSuggestion,...at};e.push(We.configure({suggestion:n}))}if(this.slashCommandSuggestion){const n={...this.slashCommandSuggestion,...pt};e.push(Ye.configure({suggestion:n,onSelectedCommand:i=>{this.$emit("selected-command",i)}}))}return e.push(ve),e.push(G.configure({types:["paragraph"]})),this.allowCode&&e.push($),this.allowCodeblock&&e.push(q.extend({renderText({node:n}){return`\`\`\`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("../../node_modules/@tiptap/vue-3.cjs"),u=require("@tiptap/core"),V=require("@tiptap/extension-blockquote"),A=require("@tiptap/extension-code-block"),M=require("@tiptap/extension-code"),q=require("@tiptap/extension-document"),$=require("@tiptap/extension-hard-break"),D=require("@tiptap/extension-paragraph"),j=require("@tiptap/extension-placeholder"),H=require("@tiptap/extension-bold"),K=require("@tiptap/extension-bullet-list"),F=require("@tiptap/extension-italic"),U=require("@tiptap/extension-link"),W=require("@tiptap/extension-list-item"),z=require("@tiptap/extension-ordered-list"),X=require("@tiptap/extension-strike"),J=require("@tiptap/extension-underline"),Y=require("@tiptap/extension-text"),G=require("@tiptap/extension-text-align"),Q=require("@tiptap/extension-history"),Z=require("@tiptap/extension-text-style"),ee=require("@tiptap/extension-color"),te=require("@tiptap/extension-font-family"),g=require("@tiptap/pm/state"),ne=require("@tiptap/suggestion"),O=require("regex-combined-emojis"),o=require("vue"),h=require("../../_plugin-vue_export-helper-BRilXfQE.cjs"),I=require("../emoji/emoji.cjs"),f=require("../../common/emoji/index.cjs"),oe=require("@dialpad/dialtone-emojis"),re=require("../list-item/list-item.cjs"),x=require("../stack/stack.cjs"),b=require("tippy.js"),k=require("../../common/utils/index.cjs"),ie=require("@tiptap/extension-image"),v=require("@tiptap/extension-mention"),P=require("../link/link.cjs"),C=require("./rich-text-editor-constants.cjs"),se=require("../avatar/avatar.cjs"),ae=require("@dialpad/dialtone-icons/vue3/hash"),ce=require("@dialpad/dialtone-icons/vue3/lock"),le=require("deep-equal"),de=require("../../localization/index.cjs"),ue=require("../button/button.cjs"),me={compatConfig:{MODE:3},name:"EmojiComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtEmoji:I.default},props:d.nodeViewProps};function he(e,t,r,n,i,s){const a=o.resolveComponent("dt-emoji"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block d-va-bottom d-lh0"},{default:o.withCtx(()=>[o.createVNode(a,{size:"500",code:e.node.attrs.code},null,8,["code"])]),_:1})}const pe=h._(me,[["render",he]]),fe={compatConfig:{MODE:3},name:"SuggestionList",components:{DtListItem:re.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();const e=this.$refs.suggestionList.querySelector(".d-list-item--highlighted");e&&e.scrollIntoView({behaviour:"smooth",block:"center"})},selectHandler(){this.selectItem(this.selectedIndex)},selectItem(e){const 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});break;case"channel":this.command({name:t.name,id:t.id});break;case"slash-command":this.command({command:t.command});break}}}},ge={class:"d-popover__dialog d-suggestion-list__container"},_e={ref:"suggestionList",class:"d-suggestion-list"};function ke(e,t,r,n,i,s){const a=o.resolveComponent("dt-list-item");return o.openBlock(),o.createElementBlock("div",ge,[o.withDirectives(o.createElementVNode("ul",_e,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(r.items,(c,l)=>(o.openBlock(),o.createBlock(a,{key:c.id,class:o.normalizeClass(["d-suggestion-list__item",{"d-list-item--highlighted":l===i.selectedIndex}]),"navigation-type":"arrow-keys",onClick:m=>s.selectItem(l),onKeydown:o.withModifiers(s.onKeyDown,["prevent"])},{default:o.withCtx(()=>[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.itemComponent),{item:c},null,8,["item"]))]),_:2},1032,["class","onClick","onKeydown"]))),128))],512),[[o.vShow,r.items.length]])])}const T=h._(fe,[["render",ke]]),we={compatConfig:{MODE:3},name:"EmojiSuggestion",components:{DtEmoji:I.default,DtStack:x.default},props:{item:{type:Object,required:!0}}};function ye(e,t,r,n,i,s){const a=o.resolveComponent("dt-emoji"),c=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(c,{direction:"row",gap:"400"},{default:o.withCtx(()=>[o.createVNode(a,{size:"200",code:r.item.code},null,8,["code"]),o.createTextVNode(" "+o.toDisplayString(r.item.code),1)]),_:1})}const Ce=h._(we,[["render",ye]]),E={name:"hideOnEsc",defaultValue:!0,fn({hide:e}){function t(r){r.keyCode===27&&e()}return{onShow(){document.addEventListener("keydown",t)},onHide(){document.removeEventListener("keydown",t)}}}},xe=20,be={items:({query:e})=>{if(e.length<2)return[];const t=Object.values(oe.emojisIndexed);return e=e.toLowerCase(),t.filter(n=>[n.name,n.shortname.replaceAll(":",""),...n.keywords].some(i=>i.startsWith(e))).splice(0,xe).map(n=>({code:n.shortname}))},command:({editor:e,range:t,props:r})=>{var s,a;const n=e.view.state.selection.$to.nodeAfter;((s=n==null?void 0:n.text)==null?void 0:s.startsWith(" "))&&(t.to+=1),e.chain().focus().insertContentAt(t,[{type:"emoji",attrs:r}]).run(),(a=window.getSelection())==null||a.collapseToEnd()},render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{props:{itemComponent:o.markRaw(Ce),itemType:"emoji",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[E]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),t==null||t[0].setProps({getReferenceClientRect:n.clientRect})},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},Te=/(:\w+:)$/,Ee=new RegExp(O.emojiPattern+"$"),Se=e=>{if(e&&f.codeToEmojiData(e[0]))return{text:e[2]||e[0]}},Be=e=>[...e.matchAll(f.emojiShortCodeRegex)].filter(r=>f.codeToEmojiData(r[0])).map(r=>({index:r.index,text:r[0],match:r})),ve=u.Node.create({name:"emoji",addOptions(){return{HTMLAttributes:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addNodeView(){return d.VueNodeViewRenderer(pe)},addAttributes(){return{code:{default:null}}},parseHTML(){return[{tag:"emoji-component"}]},renderText({node:e}){return f.stringToUnicode(f.codeToEmojiData(e.attrs.code).unicode_output)},renderHTML({HTMLAttributes:e}){return["emoji-component",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){return[new u.InputRule({find:e=>{const t=e.match(Te)||e.match(Ee);if(t)return Se(t)},handler:({state:e,range:t,match:r,commands:n,chain:i,can:s})=>{const{tr:a}=e,c=t.from,l=t.to;a.replaceWith(c,l,this.type.create({code:r[0]}))}})]},addPasteRules(){return[u.nodePasteRule({find:Be,type:this.type,getAttributes(e){return{code:e[0]}}}),u.nodePasteRule({find:f.emojiRegex,type:this.type,getAttributes(e){return{code:e[0]}}})]},addProseMirrorPlugins(){return[ne({char:":",pluginKey:new g.PluginKey("emoji"),editor:this.editor,...this.options.suggestion,...be})]},addKeyboardShortcuts(){return{Backspace:()=>this.editor.commands.command(({tr:e,state:t})=>{let r=!1;const{selection:n}=t,{empty:i,anchor:s}=n;return i?(t.doc.nodesBetween(s-1,s,(a,c)=>{if(a.type.name===this.name)return r=!0,e.insertText("",c,c+a.nodeSize),!1}),r):!1})}}});function Re(e,t,r=()=>!0){const n=[];t.lastIndex=0;let i;for(;i=t.exec(e);)r(e,i)&&n.push(i);return n}function Le(e,t){return!["#","@"].includes(e.charAt(t.index))&&!["#","@"].includes(e.charAt(t.index-1))}function De(e){const t=new RegExp("(?:"+[`[!?.,:;'"]`,"(?:&|&amp;)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)+$"].join("|"),"g");return e.replace(t,"")}function Oe(e,t){const r=e.slice(0,t+1).search(/\S+\s*$/),n=e.slice(t).search(/\s/);if(n<0){const i=e.slice(r);return{text:i,from:r,to:r+i.length}}return{text:e.slice(r,n+t),from:r,to:n+t}}function B(e,t,r,n){const i=Oe(e,t);if(n.lastIndex=0,!n.test(i.text))return i;const s=r==="left"?i.from-1:i.to+1;return s<=0||s>=e.length||s===t?i:B(e,s,r,n)}function Ie(e,t,r,n){const i=Math.max(e.from-1,0),s=Math.min(e.to+1,t.content.size),a=u.getMarksBetween(i,s,t);for(const c of a)c.mark.type===n&&r.removeMark(c.from,c.to,n)}const R=k.getPhoneNumberRegex(1,15);function L(e,t,r,n,i,s){if(!e)return;let a=r-t-1;a=a<0?0:a;const c=n-t,l=B(e,a,"left",R),m=B(e,c,"right",R),p=e.slice(l.from,m.to);Re(p,k.linkRegex,Le).forEach(S=>{const _=De(S[0]),y=t+l.from+S.index+1,N=y+_.length;i.addMark(y,N,s.create())})}function Pe(e){let t=!1;return new g.Plugin({key:new g.PluginKey("autolink"),appendTransaction:(r,n,i)=>{const s=r.some(p=>p.docChanged)&&!n.doc.eq(i.doc);if(t&&!s)return;const{tr:a}=i,{textContent:c}=i.doc;t||L(c,0,0,c.length,a,e.type),t=!0;const l=u.combineTransactionSteps(n.doc,[...r]);return u.getChangedRanges(l).forEach(({oldRange:p,newRange:w})=>{Ie(w,i.doc,a,e.type),u.findChildrenInRange(i.doc,w,_=>_.isTextblock).forEach(({node:_,pos:y})=>{L(_.textContent,y,p.from,w.to,a,e.type)})}),a}})}const Ne={class:"d-link d-c-text d-d-inline-block d-wb-break-all",rel:"noopener noreferrer nofollow"},Ve=u.Mark.create({name:"CustomLink",renderHTML({HTMLAttributes:e}){return["a",u.mergeAttributes(this.options.HTMLAttributes,e,Ne)]},renderText({node:e}){return e.attrs.text},addProseMirrorPlugins(){return[Pe({type:this.type})]}}),Ae=ie.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}),Me=D.extend({parseHTML(){return[{tag:"div"}]},renderHTML({HTMLAttributes:e}){return["div",u.mergeAttributes(this.options.HTMLAttributes,e),0]}}),qe={compatConfig:{MODE:3},name:"MentionComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:P.default},props:d.nodeViewProps,computed:{text(){return"@"+this.$props.node.attrs.name}}};function $e(e,t,r,n,i,s){const a=o.resolveComponent("dt-link"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"mention"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})]),_:1})}const je=h._(qe,[["render",$e]]),He=v.extend({addNodeView(){return d.VueNodeViewRenderer(je)},parseHTML(){return[{tag:"mention-component"}]},addAttributes(){return{name:{default:""},avatarSrc:{default:""},id:{default:""}}},renderText({node:e}){return`@${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["mention-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"@",pluginKey:new g.PluginKey("mentionSuggestion")}}),Ke={compatConfig:{MODE:3},name:"ChannelComponent",components:{NodeViewWrapper:d.NodeViewWrapper,DtLink:P.default},props:d.nodeViewProps,computed:{text(){return"#"+this.$props.node.attrs.name}}};function Fe(e,t,r,n,i,s){const a=o.resolveComponent("dt-link"),c=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(c,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"mention"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})]),_:1})}const Ue=h._(Ke,[["render",Fe]]),We=v.extend({name:"channel",addNodeView(){return d.VueNodeViewRenderer(Ue)},parseHTML(){return[{tag:"channel-component"}]},addAttributes(){return{name:{default:""},id:{default:""},locked:{default:!1}}},renderText({node:e}){return`#${e.attrs.id}`},renderHTML({HTMLAttributes:e}){return["channel-component",u.mergeAttributes(this.options.HTMLAttributes,e)]}}).configure({suggestion:{char:"#",pluginKey:new g.PluginKey("channelSuggestion")}}),ze={compatConfig:{MODE:3},name:"SlashCommandsComponent",components:{NodeViewWrapper:d.NodeViewWrapper},props:{...d.nodeViewProps},emits:["selected-command"],computed:{text(){return"/"+this.$props.node.attrs.command}},created(){var r,n,i;const e=this.$props.node.attrs.command;this.$emit("selected-command",e);const t=(i=(n=(r=this.editor)==null?void 0:r.storage)==null?void 0:n["slash-commands"])==null?void 0:i.onSelectedCommand;t&&typeof t=="function"&&t(e)}};function Xe(e,t,r,n,i,s){const a=o.resolveComponent("node-view-wrapper");return o.openBlock(),o.createBlock(a,{class:"d-d-inline-block"},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(s.text),1)]),_:1})}const Je=h._(ze,[["render",Xe]]),Ye=(e,t)=>[...e.matchAll(t)].map(n=>{let i=n[2];return i.endsWith(" ")||(i+=" "),{index:n.index,text:i,match:n}}),Ge=v.extend({name:"slash-commands",group:"inline",inline:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),onSelectedCommand:null}},addStorage(){return{onSelectedCommand:this.options.onSelectedCommand}},addNodeView(){return d.VueNodeViewRenderer(Je)},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",u.mergeAttributes(this.options.HTMLAttributes,e)]},addInputRules(){var r;const e=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),t=new RegExp(`^((?:\\/)(${e.join("|")})) $`);return[u.nodeInputRule({find:t,type:this.type,getAttributes(n){return{command:n[2]}}})]},addPasteRules(){var r;const e=(r=this.options.suggestion)==null?void 0:r.items({query:""}).map(n=>n.command),t=new RegExp(`^((?:\\/)(${e.join("|")})) ?$`,"g");return[u.nodePasteRule({find:n=>Ye(n,t),type:this.type,getAttributes(n){return{command:n[0].trim()}}})]}}).configure({suggestion:{char:"/",pluginKey:new g.PluginKey("slashCommandSuggestion")}}),Qe={compatConfig:{MODE:3},name:"MentionSuggestion",components:{DtAvatar:se.default,DtStack:x.default},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-recipe-contact-row--active",busy:"d-recipe-contact-row--busy",away:"d-recipe-contact-row--away",offline:"d-recipe-contact-row--busy"}[this.presence]},showDetails(){return this.item.showDetails}}},Ze={class:"d-mention-suggestion__name"},et={key:1,class:"d-mention-suggestion__divider"},tt={key:2,class:"d-mention-suggestion__status"};function nt(e,t,r,n,i,s){const a=o.resolveComponent("dt-avatar"),c=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(c,{direction:"row",class:"d-mention-suggestion__container",gap:"400"},{default:o.withCtx(()=>[o.createVNode(a,{"full-name":s.name,"image-src":s.avatarSrc,"image-alt":s.name,"show-presence":s.showDetails,presence:s.presence,size:"sm"},null,8,["full-name","image-src","image-alt","show-presence","presence"]),o.createVNode(c,{class:"d-mention-suggestion__details-container",gap:"100"},{default:o.withCtx(()=>[o.createElementVNode("span",Ze,o.toDisplayString(s.name),1),s.showDetails?(o.openBlock(),o.createBlock(c,{key:0,direction:"row",gap:"300",class:"d-label--sm-plain"},{default:o.withCtx(()=>[s.presenceText?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(["d-mention-suggestion__presence",[s.presenceFontColorClass]])},o.toDisplayString(s.presenceText),3)):o.createCommentVNode("",!0),s.status&&s.presenceText?(o.openBlock(),o.createElementBlock("div",et," • ")):o.createCommentVNode("",!0),s.status?(o.openBlock(),o.createElementBlock("div",tt,o.toDisplayString(s.status),1)):o.createCommentVNode("",!0)]),_:1})):o.createCommentVNode("",!0)]),_:1})]),_:1})}const ot=h._(Qe,[["render",nt]]),rt={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{props:{itemComponent:o.markRaw(ot),itemType:"mention",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[E]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},it={compatConfig:{MODE:3},name:"ChannelSuggestion",components:{DtStack:x.default,DtIconHash:ae,DtIconLock:ce},props:{item:{type:Object,required:!0}},computed:{name(){return this.item.name}}};function st(e,t,r,n,i,s){const a=o.resolveComponent("dt-icon-hash"),c=o.resolveComponent("dt-icon-lock"),l=o.resolveComponent("dt-stack");return o.openBlock(),o.createBlock(l,{direction:"row",gap:"400"},{default:o.withCtx(()=>[r.item.locked?(o.openBlock(),o.createBlock(c,{key:1,size:"300"})):(o.openBlock(),o.createBlock(a,{key:0,size:"300"})),o.createElementVNode("span",null,o.toDisplayString(s.name),1)]),_:1})}const at=h._(it,[["render",st]]),ct={allowSpaces:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{props:{itemComponent:o.markRaw(at),itemType:"channel",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[E]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},lt={compatConfig:{MODE:3},name:"SlashCommandSuggestion",props:{item:{type:Object,required:!0}},computed:{command(){return this.item.command},description(){return this.item.description},parametersExample(){return this.item.parametersExample}}},dt={class:"d-body--md-compact"},ut={key:0},mt={class:"d-body--sm d-fc-tertiary"};function ht(e,t,r,n,i,s){return o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("div",dt,[o.createElementVNode("span",null,"/"+o.toDisplayString(s.command),1),s.parametersExample?(o.openBlock(),o.createElementBlock("span",ut,o.toDisplayString(s.parametersExample),1)):o.createCommentVNode("",!0)]),o.createElementVNode("div",mt,o.toDisplayString(s.description),1)])}const pt=h._(lt,[["render",ht]]),ft={allowSpaces:!0,startOfLine:!0,render:()=>{let e,t,r=!1;return{onStart:n=>{e=new d.VueRenderer(T,{parent:void 0,props:{itemComponent:o.markRaw(pt),itemType:"slash-command",...n},editor:n.editor}),n.clientRect&&(t=b("body",{getReferenceClientRect:n.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!1,onShow:()=>{r=!0},onHidden:()=>{r=!1},interactive:!0,trigger:"manual",placement:"top-start",zIndex:650,plugins:[E]}),n.items.length>0&&(t==null||t[0].show()))},onUpdate(n){e==null||e.updateProps(n),n.items.length>0?t==null||t[0].show():t==null||t[0].hide(),n.clientRect&&(t==null||t[0].setProps({getReferenceClientRect:n.clientRect}))},onKeyDown(n){var i;if(r)return(i=e==null?void 0:e.ref)==null?void 0:i.onKeyDown(n)},onExit(){t==null||t[0].destroy(),t=null,e==null||e.destroy(),e=null}}}},gt={compatConfig:{MODE:3},name:"DtRichTextEditor",components:{EditorContent:d.EditorContent,BubbleMenu:d.BubbleMenu,DtButton:ue.default,DtStack:x.default},props:{modelValue:{type:[Object,String],default:""},editable:{type:Boolean,default:!0},preventTyping:{type:Boolean,default:!1},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"?C.RICH_TEXT_EDITOR_AUTOFOCUS_TYPES.includes(e):!0}},outputFormat:{type:String,default:"html",validator(e){return C.RICH_TEXT_EDITOR_OUTPUT_FORMATS.includes(e)}},placeholder:{type:String,default:""},link:{type:[Boolean,Object],default:!1},customLink:{type:[Boolean,Object],default:!1},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},allowFontFamily:{type:Boolean,default:!1},additionalExtensions:{type:Array,default:()=>[]},hideLinkBubbleMenu:{type:Boolean,default:!1},useDivTags:{type:Boolean,default:!1}},emits:["input","json-input","html-input","text-input","update:modelValue","blur","focus","enter","edit-link","selected","selected-command"],data(){return{editor:null,tippyOptions:{appendTo:()=>{var e;return(e=k.returnFirstEl(this.$refs.editor.$el).getRootNode())==null?void 0:e.querySelector("body")},placement:"top-start"},i18n:new de.DialtoneLocalization}},computed:{attrs(){return{...this.$attrs,onInput:()=>{},onFocus:()=>{},onBlur:()=>{}}},extensions(){const e=[q,Y,Q,$];e.push(this.useDivTags?Me:D),this.allowBlockquote&&e.push(V),this.allowBold&&e.push(H),this.allowBulletList&&(e.push(K),e.push(W.extend({renderText({node:n}){return n.textContent}})),e.push(z)),this.allowItalic&&e.push(F),this.allowStrike&&e.push(X),this.allowUnderline&&e.push(J),this.placeholder&&e.push(j.configure({placeholder:this.placeholder}));const t=this,r=u.Extension.create({addKeyboardShortcuts(){return{"Shift-Enter":({editor:n})=>t.allowLineBreaks?!1:(n.commands.first(({commands:i})=>[()=>i.newlineInCode(),()=>t.allowBulletList&&i.splitListItem("listItem"),()=>i.createParagraphNear(),()=>i.liftEmptyBlock(),()=>i.splitBlock()]),!0),Enter:()=>t.allowLineBreaks?!1:(t.$emit("enter"),!0)}}});if(e.push(r),this.link&&e.push(U.extend({inclusive:!1}).configure({HTMLAttributes:{class:"d-link d-wb-break-all"},openOnClick:!1,autolink:!0,protocols:C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS})),this.customLink&&e.push(this.getExtension(Ve,this.customLink)),this.mentionSuggestion){const n={...this.mentionSuggestion,...rt};e.push(He.configure({suggestion:n}))}if(this.channelSuggestion){const n={...this.channelSuggestion,...ct};e.push(We.configure({suggestion:n}))}if(this.slashCommandSuggestion){const n={...this.slashCommandSuggestion,...ft};e.push(Ge.configure({suggestion:n,onSelectedCommand:i=>{this.$emit("selected-command",i)}}))}return e.push(ve),e.push(G.configure({types:["paragraph"]})),this.allowCode&&e.push(M),this.allowCodeblock&&e.push(A.extend({renderText({node:n}){return`\`\`\`
2
2
  ${n.textContent}
3
- \`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&e.push(Ie),(this.allowFontFamily||this.allowFontColor)&&(e.push(Z),this.allowFontColor&&e.push(ee),this.allowFontFamily&&e.push(te)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),e},inputAttrs(){const 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)}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},mounted(){k.warnIfUnmounted(k.returnFirstEl(this.$el),this.$options.name),this.processValue(this.modelValue,!1)},methods:{createEditor(){this.editor=new d.Editor({autofocus:this.autoFocus,content:this.modelValue,editable:this.editable,extensions:this.extensions,parseOptions:{preserveWhitespace:"full"},editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handleKeyDown:(e,t)=>!!(this.preventTyping&&t.key!=="Backspace"),handlePaste:(e,t,r)=>{const n=t.clipboardData||window.clipboardData,i=n.getData("text/plain"),s=n.getData("text/html");return this.processPasteData(e,i,s)},transformPastedHTML(e){return e.replace(/(<\/\w+>)((<br \/>)+)/g,"$2$3$1")}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e,view:t,state:r,oldState:n,from:i,to:s}){return e.isActive("link")},getSelectedLinkText(e){var c,l,m;const{view:t,state:r}=e,{from:n,to:i}=t.state.selection,s=r.doc.textBetween(n,i,""),a=this.editor.state.doc.nodeAt(n);return a&&((m=(l=(c=a.marks)==null?void 0:c.at(0))==null?void 0:l.type)==null?void 0:m.name)==="link"?a.textContent:s},editLink(){const e=this.getSelectedLinkText(this.editor),t={href:this.editor.getAttributes("link").href,text:e};this.$emit("edit-link",t)},removeLink(){var e,t,r,n;(n=(r=(t=(e=this.editor)==null?void 0:e.chain())==null?void 0:t.focus())==null?void 0:r.unsetLink())==null||n.run()},openLink(){var t,r;(r=(t=this.editor)==null?void 0:t.chain())==null||r.focus();const e=this.editor.getAttributes("link").href;window.open(e,"_blank")},setLink(e,t,r,n=C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){var c,l,m;if(!e){this.removeLink();return}n.find(p=>p.test(e))||(e=`${i}${e}`),this.editor.chain().focus().extendMarkRange("link").run();const a=(m=(l=(c=this.editor)==null?void 0:c.view)==null?void 0:l.state)==null?void 0:m.selection;this.editor.chain().focus().insertContent(t).setTextSelection({from:a.from,to:a.from+t.length}).setLink({href:e,class:r.class}).run()},processValue(e,t=!0){const r=this.getOutput();if(!(t&&le(e,r))){if(typeof e=="string"&&this.outputFormat==="text"){const n=new RegExp(`(${D.emojiPattern})`,"g");e=e==null?void 0:e.replace(n,'<emoji-component code="$1"></emoji-component>')}this.editor.commands.setContent(e,!1,{preserveWhitespace:"full"})}},destroyEditor(){this.editor.destroy()},insertPlainTextWithHardBreaks(e,t){const{tr:r}=e.state,{from:n,to:i}=e.state.selection;r.deleteRange(n,i);const s=t.split(/\r?\n/);let a=n;for(let c=0;c<s.length;c++)c>0&&(r.insert(a,e.state.schema.nodes.hardBreak.create()),a++),r.insertText(s[c],a),a+=s[c].length;e.dispatch(r)},shouldPreserveLineBreaks(e,t){return this.pasteRichText?!t&&e&&this.hasBlankLines(e):!!e},processPasteData(e,t,r){if(this.shouldPreserveLineBreaks(t,r))return this.insertPlainTextWithHardBreaks(e,t),!0;if(this.shouldHandlePreformattedHTML(r)){const n=this.extractPreformattedText(r);if(n&&n.includes(`
3
+ \`\`\``}}).configure({HTMLAttributes:{class:"d-rich-text-editor__code-block"}})),this.allowInlineImages&&e.push(Ae),(this.allowFontFamily||this.allowFontColor)&&(e.push(Z),this.allowFontColor&&e.push(ee),this.allowFontFamily&&e.push(te)),this.additionalExtensions.length&&e.push(...this.additionalExtensions),e},inputAttrs(){const 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)}},created(){this.createEditor()},beforeUnmount(){this.destroyEditor()},mounted(){k.warnIfUnmounted(k.returnFirstEl(this.$el),this.$options.name),this.processValue(this.modelValue,!1)},methods:{createEditor(){this.editor=new d.Editor({autofocus:this.autoFocus,content:this.modelValue,editable:this.editable,extensions:this.extensions,parseOptions:{preserveWhitespace:"full"},editorProps:{attributes:{...this.inputAttrs,class:this.inputClass},handleKeyDown:(e,t)=>{if(!this.preventTyping)return!1;const r=["Backspace"];return!this.allowLineBreaks&&!t.shiftKey&&r.push("Enter"),!r.includes(t.key)},handlePaste:(e,t,r)=>{const n=t.clipboardData||window.clipboardData,i=n.getData("text/plain"),s=n.getData("text/html");return this.processPasteData(e,i,s)},transformPastedHTML(e){return e.replace(/(<\/\w+>)((<br \/>)+)/g,"$2$3$1")}}}),this.addEditorListeners()},bubbleMenuShouldShow({editor:e,view:t,state:r,oldState:n,from:i,to:s}){return e.isActive("link")},getSelectedLinkText(e){var c,l,m;const{view:t,state:r}=e,{from:n,to:i}=t.state.selection,s=r.doc.textBetween(n,i,""),a=this.editor.state.doc.nodeAt(n);return a&&((m=(l=(c=a.marks)==null?void 0:c.at(0))==null?void 0:l.type)==null?void 0:m.name)==="link"?a.textContent:s},editLink(){const e=this.getSelectedLinkText(this.editor),t={href:this.editor.getAttributes("link").href,text:e};this.$emit("edit-link",t)},removeLink(){var e,t,r,n;(n=(r=(t=(e=this.editor)==null?void 0:e.chain())==null?void 0:t.focus())==null?void 0:r.unsetLink())==null||n.run()},openLink(){var t,r;(r=(t=this.editor)==null?void 0:t.chain())==null||r.focus();const e=this.editor.getAttributes("link").href;window.open(e,"_blank")},setLink(e,t,r,n=C.RICH_TEXT_EDITOR_SUPPORTED_LINK_PROTOCOLS,i){var c,l,m;if(!e){this.removeLink();return}n.find(p=>p.test(e))||(e=`${i}${e}`),this.editor.chain().focus().extendMarkRange("link").run();const a=(m=(l=(c=this.editor)==null?void 0:c.view)==null?void 0:l.state)==null?void 0:m.selection;this.editor.chain().focus().insertContent(t).setTextSelection({from:a.from,to:a.from+t.length}).setLink({href:e,class:r.class}).run()},processValue(e,t=!0){const r=this.getOutput();if(!(t&&le(e,r))){if(typeof e=="string"&&this.outputFormat==="text"){const n=new RegExp(`(${O.emojiPattern})`,"g");e=e==null?void 0:e.replace(n,'<emoji-component code="$1"></emoji-component>')}this.editor.commands.setContent(e,!1,{preserveWhitespace:"full"})}},destroyEditor(){this.editor.destroy()},insertPlainTextWithHardBreaks(e,t){const{tr:r}=e.state,{from:n,to:i}=e.state.selection;r.deleteRange(n,i);const s=t.split(/\r?\n/);let a=n;for(let c=0;c<s.length;c++)c>0&&(r.insert(a,e.state.schema.nodes.hardBreak.create()),a++),r.insertText(s[c],a),a+=s[c].length;e.dispatch(r)},shouldPreserveLineBreaks(e,t){return this.pasteRichText?!t&&e&&this.hasBlankLines(e):!!e},processPasteData(e,t,r){if(this.shouldPreserveLineBreaks(t,r))return this.insertPlainTextWithHardBreaks(e,t),!0;if(this.shouldHandlePreformattedHTML(r)){const n=this.extractPreformattedText(r);if(n&&n.includes(`
4
4
  `))return this.insertPlainTextWithHardBreaks(e,n),!0}return!1},shouldHandlePreformattedHTML(e){return this.pasteRichText&&e&&this.containsPreformattedContent(e)},containsPreformattedContent(e){const t=document.createElement("div");t.innerHTML=e;const r=t.querySelectorAll("*");for(const n of r)if(this.hasPreWhitespace(n)&&this.hasLineBreaks(n))return!0;return!1},hasPreWhitespace(e){const t=e.getAttribute("style")||"",r=e.style.whiteSpace||"",n=r==="pre"||r==="pre-wrap",i=t.includes("white-space: pre");return n||i},hasLineBreaks(e){return e.textContent&&e.textContent.includes(`
5
5
  `)},hasBlankLines(e){return e.includes(`
6
6
 
7
7
  `)||/\n\s*\n/.test(e)},extractPreformattedText(e){const 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(const r of e.childNodes)t+=this.walkAndExtractText(r);return t},triggerInputChangeEvents(){const e=this.getOutput();this.$emit("input",e),this.$emit("update:modelValue",e);const t=this.editor.getJSON();this.$emit("json-input",t);const r=this.editor.getHTML();this.$emit("html-input",r);const n=this.editor.getText({blockSeparator:`
8
8
  `});this.$emit("text-input",n)},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)})},getOutput(){switch(this.outputFormat){case"json":return this.editor.getJSON();case"html":return this.editor.getHTML();case"text":default:return this.editor.getText({blockSeparator:`
9
- `})}},getExtension(e,t){var r;return typeof t=="boolean"?e:(r=e.configure)==null?void 0:r.call(e,t)},updateEditorAttributes(e){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...e}}})},focusEditor(){this.editor.commands.focus()}}},gt={class:"d-popover__dialog"};function _t(e,t,r,n,i,s){const a=o.resolveComponent("dt-button"),c=o.resolveComponent("dt-stack"),l=o.resolveComponent("bubble-menu"),m=o.resolveComponent("editor-content");return o.openBlock(),o.createElementBlock("div",null,[i.editor&&r.link&&!r.hideLinkBubbleMenu?(o.openBlock(),o.createBlock(l,{key:0,editor:i.editor,"should-show":s.bubbleMenuShouldShow,"tippy-options":i.tippyOptions,style:{visibility:"visible"}},{default:o.withCtx(()=>[o.createElementVNode("div",gt,[o.createVNode(c,{direction:"row",class:"d-rich-text-editor-bubble-menu__button-stack",gap:"0"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"muted",importance:"clear",onClick:s.editLink},{default:o.withCtx(()=>[o.createTextVNode(" Edit ")]),_:1},8,["onClick"]),o.createVNode(a,{kind:"muted",importance:"clear",onClick:s.openLink},{default:o.withCtx(()=>[o.createTextVNode(" Open link ")]),_:1},8,["onClick"]),o.createVNode(a,{kind:"danger",importance:"clear",onClick:s.removeLink},{default:o.withCtx(()=>[o.createTextVNode(" Remove ")]),_:1},8,["onClick"])]),_:1})])]),_:1},8,["editor","should-show","tippy-options"])):o.createCommentVNode("",!0),o.createVNode(m,o.mergeProps({ref:"editor",editor:i.editor,class:"d-rich-text-editor","data-qa":"dt-rich-text-editor"},s.attrs),null,16,["editor"])])}const kt=h._(ft,[["render",_t]]);exports.default=kt;
9
+ `})}},getExtension(e,t){var r;return typeof t=="boolean"?e:(r=e.configure)==null?void 0:r.call(e,t)},updateEditorAttributes(e){this.editor.setOptions({editorProps:{attributes:{...this.inputAttrs,class:this.inputClass,...e}}})},focusEditor(){this.editor.commands.focus()}}},_t={class:"d-popover__dialog"};function kt(e,t,r,n,i,s){const a=o.resolveComponent("dt-button"),c=o.resolveComponent("dt-stack"),l=o.resolveComponent("bubble-menu"),m=o.resolveComponent("editor-content");return o.openBlock(),o.createElementBlock("div",null,[i.editor&&r.link&&!r.hideLinkBubbleMenu?(o.openBlock(),o.createBlock(l,{key:0,editor:i.editor,"should-show":s.bubbleMenuShouldShow,"tippy-options":i.tippyOptions,style:{visibility:"visible"}},{default:o.withCtx(()=>[o.createElementVNode("div",_t,[o.createVNode(c,{direction:"row",class:"d-rich-text-editor-bubble-menu__button-stack",gap:"0"},{default:o.withCtx(()=>[o.createVNode(a,{kind:"muted",importance:"clear",onClick:s.editLink},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_EDIT_BUTTON_LABEL")),1)]),_:1},8,["onClick"]),o.createVNode(a,{kind:"muted",importance:"clear",onClick:s.openLink},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_OPEN_LINK_BUTTON_LABEL")),1)]),_:1},8,["onClick"]),o.createVNode(a,{kind:"danger",importance:"clear",onClick:s.removeLink},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(i.i18n.$t("DIALTONE_RICH_TEXT_EDITOR_REMOVE_BUTTON_LABEL")),1)]),_:1},8,["onClick"])]),_:1})])]),_:1},8,["editor","should-show","tippy-options"])):o.createCommentVNode("",!0),o.createVNode(m,o.mergeProps({ref:"editor",editor:i.editor,class:"d-rich-text-editor","data-qa":"dt-rich-text-editor"},s.attrs),null,16,["editor"])])}const wt=h._(gt,[["render",kt]]);exports.default=wt;
10
10
  //# sourceMappingURL=rich-text-editor.cjs.map