@wlydfe/pro-ui 0.2.1 → 0.2.3

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 (401) hide show
  1. package/es/component.mjs +22 -22
  2. package/es/defaults.mjs +1 -2
  3. package/es/directives/index.d.ts +3 -1
  4. package/es/directives/modules/tippy/index.d.ts +10 -0
  5. package/es/directives.d.ts +1 -0
  6. package/es/directives.mjs +4 -0
  7. package/es/index.css +14 -13
  8. package/es/index.mjs +35 -33
  9. package/es/node_modules/.pnpm/vue-tippy@6.7.1_vue@3.5.17_typescript@5.8.3_/node_modules/vue-tippy/dist/vue-tippy.mjs +4567 -0
  10. package/es/{components → packages/components}/breadcrumb/src/index.vue.mjs +1 -1
  11. package/es/{components → packages/components}/check-card/src/index.vue.mjs +1 -1
  12. package/es/{components → packages/components}/check-card-group/src/index.vue.mjs +1 -1
  13. package/es/{components → packages/components}/date-picker/src/index.vue.mjs +1 -1
  14. package/es/{components → packages/components}/descriptions/src/index.vue.mjs +1 -1
  15. package/es/{components → packages/components}/dialog/src/index.vue.mjs +1 -1
  16. package/es/{components → packages/components}/dialog-form/src/index.vue.mjs +1 -1
  17. package/es/{components → packages/components}/display-item/src/index.vue.mjs +1 -1
  18. package/es/{components → packages/components}/drawer-form/src/index.vue.mjs +1 -1
  19. package/es/{components → packages/components}/form/src/form-content.vue.mjs +1 -1
  20. package/es/{components → packages/components}/form/src/index.vue.mjs +1 -1
  21. package/es/{components → packages/components}/form-item/src/index.vue.mjs +1 -1
  22. package/es/{components → packages/components}/header/src/index.vue.mjs +1 -1
  23. package/es/{components → packages/components}/input-tag/src/index.vue.mjs +1 -1
  24. package/es/{components → packages/components}/layout/src/index.vue.mjs +1 -1
  25. package/es/{components → packages/components}/page/src/index.vue.mjs +1 -1
  26. package/es/{components → packages/components}/pagination/src/index.vue.mjs +1 -1
  27. package/es/{components → packages/components}/popover/src/index.vue.mjs +1 -1
  28. package/es/{components → packages/components}/radio/src/index.vue.mjs +1 -1
  29. package/es/{components → packages/components}/render/src/index.vue.mjs +1 -1
  30. package/es/{components → packages/components}/search/src/index.vue.mjs +1 -1
  31. package/es/{components → packages/components}/sidebar/src/index.vue.mjs +1 -1
  32. package/es/{components → packages/components}/sidebar/src/sidebar-item.vue.mjs +1 -1
  33. package/es/{components → packages/components}/steps-form/src/index.vue.mjs +1 -1
  34. package/es/{components → packages/components}/table/src/index.vue.mjs +1 -1
  35. package/es/{components → packages/components}/table/src/table-action-bar.vue.mjs +1 -1
  36. package/es/{components → packages/components}/table/src/table-column-drag-sort.vue.mjs +1 -1
  37. package/es/{components → packages/components}/table/src/table-column-index.vue.mjs +1 -1
  38. package/es/{components → packages/components}/table/src/table-column.vue.mjs +1 -1
  39. package/es/{components → packages/components}/table/src/table-title-bar.vue.mjs +1 -1
  40. package/es/packages/directives/index.mjs +3 -0
  41. package/es/packages/directives/modules/tippy/index.mjs +11 -0
  42. package/es/packages/theme-chalk/src/table.scss.mjs +3 -0
  43. package/es/pro-ui/directives.d.ts +1 -0
  44. package/index.css +1 -1
  45. package/index.js +4535 -14
  46. package/index.min.css +1 -0
  47. package/index.min.js +7 -3
  48. package/index.min.mjs +7 -3
  49. package/index.mjs +4531 -15
  50. package/lib/component.js +22 -22
  51. package/lib/defaults.js +1 -2
  52. package/lib/directives/index.d.ts +3 -1
  53. package/lib/directives/modules/tippy/index.d.ts +10 -0
  54. package/lib/directives.d.ts +1 -0
  55. package/lib/directives.js +15 -0
  56. package/lib/index.css +14 -13
  57. package/lib/index.js +40 -33
  58. package/lib/node_modules/.pnpm/vue-tippy@6.7.1_vue@3.5.17_typescript@5.8.3_/node_modules/vue-tippy/dist/vue-tippy.js +4582 -0
  59. package/lib/{components → packages/components}/breadcrumb/src/index.vue.js +1 -1
  60. package/lib/{components → packages/components}/check-card/src/index.vue.js +1 -1
  61. package/lib/{components → packages/components}/check-card-group/src/index.vue.js +1 -1
  62. package/lib/{components → packages/components}/date-picker/src/index.vue.js +1 -1
  63. package/lib/{components → packages/components}/descriptions/src/index.vue.js +1 -1
  64. package/lib/{components → packages/components}/dialog/src/index.vue.js +1 -1
  65. package/lib/{components → packages/components}/dialog-form/src/index.vue.js +1 -1
  66. package/lib/{components → packages/components}/display-item/src/index.vue.js +1 -1
  67. package/lib/{components → packages/components}/drawer-form/src/index.vue.js +1 -1
  68. package/lib/{components → packages/components}/form/src/form-content.vue.js +1 -1
  69. package/lib/{components → packages/components}/form/src/index.vue.js +1 -1
  70. package/lib/{components → packages/components}/form-item/src/index.vue.js +1 -1
  71. package/lib/{components → packages/components}/header/src/index.vue.js +1 -1
  72. package/lib/{components → packages/components}/input-tag/src/index.vue.js +1 -1
  73. package/lib/{components → packages/components}/layout/src/index.vue.js +1 -1
  74. package/lib/{components → packages/components}/page/src/index.vue.js +1 -1
  75. package/lib/{components → packages/components}/pagination/src/index.vue.js +1 -1
  76. package/lib/{components → packages/components}/popover/src/index.vue.js +1 -1
  77. package/lib/{components → packages/components}/radio/src/index.vue.js +1 -1
  78. package/lib/{components → packages/components}/render/src/index.vue.js +1 -1
  79. package/lib/{components → packages/components}/search/src/index.vue.js +1 -1
  80. package/lib/{components → packages/components}/sidebar/src/index.vue.js +1 -1
  81. package/lib/{components → packages/components}/sidebar/src/sidebar-item.vue.js +1 -1
  82. package/lib/{components → packages/components}/steps-form/src/index.vue.js +1 -1
  83. package/lib/{components → packages/components}/table/src/index.vue.js +1 -1
  84. package/lib/{components → packages/components}/table/src/table-action-bar.vue.js +1 -1
  85. package/lib/{components → packages/components}/table/src/table-column-drag-sort.vue.js +1 -1
  86. package/lib/{components → packages/components}/table/src/table-column-index.vue.js +1 -1
  87. package/lib/{components → packages/components}/table/src/table-column.vue.js +1 -1
  88. package/lib/{components → packages/components}/table/src/table-title-bar.vue.js +1 -1
  89. package/lib/packages/directives/index.js +14 -0
  90. package/lib/packages/directives/modules/tippy/index.js +19 -0
  91. package/lib/packages/theme-chalk/src/table.scss.js +7 -0
  92. package/lib/pro-ui/directives.d.ts +1 -0
  93. package/locale/en.js +1 -1
  94. package/locale/en.min.js +1 -1
  95. package/locale/en.min.mjs +1 -1
  96. package/locale/en.mjs +1 -1
  97. package/locale/zh-cn.js +1 -1
  98. package/locale/zh-cn.min.js +1 -1
  99. package/locale/zh-cn.min.mjs +1 -1
  100. package/locale/zh-cn.mjs +1 -1
  101. package/package.json +6 -1
  102. package/es/directive.d.ts +0 -3
  103. package/es/directive.mjs +0 -8
  104. package/es/directives/index.mjs +0 -1
  105. package/es/pro-ui/directive.d.ts +0 -3
  106. package/lib/directive.d.ts +0 -3
  107. package/lib/directive.js +0 -12
  108. package/lib/directives/index.js +0 -7
  109. package/lib/pro-ui/directive.d.ts +0 -3
  110. /package/es/directives/{click → modules/click}/hook/useClickControl.d.ts +0 -0
  111. /package/es/directives/{click → modules/click}/index.d.ts +0 -0
  112. /package/es/directives/{click → modules/click}/type/index.d.ts +0 -0
  113. /package/es/{theme-chalk/src/breadcrumb.scss.mjs → node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.css.mjs} +0 -0
  114. /package/es/{components → packages/components}/breadcrumb/index.mjs +0 -0
  115. /package/es/{components → packages/components}/breadcrumb/src/index.vue2.mjs +0 -0
  116. /package/es/{components → packages/components}/breadcrumb/style/css.mjs +0 -0
  117. /package/es/{components → packages/components}/breadcrumb/style/index.mjs +0 -0
  118. /package/es/{components → packages/components}/check-card/index.mjs +0 -0
  119. /package/es/{components → packages/components}/check-card/src/index.vue2.mjs +0 -0
  120. /package/es/{components → packages/components}/check-card/style/css.mjs +0 -0
  121. /package/es/{components → packages/components}/check-card/style/index.mjs +0 -0
  122. /package/es/{components → packages/components}/check-card-group/index.mjs +0 -0
  123. /package/es/{components → packages/components}/check-card-group/src/index.vue2.mjs +0 -0
  124. /package/es/{components → packages/components}/check-card-group/style/css.mjs +0 -0
  125. /package/es/{components → packages/components}/check-card-group/style/index.mjs +0 -0
  126. /package/es/{components → packages/components}/date-picker/index.mjs +0 -0
  127. /package/es/{components → packages/components}/date-picker/src/index.vue2.mjs +0 -0
  128. /package/es/{components → packages/components}/date-picker/style/css.mjs +0 -0
  129. /package/es/{components → packages/components}/date-picker/style/index.mjs +0 -0
  130. /package/es/{components → packages/components}/descriptions/index.mjs +0 -0
  131. /package/es/{components → packages/components}/descriptions/src/index.vue2.mjs +0 -0
  132. /package/es/{components → packages/components}/descriptions/style/css.mjs +0 -0
  133. /package/es/{components → packages/components}/descriptions/style/index.mjs +0 -0
  134. /package/es/{components → packages/components}/dialog/index.mjs +0 -0
  135. /package/es/{components → packages/components}/dialog/src/index.vue2.mjs +0 -0
  136. /package/es/{components → packages/components}/dialog/style/css.mjs +0 -0
  137. /package/es/{components → packages/components}/dialog/style/index.mjs +0 -0
  138. /package/es/{components → packages/components}/dialog-form/index.mjs +0 -0
  139. /package/es/{components → packages/components}/dialog-form/src/index.vue2.mjs +0 -0
  140. /package/es/{components → packages/components}/dialog-form/style/css.mjs +0 -0
  141. /package/es/{components → packages/components}/dialog-form/style/index.mjs +0 -0
  142. /package/es/{components → packages/components}/display-item/index.mjs +0 -0
  143. /package/es/{components → packages/components}/display-item/src/index.vue2.mjs +0 -0
  144. /package/es/{components → packages/components}/display-item/style/css.mjs +0 -0
  145. /package/es/{components → packages/components}/display-item/style/index.mjs +0 -0
  146. /package/es/{components → packages/components}/drawer-form/index.mjs +0 -0
  147. /package/es/{components → packages/components}/drawer-form/src/index.vue2.mjs +0 -0
  148. /package/es/{components → packages/components}/drawer-form/style/css.mjs +0 -0
  149. /package/es/{components → packages/components}/drawer-form/style/index.mjs +0 -0
  150. /package/es/{components → packages/components}/form/index.mjs +0 -0
  151. /package/es/{components → packages/components}/form/src/form-content.vue2.mjs +0 -0
  152. /package/es/{components → packages/components}/form/src/index.vue2.mjs +0 -0
  153. /package/es/{components → packages/components}/form/style/css.mjs +0 -0
  154. /package/es/{components → packages/components}/form/style/index.mjs +0 -0
  155. /package/es/{components → packages/components}/form-item/index.mjs +0 -0
  156. /package/es/{components → packages/components}/form-item/src/index.vue2.mjs +0 -0
  157. /package/es/{components → packages/components}/form-item/style/css.mjs +0 -0
  158. /package/es/{components → packages/components}/form-item/style/index.mjs +0 -0
  159. /package/es/{components → packages/components}/header/index.mjs +0 -0
  160. /package/es/{components → packages/components}/header/src/index.vue2.mjs +0 -0
  161. /package/es/{components → packages/components}/header/style/css.mjs +0 -0
  162. /package/es/{components → packages/components}/header/style/index.mjs +0 -0
  163. /package/es/{components → packages/components}/index.mjs +0 -0
  164. /package/es/{components → packages/components}/input-tag/index.mjs +0 -0
  165. /package/es/{components → packages/components}/input-tag/src/index.vue2.mjs +0 -0
  166. /package/es/{components → packages/components}/input-tag/style/css.mjs +0 -0
  167. /package/es/{components → packages/components}/input-tag/style/index.mjs +0 -0
  168. /package/es/{components → packages/components}/layout/index.mjs +0 -0
  169. /package/es/{components → packages/components}/layout/src/index.vue2.mjs +0 -0
  170. /package/es/{components → packages/components}/layout/style/css.mjs +0 -0
  171. /package/es/{components → packages/components}/layout/style/index.mjs +0 -0
  172. /package/es/{components → packages/components}/page/index.mjs +0 -0
  173. /package/es/{components → packages/components}/page/src/index.vue2.mjs +0 -0
  174. /package/es/{components → packages/components}/page/style/css.mjs +0 -0
  175. /package/es/{components → packages/components}/page/style/index.mjs +0 -0
  176. /package/es/{components → packages/components}/pagination/index.mjs +0 -0
  177. /package/es/{components → packages/components}/pagination/src/index.vue2.mjs +0 -0
  178. /package/es/{components → packages/components}/pagination/style/css.mjs +0 -0
  179. /package/es/{components → packages/components}/pagination/style/index.mjs +0 -0
  180. /package/es/{components → packages/components}/popover/index.mjs +0 -0
  181. /package/es/{components → packages/components}/popover/src/index.vue2.mjs +0 -0
  182. /package/es/{components → packages/components}/popover/style/css.mjs +0 -0
  183. /package/es/{components → packages/components}/popover/style/index.mjs +0 -0
  184. /package/es/{components → packages/components}/radio/index.mjs +0 -0
  185. /package/es/{components → packages/components}/radio/src/index.vue2.mjs +0 -0
  186. /package/es/{components → packages/components}/radio/style/css.mjs +0 -0
  187. /package/es/{components → packages/components}/radio/style/index.mjs +0 -0
  188. /package/es/{components → packages/components}/render/index.mjs +0 -0
  189. /package/es/{components → packages/components}/render/src/index.vue2.mjs +0 -0
  190. /package/es/{components → packages/components}/search/index.mjs +0 -0
  191. /package/es/{components → packages/components}/search/src/index.vue2.mjs +0 -0
  192. /package/es/{components → packages/components}/search/style/css.mjs +0 -0
  193. /package/es/{components → packages/components}/search/style/index.mjs +0 -0
  194. /package/es/{components → packages/components}/sidebar/index.mjs +0 -0
  195. /package/es/{components → packages/components}/sidebar/src/index.vue2.mjs +0 -0
  196. /package/es/{components → packages/components}/sidebar/src/sidebar-item.vue2.mjs +0 -0
  197. /package/es/{components → packages/components}/sidebar/style/css.mjs +0 -0
  198. /package/es/{components → packages/components}/sidebar/style/index.mjs +0 -0
  199. /package/es/{components → packages/components}/steps-form/index.mjs +0 -0
  200. /package/es/{components → packages/components}/steps-form/src/index.vue2.mjs +0 -0
  201. /package/es/{components → packages/components}/steps-form/style/css.mjs +0 -0
  202. /package/es/{components → packages/components}/steps-form/style/index.mjs +0 -0
  203. /package/es/{components → packages/components}/table/index.mjs +0 -0
  204. /package/es/{components → packages/components}/table/src/index.vue2.mjs +0 -0
  205. /package/es/{components → packages/components}/table/src/table-action-bar.vue2.mjs +0 -0
  206. /package/es/{components → packages/components}/table/src/table-column-drag-sort.vue2.mjs +0 -0
  207. /package/es/{components → packages/components}/table/src/table-column-index.vue2.mjs +0 -0
  208. /package/es/{components → packages/components}/table/src/table-column.vue2.mjs +0 -0
  209. /package/es/{components → packages/components}/table/src/table-title-bar.vue2.mjs +0 -0
  210. /package/es/{components → packages/components}/table/src/type.mjs +0 -0
  211. /package/es/{components → packages/components}/table/style/css.mjs +0 -0
  212. /package/es/{components → packages/components}/table/style/index.mjs +0 -0
  213. /package/es/{components → packages/components}/utils/format.mjs +0 -0
  214. /package/es/{components → packages/components}/utils/index.mjs +0 -0
  215. /package/es/{components → packages/components}/utils/is.mjs +0 -0
  216. /package/es/{constants → packages/constants}/form.mjs +0 -0
  217. /package/es/{constants → packages/constants}/index.mjs +0 -0
  218. /package/es/{constants → packages/constants}/page.mjs +0 -0
  219. /package/es/{directives → packages/directives/modules}/click/hook/useClickControl.mjs +0 -0
  220. /package/es/{directives → packages/directives/modules}/click/index.mjs +0 -0
  221. /package/es/{directives → packages/directives/modules}/click/type/index.mjs +0 -0
  222. /package/es/{hooks → packages/hooks}/index.mjs +0 -0
  223. /package/es/{hooks → packages/hooks}/useGetOptions.mjs +0 -0
  224. /package/es/{hooks → packages/hooks}/useLocale.mjs +0 -0
  225. /package/es/{hooks → packages/hooks}/useTable.mjs +0 -0
  226. /package/es/{locale → packages/locale}/index.mjs +0 -0
  227. /package/es/{locale → packages/locale}/lang/en.mjs +0 -0
  228. /package/es/{locale → packages/locale}/lang/zh-cn.mjs +0 -0
  229. /package/es/{theme-chalk/src/check-card-group.scss.mjs → packages/theme-chalk/src/breadcrumb.scss.mjs} +0 -0
  230. /package/es/{theme-chalk/src/check-card.scss.mjs → packages/theme-chalk/src/check-card-group.scss.mjs} +0 -0
  231. /package/es/{theme-chalk/src/date-picker.scss.mjs → packages/theme-chalk/src/check-card.scss.mjs} +0 -0
  232. /package/es/{theme-chalk/src/descriptions.scss.mjs → packages/theme-chalk/src/date-picker.scss.mjs} +0 -0
  233. /package/es/{theme-chalk/src/dialog-form.scss.mjs → packages/theme-chalk/src/descriptions.scss.mjs} +0 -0
  234. /package/es/{theme-chalk/src/dialog.scss.mjs → packages/theme-chalk/src/dialog-form.scss.mjs} +0 -0
  235. /package/es/{theme-chalk/src/display-item.scss.mjs → packages/theme-chalk/src/dialog.scss.mjs} +0 -0
  236. /package/es/{theme-chalk/src/drawer-form.scss.mjs → packages/theme-chalk/src/display-item.scss.mjs} +0 -0
  237. /package/es/{theme-chalk/src/form-item.scss.mjs → packages/theme-chalk/src/drawer-form.scss.mjs} +0 -0
  238. /package/es/{theme-chalk/src/form.scss.mjs → packages/theme-chalk/src/form-item.scss.mjs} +0 -0
  239. /package/es/{theme-chalk/src/header.scss.mjs → packages/theme-chalk/src/form.scss.mjs} +0 -0
  240. /package/es/{theme-chalk/src/input-tag.scss.mjs → packages/theme-chalk/src/header.scss.mjs} +0 -0
  241. /package/es/{theme-chalk/src/layout.scss.mjs → packages/theme-chalk/src/input-tag.scss.mjs} +0 -0
  242. /package/es/{theme-chalk/src/page.scss.mjs → packages/theme-chalk/src/layout.scss.mjs} +0 -0
  243. /package/es/{theme-chalk/src/pagination.scss.mjs → packages/theme-chalk/src/page.scss.mjs} +0 -0
  244. /package/es/{theme-chalk/src/popover.scss.mjs → packages/theme-chalk/src/pagination.scss.mjs} +0 -0
  245. /package/es/{theme-chalk/src/radio.scss.mjs → packages/theme-chalk/src/popover.scss.mjs} +0 -0
  246. /package/es/{theme-chalk/src/search.scss.mjs → packages/theme-chalk/src/radio.scss.mjs} +0 -0
  247. /package/es/{theme-chalk/src/sidebar.scss.mjs → packages/theme-chalk/src/search.scss.mjs} +0 -0
  248. /package/es/{theme-chalk/src/steps-form.scss.mjs → packages/theme-chalk/src/sidebar.scss.mjs} +0 -0
  249. /package/es/{theme-chalk/src/table.scss.mjs → packages/theme-chalk/src/steps-form.scss.mjs} +0 -0
  250. /package/es/{types → packages/types}/form.mjs +0 -0
  251. /package/es/{types → packages/types}/global.mjs +0 -0
  252. /package/es/{types → packages/types}/index.mjs +0 -0
  253. /package/es/{types → packages/types}/layout.mjs +0 -0
  254. /package/es/{types → packages/types}/plus.mjs +0 -0
  255. /package/es/{types → packages/types}/table.mjs +0 -0
  256. /package/lib/directives/{click → modules/click}/hook/useClickControl.d.ts +0 -0
  257. /package/lib/directives/{click → modules/click}/index.d.ts +0 -0
  258. /package/lib/directives/{click → modules/click}/type/index.d.ts +0 -0
  259. /package/lib/{theme-chalk/src/breadcrumb.scss.js → node_modules/.pnpm/tippy.js@6.3.7/node_modules/tippy.js/dist/tippy.css.js} +0 -0
  260. /package/lib/{components → packages/components}/breadcrumb/index.js +0 -0
  261. /package/lib/{components → packages/components}/breadcrumb/src/index.vue2.js +0 -0
  262. /package/lib/{components → packages/components}/breadcrumb/style/css.js +0 -0
  263. /package/lib/{components → packages/components}/breadcrumb/style/index.js +0 -0
  264. /package/lib/{components → packages/components}/check-card/index.js +0 -0
  265. /package/lib/{components → packages/components}/check-card/src/index.vue2.js +0 -0
  266. /package/lib/{components → packages/components}/check-card/style/css.js +0 -0
  267. /package/lib/{components → packages/components}/check-card/style/index.js +0 -0
  268. /package/lib/{components → packages/components}/check-card-group/index.js +0 -0
  269. /package/lib/{components → packages/components}/check-card-group/src/index.vue2.js +0 -0
  270. /package/lib/{components → packages/components}/check-card-group/style/css.js +0 -0
  271. /package/lib/{components → packages/components}/check-card-group/style/index.js +0 -0
  272. /package/lib/{components → packages/components}/date-picker/index.js +0 -0
  273. /package/lib/{components → packages/components}/date-picker/src/index.vue2.js +0 -0
  274. /package/lib/{components → packages/components}/date-picker/style/css.js +0 -0
  275. /package/lib/{components → packages/components}/date-picker/style/index.js +0 -0
  276. /package/lib/{components → packages/components}/descriptions/index.js +0 -0
  277. /package/lib/{components → packages/components}/descriptions/src/index.vue2.js +0 -0
  278. /package/lib/{components → packages/components}/descriptions/style/css.js +0 -0
  279. /package/lib/{components → packages/components}/descriptions/style/index.js +0 -0
  280. /package/lib/{components → packages/components}/dialog/index.js +0 -0
  281. /package/lib/{components → packages/components}/dialog/src/index.vue2.js +0 -0
  282. /package/lib/{components → packages/components}/dialog/style/css.js +0 -0
  283. /package/lib/{components → packages/components}/dialog/style/index.js +0 -0
  284. /package/lib/{components → packages/components}/dialog-form/index.js +0 -0
  285. /package/lib/{components → packages/components}/dialog-form/src/index.vue2.js +0 -0
  286. /package/lib/{components → packages/components}/dialog-form/style/css.js +0 -0
  287. /package/lib/{components → packages/components}/dialog-form/style/index.js +0 -0
  288. /package/lib/{components → packages/components}/display-item/index.js +0 -0
  289. /package/lib/{components → packages/components}/display-item/src/index.vue2.js +0 -0
  290. /package/lib/{components → packages/components}/display-item/style/css.js +0 -0
  291. /package/lib/{components → packages/components}/display-item/style/index.js +0 -0
  292. /package/lib/{components → packages/components}/drawer-form/index.js +0 -0
  293. /package/lib/{components → packages/components}/drawer-form/src/index.vue2.js +0 -0
  294. /package/lib/{components → packages/components}/drawer-form/style/css.js +0 -0
  295. /package/lib/{components → packages/components}/drawer-form/style/index.js +0 -0
  296. /package/lib/{components → packages/components}/form/index.js +0 -0
  297. /package/lib/{components → packages/components}/form/src/form-content.vue2.js +0 -0
  298. /package/lib/{components → packages/components}/form/src/index.vue2.js +0 -0
  299. /package/lib/{components → packages/components}/form/style/css.js +0 -0
  300. /package/lib/{components → packages/components}/form/style/index.js +0 -0
  301. /package/lib/{components → packages/components}/form-item/index.js +0 -0
  302. /package/lib/{components → packages/components}/form-item/src/index.vue2.js +0 -0
  303. /package/lib/{components → packages/components}/form-item/style/css.js +0 -0
  304. /package/lib/{components → packages/components}/form-item/style/index.js +0 -0
  305. /package/lib/{components → packages/components}/header/index.js +0 -0
  306. /package/lib/{components → packages/components}/header/src/index.vue2.js +0 -0
  307. /package/lib/{components → packages/components}/header/style/css.js +0 -0
  308. /package/lib/{components → packages/components}/header/style/index.js +0 -0
  309. /package/lib/{components → packages/components}/index.js +0 -0
  310. /package/lib/{components → packages/components}/input-tag/index.js +0 -0
  311. /package/lib/{components → packages/components}/input-tag/src/index.vue2.js +0 -0
  312. /package/lib/{components → packages/components}/input-tag/style/css.js +0 -0
  313. /package/lib/{components → packages/components}/input-tag/style/index.js +0 -0
  314. /package/lib/{components → packages/components}/layout/index.js +0 -0
  315. /package/lib/{components → packages/components}/layout/src/index.vue2.js +0 -0
  316. /package/lib/{components → packages/components}/layout/style/css.js +0 -0
  317. /package/lib/{components → packages/components}/layout/style/index.js +0 -0
  318. /package/lib/{components → packages/components}/page/index.js +0 -0
  319. /package/lib/{components → packages/components}/page/src/index.vue2.js +0 -0
  320. /package/lib/{components → packages/components}/page/style/css.js +0 -0
  321. /package/lib/{components → packages/components}/page/style/index.js +0 -0
  322. /package/lib/{components → packages/components}/pagination/index.js +0 -0
  323. /package/lib/{components → packages/components}/pagination/src/index.vue2.js +0 -0
  324. /package/lib/{components → packages/components}/pagination/style/css.js +0 -0
  325. /package/lib/{components → packages/components}/pagination/style/index.js +0 -0
  326. /package/lib/{components → packages/components}/popover/index.js +0 -0
  327. /package/lib/{components → packages/components}/popover/src/index.vue2.js +0 -0
  328. /package/lib/{components → packages/components}/popover/style/css.js +0 -0
  329. /package/lib/{components → packages/components}/popover/style/index.js +0 -0
  330. /package/lib/{components → packages/components}/radio/index.js +0 -0
  331. /package/lib/{components → packages/components}/radio/src/index.vue2.js +0 -0
  332. /package/lib/{components → packages/components}/radio/style/css.js +0 -0
  333. /package/lib/{components → packages/components}/radio/style/index.js +0 -0
  334. /package/lib/{components → packages/components}/render/index.js +0 -0
  335. /package/lib/{components → packages/components}/render/src/index.vue2.js +0 -0
  336. /package/lib/{components → packages/components}/search/index.js +0 -0
  337. /package/lib/{components → packages/components}/search/src/index.vue2.js +0 -0
  338. /package/lib/{components → packages/components}/search/style/css.js +0 -0
  339. /package/lib/{components → packages/components}/search/style/index.js +0 -0
  340. /package/lib/{components → packages/components}/sidebar/index.js +0 -0
  341. /package/lib/{components → packages/components}/sidebar/src/index.vue2.js +0 -0
  342. /package/lib/{components → packages/components}/sidebar/src/sidebar-item.vue2.js +0 -0
  343. /package/lib/{components → packages/components}/sidebar/style/css.js +0 -0
  344. /package/lib/{components → packages/components}/sidebar/style/index.js +0 -0
  345. /package/lib/{components → packages/components}/steps-form/index.js +0 -0
  346. /package/lib/{components → packages/components}/steps-form/src/index.vue2.js +0 -0
  347. /package/lib/{components → packages/components}/steps-form/style/css.js +0 -0
  348. /package/lib/{components → packages/components}/steps-form/style/index.js +0 -0
  349. /package/lib/{components → packages/components}/table/index.js +0 -0
  350. /package/lib/{components → packages/components}/table/src/index.vue2.js +0 -0
  351. /package/lib/{components → packages/components}/table/src/table-action-bar.vue2.js +0 -0
  352. /package/lib/{components → packages/components}/table/src/table-column-drag-sort.vue2.js +0 -0
  353. /package/lib/{components → packages/components}/table/src/table-column-index.vue2.js +0 -0
  354. /package/lib/{components → packages/components}/table/src/table-column.vue2.js +0 -0
  355. /package/lib/{components → packages/components}/table/src/table-title-bar.vue2.js +0 -0
  356. /package/lib/{components → packages/components}/table/src/type.js +0 -0
  357. /package/lib/{components → packages/components}/table/style/css.js +0 -0
  358. /package/lib/{components → packages/components}/table/style/index.js +0 -0
  359. /package/lib/{components → packages/components}/utils/format.js +0 -0
  360. /package/lib/{components → packages/components}/utils/index.js +0 -0
  361. /package/lib/{components → packages/components}/utils/is.js +0 -0
  362. /package/lib/{constants → packages/constants}/form.js +0 -0
  363. /package/lib/{constants → packages/constants}/index.js +0 -0
  364. /package/lib/{constants → packages/constants}/page.js +0 -0
  365. /package/lib/{directives → packages/directives/modules}/click/hook/useClickControl.js +0 -0
  366. /package/lib/{directives → packages/directives/modules}/click/index.js +0 -0
  367. /package/lib/{directives → packages/directives/modules}/click/type/index.js +0 -0
  368. /package/lib/{hooks → packages/hooks}/index.js +0 -0
  369. /package/lib/{hooks → packages/hooks}/useGetOptions.js +0 -0
  370. /package/lib/{hooks → packages/hooks}/useLocale.js +0 -0
  371. /package/lib/{hooks → packages/hooks}/useTable.js +0 -0
  372. /package/lib/{locale → packages/locale}/index.js +0 -0
  373. /package/lib/{locale → packages/locale}/lang/en.js +0 -0
  374. /package/lib/{locale → packages/locale}/lang/zh-cn.js +0 -0
  375. /package/lib/{theme-chalk/src/check-card-group.scss.js → packages/theme-chalk/src/breadcrumb.scss.js} +0 -0
  376. /package/lib/{theme-chalk/src/check-card.scss.js → packages/theme-chalk/src/check-card-group.scss.js} +0 -0
  377. /package/lib/{theme-chalk/src/date-picker.scss.js → packages/theme-chalk/src/check-card.scss.js} +0 -0
  378. /package/lib/{theme-chalk/src/descriptions.scss.js → packages/theme-chalk/src/date-picker.scss.js} +0 -0
  379. /package/lib/{theme-chalk/src/dialog-form.scss.js → packages/theme-chalk/src/descriptions.scss.js} +0 -0
  380. /package/lib/{theme-chalk/src/dialog.scss.js → packages/theme-chalk/src/dialog-form.scss.js} +0 -0
  381. /package/lib/{theme-chalk/src/display-item.scss.js → packages/theme-chalk/src/dialog.scss.js} +0 -0
  382. /package/lib/{theme-chalk/src/drawer-form.scss.js → packages/theme-chalk/src/display-item.scss.js} +0 -0
  383. /package/lib/{theme-chalk/src/form-item.scss.js → packages/theme-chalk/src/drawer-form.scss.js} +0 -0
  384. /package/lib/{theme-chalk/src/form.scss.js → packages/theme-chalk/src/form-item.scss.js} +0 -0
  385. /package/lib/{theme-chalk/src/header.scss.js → packages/theme-chalk/src/form.scss.js} +0 -0
  386. /package/lib/{theme-chalk/src/input-tag.scss.js → packages/theme-chalk/src/header.scss.js} +0 -0
  387. /package/lib/{theme-chalk/src/layout.scss.js → packages/theme-chalk/src/input-tag.scss.js} +0 -0
  388. /package/lib/{theme-chalk/src/page.scss.js → packages/theme-chalk/src/layout.scss.js} +0 -0
  389. /package/lib/{theme-chalk/src/pagination.scss.js → packages/theme-chalk/src/page.scss.js} +0 -0
  390. /package/lib/{theme-chalk/src/popover.scss.js → packages/theme-chalk/src/pagination.scss.js} +0 -0
  391. /package/lib/{theme-chalk/src/radio.scss.js → packages/theme-chalk/src/popover.scss.js} +0 -0
  392. /package/lib/{theme-chalk/src/search.scss.js → packages/theme-chalk/src/radio.scss.js} +0 -0
  393. /package/lib/{theme-chalk/src/sidebar.scss.js → packages/theme-chalk/src/search.scss.js} +0 -0
  394. /package/lib/{theme-chalk/src/steps-form.scss.js → packages/theme-chalk/src/sidebar.scss.js} +0 -0
  395. /package/lib/{theme-chalk/src/table.scss.js → packages/theme-chalk/src/steps-form.scss.js} +0 -0
  396. /package/lib/{types → packages/types}/form.js +0 -0
  397. /package/lib/{types → packages/types}/global.js +0 -0
  398. /package/lib/{types → packages/types}/index.js +0 -0
  399. /package/lib/{types → packages/types}/layout.js +0 -0
  400. /package/lib/{types → packages/types}/plus.js +0 -0
  401. /package/lib/{types → packages/types}/table.js +0 -0
@@ -0,0 +1,4582 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const vue = require('vue');
6
+
7
+ /*!
8
+ * vue-tippy v6.7.1
9
+ * (c) 2025
10
+ * @license MIT
11
+ */
12
+
13
+ var top = 'top';
14
+ var bottom = 'bottom';
15
+ var right = 'right';
16
+ var left = 'left';
17
+ var auto = 'auto';
18
+ var basePlacements = [top, bottom, right, left];
19
+ var start = 'start';
20
+ var end = 'end';
21
+ var clippingParents = 'clippingParents';
22
+ var viewport = 'viewport';
23
+ var popper = 'popper';
24
+ var reference = 'reference';
25
+ var variationPlacements = /*#__PURE__*/basePlacements.reduce(function (acc, placement) {
26
+ return acc.concat([placement + "-" + start, placement + "-" + end]);
27
+ }, []);
28
+ var placements = /*#__PURE__*/[].concat(basePlacements, [auto]).reduce(function (acc, placement) {
29
+ return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
30
+ }, []); // modifiers that need to read the DOM
31
+
32
+ var beforeRead = 'beforeRead';
33
+ var read = 'read';
34
+ var afterRead = 'afterRead'; // pure-logic modifiers
35
+
36
+ var beforeMain = 'beforeMain';
37
+ var main = 'main';
38
+ var afterMain = 'afterMain'; // modifier with the purpose to write to the DOM (or write into a framework state)
39
+
40
+ var beforeWrite = 'beforeWrite';
41
+ var write = 'write';
42
+ var afterWrite = 'afterWrite';
43
+ var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
44
+
45
+ function getNodeName(element) {
46
+ return element ? (element.nodeName || '').toLowerCase() : null;
47
+ }
48
+
49
+ function getWindow(node) {
50
+ if (node == null) {
51
+ return window;
52
+ }
53
+
54
+ if (node.toString() !== '[object Window]') {
55
+ var ownerDocument = node.ownerDocument;
56
+ return ownerDocument ? ownerDocument.defaultView || window : window;
57
+ }
58
+
59
+ return node;
60
+ }
61
+
62
+ function isElement(node) {
63
+ var OwnElement = getWindow(node).Element;
64
+ return node instanceof OwnElement || node instanceof Element;
65
+ }
66
+
67
+ function isHTMLElement(node) {
68
+ var OwnElement = getWindow(node).HTMLElement;
69
+ return node instanceof OwnElement || node instanceof HTMLElement;
70
+ }
71
+
72
+ function isShadowRoot(node) {
73
+ // IE 11 has no ShadowRoot
74
+ if (typeof ShadowRoot === 'undefined') {
75
+ return false;
76
+ }
77
+
78
+ var OwnElement = getWindow(node).ShadowRoot;
79
+ return node instanceof OwnElement || node instanceof ShadowRoot;
80
+ }
81
+
82
+ // and applies them to the HTMLElements such as popper and arrow
83
+
84
+ function applyStyles(_ref) {
85
+ var state = _ref.state;
86
+ Object.keys(state.elements).forEach(function (name) {
87
+ var style = state.styles[name] || {};
88
+ var attributes = state.attributes[name] || {};
89
+ var element = state.elements[name]; // arrow is optional + virtual elements
90
+
91
+ if (!isHTMLElement(element) || !getNodeName(element)) {
92
+ return;
93
+ } // Flow doesn't support to extend this property, but it's the most
94
+ // effective way to apply styles to an HTMLElement
95
+ // $FlowFixMe[cannot-write]
96
+
97
+
98
+ Object.assign(element.style, style);
99
+ Object.keys(attributes).forEach(function (name) {
100
+ var value = attributes[name];
101
+
102
+ if (value === false) {
103
+ element.removeAttribute(name);
104
+ } else {
105
+ element.setAttribute(name, value === true ? '' : value);
106
+ }
107
+ });
108
+ });
109
+ }
110
+
111
+ function effect(_ref2) {
112
+ var state = _ref2.state;
113
+ var initialStyles = {
114
+ popper: {
115
+ position: state.options.strategy,
116
+ left: '0',
117
+ top: '0',
118
+ margin: '0'
119
+ },
120
+ arrow: {
121
+ position: 'absolute'
122
+ },
123
+ reference: {}
124
+ };
125
+ Object.assign(state.elements.popper.style, initialStyles.popper);
126
+ state.styles = initialStyles;
127
+
128
+ if (state.elements.arrow) {
129
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
130
+ }
131
+
132
+ return function () {
133
+ Object.keys(state.elements).forEach(function (name) {
134
+ var element = state.elements[name];
135
+ var attributes = state.attributes[name] || {};
136
+ var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); // Set all values to an empty string to unset them
137
+
138
+ var style = styleProperties.reduce(function (style, property) {
139
+ style[property] = '';
140
+ return style;
141
+ }, {}); // arrow is optional + virtual elements
142
+
143
+ if (!isHTMLElement(element) || !getNodeName(element)) {
144
+ return;
145
+ }
146
+
147
+ Object.assign(element.style, style);
148
+ Object.keys(attributes).forEach(function (attribute) {
149
+ element.removeAttribute(attribute);
150
+ });
151
+ });
152
+ };
153
+ } // eslint-disable-next-line import/no-unused-modules
154
+
155
+
156
+ var applyStyles$1 = {
157
+ name: 'applyStyles',
158
+ enabled: true,
159
+ phase: 'write',
160
+ fn: applyStyles,
161
+ effect: effect,
162
+ requires: ['computeStyles']
163
+ };
164
+
165
+ function getBasePlacement(placement) {
166
+ return placement.split('-')[0];
167
+ }
168
+
169
+ var max = Math.max;
170
+ var min = Math.min;
171
+ var round = Math.round;
172
+
173
+ function getBoundingClientRect(element, includeScale) {
174
+ if (includeScale === void 0) {
175
+ includeScale = false;
176
+ }
177
+
178
+ var rect = element.getBoundingClientRect();
179
+ var scaleX = 1;
180
+ var scaleY = 1;
181
+
182
+ if (isHTMLElement(element) && includeScale) {
183
+ var offsetHeight = element.offsetHeight;
184
+ var offsetWidth = element.offsetWidth; // Do not attempt to divide by 0, otherwise we get `Infinity` as scale
185
+ // Fallback to 1 in case both values are `0`
186
+
187
+ if (offsetWidth > 0) {
188
+ scaleX = round(rect.width) / offsetWidth || 1;
189
+ }
190
+
191
+ if (offsetHeight > 0) {
192
+ scaleY = round(rect.height) / offsetHeight || 1;
193
+ }
194
+ }
195
+
196
+ return {
197
+ width: rect.width / scaleX,
198
+ height: rect.height / scaleY,
199
+ top: rect.top / scaleY,
200
+ right: rect.right / scaleX,
201
+ bottom: rect.bottom / scaleY,
202
+ left: rect.left / scaleX,
203
+ x: rect.left / scaleX,
204
+ y: rect.top / scaleY
205
+ };
206
+ }
207
+
208
+ // means it doesn't take into account transforms.
209
+
210
+ function getLayoutRect(element) {
211
+ var clientRect = getBoundingClientRect(element); // Use the clientRect sizes if it's not been transformed.
212
+ // Fixes https://github.com/popperjs/popper-core/issues/1223
213
+
214
+ var width = element.offsetWidth;
215
+ var height = element.offsetHeight;
216
+
217
+ if (Math.abs(clientRect.width - width) <= 1) {
218
+ width = clientRect.width;
219
+ }
220
+
221
+ if (Math.abs(clientRect.height - height) <= 1) {
222
+ height = clientRect.height;
223
+ }
224
+
225
+ return {
226
+ x: element.offsetLeft,
227
+ y: element.offsetTop,
228
+ width: width,
229
+ height: height
230
+ };
231
+ }
232
+
233
+ function contains(parent, child) {
234
+ var rootNode = child.getRootNode && child.getRootNode(); // First, attempt with faster native method
235
+
236
+ if (parent.contains(child)) {
237
+ return true;
238
+ } // then fallback to custom implementation with Shadow DOM support
239
+ else if (rootNode && isShadowRoot(rootNode)) {
240
+ var next = child;
241
+
242
+ do {
243
+ if (next && parent.isSameNode(next)) {
244
+ return true;
245
+ } // $FlowFixMe[prop-missing]: need a better way to handle this...
246
+
247
+
248
+ next = next.parentNode || next.host;
249
+ } while (next);
250
+ } // Give up, the result is false
251
+
252
+
253
+ return false;
254
+ }
255
+
256
+ function getComputedStyle(element) {
257
+ return getWindow(element).getComputedStyle(element);
258
+ }
259
+
260
+ function isTableElement(element) {
261
+ return ['table', 'td', 'th'].indexOf(getNodeName(element)) >= 0;
262
+ }
263
+
264
+ function getDocumentElement(element) {
265
+ // $FlowFixMe[incompatible-return]: assume body is always available
266
+ return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
267
+ element.document) || window.document).documentElement;
268
+ }
269
+
270
+ function getParentNode(element) {
271
+ if (getNodeName(element) === 'html') {
272
+ return element;
273
+ }
274
+
275
+ return (// this is a quicker (but less type safe) way to save quite some bytes from the bundle
276
+ // $FlowFixMe[incompatible-return]
277
+ // $FlowFixMe[prop-missing]
278
+ element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
279
+ element.parentNode || ( // DOM Element detected
280
+ isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
281
+ // $FlowFixMe[incompatible-call]: HTMLElement is a Node
282
+ getDocumentElement(element) // fallback
283
+
284
+ );
285
+ }
286
+
287
+ function getTrueOffsetParent(element) {
288
+ if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
289
+ getComputedStyle(element).position === 'fixed') {
290
+ return null;
291
+ }
292
+
293
+ return element.offsetParent;
294
+ } // `.offsetParent` reports `null` for fixed elements, while absolute elements
295
+ // return the containing block
296
+
297
+
298
+ function getContainingBlock(element) {
299
+ var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox') !== -1;
300
+ var isIE = navigator.userAgent.indexOf('Trident') !== -1;
301
+
302
+ if (isIE && isHTMLElement(element)) {
303
+ // In IE 9, 10 and 11 fixed elements containing block is always established by the viewport
304
+ var elementCss = getComputedStyle(element);
305
+
306
+ if (elementCss.position === 'fixed') {
307
+ return null;
308
+ }
309
+ }
310
+
311
+ var currentNode = getParentNode(element);
312
+
313
+ while (isHTMLElement(currentNode) && ['html', 'body'].indexOf(getNodeName(currentNode)) < 0) {
314
+ var css = getComputedStyle(currentNode); // This is non-exhaustive but covers the most common CSS properties that
315
+ // create a containing block.
316
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
317
+
318
+ if (css.transform !== 'none' || css.perspective !== 'none' || css.contain === 'paint' || ['transform', 'perspective'].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === 'filter' || isFirefox && css.filter && css.filter !== 'none') {
319
+ return currentNode;
320
+ } else {
321
+ currentNode = currentNode.parentNode;
322
+ }
323
+ }
324
+
325
+ return null;
326
+ } // Gets the closest ancestor positioned element. Handles some edge cases,
327
+ // such as table ancestors and cross browser bugs.
328
+
329
+
330
+ function getOffsetParent(element) {
331
+ var window = getWindow(element);
332
+ var offsetParent = getTrueOffsetParent(element);
333
+
334
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
335
+ offsetParent = getTrueOffsetParent(offsetParent);
336
+ }
337
+
338
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static')) {
339
+ return window;
340
+ }
341
+
342
+ return offsetParent || getContainingBlock(element) || window;
343
+ }
344
+
345
+ function getMainAxisFromPlacement(placement) {
346
+ return ['top', 'bottom'].indexOf(placement) >= 0 ? 'x' : 'y';
347
+ }
348
+
349
+ function within(min$1, value, max$1) {
350
+ return max(min$1, min(value, max$1));
351
+ }
352
+ function withinMaxClamp(min, value, max) {
353
+ var v = within(min, value, max);
354
+ return v > max ? max : v;
355
+ }
356
+
357
+ function getFreshSideObject() {
358
+ return {
359
+ top: 0,
360
+ right: 0,
361
+ bottom: 0,
362
+ left: 0
363
+ };
364
+ }
365
+
366
+ function mergePaddingObject(paddingObject) {
367
+ return Object.assign({}, getFreshSideObject(), paddingObject);
368
+ }
369
+
370
+ function expandToHashMap(value, keys) {
371
+ return keys.reduce(function (hashMap, key) {
372
+ hashMap[key] = value;
373
+ return hashMap;
374
+ }, {});
375
+ }
376
+
377
+ var toPaddingObject = function toPaddingObject(padding, state) {
378
+ padding = typeof padding === 'function' ? padding(Object.assign({}, state.rects, {
379
+ placement: state.placement
380
+ })) : padding;
381
+ return mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
382
+ };
383
+
384
+ function arrow(_ref) {
385
+ var _state$modifiersData$;
386
+
387
+ var state = _ref.state,
388
+ name = _ref.name,
389
+ options = _ref.options;
390
+ var arrowElement = state.elements.arrow;
391
+ var popperOffsets = state.modifiersData.popperOffsets;
392
+ var basePlacement = getBasePlacement(state.placement);
393
+ var axis = getMainAxisFromPlacement(basePlacement);
394
+ var isVertical = [left, right].indexOf(basePlacement) >= 0;
395
+ var len = isVertical ? 'height' : 'width';
396
+
397
+ if (!arrowElement || !popperOffsets) {
398
+ return;
399
+ }
400
+
401
+ var paddingObject = toPaddingObject(options.padding, state);
402
+ var arrowRect = getLayoutRect(arrowElement);
403
+ var minProp = axis === 'y' ? top : left;
404
+ var maxProp = axis === 'y' ? bottom : right;
405
+ var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets[axis] - state.rects.popper[len];
406
+ var startDiff = popperOffsets[axis] - state.rects.reference[axis];
407
+ var arrowOffsetParent = getOffsetParent(arrowElement);
408
+ var clientSize = arrowOffsetParent ? axis === 'y' ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
409
+ var centerToReference = endDiff / 2 - startDiff / 2; // Make sure the arrow doesn't overflow the popper if the center point is
410
+ // outside of the popper bounds
411
+
412
+ var min = paddingObject[minProp];
413
+ var max = clientSize - arrowRect[len] - paddingObject[maxProp];
414
+ var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
415
+ var offset = within(min, center, max); // Prevents breaking syntax highlighting...
416
+
417
+ var axisProp = axis;
418
+ state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset, _state$modifiersData$.centerOffset = offset - center, _state$modifiersData$);
419
+ }
420
+
421
+ function effect$1(_ref2) {
422
+ var state = _ref2.state,
423
+ options = _ref2.options;
424
+ var _options$element = options.element,
425
+ arrowElement = _options$element === void 0 ? '[data-popper-arrow]' : _options$element;
426
+
427
+ if (arrowElement == null) {
428
+ return;
429
+ } // CSS selector
430
+
431
+
432
+ if (typeof arrowElement === 'string') {
433
+ arrowElement = state.elements.popper.querySelector(arrowElement);
434
+
435
+ if (!arrowElement) {
436
+ return;
437
+ }
438
+ }
439
+
440
+ if (!contains(state.elements.popper, arrowElement)) {
441
+
442
+ return;
443
+ }
444
+
445
+ state.elements.arrow = arrowElement;
446
+ } // eslint-disable-next-line import/no-unused-modules
447
+
448
+
449
+ var arrow$1 = {
450
+ name: 'arrow',
451
+ enabled: true,
452
+ phase: 'main',
453
+ fn: arrow,
454
+ effect: effect$1,
455
+ requires: ['popperOffsets'],
456
+ requiresIfExists: ['preventOverflow']
457
+ };
458
+
459
+ function getVariation(placement) {
460
+ return placement.split('-')[1];
461
+ }
462
+
463
+ var unsetSides = {
464
+ top: 'auto',
465
+ right: 'auto',
466
+ bottom: 'auto',
467
+ left: 'auto'
468
+ }; // Round the offsets to the nearest suitable subpixel based on the DPR.
469
+ // Zooming can change the DPR, but it seems to report a value that will
470
+ // cleanly divide the values into the appropriate subpixels.
471
+
472
+ function roundOffsetsByDPR(_ref) {
473
+ var x = _ref.x,
474
+ y = _ref.y;
475
+ var win = window;
476
+ var dpr = win.devicePixelRatio || 1;
477
+ return {
478
+ x: round(x * dpr) / dpr || 0,
479
+ y: round(y * dpr) / dpr || 0
480
+ };
481
+ }
482
+
483
+ function mapToStyles(_ref2) {
484
+ var _Object$assign2;
485
+
486
+ var popper = _ref2.popper,
487
+ popperRect = _ref2.popperRect,
488
+ placement = _ref2.placement,
489
+ variation = _ref2.variation,
490
+ offsets = _ref2.offsets,
491
+ position = _ref2.position,
492
+ gpuAcceleration = _ref2.gpuAcceleration,
493
+ adaptive = _ref2.adaptive,
494
+ roundOffsets = _ref2.roundOffsets,
495
+ isFixed = _ref2.isFixed;
496
+
497
+ var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === 'function' ? roundOffsets(offsets) : offsets,
498
+ _ref3$x = _ref3.x,
499
+ x = _ref3$x === void 0 ? 0 : _ref3$x,
500
+ _ref3$y = _ref3.y,
501
+ y = _ref3$y === void 0 ? 0 : _ref3$y;
502
+
503
+ var hasX = offsets.hasOwnProperty('x');
504
+ var hasY = offsets.hasOwnProperty('y');
505
+ var sideX = left;
506
+ var sideY = top;
507
+ var win = window;
508
+
509
+ if (adaptive) {
510
+ var offsetParent = getOffsetParent(popper);
511
+ var heightProp = 'clientHeight';
512
+ var widthProp = 'clientWidth';
513
+
514
+ if (offsetParent === getWindow(popper)) {
515
+ offsetParent = getDocumentElement(popper);
516
+
517
+ if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') {
518
+ heightProp = 'scrollHeight';
519
+ widthProp = 'scrollWidth';
520
+ }
521
+ } // $FlowFixMe[incompatible-cast]: force type refinement, we compare offsetParent with window above, but Flow doesn't detect it
522
+
523
+
524
+ offsetParent = offsetParent;
525
+
526
+ if (placement === top || (placement === left || placement === right) && variation === end) {
527
+ sideY = bottom;
528
+ var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : // $FlowFixMe[prop-missing]
529
+ offsetParent[heightProp];
530
+ y -= offsetY - popperRect.height;
531
+ y *= gpuAcceleration ? 1 : -1;
532
+ }
533
+
534
+ if (placement === left || (placement === top || placement === bottom) && variation === end) {
535
+ sideX = right;
536
+ var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : // $FlowFixMe[prop-missing]
537
+ offsetParent[widthProp];
538
+ x -= offsetX - popperRect.width;
539
+ x *= gpuAcceleration ? 1 : -1;
540
+ }
541
+ }
542
+
543
+ var commonStyles = Object.assign({
544
+ position: position
545
+ }, adaptive && unsetSides);
546
+
547
+ if (gpuAcceleration) {
548
+ var _Object$assign;
549
+
550
+ return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
551
+ }
552
+
553
+ return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2));
554
+ }
555
+
556
+ function computeStyles(_ref4) {
557
+ var state = _ref4.state,
558
+ options = _ref4.options;
559
+ var _options$gpuAccelerat = options.gpuAcceleration,
560
+ gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat,
561
+ _options$adaptive = options.adaptive,
562
+ adaptive = _options$adaptive === void 0 ? true : _options$adaptive,
563
+ _options$roundOffsets = options.roundOffsets,
564
+ roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
565
+
566
+ var commonStyles = {
567
+ placement: getBasePlacement(state.placement),
568
+ variation: getVariation(state.placement),
569
+ popper: state.elements.popper,
570
+ popperRect: state.rects.popper,
571
+ gpuAcceleration: gpuAcceleration,
572
+ isFixed: state.options.strategy === 'fixed'
573
+ };
574
+
575
+ if (state.modifiersData.popperOffsets != null) {
576
+ state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
577
+ offsets: state.modifiersData.popperOffsets,
578
+ position: state.options.strategy,
579
+ adaptive: adaptive,
580
+ roundOffsets: roundOffsets
581
+ })));
582
+ }
583
+
584
+ if (state.modifiersData.arrow != null) {
585
+ state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
586
+ offsets: state.modifiersData.arrow,
587
+ position: 'absolute',
588
+ adaptive: false,
589
+ roundOffsets: roundOffsets
590
+ })));
591
+ }
592
+
593
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
594
+ 'data-popper-placement': state.placement
595
+ });
596
+ } // eslint-disable-next-line import/no-unused-modules
597
+
598
+
599
+ var computeStyles$1 = {
600
+ name: 'computeStyles',
601
+ enabled: true,
602
+ phase: 'beforeWrite',
603
+ fn: computeStyles,
604
+ data: {}
605
+ };
606
+
607
+ var passive = {
608
+ passive: true
609
+ };
610
+
611
+ function effect$2(_ref) {
612
+ var state = _ref.state,
613
+ instance = _ref.instance,
614
+ options = _ref.options;
615
+ var _options$scroll = options.scroll,
616
+ scroll = _options$scroll === void 0 ? true : _options$scroll,
617
+ _options$resize = options.resize,
618
+ resize = _options$resize === void 0 ? true : _options$resize;
619
+ var window = getWindow(state.elements.popper);
620
+ var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
621
+
622
+ if (scroll) {
623
+ scrollParents.forEach(function (scrollParent) {
624
+ scrollParent.addEventListener('scroll', instance.update, passive);
625
+ });
626
+ }
627
+
628
+ if (resize) {
629
+ window.addEventListener('resize', instance.update, passive);
630
+ }
631
+
632
+ return function () {
633
+ if (scroll) {
634
+ scrollParents.forEach(function (scrollParent) {
635
+ scrollParent.removeEventListener('scroll', instance.update, passive);
636
+ });
637
+ }
638
+
639
+ if (resize) {
640
+ window.removeEventListener('resize', instance.update, passive);
641
+ }
642
+ };
643
+ } // eslint-disable-next-line import/no-unused-modules
644
+
645
+
646
+ var eventListeners = {
647
+ name: 'eventListeners',
648
+ enabled: true,
649
+ phase: 'write',
650
+ fn: function fn() {},
651
+ effect: effect$2,
652
+ data: {}
653
+ };
654
+
655
+ var hash = {
656
+ left: 'right',
657
+ right: 'left',
658
+ bottom: 'top',
659
+ top: 'bottom'
660
+ };
661
+ function getOppositePlacement(placement) {
662
+ return placement.replace(/left|right|bottom|top/g, function (matched) {
663
+ return hash[matched];
664
+ });
665
+ }
666
+
667
+ var hash$1 = {
668
+ start: 'end',
669
+ end: 'start'
670
+ };
671
+ function getOppositeVariationPlacement(placement) {
672
+ return placement.replace(/start|end/g, function (matched) {
673
+ return hash$1[matched];
674
+ });
675
+ }
676
+
677
+ function getWindowScroll(node) {
678
+ var win = getWindow(node);
679
+ var scrollLeft = win.pageXOffset;
680
+ var scrollTop = win.pageYOffset;
681
+ return {
682
+ scrollLeft: scrollLeft,
683
+ scrollTop: scrollTop
684
+ };
685
+ }
686
+
687
+ function getWindowScrollBarX(element) {
688
+ // If <html> has a CSS width greater than the viewport, then this will be
689
+ // incorrect for RTL.
690
+ // Popper 1 is broken in this case and never had a bug report so let's assume
691
+ // it's not an issue. I don't think anyone ever specifies width on <html>
692
+ // anyway.
693
+ // Browsers where the left scrollbar doesn't cause an issue report `0` for
694
+ // this (e.g. Edge 2019, IE11, Safari)
695
+ return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
696
+ }
697
+
698
+ function getViewportRect(element) {
699
+ var win = getWindow(element);
700
+ var html = getDocumentElement(element);
701
+ var visualViewport = win.visualViewport;
702
+ var width = html.clientWidth;
703
+ var height = html.clientHeight;
704
+ var x = 0;
705
+ var y = 0; // NB: This isn't supported on iOS <= 12. If the keyboard is open, the popper
706
+ // can be obscured underneath it.
707
+ // Also, `html.clientHeight` adds the bottom bar height in Safari iOS, even
708
+ // if it isn't open, so if this isn't available, the popper will be detected
709
+ // to overflow the bottom of the screen too early.
710
+
711
+ if (visualViewport) {
712
+ width = visualViewport.width;
713
+ height = visualViewport.height; // Uses Layout Viewport (like Chrome; Safari does not currently)
714
+ // In Chrome, it returns a value very close to 0 (+/-) but contains rounding
715
+ // errors due to floating point numbers, so we need to check precision.
716
+ // Safari returns a number <= 0, usually < -1 when pinch-zoomed
717
+ // Feature detection fails in mobile emulation mode in Chrome.
718
+ // Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) <
719
+ // 0.001
720
+ // Fallback here: "Not Safari" userAgent
721
+
722
+ if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
723
+ x = visualViewport.offsetLeft;
724
+ y = visualViewport.offsetTop;
725
+ }
726
+ }
727
+
728
+ return {
729
+ width: width,
730
+ height: height,
731
+ x: x + getWindowScrollBarX(element),
732
+ y: y
733
+ };
734
+ }
735
+
736
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable
737
+
738
+ function getDocumentRect(element) {
739
+ var _element$ownerDocumen;
740
+
741
+ var html = getDocumentElement(element);
742
+ var winScroll = getWindowScroll(element);
743
+ var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
744
+ var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
745
+ var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
746
+ var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
747
+ var y = -winScroll.scrollTop;
748
+
749
+ if (getComputedStyle(body || html).direction === 'rtl') {
750
+ x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
751
+ }
752
+
753
+ return {
754
+ width: width,
755
+ height: height,
756
+ x: x,
757
+ y: y
758
+ };
759
+ }
760
+
761
+ function isScrollParent(element) {
762
+ // Firefox wants us to check `-x` and `-y` variations as well
763
+ var _getComputedStyle = getComputedStyle(element),
764
+ overflow = _getComputedStyle.overflow,
765
+ overflowX = _getComputedStyle.overflowX,
766
+ overflowY = _getComputedStyle.overflowY;
767
+
768
+ return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
769
+ }
770
+
771
+ function getScrollParent(node) {
772
+ if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) {
773
+ // $FlowFixMe[incompatible-return]: assume body is always available
774
+ return node.ownerDocument.body;
775
+ }
776
+
777
+ if (isHTMLElement(node) && isScrollParent(node)) {
778
+ return node;
779
+ }
780
+
781
+ return getScrollParent(getParentNode(node));
782
+ }
783
+
784
+ /*
785
+ given a DOM element, return the list of all scroll parents, up the list of ancesors
786
+ until we get to the top window object. This list is what we attach scroll listeners
787
+ to, because if any of these parent elements scroll, we'll need to re-calculate the
788
+ reference element's position.
789
+ */
790
+
791
+ function listScrollParents(element, list) {
792
+ var _element$ownerDocumen;
793
+
794
+ if (list === void 0) {
795
+ list = [];
796
+ }
797
+
798
+ var scrollParent = getScrollParent(element);
799
+ var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
800
+ var win = getWindow(scrollParent);
801
+ var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
802
+ var updatedList = list.concat(target);
803
+ return isBody ? updatedList : // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
804
+ updatedList.concat(listScrollParents(getParentNode(target)));
805
+ }
806
+
807
+ function rectToClientRect(rect) {
808
+ return Object.assign({}, rect, {
809
+ left: rect.x,
810
+ top: rect.y,
811
+ right: rect.x + rect.width,
812
+ bottom: rect.y + rect.height
813
+ });
814
+ }
815
+
816
+ function getInnerBoundingClientRect(element) {
817
+ var rect = getBoundingClientRect(element);
818
+ rect.top = rect.top + element.clientTop;
819
+ rect.left = rect.left + element.clientLeft;
820
+ rect.bottom = rect.top + element.clientHeight;
821
+ rect.right = rect.left + element.clientWidth;
822
+ rect.width = element.clientWidth;
823
+ rect.height = element.clientHeight;
824
+ rect.x = rect.left;
825
+ rect.y = rect.top;
826
+ return rect;
827
+ }
828
+
829
+ function getClientRectFromMixedType(element, clippingParent) {
830
+ return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
831
+ } // A "clipping parent" is an overflowable container with the characteristic of
832
+ // clipping (or hiding) overflowing elements with a position different from
833
+ // `initial`
834
+
835
+
836
+ function getClippingParents(element) {
837
+ var clippingParents = listScrollParents(getParentNode(element));
838
+ var canEscapeClipping = ['absolute', 'fixed'].indexOf(getComputedStyle(element).position) >= 0;
839
+ var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
840
+
841
+ if (!isElement(clipperElement)) {
842
+ return [];
843
+ } // $FlowFixMe[incompatible-return]: https://github.com/facebook/flow/issues/1414
844
+
845
+
846
+ return clippingParents.filter(function (clippingParent) {
847
+ return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== 'body' && (canEscapeClipping ? getComputedStyle(clippingParent).position !== 'static' : true);
848
+ });
849
+ } // Gets the maximum area that the element is visible in due to any number of
850
+ // clipping parents
851
+
852
+
853
+ function getClippingRect(element, boundary, rootBoundary) {
854
+ var mainClippingParents = boundary === 'clippingParents' ? getClippingParents(element) : [].concat(boundary);
855
+ var clippingParents = [].concat(mainClippingParents, [rootBoundary]);
856
+ var firstClippingParent = clippingParents[0];
857
+ var clippingRect = clippingParents.reduce(function (accRect, clippingParent) {
858
+ var rect = getClientRectFromMixedType(element, clippingParent);
859
+ accRect.top = max(rect.top, accRect.top);
860
+ accRect.right = min(rect.right, accRect.right);
861
+ accRect.bottom = min(rect.bottom, accRect.bottom);
862
+ accRect.left = max(rect.left, accRect.left);
863
+ return accRect;
864
+ }, getClientRectFromMixedType(element, firstClippingParent));
865
+ clippingRect.width = clippingRect.right - clippingRect.left;
866
+ clippingRect.height = clippingRect.bottom - clippingRect.top;
867
+ clippingRect.x = clippingRect.left;
868
+ clippingRect.y = clippingRect.top;
869
+ return clippingRect;
870
+ }
871
+
872
+ function computeOffsets(_ref) {
873
+ var reference = _ref.reference,
874
+ element = _ref.element,
875
+ placement = _ref.placement;
876
+ var basePlacement = placement ? getBasePlacement(placement) : null;
877
+ var variation = placement ? getVariation(placement) : null;
878
+ var commonX = reference.x + reference.width / 2 - element.width / 2;
879
+ var commonY = reference.y + reference.height / 2 - element.height / 2;
880
+ var offsets;
881
+
882
+ switch (basePlacement) {
883
+ case top:
884
+ offsets = {
885
+ x: commonX,
886
+ y: reference.y - element.height
887
+ };
888
+ break;
889
+
890
+ case bottom:
891
+ offsets = {
892
+ x: commonX,
893
+ y: reference.y + reference.height
894
+ };
895
+ break;
896
+
897
+ case right:
898
+ offsets = {
899
+ x: reference.x + reference.width,
900
+ y: commonY
901
+ };
902
+ break;
903
+
904
+ case left:
905
+ offsets = {
906
+ x: reference.x - element.width,
907
+ y: commonY
908
+ };
909
+ break;
910
+
911
+ default:
912
+ offsets = {
913
+ x: reference.x,
914
+ y: reference.y
915
+ };
916
+ }
917
+
918
+ var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
919
+
920
+ if (mainAxis != null) {
921
+ var len = mainAxis === 'y' ? 'height' : 'width';
922
+
923
+ switch (variation) {
924
+ case start:
925
+ offsets[mainAxis] = offsets[mainAxis] - (reference[len] / 2 - element[len] / 2);
926
+ break;
927
+
928
+ case end:
929
+ offsets[mainAxis] = offsets[mainAxis] + (reference[len] / 2 - element[len] / 2);
930
+ break;
931
+ }
932
+ }
933
+
934
+ return offsets;
935
+ }
936
+
937
+ function detectOverflow(state, options) {
938
+ if (options === void 0) {
939
+ options = {};
940
+ }
941
+
942
+ var _options = options,
943
+ _options$placement = _options.placement,
944
+ placement = _options$placement === void 0 ? state.placement : _options$placement,
945
+ _options$boundary = _options.boundary,
946
+ boundary = _options$boundary === void 0 ? clippingParents : _options$boundary,
947
+ _options$rootBoundary = _options.rootBoundary,
948
+ rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary,
949
+ _options$elementConte = _options.elementContext,
950
+ elementContext = _options$elementConte === void 0 ? popper : _options$elementConte,
951
+ _options$altBoundary = _options.altBoundary,
952
+ altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary,
953
+ _options$padding = _options.padding,
954
+ padding = _options$padding === void 0 ? 0 : _options$padding;
955
+ var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements));
956
+ var altContext = elementContext === popper ? reference : popper;
957
+ var popperRect = state.rects.popper;
958
+ var element = state.elements[altBoundary ? altContext : elementContext];
959
+ var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
960
+ var referenceClientRect = getBoundingClientRect(state.elements.reference);
961
+ var popperOffsets = computeOffsets({
962
+ reference: referenceClientRect,
963
+ element: popperRect,
964
+ strategy: 'absolute',
965
+ placement: placement
966
+ });
967
+ var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets));
968
+ var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; // positive = overflowing the clipping rect
969
+ // 0 or negative = within the clipping rect
970
+
971
+ var overflowOffsets = {
972
+ top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
973
+ bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
974
+ left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
975
+ right: elementClientRect.right - clippingClientRect.right + paddingObject.right
976
+ };
977
+ var offsetData = state.modifiersData.offset; // Offsets can be applied only to the popper element
978
+
979
+ if (elementContext === popper && offsetData) {
980
+ var offset = offsetData[placement];
981
+ Object.keys(overflowOffsets).forEach(function (key) {
982
+ var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
983
+ var axis = [top, bottom].indexOf(key) >= 0 ? 'y' : 'x';
984
+ overflowOffsets[key] += offset[axis] * multiply;
985
+ });
986
+ }
987
+
988
+ return overflowOffsets;
989
+ }
990
+
991
+ function computeAutoPlacement(state, options) {
992
+ if (options === void 0) {
993
+ options = {};
994
+ }
995
+
996
+ var _options = options,
997
+ placement = _options.placement,
998
+ boundary = _options.boundary,
999
+ rootBoundary = _options.rootBoundary,
1000
+ padding = _options.padding,
1001
+ flipVariations = _options.flipVariations,
1002
+ _options$allowedAutoP = _options.allowedAutoPlacements,
1003
+ allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
1004
+ var variation = getVariation(placement);
1005
+ var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function (placement) {
1006
+ return getVariation(placement) === variation;
1007
+ }) : basePlacements;
1008
+ var allowedPlacements = placements$1.filter(function (placement) {
1009
+ return allowedAutoPlacements.indexOf(placement) >= 0;
1010
+ });
1011
+
1012
+ if (allowedPlacements.length === 0) {
1013
+ allowedPlacements = placements$1;
1014
+ } // $FlowFixMe[incompatible-type]: Flow seems to have problems with two array unions...
1015
+
1016
+
1017
+ var overflows = allowedPlacements.reduce(function (acc, placement) {
1018
+ acc[placement] = detectOverflow(state, {
1019
+ placement: placement,
1020
+ boundary: boundary,
1021
+ rootBoundary: rootBoundary,
1022
+ padding: padding
1023
+ })[getBasePlacement(placement)];
1024
+ return acc;
1025
+ }, {});
1026
+ return Object.keys(overflows).sort(function (a, b) {
1027
+ return overflows[a] - overflows[b];
1028
+ });
1029
+ }
1030
+
1031
+ function getExpandedFallbackPlacements(placement) {
1032
+ if (getBasePlacement(placement) === auto) {
1033
+ return [];
1034
+ }
1035
+
1036
+ var oppositePlacement = getOppositePlacement(placement);
1037
+ return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
1038
+ }
1039
+
1040
+ function flip(_ref) {
1041
+ var state = _ref.state,
1042
+ options = _ref.options,
1043
+ name = _ref.name;
1044
+
1045
+ if (state.modifiersData[name]._skip) {
1046
+ return;
1047
+ }
1048
+
1049
+ var _options$mainAxis = options.mainAxis,
1050
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1051
+ _options$altAxis = options.altAxis,
1052
+ checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis,
1053
+ specifiedFallbackPlacements = options.fallbackPlacements,
1054
+ padding = options.padding,
1055
+ boundary = options.boundary,
1056
+ rootBoundary = options.rootBoundary,
1057
+ altBoundary = options.altBoundary,
1058
+ _options$flipVariatio = options.flipVariations,
1059
+ flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio,
1060
+ allowedAutoPlacements = options.allowedAutoPlacements;
1061
+ var preferredPlacement = state.options.placement;
1062
+ var basePlacement = getBasePlacement(preferredPlacement);
1063
+ var isBasePlacement = basePlacement === preferredPlacement;
1064
+ var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
1065
+ var placements = [preferredPlacement].concat(fallbackPlacements).reduce(function (acc, placement) {
1066
+ return acc.concat(getBasePlacement(placement) === auto ? computeAutoPlacement(state, {
1067
+ placement: placement,
1068
+ boundary: boundary,
1069
+ rootBoundary: rootBoundary,
1070
+ padding: padding,
1071
+ flipVariations: flipVariations,
1072
+ allowedAutoPlacements: allowedAutoPlacements
1073
+ }) : placement);
1074
+ }, []);
1075
+ var referenceRect = state.rects.reference;
1076
+ var popperRect = state.rects.popper;
1077
+ var checksMap = new Map();
1078
+ var makeFallbackChecks = true;
1079
+ var firstFittingPlacement = placements[0];
1080
+
1081
+ for (var i = 0; i < placements.length; i++) {
1082
+ var placement = placements[i];
1083
+
1084
+ var _basePlacement = getBasePlacement(placement);
1085
+
1086
+ var isStartVariation = getVariation(placement) === start;
1087
+ var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
1088
+ var len = isVertical ? 'width' : 'height';
1089
+ var overflow = detectOverflow(state, {
1090
+ placement: placement,
1091
+ boundary: boundary,
1092
+ rootBoundary: rootBoundary,
1093
+ altBoundary: altBoundary,
1094
+ padding: padding
1095
+ });
1096
+ var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
1097
+
1098
+ if (referenceRect[len] > popperRect[len]) {
1099
+ mainVariationSide = getOppositePlacement(mainVariationSide);
1100
+ }
1101
+
1102
+ var altVariationSide = getOppositePlacement(mainVariationSide);
1103
+ var checks = [];
1104
+
1105
+ if (checkMainAxis) {
1106
+ checks.push(overflow[_basePlacement] <= 0);
1107
+ }
1108
+
1109
+ if (checkAltAxis) {
1110
+ checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
1111
+ }
1112
+
1113
+ if (checks.every(function (check) {
1114
+ return check;
1115
+ })) {
1116
+ firstFittingPlacement = placement;
1117
+ makeFallbackChecks = false;
1118
+ break;
1119
+ }
1120
+
1121
+ checksMap.set(placement, checks);
1122
+ }
1123
+
1124
+ if (makeFallbackChecks) {
1125
+ // `2` may be desired in some cases – research later
1126
+ var numberOfChecks = flipVariations ? 3 : 1;
1127
+
1128
+ var _loop = function _loop(_i) {
1129
+ var fittingPlacement = placements.find(function (placement) {
1130
+ var checks = checksMap.get(placement);
1131
+
1132
+ if (checks) {
1133
+ return checks.slice(0, _i).every(function (check) {
1134
+ return check;
1135
+ });
1136
+ }
1137
+ });
1138
+
1139
+ if (fittingPlacement) {
1140
+ firstFittingPlacement = fittingPlacement;
1141
+ return "break";
1142
+ }
1143
+ };
1144
+
1145
+ for (var _i = numberOfChecks; _i > 0; _i--) {
1146
+ var _ret = _loop(_i);
1147
+
1148
+ if (_ret === "break") break;
1149
+ }
1150
+ }
1151
+
1152
+ if (state.placement !== firstFittingPlacement) {
1153
+ state.modifiersData[name]._skip = true;
1154
+ state.placement = firstFittingPlacement;
1155
+ state.reset = true;
1156
+ }
1157
+ } // eslint-disable-next-line import/no-unused-modules
1158
+
1159
+
1160
+ var flip$1 = {
1161
+ name: 'flip',
1162
+ enabled: true,
1163
+ phase: 'main',
1164
+ fn: flip,
1165
+ requiresIfExists: ['offset'],
1166
+ data: {
1167
+ _skip: false
1168
+ }
1169
+ };
1170
+
1171
+ function getSideOffsets(overflow, rect, preventedOffsets) {
1172
+ if (preventedOffsets === void 0) {
1173
+ preventedOffsets = {
1174
+ x: 0,
1175
+ y: 0
1176
+ };
1177
+ }
1178
+
1179
+ return {
1180
+ top: overflow.top - rect.height - preventedOffsets.y,
1181
+ right: overflow.right - rect.width + preventedOffsets.x,
1182
+ bottom: overflow.bottom - rect.height + preventedOffsets.y,
1183
+ left: overflow.left - rect.width - preventedOffsets.x
1184
+ };
1185
+ }
1186
+
1187
+ function isAnySideFullyClipped(overflow) {
1188
+ return [top, right, bottom, left].some(function (side) {
1189
+ return overflow[side] >= 0;
1190
+ });
1191
+ }
1192
+
1193
+ function hide(_ref) {
1194
+ var state = _ref.state,
1195
+ name = _ref.name;
1196
+ var referenceRect = state.rects.reference;
1197
+ var popperRect = state.rects.popper;
1198
+ var preventedOffsets = state.modifiersData.preventOverflow;
1199
+ var referenceOverflow = detectOverflow(state, {
1200
+ elementContext: 'reference'
1201
+ });
1202
+ var popperAltOverflow = detectOverflow(state, {
1203
+ altBoundary: true
1204
+ });
1205
+ var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
1206
+ var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
1207
+ var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
1208
+ var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
1209
+ state.modifiersData[name] = {
1210
+ referenceClippingOffsets: referenceClippingOffsets,
1211
+ popperEscapeOffsets: popperEscapeOffsets,
1212
+ isReferenceHidden: isReferenceHidden,
1213
+ hasPopperEscaped: hasPopperEscaped
1214
+ };
1215
+ state.attributes.popper = Object.assign({}, state.attributes.popper, {
1216
+ 'data-popper-reference-hidden': isReferenceHidden,
1217
+ 'data-popper-escaped': hasPopperEscaped
1218
+ });
1219
+ } // eslint-disable-next-line import/no-unused-modules
1220
+
1221
+
1222
+ var hide$1 = {
1223
+ name: 'hide',
1224
+ enabled: true,
1225
+ phase: 'main',
1226
+ requiresIfExists: ['preventOverflow'],
1227
+ fn: hide
1228
+ };
1229
+
1230
+ function distanceAndSkiddingToXY(placement, rects, offset) {
1231
+ var basePlacement = getBasePlacement(placement);
1232
+ var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
1233
+
1234
+ var _ref = typeof offset === 'function' ? offset(Object.assign({}, rects, {
1235
+ placement: placement
1236
+ })) : offset,
1237
+ skidding = _ref[0],
1238
+ distance = _ref[1];
1239
+
1240
+ skidding = skidding || 0;
1241
+ distance = (distance || 0) * invertDistance;
1242
+ return [left, right].indexOf(basePlacement) >= 0 ? {
1243
+ x: distance,
1244
+ y: skidding
1245
+ } : {
1246
+ x: skidding,
1247
+ y: distance
1248
+ };
1249
+ }
1250
+
1251
+ function offset(_ref2) {
1252
+ var state = _ref2.state,
1253
+ options = _ref2.options,
1254
+ name = _ref2.name;
1255
+ var _options$offset = options.offset,
1256
+ offset = _options$offset === void 0 ? [0, 0] : _options$offset;
1257
+ var data = placements.reduce(function (acc, placement) {
1258
+ acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset);
1259
+ return acc;
1260
+ }, {});
1261
+ var _data$state$placement = data[state.placement],
1262
+ x = _data$state$placement.x,
1263
+ y = _data$state$placement.y;
1264
+
1265
+ if (state.modifiersData.popperOffsets != null) {
1266
+ state.modifiersData.popperOffsets.x += x;
1267
+ state.modifiersData.popperOffsets.y += y;
1268
+ }
1269
+
1270
+ state.modifiersData[name] = data;
1271
+ } // eslint-disable-next-line import/no-unused-modules
1272
+
1273
+
1274
+ var offset$1 = {
1275
+ name: 'offset',
1276
+ enabled: true,
1277
+ phase: 'main',
1278
+ requires: ['popperOffsets'],
1279
+ fn: offset
1280
+ };
1281
+
1282
+ function popperOffsets(_ref) {
1283
+ var state = _ref.state,
1284
+ name = _ref.name;
1285
+ // Offsets are the actual position the popper needs to have to be
1286
+ // properly positioned near its reference element
1287
+ // This is the most basic placement, and will be adjusted by
1288
+ // the modifiers in the next step
1289
+ state.modifiersData[name] = computeOffsets({
1290
+ reference: state.rects.reference,
1291
+ element: state.rects.popper,
1292
+ strategy: 'absolute',
1293
+ placement: state.placement
1294
+ });
1295
+ } // eslint-disable-next-line import/no-unused-modules
1296
+
1297
+
1298
+ var popperOffsets$1 = {
1299
+ name: 'popperOffsets',
1300
+ enabled: true,
1301
+ phase: 'read',
1302
+ fn: popperOffsets,
1303
+ data: {}
1304
+ };
1305
+
1306
+ function getAltAxis(axis) {
1307
+ return axis === 'x' ? 'y' : 'x';
1308
+ }
1309
+
1310
+ function preventOverflow(_ref) {
1311
+ var state = _ref.state,
1312
+ options = _ref.options,
1313
+ name = _ref.name;
1314
+ var _options$mainAxis = options.mainAxis,
1315
+ checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis,
1316
+ _options$altAxis = options.altAxis,
1317
+ checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis,
1318
+ boundary = options.boundary,
1319
+ rootBoundary = options.rootBoundary,
1320
+ altBoundary = options.altBoundary,
1321
+ padding = options.padding,
1322
+ _options$tether = options.tether,
1323
+ tether = _options$tether === void 0 ? true : _options$tether,
1324
+ _options$tetherOffset = options.tetherOffset,
1325
+ tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
1326
+ var overflow = detectOverflow(state, {
1327
+ boundary: boundary,
1328
+ rootBoundary: rootBoundary,
1329
+ padding: padding,
1330
+ altBoundary: altBoundary
1331
+ });
1332
+ var basePlacement = getBasePlacement(state.placement);
1333
+ var variation = getVariation(state.placement);
1334
+ var isBasePlacement = !variation;
1335
+ var mainAxis = getMainAxisFromPlacement(basePlacement);
1336
+ var altAxis = getAltAxis(mainAxis);
1337
+ var popperOffsets = state.modifiersData.popperOffsets;
1338
+ var referenceRect = state.rects.reference;
1339
+ var popperRect = state.rects.popper;
1340
+ var tetherOffsetValue = typeof tetherOffset === 'function' ? tetherOffset(Object.assign({}, state.rects, {
1341
+ placement: state.placement
1342
+ })) : tetherOffset;
1343
+ var normalizedTetherOffsetValue = typeof tetherOffsetValue === 'number' ? {
1344
+ mainAxis: tetherOffsetValue,
1345
+ altAxis: tetherOffsetValue
1346
+ } : Object.assign({
1347
+ mainAxis: 0,
1348
+ altAxis: 0
1349
+ }, tetherOffsetValue);
1350
+ var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
1351
+ var data = {
1352
+ x: 0,
1353
+ y: 0
1354
+ };
1355
+
1356
+ if (!popperOffsets) {
1357
+ return;
1358
+ }
1359
+
1360
+ if (checkMainAxis) {
1361
+ var _offsetModifierState$;
1362
+
1363
+ var mainSide = mainAxis === 'y' ? top : left;
1364
+ var altSide = mainAxis === 'y' ? bottom : right;
1365
+ var len = mainAxis === 'y' ? 'height' : 'width';
1366
+ var offset = popperOffsets[mainAxis];
1367
+ var min$1 = offset + overflow[mainSide];
1368
+ var max$1 = offset - overflow[altSide];
1369
+ var additive = tether ? -popperRect[len] / 2 : 0;
1370
+ var minLen = variation === start ? referenceRect[len] : popperRect[len];
1371
+ var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; // We need to include the arrow in the calculation so the arrow doesn't go
1372
+ // outside the reference bounds
1373
+
1374
+ var arrowElement = state.elements.arrow;
1375
+ var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
1376
+ width: 0,
1377
+ height: 0
1378
+ };
1379
+ var arrowPaddingObject = state.modifiersData['arrow#persistent'] ? state.modifiersData['arrow#persistent'].padding : getFreshSideObject();
1380
+ var arrowPaddingMin = arrowPaddingObject[mainSide];
1381
+ var arrowPaddingMax = arrowPaddingObject[altSide]; // If the reference length is smaller than the arrow length, we don't want
1382
+ // to include its full size in the calculation. If the reference is small
1383
+ // and near the edge of a boundary, the popper can overflow even if the
1384
+ // reference is not overflowing as well (e.g. virtual elements with no
1385
+ // width or height)
1386
+
1387
+ var arrowLen = within(0, referenceRect[len], arrowRect[len]);
1388
+ var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
1389
+ var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
1390
+ var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
1391
+ var clientOffset = arrowOffsetParent ? mainAxis === 'y' ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
1392
+ var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
1393
+ var tetherMin = offset + minOffset - offsetModifierValue - clientOffset;
1394
+ var tetherMax = offset + maxOffset - offsetModifierValue;
1395
+ var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset, tether ? max(max$1, tetherMax) : max$1);
1396
+ popperOffsets[mainAxis] = preventedOffset;
1397
+ data[mainAxis] = preventedOffset - offset;
1398
+ }
1399
+
1400
+ if (checkAltAxis) {
1401
+ var _offsetModifierState$2;
1402
+
1403
+ var _mainSide = mainAxis === 'x' ? top : left;
1404
+
1405
+ var _altSide = mainAxis === 'x' ? bottom : right;
1406
+
1407
+ var _offset = popperOffsets[altAxis];
1408
+
1409
+ var _len = altAxis === 'y' ? 'height' : 'width';
1410
+
1411
+ var _min = _offset + overflow[_mainSide];
1412
+
1413
+ var _max = _offset - overflow[_altSide];
1414
+
1415
+ var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
1416
+
1417
+ var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
1418
+
1419
+ var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
1420
+
1421
+ var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
1422
+
1423
+ var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
1424
+
1425
+ popperOffsets[altAxis] = _preventedOffset;
1426
+ data[altAxis] = _preventedOffset - _offset;
1427
+ }
1428
+
1429
+ state.modifiersData[name] = data;
1430
+ } // eslint-disable-next-line import/no-unused-modules
1431
+
1432
+
1433
+ var preventOverflow$1 = {
1434
+ name: 'preventOverflow',
1435
+ enabled: true,
1436
+ phase: 'main',
1437
+ fn: preventOverflow,
1438
+ requiresIfExists: ['offset']
1439
+ };
1440
+
1441
+ function getHTMLElementScroll(element) {
1442
+ return {
1443
+ scrollLeft: element.scrollLeft,
1444
+ scrollTop: element.scrollTop
1445
+ };
1446
+ }
1447
+
1448
+ function getNodeScroll(node) {
1449
+ if (node === getWindow(node) || !isHTMLElement(node)) {
1450
+ return getWindowScroll(node);
1451
+ } else {
1452
+ return getHTMLElementScroll(node);
1453
+ }
1454
+ }
1455
+
1456
+ function isElementScaled(element) {
1457
+ var rect = element.getBoundingClientRect();
1458
+ var scaleX = round(rect.width) / element.offsetWidth || 1;
1459
+ var scaleY = round(rect.height) / element.offsetHeight || 1;
1460
+ return scaleX !== 1 || scaleY !== 1;
1461
+ } // Returns the composite rect of an element relative to its offsetParent.
1462
+ // Composite means it takes into account transforms as well as layout.
1463
+
1464
+
1465
+ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
1466
+ if (isFixed === void 0) {
1467
+ isFixed = false;
1468
+ }
1469
+
1470
+ var isOffsetParentAnElement = isHTMLElement(offsetParent);
1471
+ var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
1472
+ var documentElement = getDocumentElement(offsetParent);
1473
+ var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
1474
+ var scroll = {
1475
+ scrollLeft: 0,
1476
+ scrollTop: 0
1477
+ };
1478
+ var offsets = {
1479
+ x: 0,
1480
+ y: 0
1481
+ };
1482
+
1483
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
1484
+ if (getNodeName(offsetParent) !== 'body' || // https://github.com/popperjs/popper-core/issues/1078
1485
+ isScrollParent(documentElement)) {
1486
+ scroll = getNodeScroll(offsetParent);
1487
+ }
1488
+
1489
+ if (isHTMLElement(offsetParent)) {
1490
+ offsets = getBoundingClientRect(offsetParent, true);
1491
+ offsets.x += offsetParent.clientLeft;
1492
+ offsets.y += offsetParent.clientTop;
1493
+ } else if (documentElement) {
1494
+ offsets.x = getWindowScrollBarX(documentElement);
1495
+ }
1496
+ }
1497
+
1498
+ return {
1499
+ x: rect.left + scroll.scrollLeft - offsets.x,
1500
+ y: rect.top + scroll.scrollTop - offsets.y,
1501
+ width: rect.width,
1502
+ height: rect.height
1503
+ };
1504
+ }
1505
+
1506
+ function order(modifiers) {
1507
+ var map = new Map();
1508
+ var visited = new Set();
1509
+ var result = [];
1510
+ modifiers.forEach(function (modifier) {
1511
+ map.set(modifier.name, modifier);
1512
+ }); // On visiting object, check for its dependencies and visit them recursively
1513
+
1514
+ function sort(modifier) {
1515
+ visited.add(modifier.name);
1516
+ var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
1517
+ requires.forEach(function (dep) {
1518
+ if (!visited.has(dep)) {
1519
+ var depModifier = map.get(dep);
1520
+
1521
+ if (depModifier) {
1522
+ sort(depModifier);
1523
+ }
1524
+ }
1525
+ });
1526
+ result.push(modifier);
1527
+ }
1528
+
1529
+ modifiers.forEach(function (modifier) {
1530
+ if (!visited.has(modifier.name)) {
1531
+ // check for visited object
1532
+ sort(modifier);
1533
+ }
1534
+ });
1535
+ return result;
1536
+ }
1537
+
1538
+ function orderModifiers(modifiers) {
1539
+ // order based on dependencies
1540
+ var orderedModifiers = order(modifiers); // order based on phase
1541
+
1542
+ return modifierPhases.reduce(function (acc, phase) {
1543
+ return acc.concat(orderedModifiers.filter(function (modifier) {
1544
+ return modifier.phase === phase;
1545
+ }));
1546
+ }, []);
1547
+ }
1548
+
1549
+ function debounce(fn) {
1550
+ var pending;
1551
+ return function () {
1552
+ if (!pending) {
1553
+ pending = new Promise(function (resolve) {
1554
+ Promise.resolve().then(function () {
1555
+ pending = undefined;
1556
+ resolve(fn());
1557
+ });
1558
+ });
1559
+ }
1560
+
1561
+ return pending;
1562
+ };
1563
+ }
1564
+
1565
+ function mergeByName(modifiers) {
1566
+ var merged = modifiers.reduce(function (merged, current) {
1567
+ var existing = merged[current.name];
1568
+ merged[current.name] = existing ? Object.assign({}, existing, current, {
1569
+ options: Object.assign({}, existing.options, current.options),
1570
+ data: Object.assign({}, existing.data, current.data)
1571
+ }) : current;
1572
+ return merged;
1573
+ }, {}); // IE11 does not support Object.values
1574
+
1575
+ return Object.keys(merged).map(function (key) {
1576
+ return merged[key];
1577
+ });
1578
+ }
1579
+
1580
+ var DEFAULT_OPTIONS = {
1581
+ placement: 'bottom',
1582
+ modifiers: [],
1583
+ strategy: 'absolute'
1584
+ };
1585
+
1586
+ function areValidElements() {
1587
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1588
+ args[_key] = arguments[_key];
1589
+ }
1590
+
1591
+ return !args.some(function (element) {
1592
+ return !(element && typeof element.getBoundingClientRect === 'function');
1593
+ });
1594
+ }
1595
+
1596
+ function popperGenerator(generatorOptions) {
1597
+ if (generatorOptions === void 0) {
1598
+ generatorOptions = {};
1599
+ }
1600
+
1601
+ var _generatorOptions = generatorOptions,
1602
+ _generatorOptions$def = _generatorOptions.defaultModifiers,
1603
+ defaultModifiers = _generatorOptions$def === void 0 ? [] : _generatorOptions$def,
1604
+ _generatorOptions$def2 = _generatorOptions.defaultOptions,
1605
+ defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
1606
+ return function createPopper(reference, popper, options) {
1607
+ if (options === void 0) {
1608
+ options = defaultOptions;
1609
+ }
1610
+
1611
+ var state = {
1612
+ placement: 'bottom',
1613
+ orderedModifiers: [],
1614
+ options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
1615
+ modifiersData: {},
1616
+ elements: {
1617
+ reference: reference,
1618
+ popper: popper
1619
+ },
1620
+ attributes: {},
1621
+ styles: {}
1622
+ };
1623
+ var effectCleanupFns = [];
1624
+ var isDestroyed = false;
1625
+ var instance = {
1626
+ state: state,
1627
+ setOptions: function setOptions(setOptionsAction) {
1628
+ var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction;
1629
+ cleanupModifierEffects();
1630
+ state.options = Object.assign({}, defaultOptions, state.options, options);
1631
+ state.scrollParents = {
1632
+ reference: isElement(reference) ? listScrollParents(reference) : reference.contextElement ? listScrollParents(reference.contextElement) : [],
1633
+ popper: listScrollParents(popper)
1634
+ }; // Orders the modifiers based on their dependencies and `phase`
1635
+ // properties
1636
+
1637
+ var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers, state.options.modifiers))); // Strip out disabled modifiers
1638
+
1639
+ state.orderedModifiers = orderedModifiers.filter(function (m) {
1640
+ return m.enabled;
1641
+ }); // Validate the provided modifiers so that the consumer will get warned
1642
+
1643
+ runModifierEffects();
1644
+ return instance.update();
1645
+ },
1646
+ // Sync update – it will always be executed, even if not necessary. This
1647
+ // is useful for low frequency updates where sync behavior simplifies the
1648
+ // logic.
1649
+ // For high frequency updates (e.g. `resize` and `scroll` events), always
1650
+ // prefer the async Popper#update method
1651
+ forceUpdate: function forceUpdate() {
1652
+ if (isDestroyed) {
1653
+ return;
1654
+ }
1655
+
1656
+ var _state$elements = state.elements,
1657
+ reference = _state$elements.reference,
1658
+ popper = _state$elements.popper; // Don't proceed if `reference` or `popper` are not valid elements
1659
+ // anymore
1660
+
1661
+ if (!areValidElements(reference, popper)) {
1662
+
1663
+ return;
1664
+ } // Store the reference and popper rects to be read by modifiers
1665
+
1666
+
1667
+ state.rects = {
1668
+ reference: getCompositeRect(reference, getOffsetParent(popper), state.options.strategy === 'fixed'),
1669
+ popper: getLayoutRect(popper)
1670
+ }; // Modifiers have the ability to reset the current update cycle. The
1671
+ // most common use case for this is the `flip` modifier changing the
1672
+ // placement, which then needs to re-run all the modifiers, because the
1673
+ // logic was previously ran for the previous placement and is therefore
1674
+ // stale/incorrect
1675
+
1676
+ state.reset = false;
1677
+ state.placement = state.options.placement; // On each update cycle, the `modifiersData` property for each modifier
1678
+ // is filled with the initial data specified by the modifier. This means
1679
+ // it doesn't persist and is fresh on each update.
1680
+ // To ensure persistent data, use `${name}#persistent`
1681
+
1682
+ state.orderedModifiers.forEach(function (modifier) {
1683
+ return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
1684
+ });
1685
+
1686
+ for (var index = 0; index < state.orderedModifiers.length; index++) {
1687
+
1688
+ if (state.reset === true) {
1689
+ state.reset = false;
1690
+ index = -1;
1691
+ continue;
1692
+ }
1693
+
1694
+ var _state$orderedModifie = state.orderedModifiers[index],
1695
+ fn = _state$orderedModifie.fn,
1696
+ _state$orderedModifie2 = _state$orderedModifie.options,
1697
+ _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2,
1698
+ name = _state$orderedModifie.name;
1699
+
1700
+ if (typeof fn === 'function') {
1701
+ state = fn({
1702
+ state: state,
1703
+ options: _options,
1704
+ name: name,
1705
+ instance: instance
1706
+ }) || state;
1707
+ }
1708
+ }
1709
+ },
1710
+ // Async and optimistically optimized update – it will not be executed if
1711
+ // not necessary (debounced to run at most once-per-tick)
1712
+ update: debounce(function () {
1713
+ return new Promise(function (resolve) {
1714
+ instance.forceUpdate();
1715
+ resolve(state);
1716
+ });
1717
+ }),
1718
+ destroy: function destroy() {
1719
+ cleanupModifierEffects();
1720
+ isDestroyed = true;
1721
+ }
1722
+ };
1723
+
1724
+ if (!areValidElements(reference, popper)) {
1725
+
1726
+ return instance;
1727
+ }
1728
+
1729
+ instance.setOptions(options).then(function (state) {
1730
+ if (!isDestroyed && options.onFirstUpdate) {
1731
+ options.onFirstUpdate(state);
1732
+ }
1733
+ }); // Modifiers have the ability to execute arbitrary code before the first
1734
+ // update cycle runs. They will be executed in the same order as the update
1735
+ // cycle. This is useful when a modifier adds some persistent data that
1736
+ // other modifiers need to use, but the modifier is run after the dependent
1737
+ // one.
1738
+
1739
+ function runModifierEffects() {
1740
+ state.orderedModifiers.forEach(function (_ref3) {
1741
+ var name = _ref3.name,
1742
+ _ref3$options = _ref3.options,
1743
+ options = _ref3$options === void 0 ? {} : _ref3$options,
1744
+ effect = _ref3.effect;
1745
+
1746
+ if (typeof effect === 'function') {
1747
+ var cleanupFn = effect({
1748
+ state: state,
1749
+ name: name,
1750
+ instance: instance,
1751
+ options: options
1752
+ });
1753
+
1754
+ var noopFn = function noopFn() {};
1755
+
1756
+ effectCleanupFns.push(cleanupFn || noopFn);
1757
+ }
1758
+ });
1759
+ }
1760
+
1761
+ function cleanupModifierEffects() {
1762
+ effectCleanupFns.forEach(function (fn) {
1763
+ return fn();
1764
+ });
1765
+ effectCleanupFns = [];
1766
+ }
1767
+
1768
+ return instance;
1769
+ };
1770
+ }
1771
+
1772
+ var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
1773
+ var createPopper = /*#__PURE__*/popperGenerator({
1774
+ defaultModifiers: defaultModifiers
1775
+ }); // eslint-disable-next-line import/no-unused-modules
1776
+
1777
+ /**!
1778
+ * tippy.js v6.3.7
1779
+ * (c) 2017-2021 atomiks
1780
+ * MIT License
1781
+ */
1782
+
1783
+ var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
1784
+ var BOX_CLASS = "tippy-box";
1785
+ var CONTENT_CLASS = "tippy-content";
1786
+ var BACKDROP_CLASS = "tippy-backdrop";
1787
+ var ARROW_CLASS = "tippy-arrow";
1788
+ var SVG_ARROW_CLASS = "tippy-svg-arrow";
1789
+ var TOUCH_OPTIONS = {
1790
+ passive: true,
1791
+ capture: true
1792
+ };
1793
+ var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() {
1794
+ return document.body;
1795
+ };
1796
+ function getValueAtIndexOrReturn(value, index, defaultValue) {
1797
+ if (Array.isArray(value)) {
1798
+ var v = value[index];
1799
+ return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
1800
+ }
1801
+
1802
+ return value;
1803
+ }
1804
+ function isType(value, type) {
1805
+ var str = {}.toString.call(value);
1806
+ return str.indexOf('[object') === 0 && str.indexOf(type + "]") > -1;
1807
+ }
1808
+ function invokeWithArgsOrReturn(value, args) {
1809
+ return typeof value === 'function' ? value.apply(void 0, args) : value;
1810
+ }
1811
+ function debounce$1(fn, ms) {
1812
+ // Avoid wrapping in `setTimeout` if ms is 0 anyway
1813
+ if (ms === 0) {
1814
+ return fn;
1815
+ }
1816
+
1817
+ var timeout;
1818
+ return function (arg) {
1819
+ clearTimeout(timeout);
1820
+ timeout = setTimeout(function () {
1821
+ fn(arg);
1822
+ }, ms);
1823
+ };
1824
+ }
1825
+ function removeProperties(obj, keys) {
1826
+ var clone = Object.assign({}, obj);
1827
+ keys.forEach(function (key) {
1828
+ delete clone[key];
1829
+ });
1830
+ return clone;
1831
+ }
1832
+ function splitBySpaces(value) {
1833
+ return value.split(/\s+/).filter(Boolean);
1834
+ }
1835
+ function normalizeToArray(value) {
1836
+ return [].concat(value);
1837
+ }
1838
+ function pushIfUnique(arr, value) {
1839
+ if (arr.indexOf(value) === -1) {
1840
+ arr.push(value);
1841
+ }
1842
+ }
1843
+ function unique(arr) {
1844
+ return arr.filter(function (item, index) {
1845
+ return arr.indexOf(item) === index;
1846
+ });
1847
+ }
1848
+ function getBasePlacement$1(placement) {
1849
+ return placement.split('-')[0];
1850
+ }
1851
+ function arrayFrom(value) {
1852
+ return [].slice.call(value);
1853
+ }
1854
+ function removeUndefinedProps(obj) {
1855
+ return Object.keys(obj).reduce(function (acc, key) {
1856
+ if (obj[key] !== undefined) {
1857
+ acc[key] = obj[key];
1858
+ }
1859
+
1860
+ return acc;
1861
+ }, {});
1862
+ }
1863
+
1864
+ function div() {
1865
+ return document.createElement('div');
1866
+ }
1867
+ function isElement$1(value) {
1868
+ return ['Element', 'Fragment'].some(function (type) {
1869
+ return isType(value, type);
1870
+ });
1871
+ }
1872
+ function isNodeList(value) {
1873
+ return isType(value, 'NodeList');
1874
+ }
1875
+ function isMouseEvent(value) {
1876
+ return isType(value, 'MouseEvent');
1877
+ }
1878
+ function isReferenceElement(value) {
1879
+ return !!(value && value._tippy && value._tippy.reference === value);
1880
+ }
1881
+ function getArrayOfElements(value) {
1882
+ if (isElement$1(value)) {
1883
+ return [value];
1884
+ }
1885
+
1886
+ if (isNodeList(value)) {
1887
+ return arrayFrom(value);
1888
+ }
1889
+
1890
+ if (Array.isArray(value)) {
1891
+ return value;
1892
+ }
1893
+
1894
+ return arrayFrom(document.querySelectorAll(value));
1895
+ }
1896
+ function setTransitionDuration(els, value) {
1897
+ els.forEach(function (el) {
1898
+ if (el) {
1899
+ el.style.transitionDuration = value + "ms";
1900
+ }
1901
+ });
1902
+ }
1903
+ function setVisibilityState(els, state) {
1904
+ els.forEach(function (el) {
1905
+ if (el) {
1906
+ el.setAttribute('data-state', state);
1907
+ }
1908
+ });
1909
+ }
1910
+ function getOwnerDocument(elementOrElements) {
1911
+ var _element$ownerDocumen;
1912
+
1913
+ var _normalizeToArray = normalizeToArray(elementOrElements),
1914
+ element = _normalizeToArray[0]; // Elements created via a <template> have an ownerDocument with no reference to the body
1915
+
1916
+
1917
+ return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
1918
+ }
1919
+ function isCursorOutsideInteractiveBorder(popperTreeData, event) {
1920
+ var clientX = event.clientX,
1921
+ clientY = event.clientY;
1922
+ return popperTreeData.every(function (_ref) {
1923
+ var popperRect = _ref.popperRect,
1924
+ popperState = _ref.popperState,
1925
+ props = _ref.props;
1926
+ var interactiveBorder = props.interactiveBorder;
1927
+ var basePlacement = getBasePlacement$1(popperState.placement);
1928
+ var offsetData = popperState.modifiersData.offset;
1929
+
1930
+ if (!offsetData) {
1931
+ return true;
1932
+ }
1933
+
1934
+ var topDistance = basePlacement === 'bottom' ? offsetData.top.y : 0;
1935
+ var bottomDistance = basePlacement === 'top' ? offsetData.bottom.y : 0;
1936
+ var leftDistance = basePlacement === 'right' ? offsetData.left.x : 0;
1937
+ var rightDistance = basePlacement === 'left' ? offsetData.right.x : 0;
1938
+ var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
1939
+ var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
1940
+ var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
1941
+ var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
1942
+ return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
1943
+ });
1944
+ }
1945
+ function updateTransitionEndListener(box, action, listener) {
1946
+ var method = action + "EventListener"; // some browsers apparently support `transition` (unprefixed) but only fire
1947
+ // `webkitTransitionEnd`...
1948
+
1949
+ ['transitionend', 'webkitTransitionEnd'].forEach(function (event) {
1950
+ box[method](event, listener);
1951
+ });
1952
+ }
1953
+ /**
1954
+ * Compared to xxx.contains, this function works for dom structures with shadow
1955
+ * dom
1956
+ */
1957
+
1958
+ function actualContains(parent, child) {
1959
+ var target = child;
1960
+
1961
+ while (target) {
1962
+ var _target$getRootNode;
1963
+
1964
+ if (parent.contains(target)) {
1965
+ return true;
1966
+ }
1967
+
1968
+ target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
1969
+ }
1970
+
1971
+ return false;
1972
+ }
1973
+
1974
+ var currentInput = {
1975
+ isTouch: false
1976
+ };
1977
+ var lastMouseMoveTime = 0;
1978
+ /**
1979
+ * When a `touchstart` event is fired, it's assumed the user is using touch
1980
+ * input. We'll bind a `mousemove` event listener to listen for mouse input in
1981
+ * the future. This way, the `isTouch` property is fully dynamic and will handle
1982
+ * hybrid devices that use a mix of touch + mouse input.
1983
+ */
1984
+
1985
+ function onDocumentTouchStart() {
1986
+ if (currentInput.isTouch) {
1987
+ return;
1988
+ }
1989
+
1990
+ currentInput.isTouch = true;
1991
+
1992
+ if (window.performance) {
1993
+ document.addEventListener('mousemove', onDocumentMouseMove);
1994
+ }
1995
+ }
1996
+ /**
1997
+ * When two `mousemove` event are fired consecutively within 20ms, it's assumed
1998
+ * the user is using mouse input again. `mousemove` can fire on touch devices as
1999
+ * well, but very rarely that quickly.
2000
+ */
2001
+
2002
+ function onDocumentMouseMove() {
2003
+ var now = performance.now();
2004
+
2005
+ if (now - lastMouseMoveTime < 20) {
2006
+ currentInput.isTouch = false;
2007
+ document.removeEventListener('mousemove', onDocumentMouseMove);
2008
+ }
2009
+
2010
+ lastMouseMoveTime = now;
2011
+ }
2012
+ /**
2013
+ * When an element is in focus and has a tippy, leaving the tab/window and
2014
+ * returning causes it to show again. For mouse users this is unexpected, but
2015
+ * for keyboard use it makes sense.
2016
+ * TODO: find a better technique to solve this problem
2017
+ */
2018
+
2019
+ function onWindowBlur() {
2020
+ var activeElement = document.activeElement;
2021
+
2022
+ if (isReferenceElement(activeElement)) {
2023
+ var instance = activeElement._tippy;
2024
+
2025
+ if (activeElement.blur && !instance.state.isVisible) {
2026
+ activeElement.blur();
2027
+ }
2028
+ }
2029
+ }
2030
+ function bindGlobalEventListeners() {
2031
+ document.addEventListener('touchstart', onDocumentTouchStart, TOUCH_OPTIONS);
2032
+ window.addEventListener('blur', onWindowBlur);
2033
+ }
2034
+
2035
+ var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
2036
+ var isIE11 = isBrowser ? // @ts-ignore
2037
+ !!window.msCrypto : false;
2038
+
2039
+ var pluginProps = {
2040
+ animateFill: false,
2041
+ followCursor: false,
2042
+ inlinePositioning: false,
2043
+ sticky: false
2044
+ };
2045
+ var renderProps = {
2046
+ allowHTML: false,
2047
+ animation: 'fade',
2048
+ arrow: true,
2049
+ content: '',
2050
+ inertia: false,
2051
+ maxWidth: 350,
2052
+ role: 'tooltip',
2053
+ theme: '',
2054
+ zIndex: 9999
2055
+ };
2056
+ var defaultProps = Object.assign({
2057
+ appendTo: TIPPY_DEFAULT_APPEND_TO,
2058
+ aria: {
2059
+ content: 'auto',
2060
+ expanded: 'auto'
2061
+ },
2062
+ delay: 0,
2063
+ duration: [300, 250],
2064
+ getReferenceClientRect: null,
2065
+ hideOnClick: true,
2066
+ ignoreAttributes: false,
2067
+ interactive: false,
2068
+ interactiveBorder: 2,
2069
+ interactiveDebounce: 0,
2070
+ moveTransition: '',
2071
+ offset: [0, 10],
2072
+ onAfterUpdate: function onAfterUpdate() {},
2073
+ onBeforeUpdate: function onBeforeUpdate() {},
2074
+ onCreate: function onCreate() {},
2075
+ onDestroy: function onDestroy() {},
2076
+ onHidden: function onHidden() {},
2077
+ onHide: function onHide() {},
2078
+ onMount: function onMount() {},
2079
+ onShow: function onShow() {},
2080
+ onShown: function onShown() {},
2081
+ onTrigger: function onTrigger() {},
2082
+ onUntrigger: function onUntrigger() {},
2083
+ onClickOutside: function onClickOutside() {},
2084
+ placement: 'top',
2085
+ plugins: [],
2086
+ popperOptions: {},
2087
+ render: null,
2088
+ showOnCreate: false,
2089
+ touch: true,
2090
+ trigger: 'mouseenter focus',
2091
+ triggerTarget: null
2092
+ }, pluginProps, renderProps);
2093
+ var defaultKeys = Object.keys(defaultProps);
2094
+ var setDefaultProps = function setDefaultProps(partialProps) {
2095
+
2096
+ var keys = Object.keys(partialProps);
2097
+ keys.forEach(function (key) {
2098
+ defaultProps[key] = partialProps[key];
2099
+ });
2100
+ };
2101
+ function getExtendedPassedProps(passedProps) {
2102
+ var plugins = passedProps.plugins || [];
2103
+ var pluginProps = plugins.reduce(function (acc, plugin) {
2104
+ var name = plugin.name,
2105
+ defaultValue = plugin.defaultValue;
2106
+
2107
+ if (name) {
2108
+ var _name;
2109
+
2110
+ acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
2111
+ }
2112
+
2113
+ return acc;
2114
+ }, {});
2115
+ return Object.assign({}, passedProps, pluginProps);
2116
+ }
2117
+ function getDataAttributeProps(reference, plugins) {
2118
+ var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
2119
+ plugins: plugins
2120
+ }))) : defaultKeys;
2121
+ var props = propKeys.reduce(function (acc, key) {
2122
+ var valueAsString = (reference.getAttribute("data-tippy-" + key) || '').trim();
2123
+
2124
+ if (!valueAsString) {
2125
+ return acc;
2126
+ }
2127
+
2128
+ if (key === 'content') {
2129
+ acc[key] = valueAsString;
2130
+ } else {
2131
+ try {
2132
+ acc[key] = JSON.parse(valueAsString);
2133
+ } catch (e) {
2134
+ acc[key] = valueAsString;
2135
+ }
2136
+ }
2137
+
2138
+ return acc;
2139
+ }, {});
2140
+ return props;
2141
+ }
2142
+ function evaluateProps(reference, props) {
2143
+ var out = Object.assign({}, props, {
2144
+ content: invokeWithArgsOrReturn(props.content, [reference])
2145
+ }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins));
2146
+ out.aria = Object.assign({}, defaultProps.aria, out.aria);
2147
+ out.aria = {
2148
+ expanded: out.aria.expanded === 'auto' ? props.interactive : out.aria.expanded,
2149
+ content: out.aria.content === 'auto' ? props.interactive ? null : 'describedby' : out.aria.content
2150
+ };
2151
+ return out;
2152
+ }
2153
+
2154
+ var innerHTML = function innerHTML() {
2155
+ return 'innerHTML';
2156
+ };
2157
+
2158
+ function dangerouslySetInnerHTML(element, html) {
2159
+ element[innerHTML()] = html;
2160
+ }
2161
+
2162
+ function createArrowElement(value) {
2163
+ var arrow = div();
2164
+
2165
+ if (value === true) {
2166
+ arrow.className = ARROW_CLASS;
2167
+ } else {
2168
+ arrow.className = SVG_ARROW_CLASS;
2169
+
2170
+ if (isElement$1(value)) {
2171
+ arrow.appendChild(value);
2172
+ } else {
2173
+ dangerouslySetInnerHTML(arrow, value);
2174
+ }
2175
+ }
2176
+
2177
+ return arrow;
2178
+ }
2179
+
2180
+ function setContent(content, props) {
2181
+ if (isElement$1(props.content)) {
2182
+ dangerouslySetInnerHTML(content, '');
2183
+ content.appendChild(props.content);
2184
+ } else if (typeof props.content !== 'function') {
2185
+ if (props.allowHTML) {
2186
+ dangerouslySetInnerHTML(content, props.content);
2187
+ } else {
2188
+ content.textContent = props.content;
2189
+ }
2190
+ }
2191
+ }
2192
+ function getChildren(popper) {
2193
+ var box = popper.firstElementChild;
2194
+ var boxChildren = arrayFrom(box.children);
2195
+ return {
2196
+ box: box,
2197
+ content: boxChildren.find(function (node) {
2198
+ return node.classList.contains(CONTENT_CLASS);
2199
+ }),
2200
+ arrow: boxChildren.find(function (node) {
2201
+ return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);
2202
+ }),
2203
+ backdrop: boxChildren.find(function (node) {
2204
+ return node.classList.contains(BACKDROP_CLASS);
2205
+ })
2206
+ };
2207
+ }
2208
+ function render(instance) {
2209
+ var popper = div();
2210
+ var box = div();
2211
+ box.className = BOX_CLASS;
2212
+ box.setAttribute('data-state', 'hidden');
2213
+ box.setAttribute('tabindex', '-1');
2214
+ var content = div();
2215
+ content.className = CONTENT_CLASS;
2216
+ content.setAttribute('data-state', 'hidden');
2217
+ setContent(content, instance.props);
2218
+ popper.appendChild(box);
2219
+ box.appendChild(content);
2220
+ onUpdate(instance.props, instance.props);
2221
+
2222
+ function onUpdate(prevProps, nextProps) {
2223
+ var _getChildren = getChildren(popper),
2224
+ box = _getChildren.box,
2225
+ content = _getChildren.content,
2226
+ arrow = _getChildren.arrow;
2227
+
2228
+ if (nextProps.theme) {
2229
+ box.setAttribute('data-theme', nextProps.theme);
2230
+ } else {
2231
+ box.removeAttribute('data-theme');
2232
+ }
2233
+
2234
+ if (typeof nextProps.animation === 'string') {
2235
+ box.setAttribute('data-animation', nextProps.animation);
2236
+ } else {
2237
+ box.removeAttribute('data-animation');
2238
+ }
2239
+
2240
+ if (nextProps.inertia) {
2241
+ box.setAttribute('data-inertia', '');
2242
+ } else {
2243
+ box.removeAttribute('data-inertia');
2244
+ }
2245
+
2246
+ box.style.maxWidth = typeof nextProps.maxWidth === 'number' ? nextProps.maxWidth + "px" : nextProps.maxWidth;
2247
+
2248
+ if (nextProps.role) {
2249
+ box.setAttribute('role', nextProps.role);
2250
+ } else {
2251
+ box.removeAttribute('role');
2252
+ }
2253
+
2254
+ if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
2255
+ setContent(content, instance.props);
2256
+ }
2257
+
2258
+ if (nextProps.arrow) {
2259
+ if (!arrow) {
2260
+ box.appendChild(createArrowElement(nextProps.arrow));
2261
+ } else if (prevProps.arrow !== nextProps.arrow) {
2262
+ box.removeChild(arrow);
2263
+ box.appendChild(createArrowElement(nextProps.arrow));
2264
+ }
2265
+ } else if (arrow) {
2266
+ box.removeChild(arrow);
2267
+ }
2268
+ }
2269
+
2270
+ return {
2271
+ popper: popper,
2272
+ onUpdate: onUpdate
2273
+ };
2274
+ } // Runtime check to identify if the render function is the default one; this
2275
+ // way we can apply default CSS transitions logic and it can be tree-shaken away
2276
+
2277
+ render.$$tippy = true;
2278
+
2279
+ var idCounter = 1;
2280
+ var mouseMoveListeners = []; // Used by `hideAll()`
2281
+
2282
+ var mountedInstances = [];
2283
+ function createTippy(reference, passedProps) {
2284
+ var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); // ===========================================================================
2285
+ // 🔒 Private members
2286
+ // ===========================================================================
2287
+
2288
+ var showTimeout;
2289
+ var hideTimeout;
2290
+ var scheduleHideAnimationFrame;
2291
+ var isVisibleFromClick = false;
2292
+ var didHideDueToDocumentMouseDown = false;
2293
+ var didTouchMove = false;
2294
+ var ignoreOnFirstUpdate = false;
2295
+ var lastTriggerEvent;
2296
+ var currentTransitionEndListener;
2297
+ var onFirstUpdate;
2298
+ var listeners = [];
2299
+ var debouncedOnMouseMove = debounce$1(onMouseMove, props.interactiveDebounce);
2300
+ var currentTarget; // ===========================================================================
2301
+ // 🔑 Public members
2302
+ // ===========================================================================
2303
+
2304
+ var id = idCounter++;
2305
+ var popperInstance = null;
2306
+ var plugins = unique(props.plugins);
2307
+ var state = {
2308
+ // Is the instance currently enabled?
2309
+ isEnabled: true,
2310
+ // Is the tippy currently showing and not transitioning out?
2311
+ isVisible: false,
2312
+ // Has the instance been destroyed?
2313
+ isDestroyed: false,
2314
+ // Is the tippy currently mounted to the DOM?
2315
+ isMounted: false,
2316
+ // Has the tippy finished transitioning in?
2317
+ isShown: false
2318
+ };
2319
+ var instance = {
2320
+ // properties
2321
+ id: id,
2322
+ reference: reference,
2323
+ popper: div(),
2324
+ popperInstance: popperInstance,
2325
+ props: props,
2326
+ state: state,
2327
+ plugins: plugins,
2328
+ // methods
2329
+ clearDelayTimeouts: clearDelayTimeouts,
2330
+ setProps: setProps,
2331
+ setContent: setContent,
2332
+ show: show,
2333
+ hide: hide,
2334
+ hideWithInteractivity: hideWithInteractivity,
2335
+ enable: enable,
2336
+ disable: disable,
2337
+ unmount: unmount,
2338
+ destroy: destroy
2339
+ }; // TODO: Investigate why this early return causes a TDZ error in the tests —
2340
+ // it doesn't seem to happen in the browser
2341
+
2342
+ /* istanbul ignore if */
2343
+
2344
+ if (!props.render) {
2345
+
2346
+ return instance;
2347
+ } // ===========================================================================
2348
+ // Initial mutations
2349
+ // ===========================================================================
2350
+
2351
+
2352
+ var _props$render = props.render(instance),
2353
+ popper = _props$render.popper,
2354
+ onUpdate = _props$render.onUpdate;
2355
+
2356
+ popper.setAttribute('data-tippy-root', '');
2357
+ popper.id = "tippy-" + instance.id;
2358
+ instance.popper = popper;
2359
+ reference._tippy = instance;
2360
+ popper._tippy = instance;
2361
+ var pluginsHooks = plugins.map(function (plugin) {
2362
+ return plugin.fn(instance);
2363
+ });
2364
+ var hasAriaExpanded = reference.hasAttribute('aria-expanded');
2365
+ addListeners();
2366
+ handleAriaExpandedAttribute();
2367
+ handleStyles();
2368
+ invokeHook('onCreate', [instance]);
2369
+
2370
+ if (props.showOnCreate) {
2371
+ scheduleShow();
2372
+ } // Prevent a tippy with a delay from hiding if the cursor left then returned
2373
+ // before it started hiding
2374
+
2375
+
2376
+ popper.addEventListener('mouseenter', function () {
2377
+ if (instance.props.interactive && instance.state.isVisible) {
2378
+ instance.clearDelayTimeouts();
2379
+ }
2380
+ });
2381
+ popper.addEventListener('mouseleave', function () {
2382
+ if (instance.props.interactive && instance.props.trigger.indexOf('mouseenter') >= 0) {
2383
+ getDocument().addEventListener('mousemove', debouncedOnMouseMove);
2384
+ }
2385
+ });
2386
+ return instance; // ===========================================================================
2387
+ // 🔒 Private methods
2388
+ // ===========================================================================
2389
+
2390
+ function getNormalizedTouchSettings() {
2391
+ var touch = instance.props.touch;
2392
+ return Array.isArray(touch) ? touch : [touch, 0];
2393
+ }
2394
+
2395
+ function getIsCustomTouchBehavior() {
2396
+ return getNormalizedTouchSettings()[0] === 'hold';
2397
+ }
2398
+
2399
+ function getIsDefaultRenderFn() {
2400
+ var _instance$props$rende;
2401
+
2402
+ // @ts-ignore
2403
+ return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
2404
+ }
2405
+
2406
+ function getCurrentTarget() {
2407
+ return currentTarget || reference;
2408
+ }
2409
+
2410
+ function getDocument() {
2411
+ var parent = getCurrentTarget().parentNode;
2412
+ return parent ? getOwnerDocument(parent) : document;
2413
+ }
2414
+
2415
+ function getDefaultTemplateChildren() {
2416
+ return getChildren(popper);
2417
+ }
2418
+
2419
+ function getDelay(isShow) {
2420
+ // For touch or keyboard input, force `0` delay for UX reasons
2421
+ // Also if the instance is mounted but not visible (transitioning out),
2422
+ // ignore delay
2423
+ if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === 'focus') {
2424
+ return 0;
2425
+ }
2426
+
2427
+ return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
2428
+ }
2429
+
2430
+ function handleStyles(fromHide) {
2431
+ if (fromHide === void 0) {
2432
+ fromHide = false;
2433
+ }
2434
+
2435
+ popper.style.pointerEvents = instance.props.interactive && !fromHide ? '' : 'none';
2436
+ popper.style.zIndex = "" + instance.props.zIndex;
2437
+ }
2438
+
2439
+ function invokeHook(hook, args, shouldInvokePropsHook) {
2440
+ if (shouldInvokePropsHook === void 0) {
2441
+ shouldInvokePropsHook = true;
2442
+ }
2443
+
2444
+ pluginsHooks.forEach(function (pluginHooks) {
2445
+ if (pluginHooks[hook]) {
2446
+ pluginHooks[hook].apply(pluginHooks, args);
2447
+ }
2448
+ });
2449
+
2450
+ if (shouldInvokePropsHook) {
2451
+ var _instance$props;
2452
+
2453
+ (_instance$props = instance.props)[hook].apply(_instance$props, args);
2454
+ }
2455
+ }
2456
+
2457
+ function handleAriaContentAttribute() {
2458
+ var aria = instance.props.aria;
2459
+
2460
+ if (!aria.content) {
2461
+ return;
2462
+ }
2463
+
2464
+ var attr = "aria-" + aria.content;
2465
+ var id = popper.id;
2466
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
2467
+ nodes.forEach(function (node) {
2468
+ var currentValue = node.getAttribute(attr);
2469
+
2470
+ if (instance.state.isVisible) {
2471
+ node.setAttribute(attr, currentValue ? currentValue + " " + id : id);
2472
+ } else {
2473
+ var nextValue = currentValue && currentValue.replace(id, '').trim();
2474
+
2475
+ if (nextValue) {
2476
+ node.setAttribute(attr, nextValue);
2477
+ } else {
2478
+ node.removeAttribute(attr);
2479
+ }
2480
+ }
2481
+ });
2482
+ }
2483
+
2484
+ function handleAriaExpandedAttribute() {
2485
+ if (hasAriaExpanded || !instance.props.aria.expanded) {
2486
+ return;
2487
+ }
2488
+
2489
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
2490
+ nodes.forEach(function (node) {
2491
+ if (instance.props.interactive) {
2492
+ node.setAttribute('aria-expanded', instance.state.isVisible && node === getCurrentTarget() ? 'true' : 'false');
2493
+ } else {
2494
+ node.removeAttribute('aria-expanded');
2495
+ }
2496
+ });
2497
+ }
2498
+
2499
+ function cleanupInteractiveMouseListeners() {
2500
+ getDocument().removeEventListener('mousemove', debouncedOnMouseMove);
2501
+ mouseMoveListeners = mouseMoveListeners.filter(function (listener) {
2502
+ return listener !== debouncedOnMouseMove;
2503
+ });
2504
+ }
2505
+
2506
+ function onDocumentPress(event) {
2507
+ // Moved finger to scroll instead of an intentional tap outside
2508
+ if (currentInput.isTouch) {
2509
+ if (didTouchMove || event.type === 'mousedown') {
2510
+ return;
2511
+ }
2512
+ }
2513
+
2514
+ var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper
2515
+
2516
+ if (instance.props.interactive && actualContains(popper, actualTarget)) {
2517
+ return;
2518
+ } // Clicked on the event listeners target
2519
+
2520
+
2521
+ if (normalizeToArray(instance.props.triggerTarget || reference).some(function (el) {
2522
+ return actualContains(el, actualTarget);
2523
+ })) {
2524
+ if (currentInput.isTouch) {
2525
+ return;
2526
+ }
2527
+
2528
+ if (instance.state.isVisible && instance.props.trigger.indexOf('click') >= 0) {
2529
+ return;
2530
+ }
2531
+ } else {
2532
+ invokeHook('onClickOutside', [instance, event]);
2533
+ }
2534
+
2535
+ if (instance.props.hideOnClick === true) {
2536
+ instance.clearDelayTimeouts();
2537
+ instance.hide(); // `mousedown` event is fired right before `focus` if pressing the
2538
+ // currentTarget. This lets a tippy with `focus` trigger know that it
2539
+ // should not show
2540
+
2541
+ didHideDueToDocumentMouseDown = true;
2542
+ setTimeout(function () {
2543
+ didHideDueToDocumentMouseDown = false;
2544
+ }); // The listener gets added in `scheduleShow()`, but this may be hiding it
2545
+ // before it shows, and hide()'s early bail-out behavior can prevent it
2546
+ // from being cleaned up
2547
+
2548
+ if (!instance.state.isMounted) {
2549
+ removeDocumentPress();
2550
+ }
2551
+ }
2552
+ }
2553
+
2554
+ function onTouchMove() {
2555
+ didTouchMove = true;
2556
+ }
2557
+
2558
+ function onTouchStart() {
2559
+ didTouchMove = false;
2560
+ }
2561
+
2562
+ function addDocumentPress() {
2563
+ var doc = getDocument();
2564
+ doc.addEventListener('mousedown', onDocumentPress, true);
2565
+ doc.addEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
2566
+ doc.addEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
2567
+ doc.addEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
2568
+ }
2569
+
2570
+ function removeDocumentPress() {
2571
+ var doc = getDocument();
2572
+ doc.removeEventListener('mousedown', onDocumentPress, true);
2573
+ doc.removeEventListener('touchend', onDocumentPress, TOUCH_OPTIONS);
2574
+ doc.removeEventListener('touchstart', onTouchStart, TOUCH_OPTIONS);
2575
+ doc.removeEventListener('touchmove', onTouchMove, TOUCH_OPTIONS);
2576
+ }
2577
+
2578
+ function onTransitionedOut(duration, callback) {
2579
+ onTransitionEnd(duration, function () {
2580
+ if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) {
2581
+ callback();
2582
+ }
2583
+ });
2584
+ }
2585
+
2586
+ function onTransitionedIn(duration, callback) {
2587
+ onTransitionEnd(duration, callback);
2588
+ }
2589
+
2590
+ function onTransitionEnd(duration, callback) {
2591
+ var box = getDefaultTemplateChildren().box;
2592
+
2593
+ function listener(event) {
2594
+ if (event.target === box) {
2595
+ updateTransitionEndListener(box, 'remove', listener);
2596
+ callback();
2597
+ }
2598
+ } // Make callback synchronous if duration is 0
2599
+ // `transitionend` won't fire otherwise
2600
+
2601
+
2602
+ if (duration === 0) {
2603
+ return callback();
2604
+ }
2605
+
2606
+ updateTransitionEndListener(box, 'remove', currentTransitionEndListener);
2607
+ updateTransitionEndListener(box, 'add', listener);
2608
+ currentTransitionEndListener = listener;
2609
+ }
2610
+
2611
+ function on(eventType, handler, options) {
2612
+ if (options === void 0) {
2613
+ options = false;
2614
+ }
2615
+
2616
+ var nodes = normalizeToArray(instance.props.triggerTarget || reference);
2617
+ nodes.forEach(function (node) {
2618
+ node.addEventListener(eventType, handler, options);
2619
+ listeners.push({
2620
+ node: node,
2621
+ eventType: eventType,
2622
+ handler: handler,
2623
+ options: options
2624
+ });
2625
+ });
2626
+ }
2627
+
2628
+ function addListeners() {
2629
+ if (getIsCustomTouchBehavior()) {
2630
+ on('touchstart', onTrigger, {
2631
+ passive: true
2632
+ });
2633
+ on('touchend', onMouseLeave, {
2634
+ passive: true
2635
+ });
2636
+ }
2637
+
2638
+ splitBySpaces(instance.props.trigger).forEach(function (eventType) {
2639
+ if (eventType === 'manual') {
2640
+ return;
2641
+ }
2642
+
2643
+ on(eventType, onTrigger);
2644
+
2645
+ switch (eventType) {
2646
+ case 'mouseenter':
2647
+ on('mouseleave', onMouseLeave);
2648
+ break;
2649
+
2650
+ case 'focus':
2651
+ on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut);
2652
+ break;
2653
+
2654
+ case 'focusin':
2655
+ on('focusout', onBlurOrFocusOut);
2656
+ break;
2657
+ }
2658
+ });
2659
+ }
2660
+
2661
+ function removeListeners() {
2662
+ listeners.forEach(function (_ref) {
2663
+ var node = _ref.node,
2664
+ eventType = _ref.eventType,
2665
+ handler = _ref.handler,
2666
+ options = _ref.options;
2667
+ node.removeEventListener(eventType, handler, options);
2668
+ });
2669
+ listeners = [];
2670
+ }
2671
+
2672
+ function onTrigger(event) {
2673
+ var _lastTriggerEvent;
2674
+
2675
+ var shouldScheduleClickHide = false;
2676
+
2677
+ if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
2678
+ return;
2679
+ }
2680
+
2681
+ var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === 'focus';
2682
+ lastTriggerEvent = event;
2683
+ currentTarget = event.currentTarget;
2684
+ handleAriaExpandedAttribute();
2685
+
2686
+ if (!instance.state.isVisible && isMouseEvent(event)) {
2687
+ // If scrolling, `mouseenter` events can be fired if the cursor lands
2688
+ // over a new target, but `mousemove` events don't get fired. This
2689
+ // causes interactive tooltips to get stuck open until the cursor is
2690
+ // moved
2691
+ mouseMoveListeners.forEach(function (listener) {
2692
+ return listener(event);
2693
+ });
2694
+ } // Toggle show/hide when clicking click-triggered tooltips
2695
+
2696
+
2697
+ if (event.type === 'click' && (instance.props.trigger.indexOf('mouseenter') < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
2698
+ shouldScheduleClickHide = true;
2699
+ } else {
2700
+ scheduleShow(event);
2701
+ }
2702
+
2703
+ if (event.type === 'click') {
2704
+ isVisibleFromClick = !shouldScheduleClickHide;
2705
+ }
2706
+
2707
+ if (shouldScheduleClickHide && !wasFocused) {
2708
+ scheduleHide(event);
2709
+ }
2710
+ }
2711
+
2712
+ function onMouseMove(event) {
2713
+ var target = event.target;
2714
+ var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target);
2715
+
2716
+ if (event.type === 'mousemove' && isCursorOverReferenceOrPopper) {
2717
+ return;
2718
+ }
2719
+
2720
+ var popperTreeData = getNestedPopperTree().concat(popper).map(function (popper) {
2721
+ var _instance$popperInsta;
2722
+
2723
+ var instance = popper._tippy;
2724
+ var state = (_instance$popperInsta = instance.popperInstance) == null ? void 0 : _instance$popperInsta.state;
2725
+
2726
+ if (state) {
2727
+ return {
2728
+ popperRect: popper.getBoundingClientRect(),
2729
+ popperState: state,
2730
+ props: props
2731
+ };
2732
+ }
2733
+
2734
+ return null;
2735
+ }).filter(Boolean);
2736
+
2737
+ if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
2738
+ cleanupInteractiveMouseListeners();
2739
+ scheduleHide(event);
2740
+ }
2741
+ }
2742
+
2743
+ function onMouseLeave(event) {
2744
+ var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf('click') >= 0 && isVisibleFromClick;
2745
+
2746
+ if (shouldBail) {
2747
+ return;
2748
+ }
2749
+
2750
+ if (instance.props.interactive) {
2751
+ instance.hideWithInteractivity(event);
2752
+ return;
2753
+ }
2754
+
2755
+ scheduleHide(event);
2756
+ }
2757
+
2758
+ function onBlurOrFocusOut(event) {
2759
+ if (instance.props.trigger.indexOf('focusin') < 0 && event.target !== getCurrentTarget()) {
2760
+ return;
2761
+ } // If focus was moved to within the popper
2762
+
2763
+
2764
+ if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) {
2765
+ return;
2766
+ }
2767
+
2768
+ scheduleHide(event);
2769
+ }
2770
+
2771
+ function isEventListenerStopped(event) {
2772
+ return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf('touch') >= 0 : false;
2773
+ }
2774
+
2775
+ function createPopperInstance() {
2776
+ destroyPopperInstance();
2777
+ var _instance$props2 = instance.props,
2778
+ popperOptions = _instance$props2.popperOptions,
2779
+ placement = _instance$props2.placement,
2780
+ offset = _instance$props2.offset,
2781
+ getReferenceClientRect = _instance$props2.getReferenceClientRect,
2782
+ moveTransition = _instance$props2.moveTransition;
2783
+ var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null;
2784
+ var computedReference = getReferenceClientRect ? {
2785
+ getBoundingClientRect: getReferenceClientRect,
2786
+ contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
2787
+ } : reference;
2788
+ var tippyModifier = {
2789
+ name: '$$tippy',
2790
+ enabled: true,
2791
+ phase: 'beforeWrite',
2792
+ requires: ['computeStyles'],
2793
+ fn: function fn(_ref2) {
2794
+ var state = _ref2.state;
2795
+
2796
+ if (getIsDefaultRenderFn()) {
2797
+ var _getDefaultTemplateCh = getDefaultTemplateChildren(),
2798
+ box = _getDefaultTemplateCh.box;
2799
+
2800
+ ['placement', 'reference-hidden', 'escaped'].forEach(function (attr) {
2801
+ if (attr === 'placement') {
2802
+ box.setAttribute('data-placement', state.placement);
2803
+ } else {
2804
+ if (state.attributes.popper["data-popper-" + attr]) {
2805
+ box.setAttribute("data-" + attr, '');
2806
+ } else {
2807
+ box.removeAttribute("data-" + attr);
2808
+ }
2809
+ }
2810
+ });
2811
+ state.attributes.popper = {};
2812
+ }
2813
+ }
2814
+ };
2815
+ var modifiers = [{
2816
+ name: 'offset',
2817
+ options: {
2818
+ offset: offset
2819
+ }
2820
+ }, {
2821
+ name: 'preventOverflow',
2822
+ options: {
2823
+ padding: {
2824
+ top: 2,
2825
+ bottom: 2,
2826
+ left: 5,
2827
+ right: 5
2828
+ }
2829
+ }
2830
+ }, {
2831
+ name: 'flip',
2832
+ options: {
2833
+ padding: 5
2834
+ }
2835
+ }, {
2836
+ name: 'computeStyles',
2837
+ options: {
2838
+ adaptive: !moveTransition
2839
+ }
2840
+ }, tippyModifier];
2841
+
2842
+ if (getIsDefaultRenderFn() && arrow) {
2843
+ modifiers.push({
2844
+ name: 'arrow',
2845
+ options: {
2846
+ element: arrow,
2847
+ padding: 3
2848
+ }
2849
+ });
2850
+ }
2851
+
2852
+ modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
2853
+ instance.popperInstance = createPopper(computedReference, popper, Object.assign({}, popperOptions, {
2854
+ placement: placement,
2855
+ onFirstUpdate: onFirstUpdate,
2856
+ modifiers: modifiers
2857
+ }));
2858
+ }
2859
+
2860
+ function destroyPopperInstance() {
2861
+ if (instance.popperInstance) {
2862
+ instance.popperInstance.destroy();
2863
+ instance.popperInstance = null;
2864
+ }
2865
+ }
2866
+
2867
+ function mount() {
2868
+ var appendTo = instance.props.appendTo;
2869
+ var parentNode; // By default, we'll append the popper to the triggerTargets's parentNode so
2870
+ // it's directly after the reference element so the elements inside the
2871
+ // tippy can be tabbed to
2872
+ // If there are clipping issues, the user can specify a different appendTo
2873
+ // and ensure focus management is handled correctly manually
2874
+
2875
+ var node = getCurrentTarget();
2876
+
2877
+ if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') {
2878
+ parentNode = node.parentNode;
2879
+ } else {
2880
+ parentNode = invokeWithArgsOrReturn(appendTo, [node]);
2881
+ } // The popper element needs to exist on the DOM before its position can be
2882
+ // updated as Popper needs to read its dimensions
2883
+
2884
+
2885
+ if (!parentNode.contains(popper)) {
2886
+ parentNode.appendChild(popper);
2887
+ }
2888
+
2889
+ instance.state.isMounted = true;
2890
+ createPopperInstance();
2891
+ }
2892
+
2893
+ function getNestedPopperTree() {
2894
+ return arrayFrom(popper.querySelectorAll('[data-tippy-root]'));
2895
+ }
2896
+
2897
+ function scheduleShow(event) {
2898
+ instance.clearDelayTimeouts();
2899
+
2900
+ if (event) {
2901
+ invokeHook('onTrigger', [instance, event]);
2902
+ }
2903
+
2904
+ addDocumentPress();
2905
+ var delay = getDelay(true);
2906
+
2907
+ var _getNormalizedTouchSe = getNormalizedTouchSettings(),
2908
+ touchValue = _getNormalizedTouchSe[0],
2909
+ touchDelay = _getNormalizedTouchSe[1];
2910
+
2911
+ if (currentInput.isTouch && touchValue === 'hold' && touchDelay) {
2912
+ delay = touchDelay;
2913
+ }
2914
+
2915
+ if (delay) {
2916
+ showTimeout = setTimeout(function () {
2917
+ instance.show();
2918
+ }, delay);
2919
+ } else {
2920
+ instance.show();
2921
+ }
2922
+ }
2923
+
2924
+ function scheduleHide(event) {
2925
+ instance.clearDelayTimeouts();
2926
+ invokeHook('onUntrigger', [instance, event]);
2927
+
2928
+ if (!instance.state.isVisible) {
2929
+ removeDocumentPress();
2930
+ return;
2931
+ } // For interactive tippies, scheduleHide is added to a document.body handler
2932
+ // from onMouseLeave so must intercept scheduled hides from mousemove/leave
2933
+ // events when trigger contains mouseenter and click, and the tip is
2934
+ // currently shown as a result of a click.
2935
+
2936
+
2937
+ if (instance.props.trigger.indexOf('mouseenter') >= 0 && instance.props.trigger.indexOf('click') >= 0 && ['mouseleave', 'mousemove'].indexOf(event.type) >= 0 && isVisibleFromClick) {
2938
+ return;
2939
+ }
2940
+
2941
+ var delay = getDelay(false);
2942
+
2943
+ if (delay) {
2944
+ hideTimeout = setTimeout(function () {
2945
+ if (instance.state.isVisible) {
2946
+ instance.hide();
2947
+ }
2948
+ }, delay);
2949
+ } else {
2950
+ // Fixes a `transitionend` problem when it fires 1 frame too
2951
+ // late sometimes, we don't want hide() to be called.
2952
+ scheduleHideAnimationFrame = requestAnimationFrame(function () {
2953
+ instance.hide();
2954
+ });
2955
+ }
2956
+ } // ===========================================================================
2957
+ // 🔑 Public methods
2958
+ // ===========================================================================
2959
+
2960
+
2961
+ function enable() {
2962
+ instance.state.isEnabled = true;
2963
+ }
2964
+
2965
+ function disable() {
2966
+ // Disabling the instance should also hide it
2967
+ // https://github.com/atomiks/tippy.js-react/issues/106
2968
+ instance.hide();
2969
+ instance.state.isEnabled = false;
2970
+ }
2971
+
2972
+ function clearDelayTimeouts() {
2973
+ clearTimeout(showTimeout);
2974
+ clearTimeout(hideTimeout);
2975
+ cancelAnimationFrame(scheduleHideAnimationFrame);
2976
+ }
2977
+
2978
+ function setProps(partialProps) {
2979
+
2980
+ if (instance.state.isDestroyed) {
2981
+ return;
2982
+ }
2983
+
2984
+ invokeHook('onBeforeUpdate', [instance, partialProps]);
2985
+ removeListeners();
2986
+ var prevProps = instance.props;
2987
+ var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
2988
+ ignoreAttributes: true
2989
+ }));
2990
+ instance.props = nextProps;
2991
+ addListeners();
2992
+
2993
+ if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
2994
+ cleanupInteractiveMouseListeners();
2995
+ debouncedOnMouseMove = debounce$1(onMouseMove, nextProps.interactiveDebounce);
2996
+ } // Ensure stale aria-expanded attributes are removed
2997
+
2998
+
2999
+ if (prevProps.triggerTarget && !nextProps.triggerTarget) {
3000
+ normalizeToArray(prevProps.triggerTarget).forEach(function (node) {
3001
+ node.removeAttribute('aria-expanded');
3002
+ });
3003
+ } else if (nextProps.triggerTarget) {
3004
+ reference.removeAttribute('aria-expanded');
3005
+ }
3006
+
3007
+ handleAriaExpandedAttribute();
3008
+ handleStyles();
3009
+
3010
+ if (onUpdate) {
3011
+ onUpdate(prevProps, nextProps);
3012
+ }
3013
+
3014
+ if (instance.popperInstance) {
3015
+ createPopperInstance(); // Fixes an issue with nested tippies if they are all getting re-rendered,
3016
+ // and the nested ones get re-rendered first.
3017
+ // https://github.com/atomiks/tippyjs-react/issues/177
3018
+ // TODO: find a cleaner / more efficient solution(!)
3019
+
3020
+ getNestedPopperTree().forEach(function (nestedPopper) {
3021
+ // React (and other UI libs likely) requires a rAF wrapper as it flushes
3022
+ // its work in one
3023
+ requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
3024
+ });
3025
+ }
3026
+
3027
+ invokeHook('onAfterUpdate', [instance, partialProps]);
3028
+ }
3029
+
3030
+ function setContent(content) {
3031
+ instance.setProps({
3032
+ content: content
3033
+ });
3034
+ }
3035
+
3036
+ function show() {
3037
+
3038
+
3039
+ var isAlreadyVisible = instance.state.isVisible;
3040
+ var isDestroyed = instance.state.isDestroyed;
3041
+ var isDisabled = !instance.state.isEnabled;
3042
+ var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
3043
+ var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
3044
+
3045
+ if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
3046
+ return;
3047
+ } // Normalize `disabled` behavior across browsers.
3048
+ // Firefox allows events on disabled elements, but Chrome doesn't.
3049
+ // Using a wrapper element (i.e. <span>) is recommended.
3050
+
3051
+
3052
+ if (getCurrentTarget().hasAttribute('disabled')) {
3053
+ return;
3054
+ }
3055
+
3056
+ invokeHook('onShow', [instance], false);
3057
+
3058
+ if (instance.props.onShow(instance) === false) {
3059
+ return;
3060
+ }
3061
+
3062
+ instance.state.isVisible = true;
3063
+
3064
+ if (getIsDefaultRenderFn()) {
3065
+ popper.style.visibility = 'visible';
3066
+ }
3067
+
3068
+ handleStyles();
3069
+ addDocumentPress();
3070
+
3071
+ if (!instance.state.isMounted) {
3072
+ popper.style.transition = 'none';
3073
+ } // If flipping to the opposite side after hiding at least once, the
3074
+ // animation will use the wrong placement without resetting the duration
3075
+
3076
+
3077
+ if (getIsDefaultRenderFn()) {
3078
+ var _getDefaultTemplateCh2 = getDefaultTemplateChildren(),
3079
+ box = _getDefaultTemplateCh2.box,
3080
+ content = _getDefaultTemplateCh2.content;
3081
+
3082
+ setTransitionDuration([box, content], 0);
3083
+ }
3084
+
3085
+ onFirstUpdate = function onFirstUpdate() {
3086
+ var _instance$popperInsta2;
3087
+
3088
+ if (!instance.state.isVisible || ignoreOnFirstUpdate) {
3089
+ return;
3090
+ }
3091
+
3092
+ ignoreOnFirstUpdate = true; // reflow
3093
+
3094
+ void popper.offsetHeight;
3095
+ popper.style.transition = instance.props.moveTransition;
3096
+
3097
+ if (getIsDefaultRenderFn() && instance.props.animation) {
3098
+ var _getDefaultTemplateCh3 = getDefaultTemplateChildren(),
3099
+ _box = _getDefaultTemplateCh3.box,
3100
+ _content = _getDefaultTemplateCh3.content;
3101
+
3102
+ setTransitionDuration([_box, _content], duration);
3103
+ setVisibilityState([_box, _content], 'visible');
3104
+ }
3105
+
3106
+ handleAriaContentAttribute();
3107
+ handleAriaExpandedAttribute();
3108
+ pushIfUnique(mountedInstances, instance); // certain modifiers (e.g. `maxSize`) require a second update after the
3109
+ // popper has been positioned for the first time
3110
+
3111
+ (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
3112
+ invokeHook('onMount', [instance]);
3113
+
3114
+ if (instance.props.animation && getIsDefaultRenderFn()) {
3115
+ onTransitionedIn(duration, function () {
3116
+ instance.state.isShown = true;
3117
+ invokeHook('onShown', [instance]);
3118
+ });
3119
+ }
3120
+ };
3121
+
3122
+ mount();
3123
+ }
3124
+
3125
+ function hide() {
3126
+
3127
+
3128
+ var isAlreadyHidden = !instance.state.isVisible;
3129
+ var isDestroyed = instance.state.isDestroyed;
3130
+ var isDisabled = !instance.state.isEnabled;
3131
+ var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
3132
+
3133
+ if (isAlreadyHidden || isDestroyed || isDisabled) {
3134
+ return;
3135
+ }
3136
+
3137
+ invokeHook('onHide', [instance], false);
3138
+
3139
+ if (instance.props.onHide(instance) === false) {
3140
+ return;
3141
+ }
3142
+
3143
+ instance.state.isVisible = false;
3144
+ instance.state.isShown = false;
3145
+ ignoreOnFirstUpdate = false;
3146
+ isVisibleFromClick = false;
3147
+
3148
+ if (getIsDefaultRenderFn()) {
3149
+ popper.style.visibility = 'hidden';
3150
+ }
3151
+
3152
+ cleanupInteractiveMouseListeners();
3153
+ removeDocumentPress();
3154
+ handleStyles(true);
3155
+
3156
+ if (getIsDefaultRenderFn()) {
3157
+ var _getDefaultTemplateCh4 = getDefaultTemplateChildren(),
3158
+ box = _getDefaultTemplateCh4.box,
3159
+ content = _getDefaultTemplateCh4.content;
3160
+
3161
+ if (instance.props.animation) {
3162
+ setTransitionDuration([box, content], duration);
3163
+ setVisibilityState([box, content], 'hidden');
3164
+ }
3165
+ }
3166
+
3167
+ handleAriaContentAttribute();
3168
+ handleAriaExpandedAttribute();
3169
+
3170
+ if (instance.props.animation) {
3171
+ if (getIsDefaultRenderFn()) {
3172
+ onTransitionedOut(duration, instance.unmount);
3173
+ }
3174
+ } else {
3175
+ instance.unmount();
3176
+ }
3177
+ }
3178
+
3179
+ function hideWithInteractivity(event) {
3180
+
3181
+ getDocument().addEventListener('mousemove', debouncedOnMouseMove);
3182
+ pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
3183
+ debouncedOnMouseMove(event);
3184
+ }
3185
+
3186
+ function unmount() {
3187
+
3188
+ if (instance.state.isVisible) {
3189
+ instance.hide();
3190
+ }
3191
+
3192
+ if (!instance.state.isMounted) {
3193
+ return;
3194
+ }
3195
+
3196
+ destroyPopperInstance(); // If a popper is not interactive, it will be appended outside the popper
3197
+ // tree by default. This seems mainly for interactive tippies, but we should
3198
+ // find a workaround if possible
3199
+
3200
+ getNestedPopperTree().forEach(function (nestedPopper) {
3201
+ nestedPopper._tippy.unmount();
3202
+ });
3203
+
3204
+ if (popper.parentNode) {
3205
+ popper.parentNode.removeChild(popper);
3206
+ }
3207
+
3208
+ mountedInstances = mountedInstances.filter(function (i) {
3209
+ return i !== instance;
3210
+ });
3211
+ instance.state.isMounted = false;
3212
+ invokeHook('onHidden', [instance]);
3213
+ }
3214
+
3215
+ function destroy() {
3216
+
3217
+ if (instance.state.isDestroyed) {
3218
+ return;
3219
+ }
3220
+
3221
+ instance.clearDelayTimeouts();
3222
+ instance.unmount();
3223
+ removeListeners();
3224
+ delete reference._tippy;
3225
+ instance.state.isDestroyed = true;
3226
+ invokeHook('onDestroy', [instance]);
3227
+ }
3228
+ }
3229
+
3230
+ function tippy(targets, optionalProps) {
3231
+ if (optionalProps === void 0) {
3232
+ optionalProps = {};
3233
+ }
3234
+
3235
+ var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
3236
+
3237
+ bindGlobalEventListeners();
3238
+ var passedProps = Object.assign({}, optionalProps, {
3239
+ plugins: plugins
3240
+ });
3241
+ var elements = getArrayOfElements(targets);
3242
+
3243
+ var instances = elements.reduce(function (acc, reference) {
3244
+ var instance = reference && createTippy(reference, passedProps);
3245
+
3246
+ if (instance) {
3247
+ acc.push(instance);
3248
+ }
3249
+
3250
+ return acc;
3251
+ }, []);
3252
+ return isElement$1(targets) ? instances[0] : instances;
3253
+ }
3254
+
3255
+ tippy.defaultProps = defaultProps;
3256
+ tippy.setDefaultProps = setDefaultProps;
3257
+ tippy.currentInput = currentInput;
3258
+ var hideAll = function hideAll(_temp) {
3259
+ var _ref = _temp === void 0 ? {} : _temp,
3260
+ excludedReferenceOrInstance = _ref.exclude,
3261
+ duration = _ref.duration;
3262
+
3263
+ mountedInstances.forEach(function (instance) {
3264
+ var isExcluded = false;
3265
+
3266
+ if (excludedReferenceOrInstance) {
3267
+ isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper;
3268
+ }
3269
+
3270
+ if (!isExcluded) {
3271
+ var originalDuration = instance.props.duration;
3272
+ instance.setProps({
3273
+ duration: duration
3274
+ });
3275
+ instance.hide();
3276
+
3277
+ if (!instance.state.isDestroyed) {
3278
+ instance.setProps({
3279
+ duration: originalDuration
3280
+ });
3281
+ }
3282
+ }
3283
+ });
3284
+ };
3285
+
3286
+ // every time the popper is destroyed (i.e. a new target), removing the styles
3287
+ // and causing transitions to break for singletons when the console is open, but
3288
+ // most notably for non-transform styles being used, `gpuAcceleration: false`.
3289
+
3290
+ var applyStylesModifier = Object.assign({}, applyStyles$1, {
3291
+ effect: function effect(_ref) {
3292
+ var state = _ref.state;
3293
+ var initialStyles = {
3294
+ popper: {
3295
+ position: state.options.strategy,
3296
+ left: '0',
3297
+ top: '0',
3298
+ margin: '0'
3299
+ },
3300
+ arrow: {
3301
+ position: 'absolute'
3302
+ },
3303
+ reference: {}
3304
+ };
3305
+ Object.assign(state.elements.popper.style, initialStyles.popper);
3306
+ state.styles = initialStyles;
3307
+
3308
+ if (state.elements.arrow) {
3309
+ Object.assign(state.elements.arrow.style, initialStyles.arrow);
3310
+ } // intentionally return no cleanup function
3311
+ // return () => { ... }
3312
+
3313
+ }
3314
+ });
3315
+
3316
+ var createSingleton = function createSingleton(tippyInstances, optionalProps) {
3317
+ var _optionalProps$popper;
3318
+
3319
+ if (optionalProps === void 0) {
3320
+ optionalProps = {};
3321
+ }
3322
+
3323
+ var individualInstances = tippyInstances;
3324
+ var references = [];
3325
+ var triggerTargets = [];
3326
+ var currentTarget;
3327
+ var overrides = optionalProps.overrides;
3328
+ var interceptSetPropsCleanups = [];
3329
+ var shownOnCreate = false;
3330
+
3331
+ function setTriggerTargets() {
3332
+ triggerTargets = individualInstances.map(function (instance) {
3333
+ return normalizeToArray(instance.props.triggerTarget || instance.reference);
3334
+ }).reduce(function (acc, item) {
3335
+ return acc.concat(item);
3336
+ }, []);
3337
+ }
3338
+
3339
+ function setReferences() {
3340
+ references = individualInstances.map(function (instance) {
3341
+ return instance.reference;
3342
+ });
3343
+ }
3344
+
3345
+ function enableInstances(isEnabled) {
3346
+ individualInstances.forEach(function (instance) {
3347
+ if (isEnabled) {
3348
+ instance.enable();
3349
+ } else {
3350
+ instance.disable();
3351
+ }
3352
+ });
3353
+ }
3354
+
3355
+ function interceptSetProps(singleton) {
3356
+ return individualInstances.map(function (instance) {
3357
+ var originalSetProps = instance.setProps;
3358
+
3359
+ instance.setProps = function (props) {
3360
+ originalSetProps(props);
3361
+
3362
+ if (instance.reference === currentTarget) {
3363
+ singleton.setProps(props);
3364
+ }
3365
+ };
3366
+
3367
+ return function () {
3368
+ instance.setProps = originalSetProps;
3369
+ };
3370
+ });
3371
+ } // have to pass singleton, as it maybe undefined on first call
3372
+
3373
+
3374
+ function prepareInstance(singleton, target) {
3375
+ var index = triggerTargets.indexOf(target); // bail-out
3376
+
3377
+ if (target === currentTarget) {
3378
+ return;
3379
+ }
3380
+
3381
+ currentTarget = target;
3382
+ var overrideProps = (overrides || []).concat('content').reduce(function (acc, prop) {
3383
+ acc[prop] = individualInstances[index].props[prop];
3384
+ return acc;
3385
+ }, {});
3386
+ singleton.setProps(Object.assign({}, overrideProps, {
3387
+ getReferenceClientRect: typeof overrideProps.getReferenceClientRect === 'function' ? overrideProps.getReferenceClientRect : function () {
3388
+ var _references$index;
3389
+
3390
+ return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
3391
+ }
3392
+ }));
3393
+ }
3394
+
3395
+ enableInstances(false);
3396
+ setReferences();
3397
+ setTriggerTargets();
3398
+ var plugin = {
3399
+ fn: function fn() {
3400
+ return {
3401
+ onDestroy: function onDestroy() {
3402
+ enableInstances(true);
3403
+ },
3404
+ onHidden: function onHidden() {
3405
+ currentTarget = null;
3406
+ },
3407
+ onClickOutside: function onClickOutside(instance) {
3408
+ if (instance.props.showOnCreate && !shownOnCreate) {
3409
+ shownOnCreate = true;
3410
+ currentTarget = null;
3411
+ }
3412
+ },
3413
+ onShow: function onShow(instance) {
3414
+ if (instance.props.showOnCreate && !shownOnCreate) {
3415
+ shownOnCreate = true;
3416
+ prepareInstance(instance, references[0]);
3417
+ }
3418
+ },
3419
+ onTrigger: function onTrigger(instance, event) {
3420
+ prepareInstance(instance, event.currentTarget);
3421
+ }
3422
+ };
3423
+ }
3424
+ };
3425
+ var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ['overrides']), {
3426
+ plugins: [plugin].concat(optionalProps.plugins || []),
3427
+ triggerTarget: triggerTargets,
3428
+ popperOptions: Object.assign({}, optionalProps.popperOptions, {
3429
+ modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
3430
+ })
3431
+ }));
3432
+ var originalShow = singleton.show;
3433
+
3434
+ singleton.show = function (target) {
3435
+ originalShow(); // first time, showOnCreate or programmatic call with no params
3436
+ // default to showing first instance
3437
+
3438
+ if (!currentTarget && target == null) {
3439
+ return prepareInstance(singleton, references[0]);
3440
+ } // triggered from event (do nothing as prepareInstance already called by onTrigger)
3441
+ // programmatic call with no params when already visible (do nothing again)
3442
+
3443
+
3444
+ if (currentTarget && target == null) {
3445
+ return;
3446
+ } // target is index of instance
3447
+
3448
+
3449
+ if (typeof target === 'number') {
3450
+ return references[target] && prepareInstance(singleton, references[target]);
3451
+ } // target is a child tippy instance
3452
+
3453
+
3454
+ if (individualInstances.indexOf(target) >= 0) {
3455
+ var ref = target.reference;
3456
+ return prepareInstance(singleton, ref);
3457
+ } // target is a ReferenceElement
3458
+
3459
+
3460
+ if (references.indexOf(target) >= 0) {
3461
+ return prepareInstance(singleton, target);
3462
+ }
3463
+ };
3464
+
3465
+ singleton.showNext = function () {
3466
+ var first = references[0];
3467
+
3468
+ if (!currentTarget) {
3469
+ return singleton.show(0);
3470
+ }
3471
+
3472
+ var index = references.indexOf(currentTarget);
3473
+ singleton.show(references[index + 1] || first);
3474
+ };
3475
+
3476
+ singleton.showPrevious = function () {
3477
+ var last = references[references.length - 1];
3478
+
3479
+ if (!currentTarget) {
3480
+ return singleton.show(last);
3481
+ }
3482
+
3483
+ var index = references.indexOf(currentTarget);
3484
+ var target = references[index - 1] || last;
3485
+ singleton.show(target);
3486
+ };
3487
+
3488
+ var originalSetProps = singleton.setProps;
3489
+
3490
+ singleton.setProps = function (props) {
3491
+ overrides = props.overrides || overrides;
3492
+ originalSetProps(props);
3493
+ };
3494
+
3495
+ singleton.setInstances = function (nextInstances) {
3496
+ enableInstances(true);
3497
+ interceptSetPropsCleanups.forEach(function (fn) {
3498
+ return fn();
3499
+ });
3500
+ individualInstances = nextInstances;
3501
+ enableInstances(false);
3502
+ setReferences();
3503
+ setTriggerTargets();
3504
+ interceptSetPropsCleanups = interceptSetProps(singleton);
3505
+ singleton.setProps({
3506
+ triggerTarget: triggerTargets
3507
+ });
3508
+ };
3509
+
3510
+ interceptSetPropsCleanups = interceptSetProps(singleton);
3511
+ return singleton;
3512
+ };
3513
+
3514
+ var animateFill = {
3515
+ name: 'animateFill',
3516
+ defaultValue: false,
3517
+ fn: function fn(instance) {
3518
+ var _instance$props$rende;
3519
+
3520
+ // @ts-ignore
3521
+ if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
3522
+
3523
+ return {};
3524
+ }
3525
+
3526
+ var _getChildren = getChildren(instance.popper),
3527
+ box = _getChildren.box,
3528
+ content = _getChildren.content;
3529
+
3530
+ var backdrop = instance.props.animateFill ? createBackdropElement() : null;
3531
+ return {
3532
+ onCreate: function onCreate() {
3533
+ if (backdrop) {
3534
+ box.insertBefore(backdrop, box.firstElementChild);
3535
+ box.setAttribute('data-animatefill', '');
3536
+ box.style.overflow = 'hidden';
3537
+ instance.setProps({
3538
+ arrow: false,
3539
+ animation: 'shift-away'
3540
+ });
3541
+ }
3542
+ },
3543
+ onMount: function onMount() {
3544
+ if (backdrop) {
3545
+ var transitionDuration = box.style.transitionDuration;
3546
+ var duration = Number(transitionDuration.replace('ms', '')); // The content should fade in after the backdrop has mostly filled the
3547
+ // tooltip element. `clip-path` is the other alternative but is not
3548
+ // well-supported and is buggy on some devices.
3549
+
3550
+ content.style.transitionDelay = Math.round(duration / 10) + "ms";
3551
+ backdrop.style.transitionDuration = transitionDuration;
3552
+ setVisibilityState([backdrop], 'visible');
3553
+ }
3554
+ },
3555
+ onShow: function onShow() {
3556
+ if (backdrop) {
3557
+ backdrop.style.transitionDuration = '0ms';
3558
+ }
3559
+ },
3560
+ onHide: function onHide() {
3561
+ if (backdrop) {
3562
+ setVisibilityState([backdrop], 'hidden');
3563
+ }
3564
+ }
3565
+ };
3566
+ }
3567
+ };
3568
+
3569
+ function createBackdropElement() {
3570
+ var backdrop = div();
3571
+ backdrop.className = BACKDROP_CLASS;
3572
+ setVisibilityState([backdrop], 'hidden');
3573
+ return backdrop;
3574
+ }
3575
+
3576
+ var mouseCoords = {
3577
+ clientX: 0,
3578
+ clientY: 0
3579
+ };
3580
+ var activeInstances = [];
3581
+
3582
+ function storeMouseCoords(_ref) {
3583
+ var clientX = _ref.clientX,
3584
+ clientY = _ref.clientY;
3585
+ mouseCoords = {
3586
+ clientX: clientX,
3587
+ clientY: clientY
3588
+ };
3589
+ }
3590
+
3591
+ function addMouseCoordsListener(doc) {
3592
+ doc.addEventListener('mousemove', storeMouseCoords);
3593
+ }
3594
+
3595
+ function removeMouseCoordsListener(doc) {
3596
+ doc.removeEventListener('mousemove', storeMouseCoords);
3597
+ }
3598
+
3599
+ var followCursor = {
3600
+ name: 'followCursor',
3601
+ defaultValue: false,
3602
+ fn: function fn(instance) {
3603
+ var reference = instance.reference;
3604
+ var doc = getOwnerDocument(instance.props.triggerTarget || reference);
3605
+ var isInternalUpdate = false;
3606
+ var wasFocusEvent = false;
3607
+ var isUnmounted = true;
3608
+ var prevProps = instance.props;
3609
+
3610
+ function getIsInitialBehavior() {
3611
+ return instance.props.followCursor === 'initial' && instance.state.isVisible;
3612
+ }
3613
+
3614
+ function addListener() {
3615
+ doc.addEventListener('mousemove', onMouseMove);
3616
+ }
3617
+
3618
+ function removeListener() {
3619
+ doc.removeEventListener('mousemove', onMouseMove);
3620
+ }
3621
+
3622
+ function unsetGetReferenceClientRect() {
3623
+ isInternalUpdate = true;
3624
+ instance.setProps({
3625
+ getReferenceClientRect: null
3626
+ });
3627
+ isInternalUpdate = false;
3628
+ }
3629
+
3630
+ function onMouseMove(event) {
3631
+ // If the instance is interactive, avoid updating the position unless it's
3632
+ // over the reference element
3633
+ var isCursorOverReference = event.target ? reference.contains(event.target) : true;
3634
+ var followCursor = instance.props.followCursor;
3635
+ var clientX = event.clientX,
3636
+ clientY = event.clientY;
3637
+ var rect = reference.getBoundingClientRect();
3638
+ var relativeX = clientX - rect.left;
3639
+ var relativeY = clientY - rect.top;
3640
+
3641
+ if (isCursorOverReference || !instance.props.interactive) {
3642
+ instance.setProps({
3643
+ // @ts-ignore - unneeded DOMRect properties
3644
+ getReferenceClientRect: function getReferenceClientRect() {
3645
+ var rect = reference.getBoundingClientRect();
3646
+ var x = clientX;
3647
+ var y = clientY;
3648
+
3649
+ if (followCursor === 'initial') {
3650
+ x = rect.left + relativeX;
3651
+ y = rect.top + relativeY;
3652
+ }
3653
+
3654
+ var top = followCursor === 'horizontal' ? rect.top : y;
3655
+ var right = followCursor === 'vertical' ? rect.right : x;
3656
+ var bottom = followCursor === 'horizontal' ? rect.bottom : y;
3657
+ var left = followCursor === 'vertical' ? rect.left : x;
3658
+ return {
3659
+ width: right - left,
3660
+ height: bottom - top,
3661
+ top: top,
3662
+ right: right,
3663
+ bottom: bottom,
3664
+ left: left
3665
+ };
3666
+ }
3667
+ });
3668
+ }
3669
+ }
3670
+
3671
+ function create() {
3672
+ if (instance.props.followCursor) {
3673
+ activeInstances.push({
3674
+ instance: instance,
3675
+ doc: doc
3676
+ });
3677
+ addMouseCoordsListener(doc);
3678
+ }
3679
+ }
3680
+
3681
+ function destroy() {
3682
+ activeInstances = activeInstances.filter(function (data) {
3683
+ return data.instance !== instance;
3684
+ });
3685
+
3686
+ if (activeInstances.filter(function (data) {
3687
+ return data.doc === doc;
3688
+ }).length === 0) {
3689
+ removeMouseCoordsListener(doc);
3690
+ }
3691
+ }
3692
+
3693
+ return {
3694
+ onCreate: create,
3695
+ onDestroy: destroy,
3696
+ onBeforeUpdate: function onBeforeUpdate() {
3697
+ prevProps = instance.props;
3698
+ },
3699
+ onAfterUpdate: function onAfterUpdate(_, _ref2) {
3700
+ var followCursor = _ref2.followCursor;
3701
+
3702
+ if (isInternalUpdate) {
3703
+ return;
3704
+ }
3705
+
3706
+ if (followCursor !== undefined && prevProps.followCursor !== followCursor) {
3707
+ destroy();
3708
+
3709
+ if (followCursor) {
3710
+ create();
3711
+
3712
+ if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {
3713
+ addListener();
3714
+ }
3715
+ } else {
3716
+ removeListener();
3717
+ unsetGetReferenceClientRect();
3718
+ }
3719
+ }
3720
+ },
3721
+ onMount: function onMount() {
3722
+ if (instance.props.followCursor && !wasFocusEvent) {
3723
+ if (isUnmounted) {
3724
+ onMouseMove(mouseCoords);
3725
+ isUnmounted = false;
3726
+ }
3727
+
3728
+ if (!getIsInitialBehavior()) {
3729
+ addListener();
3730
+ }
3731
+ }
3732
+ },
3733
+ onTrigger: function onTrigger(_, event) {
3734
+ if (isMouseEvent(event)) {
3735
+ mouseCoords = {
3736
+ clientX: event.clientX,
3737
+ clientY: event.clientY
3738
+ };
3739
+ }
3740
+
3741
+ wasFocusEvent = event.type === 'focus';
3742
+ },
3743
+ onHidden: function onHidden() {
3744
+ if (instance.props.followCursor) {
3745
+ unsetGetReferenceClientRect();
3746
+ removeListener();
3747
+ isUnmounted = true;
3748
+ }
3749
+ }
3750
+ };
3751
+ }
3752
+ };
3753
+
3754
+ function getProps(props, modifier) {
3755
+ var _props$popperOptions;
3756
+
3757
+ return {
3758
+ popperOptions: Object.assign({}, props.popperOptions, {
3759
+ modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function (_ref) {
3760
+ var name = _ref.name;
3761
+ return name !== modifier.name;
3762
+ }), [modifier])
3763
+ })
3764
+ };
3765
+ }
3766
+
3767
+ var inlinePositioning = {
3768
+ name: 'inlinePositioning',
3769
+ defaultValue: false,
3770
+ fn: function fn(instance) {
3771
+ var reference = instance.reference;
3772
+
3773
+ function isEnabled() {
3774
+ return !!instance.props.inlinePositioning;
3775
+ }
3776
+
3777
+ var placement;
3778
+ var cursorRectIndex = -1;
3779
+ var isInternalUpdate = false;
3780
+ var triedPlacements = [];
3781
+ var modifier = {
3782
+ name: 'tippyInlinePositioning',
3783
+ enabled: true,
3784
+ phase: 'afterWrite',
3785
+ fn: function fn(_ref2) {
3786
+ var state = _ref2.state;
3787
+
3788
+ if (isEnabled()) {
3789
+ if (triedPlacements.indexOf(state.placement) !== -1) {
3790
+ triedPlacements = [];
3791
+ }
3792
+
3793
+ if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
3794
+ triedPlacements.push(state.placement);
3795
+ instance.setProps({
3796
+ // @ts-ignore - unneeded DOMRect properties
3797
+ getReferenceClientRect: function getReferenceClientRect() {
3798
+ return _getReferenceClientRect(state.placement);
3799
+ }
3800
+ });
3801
+ }
3802
+
3803
+ placement = state.placement;
3804
+ }
3805
+ }
3806
+ };
3807
+
3808
+ function _getReferenceClientRect(placement) {
3809
+ return getInlineBoundingClientRect(getBasePlacement$1(placement), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex);
3810
+ }
3811
+
3812
+ function setInternalProps(partialProps) {
3813
+ isInternalUpdate = true;
3814
+ instance.setProps(partialProps);
3815
+ isInternalUpdate = false;
3816
+ }
3817
+
3818
+ function addModifier() {
3819
+ if (!isInternalUpdate) {
3820
+ setInternalProps(getProps(instance.props, modifier));
3821
+ }
3822
+ }
3823
+
3824
+ return {
3825
+ onCreate: addModifier,
3826
+ onAfterUpdate: addModifier,
3827
+ onTrigger: function onTrigger(_, event) {
3828
+ if (isMouseEvent(event)) {
3829
+ var rects = arrayFrom(instance.reference.getClientRects());
3830
+ var cursorRect = rects.find(function (rect) {
3831
+ return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;
3832
+ });
3833
+ var index = rects.indexOf(cursorRect);
3834
+ cursorRectIndex = index > -1 ? index : cursorRectIndex;
3835
+ }
3836
+ },
3837
+ onHidden: function onHidden() {
3838
+ cursorRectIndex = -1;
3839
+ }
3840
+ };
3841
+ }
3842
+ };
3843
+ function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) {
3844
+ // Not an inline element, or placement is not yet known
3845
+ if (clientRects.length < 2 || currentBasePlacement === null) {
3846
+ return boundingRect;
3847
+ } // There are two rects and they are disjoined
3848
+
3849
+
3850
+ if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) {
3851
+ return clientRects[cursorRectIndex] || boundingRect;
3852
+ }
3853
+
3854
+ switch (currentBasePlacement) {
3855
+ case 'top':
3856
+ case 'bottom':
3857
+ {
3858
+ var firstRect = clientRects[0];
3859
+ var lastRect = clientRects[clientRects.length - 1];
3860
+ var isTop = currentBasePlacement === 'top';
3861
+ var top = firstRect.top;
3862
+ var bottom = lastRect.bottom;
3863
+ var left = isTop ? firstRect.left : lastRect.left;
3864
+ var right = isTop ? firstRect.right : lastRect.right;
3865
+ var width = right - left;
3866
+ var height = bottom - top;
3867
+ return {
3868
+ top: top,
3869
+ bottom: bottom,
3870
+ left: left,
3871
+ right: right,
3872
+ width: width,
3873
+ height: height
3874
+ };
3875
+ }
3876
+
3877
+ case 'left':
3878
+ case 'right':
3879
+ {
3880
+ var minLeft = Math.min.apply(Math, clientRects.map(function (rects) {
3881
+ return rects.left;
3882
+ }));
3883
+ var maxRight = Math.max.apply(Math, clientRects.map(function (rects) {
3884
+ return rects.right;
3885
+ }));
3886
+ var measureRects = clientRects.filter(function (rect) {
3887
+ return currentBasePlacement === 'left' ? rect.left === minLeft : rect.right === maxRight;
3888
+ });
3889
+ var _top = measureRects[0].top;
3890
+ var _bottom = measureRects[measureRects.length - 1].bottom;
3891
+ var _left = minLeft;
3892
+ var _right = maxRight;
3893
+
3894
+ var _width = _right - _left;
3895
+
3896
+ var _height = _bottom - _top;
3897
+
3898
+ return {
3899
+ top: _top,
3900
+ bottom: _bottom,
3901
+ left: _left,
3902
+ right: _right,
3903
+ width: _width,
3904
+ height: _height
3905
+ };
3906
+ }
3907
+
3908
+ default:
3909
+ {
3910
+ return boundingRect;
3911
+ }
3912
+ }
3913
+ }
3914
+
3915
+ var sticky = {
3916
+ name: 'sticky',
3917
+ defaultValue: false,
3918
+ fn: function fn(instance) {
3919
+ var reference = instance.reference,
3920
+ popper = instance.popper;
3921
+
3922
+ function getReference() {
3923
+ return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference;
3924
+ }
3925
+
3926
+ function shouldCheck(value) {
3927
+ return instance.props.sticky === true || instance.props.sticky === value;
3928
+ }
3929
+
3930
+ var prevRefRect = null;
3931
+ var prevPopRect = null;
3932
+
3933
+ function updatePosition() {
3934
+ var currentRefRect = shouldCheck('reference') ? getReference().getBoundingClientRect() : null;
3935
+ var currentPopRect = shouldCheck('popper') ? popper.getBoundingClientRect() : null;
3936
+
3937
+ if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {
3938
+ if (instance.popperInstance) {
3939
+ instance.popperInstance.update();
3940
+ }
3941
+ }
3942
+
3943
+ prevRefRect = currentRefRect;
3944
+ prevPopRect = currentPopRect;
3945
+
3946
+ if (instance.state.isMounted) {
3947
+ requestAnimationFrame(updatePosition);
3948
+ }
3949
+ }
3950
+
3951
+ return {
3952
+ onMount: function onMount() {
3953
+ if (instance.props.sticky) {
3954
+ updatePosition();
3955
+ }
3956
+ }
3957
+ };
3958
+ }
3959
+ };
3960
+
3961
+ function areRectsDifferent(rectA, rectB) {
3962
+ if (rectA && rectB) {
3963
+ return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;
3964
+ }
3965
+
3966
+ return true;
3967
+ }
3968
+
3969
+ tippy.setDefaultProps({
3970
+ render: render
3971
+ });
3972
+
3973
+ tippy.setDefaultProps({
3974
+ //@ts-ignore
3975
+ onShow: instance => {
3976
+ if (!instance.props.content)
3977
+ return false;
3978
+ },
3979
+ });
3980
+ const isComponentInstance = (value) => {
3981
+ return value instanceof Object && '$' in value && '$el' in value;
3982
+ };
3983
+ function useTippy(el, opts = {}, settings = { mount: true, appName: 'Tippy' }) {
3984
+ settings = Object.assign({ mount: true, appName: 'Tippy' }, settings);
3985
+ const vm = vue.getCurrentInstance();
3986
+ const instance = vue.ref();
3987
+ const state = vue.ref({
3988
+ isEnabled: false,
3989
+ isVisible: false,
3990
+ isDestroyed: false,
3991
+ isMounted: false,
3992
+ isShown: false,
3993
+ });
3994
+ const headlessApp = vue.shallowRef();
3995
+ let container = null;
3996
+ const getContainer = () => {
3997
+ if (container)
3998
+ return container;
3999
+ container = document.createDocumentFragment();
4000
+ return container;
4001
+ };
4002
+ const getContent = (content) => {
4003
+ let newContent;
4004
+ let unwrappedContent = vue.isRef(content)
4005
+ ? content.value
4006
+ : content;
4007
+ if (vue.isVNode(unwrappedContent)) {
4008
+ if (!headlessApp.value) {
4009
+ headlessApp.value = vue.createApp({
4010
+ name: settings.appName,
4011
+ setup: () => {
4012
+ return () => vue.isRef(content) ? content.value : content;
4013
+ },
4014
+ });
4015
+ if (vm) {
4016
+ Object.assign(headlessApp.value._context, vm.appContext);
4017
+ }
4018
+ headlessApp.value.mount(getContainer());
4019
+ }
4020
+ newContent = () => getContainer();
4021
+ }
4022
+ else if (typeof unwrappedContent === 'object') {
4023
+ if (!headlessApp.value) {
4024
+ headlessApp.value = vue.createApp({
4025
+ name: settings.appName,
4026
+ setup: () => {
4027
+ return () => vue.h(vue.isRef(content) ? content.value : content);
4028
+ },
4029
+ });
4030
+ if (vm) {
4031
+ Object.assign(headlessApp.value._context, vm.appContext);
4032
+ }
4033
+ headlessApp.value.mount(getContainer());
4034
+ }
4035
+ newContent = () => getContainer();
4036
+ }
4037
+ else {
4038
+ newContent = unwrappedContent;
4039
+ }
4040
+ return newContent;
4041
+ };
4042
+ const getProps = (opts) => {
4043
+ let options = {};
4044
+ if (vue.isRef(opts)) {
4045
+ options = opts.value || {};
4046
+ }
4047
+ else if (vue.isReactive(opts)) {
4048
+ options = { ...opts };
4049
+ }
4050
+ else {
4051
+ options = { ...opts };
4052
+ }
4053
+ if (options.content) {
4054
+ options.content = getContent(options.content);
4055
+ }
4056
+ if (options.triggerTarget) {
4057
+ options.triggerTarget = vue.isRef(options.triggerTarget)
4058
+ ? options.triggerTarget.value
4059
+ : options.triggerTarget;
4060
+ }
4061
+ if (!options.plugins || !Array.isArray(options.plugins)) {
4062
+ options.plugins = [];
4063
+ }
4064
+ options.plugins = options.plugins.filter((plugin) => plugin.name !== 'vueTippyReactiveState');
4065
+ options.plugins.push({
4066
+ name: 'vueTippyReactiveState',
4067
+ fn: () => {
4068
+ return {
4069
+ onCreate() {
4070
+ state.value.isEnabled = true;
4071
+ },
4072
+ onMount() {
4073
+ state.value.isMounted = true;
4074
+ },
4075
+ onShow() {
4076
+ state.value.isMounted = true;
4077
+ state.value.isVisible = true;
4078
+ },
4079
+ onShown() {
4080
+ state.value.isShown = true;
4081
+ },
4082
+ onHide() {
4083
+ state.value.isMounted = false;
4084
+ state.value.isVisible = false;
4085
+ },
4086
+ onHidden() {
4087
+ state.value.isShown = false;
4088
+ },
4089
+ onUnmounted() {
4090
+ state.value.isMounted = false;
4091
+ },
4092
+ onDestroy() {
4093
+ state.value.isDestroyed = true;
4094
+ },
4095
+ };
4096
+ }
4097
+ });
4098
+ return options;
4099
+ };
4100
+ const refresh = () => {
4101
+ if (!instance.value)
4102
+ return;
4103
+ instance.value.setProps(getProps(opts));
4104
+ };
4105
+ const refreshContent = () => {
4106
+ if (!instance.value || !opts.content)
4107
+ return;
4108
+ instance.value.setContent(getContent(opts.content));
4109
+ };
4110
+ const setContent = (value) => {
4111
+ var _a;
4112
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.setContent(getContent(value));
4113
+ };
4114
+ const setProps = (value) => {
4115
+ var _a;
4116
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.setProps(getProps(value));
4117
+ };
4118
+ const destroy = () => {
4119
+ var _a;
4120
+ if (instance.value) {
4121
+ instance.value.destroy();
4122
+ instance.value = undefined;
4123
+ }
4124
+ container = null;
4125
+ (_a = headlessApp.value) === null || _a === void 0 ? void 0 : _a.unmount();
4126
+ headlessApp.value = undefined;
4127
+ };
4128
+ const show = () => {
4129
+ var _a;
4130
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.show();
4131
+ };
4132
+ const hide = () => {
4133
+ var _a;
4134
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.hide();
4135
+ };
4136
+ const disable = () => {
4137
+ var _a;
4138
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.disable();
4139
+ state.value.isEnabled = false;
4140
+ };
4141
+ const enable = () => {
4142
+ var _a;
4143
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.enable();
4144
+ state.value.isEnabled = true;
4145
+ };
4146
+ const unmount = () => {
4147
+ var _a;
4148
+ (_a = instance.value) === null || _a === void 0 ? void 0 : _a.unmount();
4149
+ };
4150
+ const mount = () => {
4151
+ if (!el)
4152
+ return;
4153
+ let target = vue.isRef(el) ? el.value : el;
4154
+ if (typeof target === 'function')
4155
+ target = target();
4156
+ if (isComponentInstance(target)) {
4157
+ target = target.$el;
4158
+ }
4159
+ if (target) {
4160
+ //@ts-ignore
4161
+ instance.value = tippy(target, getProps(opts));
4162
+ //@ts-ignore
4163
+ target.$tippy = response;
4164
+ }
4165
+ };
4166
+ const response = {
4167
+ tippy: instance,
4168
+ refresh,
4169
+ refreshContent,
4170
+ setContent,
4171
+ setProps,
4172
+ destroy,
4173
+ hide,
4174
+ show,
4175
+ disable,
4176
+ enable,
4177
+ unmount,
4178
+ mount,
4179
+ state,
4180
+ };
4181
+ if (settings.mount) {
4182
+ if (vm) {
4183
+ if (vm.isMounted) {
4184
+ mount();
4185
+ }
4186
+ else {
4187
+ vue.onMounted(mount);
4188
+ }
4189
+ }
4190
+ else {
4191
+ mount();
4192
+ }
4193
+ }
4194
+ if (vm) {
4195
+ vue.onUnmounted(() => {
4196
+ destroy();
4197
+ });
4198
+ }
4199
+ if (vue.isRef(opts) || vue.isReactive(opts)) {
4200
+ vue.watch(opts, refresh, { immediate: false });
4201
+ }
4202
+ else if (vue.isRef(opts.content)) {
4203
+ vue.watch(opts.content, refreshContent, { immediate: false });
4204
+ }
4205
+ return response;
4206
+ }
4207
+
4208
+ function useTippyComponent(opts = {}, children) {
4209
+ const instance = vue.ref();
4210
+ return {
4211
+ instance,
4212
+ TippyComponent: vue.h(TippyComponent, {
4213
+ ...opts,
4214
+ onVnodeMounted: (vnode) => {
4215
+ //@ts-ignore
4216
+ instance.value = vnode.component.ctx;
4217
+ },
4218
+ }, children),
4219
+ };
4220
+ }
4221
+
4222
+ function useSingleton(instances, optionalProps) {
4223
+ const singleton = vue.ref();
4224
+ vue.onMounted(() => {
4225
+ const pendingTippyInstances = Array.isArray(instances)
4226
+ ? instances.map(i => i.value)
4227
+ : typeof instances === 'function'
4228
+ ? instances()
4229
+ : instances.value;
4230
+ const tippyInstances = pendingTippyInstances
4231
+ .map((instance) => {
4232
+ if (instance instanceof Element) {
4233
+ //@ts-ignore
4234
+ return instance._tippy;
4235
+ }
4236
+ return instance;
4237
+ })
4238
+ .filter(Boolean);
4239
+ singleton.value = createSingleton(tippyInstances, optionalProps
4240
+ ? { allowHTML: true, ...optionalProps }
4241
+ : { allowHTML: true });
4242
+ });
4243
+ return {
4244
+ singleton,
4245
+ };
4246
+ }
4247
+
4248
+ function toValue(r) {
4249
+ return typeof r === 'function'
4250
+ ? r()
4251
+ : vue.unref(r);
4252
+ }
4253
+ function unrefElement(elRef) {
4254
+ var _a, _b;
4255
+ const plain = toValue(elRef);
4256
+ return (_b = (_a = plain) === null || _a === void 0 ? void 0 : _a.$el) !== null && _b !== void 0 ? _b : plain;
4257
+ }
4258
+ const TippyComponent = vue.defineComponent({
4259
+ props: {
4260
+ to: {
4261
+ type: [String, Function],
4262
+ },
4263
+ tag: {
4264
+ type: [String, Object],
4265
+ default: 'span'
4266
+ },
4267
+ contentTag: {
4268
+ type: [String, Object],
4269
+ default: 'span'
4270
+ },
4271
+ contentClass: {
4272
+ type: String,
4273
+ default: null
4274
+ },
4275
+ appendTo: { default: () => tippy.defaultProps['appendTo'] },
4276
+ aria: { default: () => tippy.defaultProps['aria'] },
4277
+ delay: { default: () => tippy.defaultProps['delay'] },
4278
+ duration: { default: () => tippy.defaultProps['duration'] },
4279
+ getReferenceClientRect: { default: () => tippy.defaultProps['getReferenceClientRect'] },
4280
+ hideOnClick: { type: [Boolean, String], default: () => tippy.defaultProps['hideOnClick'] },
4281
+ ignoreAttributes: { type: Boolean, default: () => tippy.defaultProps['ignoreAttributes'] },
4282
+ interactive: { type: Boolean, default: () => tippy.defaultProps['interactive'] },
4283
+ interactiveBorder: { default: () => tippy.defaultProps['interactiveBorder'] },
4284
+ interactiveDebounce: { default: () => tippy.defaultProps['interactiveDebounce'] },
4285
+ moveTransition: { default: () => tippy.defaultProps['moveTransition'] },
4286
+ offset: { default: () => tippy.defaultProps['offset'] },
4287
+ onAfterUpdate: { default: () => tippy.defaultProps['onAfterUpdate'] },
4288
+ onBeforeUpdate: { default: () => tippy.defaultProps['onBeforeUpdate'] },
4289
+ onCreate: { default: () => tippy.defaultProps['onCreate'] },
4290
+ onDestroy: { default: () => tippy.defaultProps['onDestroy'] },
4291
+ onHidden: { default: () => tippy.defaultProps['onHidden'] },
4292
+ onHide: { default: () => tippy.defaultProps['onHide'] },
4293
+ onMount: { default: () => tippy.defaultProps['onMount'] },
4294
+ onShow: { default: () => tippy.defaultProps['onShow'] },
4295
+ onShown: { default: () => tippy.defaultProps['onShown'] },
4296
+ onTrigger: { default: () => tippy.defaultProps['onTrigger'] },
4297
+ onUntrigger: { default: () => tippy.defaultProps['onUntrigger'] },
4298
+ onClickOutside: { default: () => tippy.defaultProps['onClickOutside'] },
4299
+ placement: { default: () => tippy.defaultProps['placement'] },
4300
+ plugins: { default: () => tippy.defaultProps['plugins'] },
4301
+ popperOptions: { default: () => tippy.defaultProps['popperOptions'] },
4302
+ render: { default: () => tippy.defaultProps['render'] },
4303
+ showOnCreate: { type: Boolean, default: () => tippy.defaultProps['showOnCreate'] },
4304
+ touch: { type: [Boolean, String, Array], default: () => tippy.defaultProps['touch'] },
4305
+ trigger: { default: () => tippy.defaultProps['trigger'] },
4306
+ triggerTarget: { default: () => tippy.defaultProps['triggerTarget'] },
4307
+ animateFill: { type: Boolean, default: () => tippy.defaultProps['animateFill'] },
4308
+ followCursor: { type: [Boolean, String], default: () => tippy.defaultProps['followCursor'] },
4309
+ inlinePositioning: { type: Boolean, default: () => tippy.defaultProps['inlinePositioning'] },
4310
+ sticky: { type: [Boolean, String], default: () => tippy.defaultProps['sticky'] },
4311
+ allowHTML: { type: Boolean, default: () => tippy.defaultProps['allowHTML'] },
4312
+ animation: { default: () => tippy.defaultProps['animation'] },
4313
+ arrow: { default: () => tippy.defaultProps['arrow'] },
4314
+ content: { default: () => tippy.defaultProps['content'] },
4315
+ inertia: { default: () => tippy.defaultProps['inertia'] },
4316
+ maxWidth: { default: () => tippy.defaultProps['maxWidth'] },
4317
+ role: { default: () => tippy.defaultProps['role'] },
4318
+ theme: { default: () => tippy.defaultProps['theme'] },
4319
+ zIndex: { default: () => tippy.defaultProps['zIndex'] }
4320
+ },
4321
+ emits: ['state'],
4322
+ setup(props, { slots, emit, expose }) {
4323
+ const elem = vue.ref();
4324
+ const findParentHelper = vue.ref();
4325
+ const contentElem = vue.ref();
4326
+ const mounted = vue.ref(false);
4327
+ const getOptions = () => {
4328
+ let options = { ...props };
4329
+ for (const prop of ['to', 'tag', 'contentTag', 'contentClass']) {
4330
+ if (options.hasOwnProperty(prop)) {
4331
+ // @ts-ignore
4332
+ delete options[prop];
4333
+ }
4334
+ }
4335
+ return options;
4336
+ };
4337
+ let target = () => unrefElement(elem);
4338
+ if (props.to) {
4339
+ if (typeof Element !== 'undefined' && props.to instanceof Element) {
4340
+ target = () => props.to;
4341
+ }
4342
+ else if (props.to === 'parent') {
4343
+ target = () => {
4344
+ let el = elem.value;
4345
+ if (!el) {
4346
+ el = elem.value = findParentHelper.value.parentElement;
4347
+ }
4348
+ return el;
4349
+ };
4350
+ }
4351
+ else if (typeof props.to === 'string' || props.to instanceof String) {
4352
+ target = () => document.querySelector(props.to);
4353
+ }
4354
+ }
4355
+ const tippy = useTippy(target, getOptions());
4356
+ let contentSlot = slots.content;
4357
+ if (!contentSlot && props.to === 'parent') {
4358
+ contentSlot = slots.default;
4359
+ }
4360
+ vue.onMounted(() => {
4361
+ mounted.value = true;
4362
+ vue.nextTick(() => {
4363
+ if (contentSlot)
4364
+ tippy.setContent(() => contentElem.value);
4365
+ });
4366
+ });
4367
+ vue.watch(tippy.state, () => {
4368
+ emit('state', vue.unref(tippy.state));
4369
+ }, { immediate: true, deep: true });
4370
+ vue.watch(() => props, () => {
4371
+ tippy.setProps(getOptions());
4372
+ if (contentSlot)
4373
+ tippy.setContent(() => contentElem.value);
4374
+ }, { deep: true });
4375
+ let exposed = vue.reactive({
4376
+ elem,
4377
+ contentElem,
4378
+ mounted,
4379
+ ...tippy
4380
+ });
4381
+ expose(exposed);
4382
+ return () => {
4383
+ const contentTag = typeof props.contentTag === 'string' ? props.contentTag : props.contentTag;
4384
+ const content = contentSlot
4385
+ ? vue.h(contentTag, {
4386
+ ref: contentElem,
4387
+ style: { display: mounted.value ? 'inherit' : 'none' },
4388
+ class: props.contentClass,
4389
+ }, contentSlot(exposed))
4390
+ : null;
4391
+ if (props.to === 'parent') {
4392
+ const result = [];
4393
+ if (!elem.value) {
4394
+ const findParentHelperNode = vue.h('span', {
4395
+ ref: findParentHelper,
4396
+ 'data-v-tippy': '',
4397
+ style: { display: 'none' },
4398
+ });
4399
+ result.push(findParentHelperNode);
4400
+ }
4401
+ if (content) {
4402
+ result.push(content);
4403
+ }
4404
+ return result;
4405
+ }
4406
+ const slot = slots.default ? slots.default(exposed) : [];
4407
+ if (!props.tag) {
4408
+ const trigger = vue.h(slot[0], {
4409
+ ref: elem, 'data-v-tippy': ''
4410
+ });
4411
+ return content ? [trigger, content] : trigger;
4412
+ }
4413
+ const tag = typeof props.tag === 'string' ? props.tag : props.tag;
4414
+ return vue.h(tag, { ref: elem, 'data-v-tippy': '' }, content ? [slot, content] : slot);
4415
+ };
4416
+ },
4417
+ });
4418
+
4419
+ const booleanProps = [
4420
+ 'a11y',
4421
+ 'allowHTML',
4422
+ 'arrow',
4423
+ 'flip',
4424
+ 'flipOnUpdate',
4425
+ 'hideOnClick',
4426
+ 'ignoreAttributes',
4427
+ 'inertia',
4428
+ 'interactive',
4429
+ 'lazy',
4430
+ 'multiple',
4431
+ 'showOnInit',
4432
+ 'touch',
4433
+ 'touchHold',
4434
+ ];
4435
+ let props = {};
4436
+ Object.keys(tippy.defaultProps).forEach((prop) => {
4437
+ if (booleanProps.includes(prop)) {
4438
+ props[prop] = {
4439
+ type: Boolean,
4440
+ default: function () {
4441
+ return tippy.defaultProps[prop];
4442
+ },
4443
+ };
4444
+ }
4445
+ else {
4446
+ props[prop] = {
4447
+ default: function () {
4448
+ return tippy.defaultProps[prop];
4449
+ },
4450
+ };
4451
+ }
4452
+ });
4453
+ const TippySingleton = vue.defineComponent({
4454
+ props,
4455
+ setup(props) {
4456
+ const instances = vue.ref([]);
4457
+ const { singleton } = useSingleton(instances, props);
4458
+ return { instances, singleton };
4459
+ },
4460
+ mounted() {
4461
+ var _a;
4462
+ const parent = this.$el.parentElement;
4463
+ const elements = parent.querySelectorAll('[data-v-tippy]');
4464
+ this.instances = Array.from(elements)
4465
+ .map((el) => el._tippy)
4466
+ .filter(Boolean);
4467
+ (_a = this.singleton) === null || _a === void 0 ? void 0 : _a.setInstances(this.instances);
4468
+ },
4469
+ render() {
4470
+ let slot = this.$slots.default ? this.$slots.default() : [];
4471
+ return vue.h(() => slot);
4472
+ },
4473
+ });
4474
+
4475
+ const directive = {
4476
+ mounted(el, binding, vnode) {
4477
+ const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
4478
+ const modifiers = Object.keys(binding.modifiers || {});
4479
+ const placement = modifiers.find(modifier => modifier !== 'arrow');
4480
+ const withArrow = modifiers.findIndex(modifier => modifier === 'arrow') !== -1;
4481
+ if (placement) {
4482
+ opts.placement = opts.placement || placement;
4483
+ }
4484
+ if (withArrow) {
4485
+ opts.arrow = opts.arrow !== undefined ? opts.arrow : true;
4486
+ }
4487
+ if (vnode.props && vnode.props.onTippyShow) {
4488
+ opts.onShow = function (...args) {
4489
+ var _a;
4490
+ return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShow(...args);
4491
+ };
4492
+ }
4493
+ if (vnode.props && vnode.props.onTippyShown) {
4494
+ opts.onShown = function (...args) {
4495
+ var _a;
4496
+ return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShown(...args);
4497
+ };
4498
+ }
4499
+ if (vnode.props && vnode.props.onTippyHidden) {
4500
+ opts.onHidden = function (...args) {
4501
+ var _a;
4502
+ return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHidden(...args);
4503
+ };
4504
+ }
4505
+ if (vnode.props && vnode.props.onTippyHide) {
4506
+ opts.onHide = function (...args) {
4507
+ var _a;
4508
+ return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHide(...args);
4509
+ };
4510
+ }
4511
+ if (vnode.props && vnode.props.onTippyMount) {
4512
+ opts.onMount = function (...args) {
4513
+ var _a;
4514
+ return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyMount(...args);
4515
+ };
4516
+ }
4517
+ if (el.getAttribute('title') && !opts.content) {
4518
+ opts.content = el.getAttribute('title');
4519
+ el.removeAttribute('title');
4520
+ }
4521
+ if (el.getAttribute('content') && !opts.content) {
4522
+ opts.content = el.getAttribute('content');
4523
+ }
4524
+ useTippy(el, opts);
4525
+ },
4526
+ unmounted(el) {
4527
+ if (el.$tippy) {
4528
+ el.$tippy.destroy();
4529
+ }
4530
+ else if (el._tippy) {
4531
+ el._tippy.destroy();
4532
+ }
4533
+ },
4534
+ updated(el, binding) {
4535
+ const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
4536
+ // any kind of falsy content value, even undefined, should be treated as null - 'no tooltip to show'
4537
+ if (!opts.content) {
4538
+ opts.content = null;
4539
+ }
4540
+ if (el.getAttribute('title') && !opts.content) {
4541
+ opts.content = el.getAttribute('title');
4542
+ el.removeAttribute('title');
4543
+ }
4544
+ if (el.getAttribute('content') && !opts.content) {
4545
+ opts.content = el.getAttribute('content');
4546
+ }
4547
+ if (el.$tippy) {
4548
+ el.$tippy.setProps(opts || {});
4549
+ }
4550
+ else if (el._tippy) {
4551
+ el._tippy.setProps(opts || {});
4552
+ }
4553
+ },
4554
+ };
4555
+
4556
+ const plugin = {
4557
+ install(app, options = {}) {
4558
+ tippy.setDefaultProps(options.defaultProps || {});
4559
+ app.directive(options.directive || 'tippy', directive);
4560
+ app.component(options.component || 'tippy', TippyComponent);
4561
+ app.component(options.componentSingleton || 'tippy-singleton', TippySingleton);
4562
+ },
4563
+ };
4564
+
4565
+ const setDefaultProps$1 = tippy.setDefaultProps;
4566
+ setDefaultProps$1({
4567
+ ignoreAttributes: true,
4568
+ plugins: [sticky, inlinePositioning, followCursor, animateFill],
4569
+ });
4570
+
4571
+ exports.Tippy = TippyComponent;
4572
+ exports.TippySingleton = TippySingleton;
4573
+ exports.default = plugin;
4574
+ exports.directive = directive;
4575
+ exports.hideAll = hideAll;
4576
+ exports.plugin = plugin;
4577
+ exports.roundArrow = ROUND_ARROW;
4578
+ exports.setDefaultProps = setDefaultProps$1;
4579
+ exports.tippy = tippy;
4580
+ exports.useSingleton = useSingleton;
4581
+ exports.useTippy = useTippy;
4582
+ exports.useTippyComponent = useTippyComponent;