@bigbinary/neeto-atoms 1.0.5 → 1.0.7

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 (503) hide show
  1. package/dist/DataTable-Y4POx0WN.js +3737 -0
  2. package/dist/DataTable-Y4POx0WN.js.map +1 -0
  3. package/dist/button-COIbN8dg.js +40 -0
  4. package/dist/button-COIbN8dg.js.map +1 -0
  5. package/dist/check-Cpkv29p1.js +15 -0
  6. package/dist/check-Cpkv29p1.js.map +1 -0
  7. package/dist/chevron-down-BNi0ntys.js +15 -0
  8. package/dist/chevron-down-BNi0ntys.js.map +1 -0
  9. package/dist/chevron-left-BDoT8E2-.js +15 -0
  10. package/dist/chevron-left-BDoT8E2-.js.map +1 -0
  11. package/dist/chevron-right-DQnrO-ek.js +15 -0
  12. package/dist/chevron-right-DQnrO-ek.js.map +1 -0
  13. package/dist/chevron-up-Bf2G3AAU.js +15 -0
  14. package/dist/chevron-up-Bf2G3AAU.js.map +1 -0
  15. package/dist/cjs/DataTable-DJw2SZ7b.js +3764 -0
  16. package/dist/cjs/DataTable-DJw2SZ7b.js.map +1 -0
  17. package/dist/cjs/button-B8XGl69v.js +63 -0
  18. package/dist/cjs/button-B8XGl69v.js.map +1 -0
  19. package/dist/cjs/check-BQgcDXys.js +17 -0
  20. package/dist/cjs/check-BQgcDXys.js.map +1 -0
  21. package/dist/cjs/chevron-down-CPsWSS51.js +17 -0
  22. package/dist/cjs/chevron-down-CPsWSS51.js.map +1 -0
  23. package/dist/cjs/chevron-left-BldoOh5p.js +17 -0
  24. package/dist/cjs/chevron-left-BldoOh5p.js.map +1 -0
  25. package/dist/cjs/chevron-right-0jNdwX2Q.js +17 -0
  26. package/dist/cjs/chevron-right-0jNdwX2Q.js.map +1 -0
  27. package/dist/cjs/chevron-up-BpwpBnZU.js +17 -0
  28. package/dist/cjs/chevron-up-BpwpBnZU.js.map +1 -0
  29. package/dist/cjs/components/DataTable.js +53 -0
  30. package/dist/cjs/components/DataTable.js.map +1 -0
  31. package/dist/cjs/createLucideIcon-D0tRgV6l.js +149 -0
  32. package/dist/cjs/createLucideIcon-D0tRgV6l.js.map +1 -0
  33. package/dist/cjs/dialog-DzNWLbJ6.js +50 -0
  34. package/dist/cjs/dialog-DzNWLbJ6.js.map +1 -0
  35. package/dist/cjs/ellipsis-4aubOI2n.js +21 -0
  36. package/dist/cjs/ellipsis-4aubOI2n.js.map +1 -0
  37. package/dist/cjs/floating-ui.react-dom-B4Aw6O7R.js +2293 -0
  38. package/dist/cjs/floating-ui.react-dom-B4Aw6O7R.js.map +1 -0
  39. package/dist/cjs/index-9jC1advf.js +34 -0
  40. package/dist/cjs/index-9jC1advf.js.map +1 -0
  41. package/dist/cjs/index-BZhTddX0.js +47 -0
  42. package/dist/cjs/index-BZhTddX0.js.map +1 -0
  43. package/dist/cjs/index-Bf0WsHta.js +63 -0
  44. package/dist/cjs/index-Bf0WsHta.js.map +1 -0
  45. package/dist/cjs/index-BqCr1H3u.js +173 -0
  46. package/dist/cjs/index-BqCr1H3u.js.map +1 -0
  47. package/dist/cjs/index-BrpkRQoS.js +99 -0
  48. package/dist/cjs/index-BrpkRQoS.js.map +1 -0
  49. package/dist/cjs/index-Bvu9MiFi.js +247 -0
  50. package/dist/cjs/index-Bvu9MiFi.js.map +1 -0
  51. package/dist/cjs/index-BwAq9ba8.js +38 -0
  52. package/dist/cjs/index-BwAq9ba8.js.map +1 -0
  53. package/dist/cjs/index-C9ICrOhM.js +328 -0
  54. package/dist/cjs/index-C9ICrOhM.js.map +1 -0
  55. package/dist/cjs/index-CB9xFokC.js +59 -0
  56. package/dist/cjs/index-CB9xFokC.js.map +1 -0
  57. package/dist/cjs/index-CCdG4z4E.js +30 -0
  58. package/dist/cjs/index-CCdG4z4E.js.map +1 -0
  59. package/dist/cjs/index-CF951Pw9.js +38 -0
  60. package/dist/cjs/index-CF951Pw9.js.map +1 -0
  61. package/dist/cjs/index-CGUGhyIp.js +103 -0
  62. package/dist/cjs/index-CGUGhyIp.js.map +1 -0
  63. package/dist/cjs/index-CGet1HH4.js +953 -0
  64. package/dist/cjs/index-CGet1HH4.js.map +1 -0
  65. package/dist/cjs/index-COPkC3I5.js +14 -0
  66. package/dist/cjs/index-COPkC3I5.js.map +1 -0
  67. package/dist/cjs/index-Ch55j1or.js +176 -0
  68. package/dist/cjs/index-Ch55j1or.js.map +1 -0
  69. package/dist/cjs/index-ChSOMM8b.js +1153 -0
  70. package/dist/cjs/index-ChSOMM8b.js.map +1 -0
  71. package/dist/cjs/index-CyrAgb4H.js +93 -0
  72. package/dist/cjs/index-CyrAgb4H.js.map +1 -0
  73. package/dist/cjs/index-D-iDn9RI.js +63 -0
  74. package/dist/cjs/index-D-iDn9RI.js.map +1 -0
  75. package/dist/cjs/index-DAds6mf_.js +433 -0
  76. package/dist/cjs/index-DAds6mf_.js.map +1 -0
  77. package/dist/cjs/index-DMbj7vXd.js +152 -0
  78. package/dist/cjs/index-DMbj7vXd.js.map +1 -0
  79. package/dist/cjs/index-DR7GJU4J.js +248 -0
  80. package/dist/cjs/index-DR7GJU4J.js.map +1 -0
  81. package/dist/cjs/index-DcCSSgb7.js +153 -0
  82. package/dist/cjs/index-DcCSSgb7.js.map +1 -0
  83. package/dist/cjs/index-Df-Ffa3s.js +43 -0
  84. package/dist/cjs/index-Df-Ffa3s.js.map +1 -0
  85. package/dist/cjs/index-DnKJmaCq.js +8 -0
  86. package/dist/cjs/index-DnKJmaCq.js.map +1 -0
  87. package/dist/cjs/index-DuNgWCXZ.js +113 -0
  88. package/dist/cjs/index-DuNgWCXZ.js.map +1 -0
  89. package/dist/cjs/index-EyWRfsCG.js +9 -0
  90. package/dist/cjs/index-EyWRfsCG.js.map +1 -0
  91. package/dist/cjs/index-lWVw05cs.js +35 -0
  92. package/dist/cjs/index-lWVw05cs.js.map +1 -0
  93. package/dist/cjs/index.js +53 -66849
  94. package/dist/cjs/index.js.map +1 -1
  95. package/dist/cjs/input-CgKPISj_.js +11 -0
  96. package/dist/cjs/input-CgKPISj_.js.map +1 -0
  97. package/dist/cjs/input-group-DoK0-4fL.js +66 -0
  98. package/dist/cjs/input-group-DoK0-4fL.js.map +1 -0
  99. package/dist/cjs/label-Bdc9ytTI.js +52 -0
  100. package/dist/cjs/label-Bdc9ytTI.js.map +1 -0
  101. package/dist/cjs/loader-circle-Bw7zP2Gn.js +17 -0
  102. package/dist/cjs/loader-circle-Bw7zP2Gn.js.map +1 -0
  103. package/dist/cjs/primitives/Accordion.js +340 -0
  104. package/dist/cjs/primitives/Accordion.js.map +1 -0
  105. package/dist/cjs/primitives/Alert.js +40 -0
  106. package/dist/cjs/primitives/Alert.js.map +1 -0
  107. package/dist/cjs/primitives/AlertDialog.js +256 -0
  108. package/dist/cjs/primitives/AlertDialog.js.map +1 -0
  109. package/dist/cjs/primitives/AspectRatio.js +75 -0
  110. package/dist/cjs/primitives/AspectRatio.js.map +1 -0
  111. package/dist/cjs/primitives/Avatar.js +189 -0
  112. package/dist/cjs/primitives/Avatar.js.map +1 -0
  113. package/dist/cjs/primitives/Badge.js +34 -0
  114. package/dist/cjs/primitives/Badge.js.map +1 -0
  115. package/dist/cjs/primitives/Breadcrumb.js +50 -0
  116. package/dist/cjs/primitives/Breadcrumb.js.map +1 -0
  117. package/dist/cjs/primitives/Button.js +16 -0
  118. package/dist/cjs/primitives/Button.js.map +1 -0
  119. package/dist/cjs/primitives/ButtonGroup.js +43 -0
  120. package/dist/cjs/primitives/ButtonGroup.js.map +1 -0
  121. package/dist/cjs/primitives/Calendar.js +8030 -0
  122. package/dist/cjs/primitives/Calendar.js.map +1 -0
  123. package/dist/cjs/primitives/Card.js +43 -0
  124. package/dist/cjs/primitives/Card.js.map +1 -0
  125. package/dist/cjs/primitives/Carousel.js +1867 -0
  126. package/dist/cjs/primitives/Carousel.js.map +1 -0
  127. package/dist/cjs/primitives/Chart.js +18787 -0
  128. package/dist/cjs/primitives/Chart.js.map +1 -0
  129. package/dist/cjs/primitives/Checkbox.js +304 -0
  130. package/dist/cjs/primitives/Checkbox.js.map +1 -0
  131. package/dist/cjs/primitives/Collapsible.js +33 -0
  132. package/dist/cjs/primitives/Collapsible.js.map +1 -0
  133. package/dist/cjs/primitives/Combobox.js +10288 -0
  134. package/dist/cjs/primitives/Combobox.js.map +1 -0
  135. package/dist/cjs/primitives/Command.js +248 -0
  136. package/dist/cjs/primitives/Command.js.map +1 -0
  137. package/dist/cjs/primitives/ContextMenu.js +404 -0
  138. package/dist/cjs/primitives/ContextMenu.js.map +1 -0
  139. package/dist/cjs/primitives/Dialog.js +48 -0
  140. package/dist/cjs/primitives/Dialog.js.map +1 -0
  141. package/dist/cjs/primitives/Drawer.js +1715 -0
  142. package/dist/cjs/primitives/Drawer.js.map +1 -0
  143. package/dist/cjs/primitives/DropdownMenu.js +383 -0
  144. package/dist/cjs/primitives/DropdownMenu.js.map +1 -0
  145. package/dist/cjs/primitives/Empty.js +50 -0
  146. package/dist/cjs/primitives/Empty.js.map +1 -0
  147. package/dist/cjs/primitives/Field.js +95 -0
  148. package/dist/cjs/primitives/Field.js.map +1 -0
  149. package/dist/cjs/primitives/HoverCard.js +291 -0
  150. package/dist/cjs/primitives/HoverCard.js.map +1 -0
  151. package/dist/cjs/primitives/Input.js +10 -0
  152. package/dist/cjs/primitives/Input.js.map +1 -0
  153. package/dist/cjs/primitives/InputGroup.js +27 -0
  154. package/dist/cjs/primitives/InputGroup.js.map +1 -0
  155. package/dist/cjs/primitives/InputOTP.js +84 -0
  156. package/dist/cjs/primitives/InputOTP.js.map +1 -0
  157. package/dist/cjs/primitives/Item.js +96 -0
  158. package/dist/cjs/primitives/Item.js.map +1 -0
  159. package/dist/cjs/primitives/Kbd.js +18 -0
  160. package/dist/cjs/primitives/Kbd.js.map +1 -0
  161. package/dist/cjs/primitives/Label.js +14 -0
  162. package/dist/cjs/primitives/Label.js.map +1 -0
  163. package/dist/cjs/primitives/Menubar.js +547 -0
  164. package/dist/cjs/primitives/Menubar.js.map +1 -0
  165. package/dist/cjs/primitives/NativeSelect.js +26 -0
  166. package/dist/cjs/primitives/NativeSelect.js.map +1 -0
  167. package/dist/cjs/primitives/NavigationMenu.js +856 -0
  168. package/dist/cjs/primitives/NavigationMenu.js.map +1 -0
  169. package/dist/cjs/primitives/Pagination.js +52 -0
  170. package/dist/cjs/primitives/Pagination.js.map +1 -0
  171. package/dist/cjs/primitives/Popover.js +444 -0
  172. package/dist/cjs/primitives/Popover.js.map +1 -0
  173. package/dist/cjs/primitives/Progress.js +125 -0
  174. package/dist/cjs/primitives/Progress.js.map +1 -0
  175. package/dist/cjs/primitives/RadioGroup.js +322 -0
  176. package/dist/cjs/primitives/RadioGroup.js.map +1 -0
  177. package/dist/cjs/primitives/Resizable.js +2051 -0
  178. package/dist/cjs/primitives/Resizable.js.map +1 -0
  179. package/dist/cjs/primitives/ScrollArea.js +754 -0
  180. package/dist/cjs/primitives/ScrollArea.js.map +1 -0
  181. package/dist/cjs/primitives/Select.js +1318 -0
  182. package/dist/cjs/primitives/Select.js.map +1 -0
  183. package/dist/cjs/primitives/Separator.js +14 -0
  184. package/dist/cjs/primitives/Separator.js.map +1 -0
  185. package/dist/cjs/primitives/Sheet.js +44 -0
  186. package/dist/cjs/primitives/Sheet.js.map +1 -0
  187. package/dist/cjs/primitives/Sidebar.js +310 -0
  188. package/dist/cjs/primitives/Sidebar.js.map +1 -0
  189. package/dist/cjs/primitives/Skeleton.js +10 -0
  190. package/dist/cjs/primitives/Skeleton.js.map +1 -0
  191. package/dist/cjs/primitives/Slider.js +591 -0
  192. package/dist/cjs/primitives/Slider.js.map +1 -0
  193. package/dist/cjs/primitives/Sonner.js +1260 -0
  194. package/dist/cjs/primitives/Sonner.js.map +1 -0
  195. package/dist/cjs/primitives/Spinner.js +16 -0
  196. package/dist/cjs/primitives/Spinner.js.map +1 -0
  197. package/dist/cjs/primitives/Switch.js +184 -0
  198. package/dist/cjs/primitives/Switch.js.map +1 -0
  199. package/dist/cjs/primitives/Table.js +45 -0
  200. package/dist/cjs/primitives/Table.js.map +1 -0
  201. package/dist/cjs/primitives/Tabs.js +250 -0
  202. package/dist/cjs/primitives/Tabs.js.map +1 -0
  203. package/dist/cjs/primitives/Textarea.js +10 -0
  204. package/dist/cjs/primitives/Textarea.js.map +1 -0
  205. package/dist/cjs/primitives/Toggle.js +19 -0
  206. package/dist/cjs/primitives/Toggle.js.map +1 -0
  207. package/dist/cjs/primitives/ToggleGroup.js +221 -0
  208. package/dist/cjs/primitives/ToggleGroup.js.map +1 -0
  209. package/dist/cjs/primitives/Tooltip.js +33 -0
  210. package/dist/cjs/primitives/Tooltip.js.map +1 -0
  211. package/dist/cjs/primitives/Typography.js +105 -0
  212. package/dist/cjs/primitives/Typography.js.map +1 -0
  213. package/dist/cjs/primitives/index.js +422 -0
  214. package/dist/cjs/primitives/index.js.map +1 -0
  215. package/dist/cjs/reselect-CeyIIDM-.js +457 -0
  216. package/dist/cjs/reselect-CeyIIDM-.js.map +1 -0
  217. package/dist/cjs/separator-CPy2gyg1.js +58 -0
  218. package/dist/cjs/separator-CPy2gyg1.js.map +1 -0
  219. package/dist/cjs/sheet-nHSYZxAA.js +48 -0
  220. package/dist/cjs/sheet-nHSYZxAA.js.map +1 -0
  221. package/dist/cjs/skeleton-DffZ8bV7.js +11 -0
  222. package/dist/cjs/skeleton-DffZ8bV7.js.map +1 -0
  223. package/dist/cjs/textarea-CZSSY75H.js +11 -0
  224. package/dist/cjs/textarea-CZSSY75H.js.map +1 -0
  225. package/dist/cjs/toggle-CaqzT8dI.js +84 -0
  226. package/dist/cjs/toggle-CaqzT8dI.js.map +1 -0
  227. package/dist/cjs/tooltip-CRkOMh1b.js +542 -0
  228. package/dist/cjs/tooltip-CRkOMh1b.js.map +1 -0
  229. package/dist/cjs/use-mobile-B-UYxtqX.js +41 -0
  230. package/dist/cjs/use-mobile-B-UYxtqX.js.map +1 -0
  231. package/dist/cjs/utils-CTr7wn5d.js +3210 -0
  232. package/dist/cjs/utils-CTr7wn5d.js.map +1 -0
  233. package/dist/cjs/x-Brw3FJst.js +20 -0
  234. package/dist/cjs/x-Brw3FJst.js.map +1 -0
  235. package/dist/components/DataTable/DataTable.d.ts +1 -1
  236. package/dist/components/DataTable/types.d.ts +0 -5
  237. package/dist/components/DataTable.js +41 -0
  238. package/dist/components/DataTable.js.map +1 -0
  239. package/dist/createLucideIcon-C8ycilSN.js +147 -0
  240. package/dist/createLucideIcon-C8ycilSN.js.map +1 -0
  241. package/dist/dialog-C97DOTvO.js +39 -0
  242. package/dist/dialog-C97DOTvO.js.map +1 -0
  243. package/dist/ellipsis-lb8Ws6br.js +19 -0
  244. package/dist/ellipsis-lb8Ws6br.js.map +1 -0
  245. package/dist/floating-ui.react-dom-CcGbtPEK.js +2243 -0
  246. package/dist/floating-ui.react-dom-CcGbtPEK.js.map +1 -0
  247. package/dist/index-0o2E3Cnw.js +146 -0
  248. package/dist/index-0o2E3Cnw.js.map +1 -0
  249. package/dist/index-30QpKM0j.js +16 -0
  250. package/dist/index-30QpKM0j.js.map +1 -0
  251. package/dist/index-B4_fVWDx.js +1129 -0
  252. package/dist/index-B4_fVWDx.js.map +1 -0
  253. package/dist/index-BA158WEj.js +12 -0
  254. package/dist/index-BA158WEj.js.map +1 -0
  255. package/dist/index-BNPynZWM.js +225 -0
  256. package/dist/index-BNPynZWM.js.map +1 -0
  257. package/dist/index-BYZaLNq1.js +41 -0
  258. package/dist/index-BYZaLNq1.js.map +1 -0
  259. package/dist/index-BfAAoDv6.js +7 -0
  260. package/dist/index-BfAAoDv6.js.map +1 -0
  261. package/dist/index-BtkPdosV.js +40 -0
  262. package/dist/index-BtkPdosV.js.map +1 -0
  263. package/dist/index-BwxI_qgh.js +915 -0
  264. package/dist/index-BwxI_qgh.js.map +1 -0
  265. package/dist/index-ByEpUy7w.js +302 -0
  266. package/dist/index-ByEpUy7w.js.map +1 -0
  267. package/dist/index-CSMSzzKM.js +93 -0
  268. package/dist/index-CSMSzzKM.js.map +1 -0
  269. package/dist/index-CSUSJzOJ.js +13 -0
  270. package/dist/index-CSUSJzOJ.js.map +1 -0
  271. package/dist/index-CSggBaQF.js +36 -0
  272. package/dist/index-CSggBaQF.js.map +1 -0
  273. package/dist/index-CfriMyrd.js +91 -0
  274. package/dist/index-CfriMyrd.js.map +1 -0
  275. package/dist/index-CiyxEyB0.js +80 -0
  276. package/dist/index-CiyxEyB0.js.map +1 -0
  277. package/dist/index-Cor698lu.js +71 -0
  278. package/dist/index-Cor698lu.js.map +1 -0
  279. package/dist/index-D7Zy7P05.js +45 -0
  280. package/dist/index-D7Zy7P05.js.map +1 -0
  281. package/dist/index-DNzunGHb.js +12 -0
  282. package/dist/index-DNzunGHb.js.map +1 -0
  283. package/dist/index-DOzu5J1s.js +8 -0
  284. package/dist/index-DOzu5J1s.js.map +1 -0
  285. package/dist/index-DZXbzIgC.js +6 -0
  286. package/dist/index-DZXbzIgC.js.map +1 -0
  287. package/dist/index-Dd1i1d2M.js +155 -0
  288. package/dist/index-Dd1i1d2M.js.map +1 -0
  289. package/dist/index-DhnfW8wQ.js +128 -0
  290. package/dist/index-DhnfW8wQ.js.map +1 -0
  291. package/dist/index-PF0ms7Xn.js +402 -0
  292. package/dist/index-PF0ms7Xn.js.map +1 -0
  293. package/dist/index-fV_U4ZJM.js +18 -0
  294. package/dist/index-fV_U4ZJM.js.map +1 -0
  295. package/dist/index-j_qxDBFl.js +224 -0
  296. package/dist/index-j_qxDBFl.js.map +1 -0
  297. package/dist/index-yFgkK_AM.js +131 -0
  298. package/dist/index-yFgkK_AM.js.map +1 -0
  299. package/dist/index-zW4GjM5L.js +16 -0
  300. package/dist/index-zW4GjM5L.js.map +1 -0
  301. package/dist/index.d.ts +0 -55
  302. package/dist/index.js +41 -66515
  303. package/dist/index.js.map +1 -1
  304. package/dist/input-GLCCE2kT.js +9 -0
  305. package/dist/input-GLCCE2kT.js.map +1 -0
  306. package/dist/input-group-CDBpz6Pb.js +59 -0
  307. package/dist/input-group-CDBpz6Pb.js.map +1 -0
  308. package/dist/label-B4qDF3W1.js +30 -0
  309. package/dist/label-B4qDF3W1.js.map +1 -0
  310. package/dist/loader-circle-DycHUAWN.js +15 -0
  311. package/dist/loader-circle-DycHUAWN.js.map +1 -0
  312. package/dist/primitives/Accordion.js +331 -0
  313. package/dist/primitives/Accordion.js.map +1 -0
  314. package/dist/primitives/Alert.js +35 -0
  315. package/dist/primitives/Alert.js.map +1 -0
  316. package/dist/primitives/AlertDialog.js +223 -0
  317. package/dist/primitives/AlertDialog.js.map +1 -0
  318. package/dist/primitives/AspectRatio.js +53 -0
  319. package/dist/primitives/AspectRatio.js.map +1 -0
  320. package/dist/primitives/Avatar.js +162 -0
  321. package/dist/primitives/Avatar.js.map +1 -0
  322. package/dist/primitives/Badge.js +31 -0
  323. package/dist/primitives/Badge.js.map +1 -0
  324. package/dist/primitives/Breadcrumb.js +42 -0
  325. package/dist/primitives/Breadcrumb.js.map +1 -0
  326. package/dist/{components → primitives}/Button.d.ts +1 -1
  327. package/dist/primitives/Button.js +14 -0
  328. package/dist/primitives/Button.js.map +1 -0
  329. package/dist/primitives/ButtonGroup.js +38 -0
  330. package/dist/primitives/ButtonGroup.js.map +1 -0
  331. package/dist/primitives/Calendar.js +8008 -0
  332. package/dist/primitives/Calendar.js.map +1 -0
  333. package/dist/primitives/Card.js +35 -0
  334. package/dist/primitives/Card.js.map +1 -0
  335. package/dist/{components → primitives}/Carousel.d.ts +1 -1
  336. package/dist/primitives/Carousel.js +1841 -0
  337. package/dist/primitives/Carousel.js.map +1 -0
  338. package/dist/primitives/Chart.js +18761 -0
  339. package/dist/primitives/Chart.js.map +1 -0
  340. package/dist/primitives/Checkbox.js +282 -0
  341. package/dist/primitives/Checkbox.js.map +1 -0
  342. package/dist/primitives/Collapsible.js +29 -0
  343. package/dist/primitives/Collapsible.js.map +1 -0
  344. package/dist/primitives/Combobox.js +10251 -0
  345. package/dist/primitives/Combobox.js.map +1 -0
  346. package/dist/primitives/Command.js +218 -0
  347. package/dist/primitives/Command.js.map +1 -0
  348. package/dist/primitives/ContextMenu.js +368 -0
  349. package/dist/primitives/ContextMenu.js.map +1 -0
  350. package/dist/primitives/Dialog.js +37 -0
  351. package/dist/primitives/Dialog.js.map +1 -0
  352. package/dist/primitives/Drawer.js +1685 -0
  353. package/dist/primitives/Drawer.js.map +1 -0
  354. package/dist/primitives/DropdownMenu.js +347 -0
  355. package/dist/primitives/DropdownMenu.js.map +1 -0
  356. package/dist/primitives/Empty.js +43 -0
  357. package/dist/primitives/Empty.js.map +1 -0
  358. package/dist/primitives/Field.js +84 -0
  359. package/dist/primitives/Field.js.map +1 -0
  360. package/dist/primitives/HoverCard.js +267 -0
  361. package/dist/primitives/HoverCard.js.map +1 -0
  362. package/dist/primitives/Input.js +8 -0
  363. package/dist/primitives/Input.js.map +1 -0
  364. package/dist/primitives/InputGroup.js +20 -0
  365. package/dist/primitives/InputGroup.js.map +1 -0
  366. package/dist/primitives/InputOTP.js +59 -0
  367. package/dist/primitives/InputOTP.js.map +1 -0
  368. package/dist/primitives/Item.js +85 -0
  369. package/dist/primitives/Item.js.map +1 -0
  370. package/dist/primitives/Kbd.js +15 -0
  371. package/dist/primitives/Kbd.js.map +1 -0
  372. package/dist/primitives/Label.js +12 -0
  373. package/dist/primitives/Label.js.map +1 -0
  374. package/dist/primitives/Menubar.js +510 -0
  375. package/dist/primitives/Menubar.js.map +1 -0
  376. package/dist/primitives/NativeSelect.js +22 -0
  377. package/dist/primitives/NativeSelect.js.map +1 -0
  378. package/dist/primitives/NavigationMenu.js +823 -0
  379. package/dist/primitives/NavigationMenu.js.map +1 -0
  380. package/dist/primitives/Pagination.js +44 -0
  381. package/dist/primitives/Pagination.js.map +1 -0
  382. package/dist/primitives/Popover.js +416 -0
  383. package/dist/primitives/Popover.js.map +1 -0
  384. package/dist/primitives/Progress.js +103 -0
  385. package/dist/primitives/Progress.js.map +1 -0
  386. package/dist/primitives/RadioGroup.js +299 -0
  387. package/dist/primitives/RadioGroup.js.map +1 -0
  388. package/dist/primitives/Resizable.js +2047 -0
  389. package/dist/primitives/Resizable.js.map +1 -0
  390. package/dist/primitives/ScrollArea.js +731 -0
  391. package/dist/primitives/ScrollArea.js.map +1 -0
  392. package/dist/primitives/Select.js +1286 -0
  393. package/dist/primitives/Select.js.map +1 -0
  394. package/dist/primitives/Separator.js +12 -0
  395. package/dist/primitives/Separator.js.map +1 -0
  396. package/dist/primitives/Sheet.js +35 -0
  397. package/dist/primitives/Sheet.js.map +1 -0
  398. package/dist/primitives/Sidebar.js +265 -0
  399. package/dist/primitives/Sidebar.js.map +1 -0
  400. package/dist/primitives/Skeleton.js +8 -0
  401. package/dist/primitives/Skeleton.js.map +1 -0
  402. package/dist/primitives/Slider.js +569 -0
  403. package/dist/primitives/Slider.js.map +1 -0
  404. package/dist/primitives/Sonner.js +1236 -0
  405. package/dist/primitives/Sonner.js.map +1 -0
  406. package/dist/primitives/Spinner.js +14 -0
  407. package/dist/primitives/Spinner.js.map +1 -0
  408. package/dist/primitives/Switch.js +162 -0
  409. package/dist/primitives/Switch.js.map +1 -0
  410. package/dist/{components → primitives}/Table.d.ts +2 -2
  411. package/dist/primitives/Table.js +36 -0
  412. package/dist/primitives/Table.js.map +1 -0
  413. package/dist/primitives/Tabs.js +224 -0
  414. package/dist/primitives/Tabs.js.map +1 -0
  415. package/dist/primitives/Textarea.js +8 -0
  416. package/dist/primitives/Textarea.js.map +1 -0
  417. package/dist/primitives/Toggle.js +17 -0
  418. package/dist/primitives/Toggle.js.map +1 -0
  419. package/dist/primitives/ToggleGroup.js +199 -0
  420. package/dist/primitives/ToggleGroup.js.map +1 -0
  421. package/dist/primitives/Tooltip.js +28 -0
  422. package/dist/primitives/Tooltip.js.map +1 -0
  423. package/dist/{components → primitives}/Typography.d.ts +1 -1
  424. package/dist/primitives/Typography.js +83 -0
  425. package/dist/primitives/Typography.js.map +1 -0
  426. package/dist/primitives/index.d.ts +55 -0
  427. package/dist/primitives/index.js +110 -0
  428. package/dist/primitives/index.js.map +1 -0
  429. package/dist/reselect-CABQm5hA.js +448 -0
  430. package/dist/reselect-CABQm5hA.js.map +1 -0
  431. package/dist/separator-BbhgePmX.js +36 -0
  432. package/dist/separator-BbhgePmX.js.map +1 -0
  433. package/dist/shadcn/components/badge.d.ts +1 -1
  434. package/dist/shadcn/components/button.d.ts +2 -2
  435. package/dist/shadcn/components/typography.d.ts +2 -2
  436. package/dist/sheet-D1ngftfX.js +39 -0
  437. package/dist/sheet-D1ngftfX.js.map +1 -0
  438. package/dist/skeleton-AR83txPr.js +9 -0
  439. package/dist/skeleton-AR83txPr.js.map +1 -0
  440. package/dist/textarea-BSZwxzjQ.js +9 -0
  441. package/dist/textarea-BSZwxzjQ.js.map +1 -0
  442. package/dist/toggle-2k9K8a5c.js +60 -0
  443. package/dist/toggle-2k9K8a5c.js.map +1 -0
  444. package/dist/tooltip-D5soNrAP.js +517 -0
  445. package/dist/tooltip-D5soNrAP.js.map +1 -0
  446. package/dist/use-mobile-IRjN_mlT.js +19 -0
  447. package/dist/use-mobile-IRjN_mlT.js.map +1 -0
  448. package/dist/utils-DdHUxIdC.js +3207 -0
  449. package/dist/utils-DdHUxIdC.js.map +1 -0
  450. package/dist/x-_o2T3n6D.js +18 -0
  451. package/dist/x-_o2T3n6D.js.map +1 -0
  452. package/package.json +53 -33
  453. /package/dist/{components → primitives}/Accordion.d.ts +0 -0
  454. /package/dist/{components → primitives}/Alert.d.ts +0 -0
  455. /package/dist/{components → primitives}/AlertDialog.d.ts +0 -0
  456. /package/dist/{components → primitives}/AspectRatio.d.ts +0 -0
  457. /package/dist/{components → primitives}/Avatar.d.ts +0 -0
  458. /package/dist/{components → primitives}/Badge.d.ts +0 -0
  459. /package/dist/{components → primitives}/Breadcrumb.d.ts +0 -0
  460. /package/dist/{components → primitives}/ButtonGroup.d.ts +0 -0
  461. /package/dist/{components → primitives}/Calendar.d.ts +0 -0
  462. /package/dist/{components → primitives}/Card.d.ts +0 -0
  463. /package/dist/{components → primitives}/Chart.d.ts +0 -0
  464. /package/dist/{components → primitives}/Checkbox.d.ts +0 -0
  465. /package/dist/{components → primitives}/Collapsible.d.ts +0 -0
  466. /package/dist/{components → primitives}/Combobox.d.ts +0 -0
  467. /package/dist/{components → primitives}/Command.d.ts +0 -0
  468. /package/dist/{components → primitives}/ContextMenu.d.ts +0 -0
  469. /package/dist/{components → primitives}/Dialog.d.ts +0 -0
  470. /package/dist/{components → primitives}/Drawer.d.ts +0 -0
  471. /package/dist/{components → primitives}/DropdownMenu.d.ts +0 -0
  472. /package/dist/{components → primitives}/Empty.d.ts +0 -0
  473. /package/dist/{components → primitives}/Field.d.ts +0 -0
  474. /package/dist/{components → primitives}/HoverCard.d.ts +0 -0
  475. /package/dist/{components → primitives}/Input.d.ts +0 -0
  476. /package/dist/{components → primitives}/InputGroup.d.ts +0 -0
  477. /package/dist/{components → primitives}/InputOTP.d.ts +0 -0
  478. /package/dist/{components → primitives}/Item.d.ts +0 -0
  479. /package/dist/{components → primitives}/Kbd.d.ts +0 -0
  480. /package/dist/{components → primitives}/Label.d.ts +0 -0
  481. /package/dist/{components → primitives}/Menubar.d.ts +0 -0
  482. /package/dist/{components → primitives}/NativeSelect.d.ts +0 -0
  483. /package/dist/{components → primitives}/NavigationMenu.d.ts +0 -0
  484. /package/dist/{components → primitives}/Pagination.d.ts +0 -0
  485. /package/dist/{components → primitives}/Popover.d.ts +0 -0
  486. /package/dist/{components → primitives}/Progress.d.ts +0 -0
  487. /package/dist/{components → primitives}/RadioGroup.d.ts +0 -0
  488. /package/dist/{components → primitives}/Resizable.d.ts +0 -0
  489. /package/dist/{components → primitives}/ScrollArea.d.ts +0 -0
  490. /package/dist/{components → primitives}/Select.d.ts +0 -0
  491. /package/dist/{components → primitives}/Separator.d.ts +0 -0
  492. /package/dist/{components → primitives}/Sheet.d.ts +0 -0
  493. /package/dist/{components → primitives}/Sidebar.d.ts +0 -0
  494. /package/dist/{components → primitives}/Skeleton.d.ts +0 -0
  495. /package/dist/{components → primitives}/Slider.d.ts +0 -0
  496. /package/dist/{components → primitives}/Sonner.d.ts +0 -0
  497. /package/dist/{components → primitives}/Spinner.d.ts +0 -0
  498. /package/dist/{components → primitives}/Switch.d.ts +0 -0
  499. /package/dist/{components → primitives}/Tabs.d.ts +0 -0
  500. /package/dist/{components → primitives}/Textarea.d.ts +0 -0
  501. /package/dist/{components → primitives}/Toggle.d.ts +0 -0
  502. /package/dist/{components → primitives}/ToggleGroup.d.ts +0 -0
  503. /package/dist/{components → primitives}/Tooltip.d.ts +0 -0
@@ -0,0 +1,1867 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var React = require('react');
5
+ var utils = require('../utils-CTr7wn5d.js');
6
+ var button = require('../button-B8XGl69v.js');
7
+ var chevronRight = require('../chevron-right-0jNdwX2Q.js');
8
+ var chevronLeft = require('../chevron-left-BldoOh5p.js');
9
+ require('../index-BZhTddX0.js');
10
+ require('../index-DuNgWCXZ.js');
11
+ require('../index-D-iDn9RI.js');
12
+ require('../createLucideIcon-D0tRgV6l.js');
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n.default = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
+
34
+ function isObject$1(subject) {
35
+ return Object.prototype.toString.call(subject) === '[object Object]';
36
+ }
37
+ function isRecord(subject) {
38
+ return isObject$1(subject) || Array.isArray(subject);
39
+ }
40
+ function canUseDOM() {
41
+ return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
42
+ }
43
+ function areOptionsEqual(optionsA, optionsB) {
44
+ const optionsAKeys = Object.keys(optionsA);
45
+ const optionsBKeys = Object.keys(optionsB);
46
+ if (optionsAKeys.length !== optionsBKeys.length) return false;
47
+ const breakpointsA = JSON.stringify(Object.keys(optionsA.breakpoints || {}));
48
+ const breakpointsB = JSON.stringify(Object.keys(optionsB.breakpoints || {}));
49
+ if (breakpointsA !== breakpointsB) return false;
50
+ return optionsAKeys.every(key => {
51
+ const valueA = optionsA[key];
52
+ const valueB = optionsB[key];
53
+ if (typeof valueA === 'function') return `${valueA}` === `${valueB}`;
54
+ if (!isRecord(valueA) || !isRecord(valueB)) return valueA === valueB;
55
+ return areOptionsEqual(valueA, valueB);
56
+ });
57
+ }
58
+ function sortAndMapPluginToOptions(plugins) {
59
+ return plugins.concat().sort((a, b) => a.name > b.name ? 1 : -1).map(plugin => plugin.options);
60
+ }
61
+ function arePluginsEqual(pluginsA, pluginsB) {
62
+ if (pluginsA.length !== pluginsB.length) return false;
63
+ const optionsA = sortAndMapPluginToOptions(pluginsA);
64
+ const optionsB = sortAndMapPluginToOptions(pluginsB);
65
+ return optionsA.every((optionA, index) => {
66
+ const optionB = optionsB[index];
67
+ return areOptionsEqual(optionA, optionB);
68
+ });
69
+ }
70
+
71
+ function isNumber(subject) {
72
+ return typeof subject === 'number';
73
+ }
74
+ function isString(subject) {
75
+ return typeof subject === 'string';
76
+ }
77
+ function isBoolean(subject) {
78
+ return typeof subject === 'boolean';
79
+ }
80
+ function isObject(subject) {
81
+ return Object.prototype.toString.call(subject) === '[object Object]';
82
+ }
83
+ function mathAbs(n) {
84
+ return Math.abs(n);
85
+ }
86
+ function mathSign(n) {
87
+ return Math.sign(n);
88
+ }
89
+ function deltaAbs(valueB, valueA) {
90
+ return mathAbs(valueB - valueA);
91
+ }
92
+ function factorAbs(valueB, valueA) {
93
+ if (valueB === 0 || valueA === 0) return 0;
94
+ if (mathAbs(valueB) <= mathAbs(valueA)) return 0;
95
+ const diff = deltaAbs(mathAbs(valueB), mathAbs(valueA));
96
+ return mathAbs(diff / valueB);
97
+ }
98
+ function roundToTwoDecimals(num) {
99
+ return Math.round(num * 100) / 100;
100
+ }
101
+ function arrayKeys(array) {
102
+ return objectKeys(array).map(Number);
103
+ }
104
+ function arrayLast(array) {
105
+ return array[arrayLastIndex(array)];
106
+ }
107
+ function arrayLastIndex(array) {
108
+ return Math.max(0, array.length - 1);
109
+ }
110
+ function arrayIsLastIndex(array, index) {
111
+ return index === arrayLastIndex(array);
112
+ }
113
+ function arrayFromNumber(n, startAt = 0) {
114
+ return Array.from(Array(n), (_, i) => startAt + i);
115
+ }
116
+ function objectKeys(object) {
117
+ return Object.keys(object);
118
+ }
119
+ function objectsMergeDeep(objectA, objectB) {
120
+ return [objectA, objectB].reduce((mergedObjects, currentObject) => {
121
+ objectKeys(currentObject).forEach(key => {
122
+ const valueA = mergedObjects[key];
123
+ const valueB = currentObject[key];
124
+ const areObjects = isObject(valueA) && isObject(valueB);
125
+ mergedObjects[key] = areObjects ? objectsMergeDeep(valueA, valueB) : valueB;
126
+ });
127
+ return mergedObjects;
128
+ }, {});
129
+ }
130
+ function isMouseEvent(evt, ownerWindow) {
131
+ return typeof ownerWindow.MouseEvent !== 'undefined' && evt instanceof ownerWindow.MouseEvent;
132
+ }
133
+
134
+ function Alignment(align, viewSize) {
135
+ const predefined = {
136
+ start,
137
+ center,
138
+ end
139
+ };
140
+ function start() {
141
+ return 0;
142
+ }
143
+ function center(n) {
144
+ return end(n) / 2;
145
+ }
146
+ function end(n) {
147
+ return viewSize - n;
148
+ }
149
+ function measure(n, index) {
150
+ if (isString(align)) return predefined[align](n);
151
+ return align(viewSize, n, index);
152
+ }
153
+ const self = {
154
+ measure
155
+ };
156
+ return self;
157
+ }
158
+
159
+ function EventStore() {
160
+ let listeners = [];
161
+ function add(node, type, handler, options = {
162
+ passive: true
163
+ }) {
164
+ let removeListener;
165
+ if ('addEventListener' in node) {
166
+ node.addEventListener(type, handler, options);
167
+ removeListener = () => node.removeEventListener(type, handler, options);
168
+ } else {
169
+ const legacyMediaQueryList = node;
170
+ legacyMediaQueryList.addListener(handler);
171
+ removeListener = () => legacyMediaQueryList.removeListener(handler);
172
+ }
173
+ listeners.push(removeListener);
174
+ return self;
175
+ }
176
+ function clear() {
177
+ listeners = listeners.filter(remove => remove());
178
+ }
179
+ const self = {
180
+ add,
181
+ clear
182
+ };
183
+ return self;
184
+ }
185
+
186
+ function Animations(ownerDocument, ownerWindow, update, render) {
187
+ const documentVisibleHandler = EventStore();
188
+ const fixedTimeStep = 1000 / 60;
189
+ let lastTimeStamp = null;
190
+ let accumulatedTime = 0;
191
+ let animationId = 0;
192
+ function init() {
193
+ documentVisibleHandler.add(ownerDocument, 'visibilitychange', () => {
194
+ if (ownerDocument.hidden) reset();
195
+ });
196
+ }
197
+ function destroy() {
198
+ stop();
199
+ documentVisibleHandler.clear();
200
+ }
201
+ function animate(timeStamp) {
202
+ if (!animationId) return;
203
+ if (!lastTimeStamp) {
204
+ lastTimeStamp = timeStamp;
205
+ update();
206
+ update();
207
+ }
208
+ const timeElapsed = timeStamp - lastTimeStamp;
209
+ lastTimeStamp = timeStamp;
210
+ accumulatedTime += timeElapsed;
211
+ while (accumulatedTime >= fixedTimeStep) {
212
+ update();
213
+ accumulatedTime -= fixedTimeStep;
214
+ }
215
+ const alpha = accumulatedTime / fixedTimeStep;
216
+ render(alpha);
217
+ if (animationId) {
218
+ animationId = ownerWindow.requestAnimationFrame(animate);
219
+ }
220
+ }
221
+ function start() {
222
+ if (animationId) return;
223
+ animationId = ownerWindow.requestAnimationFrame(animate);
224
+ }
225
+ function stop() {
226
+ ownerWindow.cancelAnimationFrame(animationId);
227
+ lastTimeStamp = null;
228
+ accumulatedTime = 0;
229
+ animationId = 0;
230
+ }
231
+ function reset() {
232
+ lastTimeStamp = null;
233
+ accumulatedTime = 0;
234
+ }
235
+ const self = {
236
+ init,
237
+ destroy,
238
+ start,
239
+ stop,
240
+ update,
241
+ render
242
+ };
243
+ return self;
244
+ }
245
+
246
+ function Axis(axis, contentDirection) {
247
+ const isRightToLeft = contentDirection === 'rtl';
248
+ const isVertical = axis === 'y';
249
+ const scroll = isVertical ? 'y' : 'x';
250
+ const cross = isVertical ? 'x' : 'y';
251
+ const sign = !isVertical && isRightToLeft ? -1 : 1;
252
+ const startEdge = getStartEdge();
253
+ const endEdge = getEndEdge();
254
+ function measureSize(nodeRect) {
255
+ const {
256
+ height,
257
+ width
258
+ } = nodeRect;
259
+ return isVertical ? height : width;
260
+ }
261
+ function getStartEdge() {
262
+ if (isVertical) return 'top';
263
+ return isRightToLeft ? 'right' : 'left';
264
+ }
265
+ function getEndEdge() {
266
+ if (isVertical) return 'bottom';
267
+ return isRightToLeft ? 'left' : 'right';
268
+ }
269
+ function direction(n) {
270
+ return n * sign;
271
+ }
272
+ const self = {
273
+ scroll,
274
+ cross,
275
+ startEdge,
276
+ endEdge,
277
+ measureSize,
278
+ direction
279
+ };
280
+ return self;
281
+ }
282
+
283
+ function Limit(min = 0, max = 0) {
284
+ const length = mathAbs(min - max);
285
+ function reachedMin(n) {
286
+ return n < min;
287
+ }
288
+ function reachedMax(n) {
289
+ return n > max;
290
+ }
291
+ function reachedAny(n) {
292
+ return reachedMin(n) || reachedMax(n);
293
+ }
294
+ function constrain(n) {
295
+ if (!reachedAny(n)) return n;
296
+ return reachedMin(n) ? min : max;
297
+ }
298
+ function removeOffset(n) {
299
+ if (!length) return n;
300
+ return n - length * Math.ceil((n - max) / length);
301
+ }
302
+ const self = {
303
+ length,
304
+ max,
305
+ min,
306
+ constrain,
307
+ reachedAny,
308
+ reachedMax,
309
+ reachedMin,
310
+ removeOffset
311
+ };
312
+ return self;
313
+ }
314
+
315
+ function Counter(max, start, loop) {
316
+ const {
317
+ constrain
318
+ } = Limit(0, max);
319
+ const loopEnd = max + 1;
320
+ let counter = withinLimit(start);
321
+ function withinLimit(n) {
322
+ return !loop ? constrain(n) : mathAbs((loopEnd + n) % loopEnd);
323
+ }
324
+ function get() {
325
+ return counter;
326
+ }
327
+ function set(n) {
328
+ counter = withinLimit(n);
329
+ return self;
330
+ }
331
+ function add(n) {
332
+ return clone().set(get() + n);
333
+ }
334
+ function clone() {
335
+ return Counter(max, get(), loop);
336
+ }
337
+ const self = {
338
+ get,
339
+ set,
340
+ add,
341
+ clone
342
+ };
343
+ return self;
344
+ }
345
+
346
+ function DragHandler(axis, rootNode, ownerDocument, ownerWindow, target, dragTracker, location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, baseFriction, watchDrag) {
347
+ const {
348
+ cross: crossAxis,
349
+ direction
350
+ } = axis;
351
+ const focusNodes = ['INPUT', 'SELECT', 'TEXTAREA'];
352
+ const nonPassiveEvent = {
353
+ passive: false
354
+ };
355
+ const initEvents = EventStore();
356
+ const dragEvents = EventStore();
357
+ const goToNextThreshold = Limit(50, 225).constrain(percentOfView.measure(20));
358
+ const snapForceBoost = {
359
+ mouse: 300,
360
+ touch: 400
361
+ };
362
+ const freeForceBoost = {
363
+ mouse: 500,
364
+ touch: 600
365
+ };
366
+ const baseSpeed = dragFree ? 43 : 25;
367
+ let isMoving = false;
368
+ let startScroll = 0;
369
+ let startCross = 0;
370
+ let pointerIsDown = false;
371
+ let preventScroll = false;
372
+ let preventClick = false;
373
+ let isMouse = false;
374
+ function init(emblaApi) {
375
+ if (!watchDrag) return;
376
+ function downIfAllowed(evt) {
377
+ if (isBoolean(watchDrag) || watchDrag(emblaApi, evt)) down(evt);
378
+ }
379
+ const node = rootNode;
380
+ initEvents.add(node, 'dragstart', evt => evt.preventDefault(), nonPassiveEvent).add(node, 'touchmove', () => undefined, nonPassiveEvent).add(node, 'touchend', () => undefined).add(node, 'touchstart', downIfAllowed).add(node, 'mousedown', downIfAllowed).add(node, 'touchcancel', up).add(node, 'contextmenu', up).add(node, 'click', click, true);
381
+ }
382
+ function destroy() {
383
+ initEvents.clear();
384
+ dragEvents.clear();
385
+ }
386
+ function addDragEvents() {
387
+ const node = isMouse ? ownerDocument : rootNode;
388
+ dragEvents.add(node, 'touchmove', move, nonPassiveEvent).add(node, 'touchend', up).add(node, 'mousemove', move, nonPassiveEvent).add(node, 'mouseup', up);
389
+ }
390
+ function isFocusNode(node) {
391
+ const nodeName = node.nodeName || '';
392
+ return focusNodes.includes(nodeName);
393
+ }
394
+ function forceBoost() {
395
+ const boost = dragFree ? freeForceBoost : snapForceBoost;
396
+ const type = isMouse ? 'mouse' : 'touch';
397
+ return boost[type];
398
+ }
399
+ function allowedForce(force, targetChanged) {
400
+ const next = index.add(mathSign(force) * -1);
401
+ const baseForce = scrollTarget.byDistance(force, !dragFree).distance;
402
+ if (dragFree || mathAbs(force) < goToNextThreshold) return baseForce;
403
+ if (skipSnaps && targetChanged) return baseForce * 0.5;
404
+ return scrollTarget.byIndex(next.get(), 0).distance;
405
+ }
406
+ function down(evt) {
407
+ const isMouseEvt = isMouseEvent(evt, ownerWindow);
408
+ isMouse = isMouseEvt;
409
+ preventClick = dragFree && isMouseEvt && !evt.buttons && isMoving;
410
+ isMoving = deltaAbs(target.get(), location.get()) >= 2;
411
+ if (isMouseEvt && evt.button !== 0) return;
412
+ if (isFocusNode(evt.target)) return;
413
+ pointerIsDown = true;
414
+ dragTracker.pointerDown(evt);
415
+ scrollBody.useFriction(0).useDuration(0);
416
+ target.set(location);
417
+ addDragEvents();
418
+ startScroll = dragTracker.readPoint(evt);
419
+ startCross = dragTracker.readPoint(evt, crossAxis);
420
+ eventHandler.emit('pointerDown');
421
+ }
422
+ function move(evt) {
423
+ const isTouchEvt = !isMouseEvent(evt, ownerWindow);
424
+ if (isTouchEvt && evt.touches.length >= 2) return up(evt);
425
+ const lastScroll = dragTracker.readPoint(evt);
426
+ const lastCross = dragTracker.readPoint(evt, crossAxis);
427
+ const diffScroll = deltaAbs(lastScroll, startScroll);
428
+ const diffCross = deltaAbs(lastCross, startCross);
429
+ if (!preventScroll && !isMouse) {
430
+ if (!evt.cancelable) return up(evt);
431
+ preventScroll = diffScroll > diffCross;
432
+ if (!preventScroll) return up(evt);
433
+ }
434
+ const diff = dragTracker.pointerMove(evt);
435
+ if (diffScroll > dragThreshold) preventClick = true;
436
+ scrollBody.useFriction(0.3).useDuration(0.75);
437
+ animation.start();
438
+ target.add(direction(diff));
439
+ evt.preventDefault();
440
+ }
441
+ function up(evt) {
442
+ const currentLocation = scrollTarget.byDistance(0, false);
443
+ const targetChanged = currentLocation.index !== index.get();
444
+ const rawForce = dragTracker.pointerUp(evt) * forceBoost();
445
+ const force = allowedForce(direction(rawForce), targetChanged);
446
+ const forceFactor = factorAbs(rawForce, force);
447
+ const speed = baseSpeed - 10 * forceFactor;
448
+ const friction = baseFriction + forceFactor / 50;
449
+ preventScroll = false;
450
+ pointerIsDown = false;
451
+ dragEvents.clear();
452
+ scrollBody.useDuration(speed).useFriction(friction);
453
+ scrollTo.distance(force, !dragFree);
454
+ isMouse = false;
455
+ eventHandler.emit('pointerUp');
456
+ }
457
+ function click(evt) {
458
+ if (preventClick) {
459
+ evt.stopPropagation();
460
+ evt.preventDefault();
461
+ preventClick = false;
462
+ }
463
+ }
464
+ function pointerDown() {
465
+ return pointerIsDown;
466
+ }
467
+ const self = {
468
+ init,
469
+ destroy,
470
+ pointerDown
471
+ };
472
+ return self;
473
+ }
474
+
475
+ function DragTracker(axis, ownerWindow) {
476
+ const logInterval = 170;
477
+ let startEvent;
478
+ let lastEvent;
479
+ function readTime(evt) {
480
+ return evt.timeStamp;
481
+ }
482
+ function readPoint(evt, evtAxis) {
483
+ const property = evtAxis || axis.scroll;
484
+ const coord = `client${property === 'x' ? 'X' : 'Y'}`;
485
+ return (isMouseEvent(evt, ownerWindow) ? evt : evt.touches[0])[coord];
486
+ }
487
+ function pointerDown(evt) {
488
+ startEvent = evt;
489
+ lastEvent = evt;
490
+ return readPoint(evt);
491
+ }
492
+ function pointerMove(evt) {
493
+ const diff = readPoint(evt) - readPoint(lastEvent);
494
+ const expired = readTime(evt) - readTime(startEvent) > logInterval;
495
+ lastEvent = evt;
496
+ if (expired) startEvent = evt;
497
+ return diff;
498
+ }
499
+ function pointerUp(evt) {
500
+ if (!startEvent || !lastEvent) return 0;
501
+ const diffDrag = readPoint(lastEvent) - readPoint(startEvent);
502
+ const diffTime = readTime(evt) - readTime(startEvent);
503
+ const expired = readTime(evt) - readTime(lastEvent) > logInterval;
504
+ const force = diffDrag / diffTime;
505
+ const isFlick = diffTime && !expired && mathAbs(force) > 0.1;
506
+ return isFlick ? force : 0;
507
+ }
508
+ const self = {
509
+ pointerDown,
510
+ pointerMove,
511
+ pointerUp,
512
+ readPoint
513
+ };
514
+ return self;
515
+ }
516
+
517
+ function NodeRects() {
518
+ function measure(node) {
519
+ const {
520
+ offsetTop,
521
+ offsetLeft,
522
+ offsetWidth,
523
+ offsetHeight
524
+ } = node;
525
+ const offset = {
526
+ top: offsetTop,
527
+ right: offsetLeft + offsetWidth,
528
+ bottom: offsetTop + offsetHeight,
529
+ left: offsetLeft,
530
+ width: offsetWidth,
531
+ height: offsetHeight
532
+ };
533
+ return offset;
534
+ }
535
+ const self = {
536
+ measure
537
+ };
538
+ return self;
539
+ }
540
+
541
+ function PercentOfView(viewSize) {
542
+ function measure(n) {
543
+ return viewSize * (n / 100);
544
+ }
545
+ const self = {
546
+ measure
547
+ };
548
+ return self;
549
+ }
550
+
551
+ function ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects) {
552
+ const observeNodes = [container].concat(slides);
553
+ let resizeObserver;
554
+ let containerSize;
555
+ let slideSizes = [];
556
+ let destroyed = false;
557
+ function readSize(node) {
558
+ return axis.measureSize(nodeRects.measure(node));
559
+ }
560
+ function init(emblaApi) {
561
+ if (!watchResize) return;
562
+ containerSize = readSize(container);
563
+ slideSizes = slides.map(readSize);
564
+ function defaultCallback(entries) {
565
+ for (const entry of entries) {
566
+ if (destroyed) return;
567
+ const isContainer = entry.target === container;
568
+ const slideIndex = slides.indexOf(entry.target);
569
+ const lastSize = isContainer ? containerSize : slideSizes[slideIndex];
570
+ const newSize = readSize(isContainer ? container : slides[slideIndex]);
571
+ const diffSize = mathAbs(newSize - lastSize);
572
+ if (diffSize >= 0.5) {
573
+ emblaApi.reInit();
574
+ eventHandler.emit('resize');
575
+ break;
576
+ }
577
+ }
578
+ }
579
+ resizeObserver = new ResizeObserver(entries => {
580
+ if (isBoolean(watchResize) || watchResize(emblaApi, entries)) {
581
+ defaultCallback(entries);
582
+ }
583
+ });
584
+ ownerWindow.requestAnimationFrame(() => {
585
+ observeNodes.forEach(node => resizeObserver.observe(node));
586
+ });
587
+ }
588
+ function destroy() {
589
+ destroyed = true;
590
+ if (resizeObserver) resizeObserver.disconnect();
591
+ }
592
+ const self = {
593
+ init,
594
+ destroy
595
+ };
596
+ return self;
597
+ }
598
+
599
+ function ScrollBody(location, offsetLocation, previousLocation, target, baseDuration, baseFriction) {
600
+ let scrollVelocity = 0;
601
+ let scrollDirection = 0;
602
+ let scrollDuration = baseDuration;
603
+ let scrollFriction = baseFriction;
604
+ let rawLocation = location.get();
605
+ let rawLocationPrevious = 0;
606
+ function seek() {
607
+ const displacement = target.get() - location.get();
608
+ const isInstant = !scrollDuration;
609
+ let scrollDistance = 0;
610
+ if (isInstant) {
611
+ scrollVelocity = 0;
612
+ previousLocation.set(target);
613
+ location.set(target);
614
+ scrollDistance = displacement;
615
+ } else {
616
+ previousLocation.set(location);
617
+ scrollVelocity += displacement / scrollDuration;
618
+ scrollVelocity *= scrollFriction;
619
+ rawLocation += scrollVelocity;
620
+ location.add(scrollVelocity);
621
+ scrollDistance = rawLocation - rawLocationPrevious;
622
+ }
623
+ scrollDirection = mathSign(scrollDistance);
624
+ rawLocationPrevious = rawLocation;
625
+ return self;
626
+ }
627
+ function settled() {
628
+ const diff = target.get() - offsetLocation.get();
629
+ return mathAbs(diff) < 0.001;
630
+ }
631
+ function duration() {
632
+ return scrollDuration;
633
+ }
634
+ function direction() {
635
+ return scrollDirection;
636
+ }
637
+ function velocity() {
638
+ return scrollVelocity;
639
+ }
640
+ function useBaseDuration() {
641
+ return useDuration(baseDuration);
642
+ }
643
+ function useBaseFriction() {
644
+ return useFriction(baseFriction);
645
+ }
646
+ function useDuration(n) {
647
+ scrollDuration = n;
648
+ return self;
649
+ }
650
+ function useFriction(n) {
651
+ scrollFriction = n;
652
+ return self;
653
+ }
654
+ const self = {
655
+ direction,
656
+ duration,
657
+ velocity,
658
+ seek,
659
+ settled,
660
+ useBaseFriction,
661
+ useBaseDuration,
662
+ useFriction,
663
+ useDuration
664
+ };
665
+ return self;
666
+ }
667
+
668
+ function ScrollBounds(limit, location, target, scrollBody, percentOfView) {
669
+ const pullBackThreshold = percentOfView.measure(10);
670
+ const edgeOffsetTolerance = percentOfView.measure(50);
671
+ const frictionLimit = Limit(0.1, 0.99);
672
+ let disabled = false;
673
+ function shouldConstrain() {
674
+ if (disabled) return false;
675
+ if (!limit.reachedAny(target.get())) return false;
676
+ if (!limit.reachedAny(location.get())) return false;
677
+ return true;
678
+ }
679
+ function constrain(pointerDown) {
680
+ if (!shouldConstrain()) return;
681
+ const edge = limit.reachedMin(location.get()) ? 'min' : 'max';
682
+ const diffToEdge = mathAbs(limit[edge] - location.get());
683
+ const diffToTarget = target.get() - location.get();
684
+ const friction = frictionLimit.constrain(diffToEdge / edgeOffsetTolerance);
685
+ target.subtract(diffToTarget * friction);
686
+ if (!pointerDown && mathAbs(diffToTarget) < pullBackThreshold) {
687
+ target.set(limit.constrain(target.get()));
688
+ scrollBody.useDuration(25).useBaseFriction();
689
+ }
690
+ }
691
+ function toggleActive(active) {
692
+ disabled = !active;
693
+ }
694
+ const self = {
695
+ shouldConstrain,
696
+ constrain,
697
+ toggleActive
698
+ };
699
+ return self;
700
+ }
701
+
702
+ function ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance) {
703
+ const scrollBounds = Limit(-contentSize + viewSize, 0);
704
+ const snapsBounded = measureBounded();
705
+ const scrollContainLimit = findScrollContainLimit();
706
+ const snapsContained = measureContained();
707
+ function usePixelTolerance(bound, snap) {
708
+ return deltaAbs(bound, snap) <= 1;
709
+ }
710
+ function findScrollContainLimit() {
711
+ const startSnap = snapsBounded[0];
712
+ const endSnap = arrayLast(snapsBounded);
713
+ const min = snapsBounded.lastIndexOf(startSnap);
714
+ const max = snapsBounded.indexOf(endSnap) + 1;
715
+ return Limit(min, max);
716
+ }
717
+ function measureBounded() {
718
+ return snapsAligned.map((snapAligned, index) => {
719
+ const {
720
+ min,
721
+ max
722
+ } = scrollBounds;
723
+ const snap = scrollBounds.constrain(snapAligned);
724
+ const isFirst = !index;
725
+ const isLast = arrayIsLastIndex(snapsAligned, index);
726
+ if (isFirst) return max;
727
+ if (isLast) return min;
728
+ if (usePixelTolerance(min, snap)) return min;
729
+ if (usePixelTolerance(max, snap)) return max;
730
+ return snap;
731
+ }).map(scrollBound => parseFloat(scrollBound.toFixed(3)));
732
+ }
733
+ function measureContained() {
734
+ if (contentSize <= viewSize + pixelTolerance) return [scrollBounds.max];
735
+ if (containScroll === 'keepSnaps') return snapsBounded;
736
+ const {
737
+ min,
738
+ max
739
+ } = scrollContainLimit;
740
+ return snapsBounded.slice(min, max);
741
+ }
742
+ const self = {
743
+ snapsContained,
744
+ scrollContainLimit
745
+ };
746
+ return self;
747
+ }
748
+
749
+ function ScrollLimit(contentSize, scrollSnaps, loop) {
750
+ const max = scrollSnaps[0];
751
+ const min = loop ? max - contentSize : arrayLast(scrollSnaps);
752
+ const limit = Limit(min, max);
753
+ const self = {
754
+ limit
755
+ };
756
+ return self;
757
+ }
758
+
759
+ function ScrollLooper(contentSize, limit, location, vectors) {
760
+ const jointSafety = 0.1;
761
+ const min = limit.min + jointSafety;
762
+ const max = limit.max + jointSafety;
763
+ const {
764
+ reachedMin,
765
+ reachedMax
766
+ } = Limit(min, max);
767
+ function shouldLoop(direction) {
768
+ if (direction === 1) return reachedMax(location.get());
769
+ if (direction === -1) return reachedMin(location.get());
770
+ return false;
771
+ }
772
+ function loop(direction) {
773
+ if (!shouldLoop(direction)) return;
774
+ const loopDistance = contentSize * (direction * -1);
775
+ vectors.forEach(v => v.add(loopDistance));
776
+ }
777
+ const self = {
778
+ loop
779
+ };
780
+ return self;
781
+ }
782
+
783
+ function ScrollProgress(limit) {
784
+ const {
785
+ max,
786
+ length
787
+ } = limit;
788
+ function get(n) {
789
+ const currentLocation = n - max;
790
+ return length ? currentLocation / -length : 0;
791
+ }
792
+ const self = {
793
+ get
794
+ };
795
+ return self;
796
+ }
797
+
798
+ function ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll) {
799
+ const {
800
+ startEdge,
801
+ endEdge
802
+ } = axis;
803
+ const {
804
+ groupSlides
805
+ } = slidesToScroll;
806
+ const alignments = measureSizes().map(alignment.measure);
807
+ const snaps = measureUnaligned();
808
+ const snapsAligned = measureAligned();
809
+ function measureSizes() {
810
+ return groupSlides(slideRects).map(rects => arrayLast(rects)[endEdge] - rects[0][startEdge]).map(mathAbs);
811
+ }
812
+ function measureUnaligned() {
813
+ return slideRects.map(rect => containerRect[startEdge] - rect[startEdge]).map(snap => -mathAbs(snap));
814
+ }
815
+ function measureAligned() {
816
+ return groupSlides(snaps).map(g => g[0]).map((snap, index) => snap + alignments[index]);
817
+ }
818
+ const self = {
819
+ snaps,
820
+ snapsAligned
821
+ };
822
+ return self;
823
+ }
824
+
825
+ function SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes) {
826
+ const {
827
+ groupSlides
828
+ } = slidesToScroll;
829
+ const {
830
+ min,
831
+ max
832
+ } = scrollContainLimit;
833
+ const slideRegistry = createSlideRegistry();
834
+ function createSlideRegistry() {
835
+ const groupedSlideIndexes = groupSlides(slideIndexes);
836
+ const doNotContain = !containSnaps || containScroll === 'keepSnaps';
837
+ if (scrollSnaps.length === 1) return [slideIndexes];
838
+ if (doNotContain) return groupedSlideIndexes;
839
+ return groupedSlideIndexes.slice(min, max).map((group, index, groups) => {
840
+ const isFirst = !index;
841
+ const isLast = arrayIsLastIndex(groups, index);
842
+ if (isFirst) {
843
+ const range = arrayLast(groups[0]) + 1;
844
+ return arrayFromNumber(range);
845
+ }
846
+ if (isLast) {
847
+ const range = arrayLastIndex(slideIndexes) - arrayLast(groups)[0] + 1;
848
+ return arrayFromNumber(range, arrayLast(groups)[0]);
849
+ }
850
+ return group;
851
+ });
852
+ }
853
+ const self = {
854
+ slideRegistry
855
+ };
856
+ return self;
857
+ }
858
+
859
+ function ScrollTarget(loop, scrollSnaps, contentSize, limit, targetVector) {
860
+ const {
861
+ reachedAny,
862
+ removeOffset,
863
+ constrain
864
+ } = limit;
865
+ function minDistance(distances) {
866
+ return distances.concat().sort((a, b) => mathAbs(a) - mathAbs(b))[0];
867
+ }
868
+ function findTargetSnap(target) {
869
+ const distance = loop ? removeOffset(target) : constrain(target);
870
+ const ascDiffsToSnaps = scrollSnaps.map((snap, index) => ({
871
+ diff: shortcut(snap - distance, 0),
872
+ index
873
+ })).sort((d1, d2) => mathAbs(d1.diff) - mathAbs(d2.diff));
874
+ const {
875
+ index
876
+ } = ascDiffsToSnaps[0];
877
+ return {
878
+ index,
879
+ distance
880
+ };
881
+ }
882
+ function shortcut(target, direction) {
883
+ const targets = [target, target + contentSize, target - contentSize];
884
+ if (!loop) return target;
885
+ if (!direction) return minDistance(targets);
886
+ const matchingTargets = targets.filter(t => mathSign(t) === direction);
887
+ if (matchingTargets.length) return minDistance(matchingTargets);
888
+ return arrayLast(targets) - contentSize;
889
+ }
890
+ function byIndex(index, direction) {
891
+ const diffToSnap = scrollSnaps[index] - targetVector.get();
892
+ const distance = shortcut(diffToSnap, direction);
893
+ return {
894
+ index,
895
+ distance
896
+ };
897
+ }
898
+ function byDistance(distance, snap) {
899
+ const target = targetVector.get() + distance;
900
+ const {
901
+ index,
902
+ distance: targetSnapDistance
903
+ } = findTargetSnap(target);
904
+ const reachedBound = !loop && reachedAny(target);
905
+ if (!snap || reachedBound) return {
906
+ index,
907
+ distance
908
+ };
909
+ const diffToSnap = scrollSnaps[index] - targetSnapDistance;
910
+ const snapDistance = distance + shortcut(diffToSnap, 0);
911
+ return {
912
+ index,
913
+ distance: snapDistance
914
+ };
915
+ }
916
+ const self = {
917
+ byDistance,
918
+ byIndex,
919
+ shortcut
920
+ };
921
+ return self;
922
+ }
923
+
924
+ function ScrollTo(animation, indexCurrent, indexPrevious, scrollBody, scrollTarget, targetVector, eventHandler) {
925
+ function scrollTo(target) {
926
+ const distanceDiff = target.distance;
927
+ const indexDiff = target.index !== indexCurrent.get();
928
+ targetVector.add(distanceDiff);
929
+ if (distanceDiff) {
930
+ if (scrollBody.duration()) {
931
+ animation.start();
932
+ } else {
933
+ animation.update();
934
+ animation.render(1);
935
+ animation.update();
936
+ }
937
+ }
938
+ if (indexDiff) {
939
+ indexPrevious.set(indexCurrent.get());
940
+ indexCurrent.set(target.index);
941
+ eventHandler.emit('select');
942
+ }
943
+ }
944
+ function distance(n, snap) {
945
+ const target = scrollTarget.byDistance(n, snap);
946
+ scrollTo(target);
947
+ }
948
+ function index(n, direction) {
949
+ const targetIndex = indexCurrent.clone().set(n);
950
+ const target = scrollTarget.byIndex(targetIndex.get(), direction);
951
+ scrollTo(target);
952
+ }
953
+ const self = {
954
+ distance,
955
+ index
956
+ };
957
+ return self;
958
+ }
959
+
960
+ function SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus) {
961
+ const focusListenerOptions = {
962
+ passive: true,
963
+ capture: true
964
+ };
965
+ let lastTabPressTime = 0;
966
+ function init(emblaApi) {
967
+ if (!watchFocus) return;
968
+ function defaultCallback(index) {
969
+ const nowTime = new Date().getTime();
970
+ const diffTime = nowTime - lastTabPressTime;
971
+ if (diffTime > 10) return;
972
+ eventHandler.emit('slideFocusStart');
973
+ root.scrollLeft = 0;
974
+ const group = slideRegistry.findIndex(group => group.includes(index));
975
+ if (!isNumber(group)) return;
976
+ scrollBody.useDuration(0);
977
+ scrollTo.index(group, 0);
978
+ eventHandler.emit('slideFocus');
979
+ }
980
+ eventStore.add(document, 'keydown', registerTabPress, false);
981
+ slides.forEach((slide, slideIndex) => {
982
+ eventStore.add(slide, 'focus', evt => {
983
+ if (isBoolean(watchFocus) || watchFocus(emblaApi, evt)) {
984
+ defaultCallback(slideIndex);
985
+ }
986
+ }, focusListenerOptions);
987
+ });
988
+ }
989
+ function registerTabPress(event) {
990
+ if (event.code === 'Tab') lastTabPressTime = new Date().getTime();
991
+ }
992
+ const self = {
993
+ init
994
+ };
995
+ return self;
996
+ }
997
+
998
+ function Vector1D(initialValue) {
999
+ let value = initialValue;
1000
+ function get() {
1001
+ return value;
1002
+ }
1003
+ function set(n) {
1004
+ value = normalizeInput(n);
1005
+ }
1006
+ function add(n) {
1007
+ value += normalizeInput(n);
1008
+ }
1009
+ function subtract(n) {
1010
+ value -= normalizeInput(n);
1011
+ }
1012
+ function normalizeInput(n) {
1013
+ return isNumber(n) ? n : n.get();
1014
+ }
1015
+ const self = {
1016
+ get,
1017
+ set,
1018
+ add,
1019
+ subtract
1020
+ };
1021
+ return self;
1022
+ }
1023
+
1024
+ function Translate(axis, container) {
1025
+ const translate = axis.scroll === 'x' ? x : y;
1026
+ const containerStyle = container.style;
1027
+ let previousTarget = null;
1028
+ let disabled = false;
1029
+ function x(n) {
1030
+ return `translate3d(${n}px,0px,0px)`;
1031
+ }
1032
+ function y(n) {
1033
+ return `translate3d(0px,${n}px,0px)`;
1034
+ }
1035
+ function to(target) {
1036
+ if (disabled) return;
1037
+ const newTarget = roundToTwoDecimals(axis.direction(target));
1038
+ if (newTarget === previousTarget) return;
1039
+ containerStyle.transform = translate(newTarget);
1040
+ previousTarget = newTarget;
1041
+ }
1042
+ function toggleActive(active) {
1043
+ disabled = !active;
1044
+ }
1045
+ function clear() {
1046
+ if (disabled) return;
1047
+ containerStyle.transform = '';
1048
+ if (!container.getAttribute('style')) container.removeAttribute('style');
1049
+ }
1050
+ const self = {
1051
+ clear,
1052
+ to,
1053
+ toggleActive
1054
+ };
1055
+ return self;
1056
+ }
1057
+
1058
+ function SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, location, slides) {
1059
+ const roundingSafety = 0.5;
1060
+ const ascItems = arrayKeys(slideSizesWithGaps);
1061
+ const descItems = arrayKeys(slideSizesWithGaps).reverse();
1062
+ const loopPoints = startPoints().concat(endPoints());
1063
+ function removeSlideSizes(indexes, from) {
1064
+ return indexes.reduce((a, i) => {
1065
+ return a - slideSizesWithGaps[i];
1066
+ }, from);
1067
+ }
1068
+ function slidesInGap(indexes, gap) {
1069
+ return indexes.reduce((a, i) => {
1070
+ const remainingGap = removeSlideSizes(a, gap);
1071
+ return remainingGap > 0 ? a.concat([i]) : a;
1072
+ }, []);
1073
+ }
1074
+ function findSlideBounds(offset) {
1075
+ return snaps.map((snap, index) => ({
1076
+ start: snap - slideSizes[index] + roundingSafety + offset,
1077
+ end: snap + viewSize - roundingSafety + offset
1078
+ }));
1079
+ }
1080
+ function findLoopPoints(indexes, offset, isEndEdge) {
1081
+ const slideBounds = findSlideBounds(offset);
1082
+ return indexes.map(index => {
1083
+ const initial = isEndEdge ? 0 : -contentSize;
1084
+ const altered = isEndEdge ? contentSize : 0;
1085
+ const boundEdge = isEndEdge ? 'end' : 'start';
1086
+ const loopPoint = slideBounds[index][boundEdge];
1087
+ return {
1088
+ index,
1089
+ loopPoint,
1090
+ slideLocation: Vector1D(-1),
1091
+ translate: Translate(axis, slides[index]),
1092
+ target: () => location.get() > loopPoint ? initial : altered
1093
+ };
1094
+ });
1095
+ }
1096
+ function startPoints() {
1097
+ const gap = scrollSnaps[0];
1098
+ const indexes = slidesInGap(descItems, gap);
1099
+ return findLoopPoints(indexes, contentSize, false);
1100
+ }
1101
+ function endPoints() {
1102
+ const gap = viewSize - scrollSnaps[0] - 1;
1103
+ const indexes = slidesInGap(ascItems, gap);
1104
+ return findLoopPoints(indexes, -contentSize, true);
1105
+ }
1106
+ function canLoop() {
1107
+ return loopPoints.every(({
1108
+ index
1109
+ }) => {
1110
+ const otherIndexes = ascItems.filter(i => i !== index);
1111
+ return removeSlideSizes(otherIndexes, viewSize) <= 0.1;
1112
+ });
1113
+ }
1114
+ function loop() {
1115
+ loopPoints.forEach(loopPoint => {
1116
+ const {
1117
+ target,
1118
+ translate,
1119
+ slideLocation
1120
+ } = loopPoint;
1121
+ const shiftLocation = target();
1122
+ if (shiftLocation === slideLocation.get()) return;
1123
+ translate.to(shiftLocation);
1124
+ slideLocation.set(shiftLocation);
1125
+ });
1126
+ }
1127
+ function clear() {
1128
+ loopPoints.forEach(loopPoint => loopPoint.translate.clear());
1129
+ }
1130
+ const self = {
1131
+ canLoop,
1132
+ clear,
1133
+ loop,
1134
+ loopPoints
1135
+ };
1136
+ return self;
1137
+ }
1138
+
1139
+ function SlidesHandler(container, eventHandler, watchSlides) {
1140
+ let mutationObserver;
1141
+ let destroyed = false;
1142
+ function init(emblaApi) {
1143
+ if (!watchSlides) return;
1144
+ function defaultCallback(mutations) {
1145
+ for (const mutation of mutations) {
1146
+ if (mutation.type === 'childList') {
1147
+ emblaApi.reInit();
1148
+ eventHandler.emit('slidesChanged');
1149
+ break;
1150
+ }
1151
+ }
1152
+ }
1153
+ mutationObserver = new MutationObserver(mutations => {
1154
+ if (destroyed) return;
1155
+ if (isBoolean(watchSlides) || watchSlides(emblaApi, mutations)) {
1156
+ defaultCallback(mutations);
1157
+ }
1158
+ });
1159
+ mutationObserver.observe(container, {
1160
+ childList: true
1161
+ });
1162
+ }
1163
+ function destroy() {
1164
+ if (mutationObserver) mutationObserver.disconnect();
1165
+ destroyed = true;
1166
+ }
1167
+ const self = {
1168
+ init,
1169
+ destroy
1170
+ };
1171
+ return self;
1172
+ }
1173
+
1174
+ function SlidesInView(container, slides, eventHandler, threshold) {
1175
+ const intersectionEntryMap = {};
1176
+ let inViewCache = null;
1177
+ let notInViewCache = null;
1178
+ let intersectionObserver;
1179
+ let destroyed = false;
1180
+ function init() {
1181
+ intersectionObserver = new IntersectionObserver(entries => {
1182
+ if (destroyed) return;
1183
+ entries.forEach(entry => {
1184
+ const index = slides.indexOf(entry.target);
1185
+ intersectionEntryMap[index] = entry;
1186
+ });
1187
+ inViewCache = null;
1188
+ notInViewCache = null;
1189
+ eventHandler.emit('slidesInView');
1190
+ }, {
1191
+ root: container.parentElement,
1192
+ threshold
1193
+ });
1194
+ slides.forEach(slide => intersectionObserver.observe(slide));
1195
+ }
1196
+ function destroy() {
1197
+ if (intersectionObserver) intersectionObserver.disconnect();
1198
+ destroyed = true;
1199
+ }
1200
+ function createInViewList(inView) {
1201
+ return objectKeys(intersectionEntryMap).reduce((list, slideIndex) => {
1202
+ const index = parseInt(slideIndex);
1203
+ const {
1204
+ isIntersecting
1205
+ } = intersectionEntryMap[index];
1206
+ const inViewMatch = inView && isIntersecting;
1207
+ const notInViewMatch = !inView && !isIntersecting;
1208
+ if (inViewMatch || notInViewMatch) list.push(index);
1209
+ return list;
1210
+ }, []);
1211
+ }
1212
+ function get(inView = true) {
1213
+ if (inView && inViewCache) return inViewCache;
1214
+ if (!inView && notInViewCache) return notInViewCache;
1215
+ const slideIndexes = createInViewList(inView);
1216
+ if (inView) inViewCache = slideIndexes;
1217
+ if (!inView) notInViewCache = slideIndexes;
1218
+ return slideIndexes;
1219
+ }
1220
+ const self = {
1221
+ init,
1222
+ destroy,
1223
+ get
1224
+ };
1225
+ return self;
1226
+ }
1227
+
1228
+ function SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow) {
1229
+ const {
1230
+ measureSize,
1231
+ startEdge,
1232
+ endEdge
1233
+ } = axis;
1234
+ const withEdgeGap = slideRects[0] && readEdgeGap;
1235
+ const startGap = measureStartGap();
1236
+ const endGap = measureEndGap();
1237
+ const slideSizes = slideRects.map(measureSize);
1238
+ const slideSizesWithGaps = measureWithGaps();
1239
+ function measureStartGap() {
1240
+ if (!withEdgeGap) return 0;
1241
+ const slideRect = slideRects[0];
1242
+ return mathAbs(containerRect[startEdge] - slideRect[startEdge]);
1243
+ }
1244
+ function measureEndGap() {
1245
+ if (!withEdgeGap) return 0;
1246
+ const style = ownerWindow.getComputedStyle(arrayLast(slides));
1247
+ return parseFloat(style.getPropertyValue(`margin-${endEdge}`));
1248
+ }
1249
+ function measureWithGaps() {
1250
+ return slideRects.map((rect, index, rects) => {
1251
+ const isFirst = !index;
1252
+ const isLast = arrayIsLastIndex(rects, index);
1253
+ if (isFirst) return slideSizes[index] + startGap;
1254
+ if (isLast) return slideSizes[index] + endGap;
1255
+ return rects[index + 1][startEdge] - rect[startEdge];
1256
+ }).map(mathAbs);
1257
+ }
1258
+ const self = {
1259
+ slideSizes,
1260
+ slideSizesWithGaps,
1261
+ startGap,
1262
+ endGap
1263
+ };
1264
+ return self;
1265
+ }
1266
+
1267
+ function SlidesToScroll(axis, viewSize, slidesToScroll, loop, containerRect, slideRects, startGap, endGap, pixelTolerance) {
1268
+ const {
1269
+ startEdge,
1270
+ endEdge,
1271
+ direction
1272
+ } = axis;
1273
+ const groupByNumber = isNumber(slidesToScroll);
1274
+ function byNumber(array, groupSize) {
1275
+ return arrayKeys(array).filter(i => i % groupSize === 0).map(i => array.slice(i, i + groupSize));
1276
+ }
1277
+ function bySize(array) {
1278
+ if (!array.length) return [];
1279
+ return arrayKeys(array).reduce((groups, rectB, index) => {
1280
+ const rectA = arrayLast(groups) || 0;
1281
+ const isFirst = rectA === 0;
1282
+ const isLast = rectB === arrayLastIndex(array);
1283
+ const edgeA = containerRect[startEdge] - slideRects[rectA][startEdge];
1284
+ const edgeB = containerRect[startEdge] - slideRects[rectB][endEdge];
1285
+ const gapA = !loop && isFirst ? direction(startGap) : 0;
1286
+ const gapB = !loop && isLast ? direction(endGap) : 0;
1287
+ const chunkSize = mathAbs(edgeB - gapB - (edgeA + gapA));
1288
+ if (index && chunkSize > viewSize + pixelTolerance) groups.push(rectB);
1289
+ if (isLast) groups.push(array.length);
1290
+ return groups;
1291
+ }, []).map((currentSize, index, groups) => {
1292
+ const previousSize = Math.max(groups[index - 1] || 0);
1293
+ return array.slice(previousSize, currentSize);
1294
+ });
1295
+ }
1296
+ function groupSlides(array) {
1297
+ return groupByNumber ? byNumber(array, slidesToScroll) : bySize(array);
1298
+ }
1299
+ const self = {
1300
+ groupSlides
1301
+ };
1302
+ return self;
1303
+ }
1304
+
1305
+ function Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler) {
1306
+ // Options
1307
+ const {
1308
+ align,
1309
+ axis: scrollAxis,
1310
+ direction,
1311
+ startIndex,
1312
+ loop,
1313
+ duration,
1314
+ dragFree,
1315
+ dragThreshold,
1316
+ inViewThreshold,
1317
+ slidesToScroll: groupSlides,
1318
+ skipSnaps,
1319
+ containScroll,
1320
+ watchResize,
1321
+ watchSlides,
1322
+ watchDrag,
1323
+ watchFocus
1324
+ } = options;
1325
+ // Measurements
1326
+ const pixelTolerance = 2;
1327
+ const nodeRects = NodeRects();
1328
+ const containerRect = nodeRects.measure(container);
1329
+ const slideRects = slides.map(nodeRects.measure);
1330
+ const axis = Axis(scrollAxis, direction);
1331
+ const viewSize = axis.measureSize(containerRect);
1332
+ const percentOfView = PercentOfView(viewSize);
1333
+ const alignment = Alignment(align, viewSize);
1334
+ const containSnaps = !loop && !!containScroll;
1335
+ const readEdgeGap = loop || !!containScroll;
1336
+ const {
1337
+ slideSizes,
1338
+ slideSizesWithGaps,
1339
+ startGap,
1340
+ endGap
1341
+ } = SlideSizes(axis, containerRect, slideRects, slides, readEdgeGap, ownerWindow);
1342
+ const slidesToScroll = SlidesToScroll(axis, viewSize, groupSlides, loop, containerRect, slideRects, startGap, endGap, pixelTolerance);
1343
+ const {
1344
+ snaps,
1345
+ snapsAligned
1346
+ } = ScrollSnaps(axis, alignment, containerRect, slideRects, slidesToScroll);
1347
+ const contentSize = -arrayLast(snaps) + arrayLast(slideSizesWithGaps);
1348
+ const {
1349
+ snapsContained,
1350
+ scrollContainLimit
1351
+ } = ScrollContain(viewSize, contentSize, snapsAligned, containScroll, pixelTolerance);
1352
+ const scrollSnaps = containSnaps ? snapsContained : snapsAligned;
1353
+ const {
1354
+ limit
1355
+ } = ScrollLimit(contentSize, scrollSnaps, loop);
1356
+ // Indexes
1357
+ const index = Counter(arrayLastIndex(scrollSnaps), startIndex, loop);
1358
+ const indexPrevious = index.clone();
1359
+ const slideIndexes = arrayKeys(slides);
1360
+ // Animation
1361
+ const update = ({
1362
+ dragHandler,
1363
+ scrollBody,
1364
+ scrollBounds,
1365
+ options: {
1366
+ loop
1367
+ }
1368
+ }) => {
1369
+ if (!loop) scrollBounds.constrain(dragHandler.pointerDown());
1370
+ scrollBody.seek();
1371
+ };
1372
+ const render = ({
1373
+ scrollBody,
1374
+ translate,
1375
+ location,
1376
+ offsetLocation,
1377
+ previousLocation,
1378
+ scrollLooper,
1379
+ slideLooper,
1380
+ dragHandler,
1381
+ animation,
1382
+ eventHandler,
1383
+ scrollBounds,
1384
+ options: {
1385
+ loop
1386
+ }
1387
+ }, alpha) => {
1388
+ const shouldSettle = scrollBody.settled();
1389
+ const withinBounds = !scrollBounds.shouldConstrain();
1390
+ const hasSettled = loop ? shouldSettle : shouldSettle && withinBounds;
1391
+ const hasSettledAndIdle = hasSettled && !dragHandler.pointerDown();
1392
+ if (hasSettledAndIdle) animation.stop();
1393
+ const interpolatedLocation = location.get() * alpha + previousLocation.get() * (1 - alpha);
1394
+ offsetLocation.set(interpolatedLocation);
1395
+ if (loop) {
1396
+ scrollLooper.loop(scrollBody.direction());
1397
+ slideLooper.loop();
1398
+ }
1399
+ translate.to(offsetLocation.get());
1400
+ if (hasSettledAndIdle) eventHandler.emit('settle');
1401
+ if (!hasSettled) eventHandler.emit('scroll');
1402
+ };
1403
+ const animation = Animations(ownerDocument, ownerWindow, () => update(engine), alpha => render(engine, alpha));
1404
+ // Shared
1405
+ const friction = 0.68;
1406
+ const startLocation = scrollSnaps[index.get()];
1407
+ const location = Vector1D(startLocation);
1408
+ const previousLocation = Vector1D(startLocation);
1409
+ const offsetLocation = Vector1D(startLocation);
1410
+ const target = Vector1D(startLocation);
1411
+ const scrollBody = ScrollBody(location, offsetLocation, previousLocation, target, duration, friction);
1412
+ const scrollTarget = ScrollTarget(loop, scrollSnaps, contentSize, limit, target);
1413
+ const scrollTo = ScrollTo(animation, index, indexPrevious, scrollBody, scrollTarget, target, eventHandler);
1414
+ const scrollProgress = ScrollProgress(limit);
1415
+ const eventStore = EventStore();
1416
+ const slidesInView = SlidesInView(container, slides, eventHandler, inViewThreshold);
1417
+ const {
1418
+ slideRegistry
1419
+ } = SlideRegistry(containSnaps, containScroll, scrollSnaps, scrollContainLimit, slidesToScroll, slideIndexes);
1420
+ const slideFocus = SlideFocus(root, slides, slideRegistry, scrollTo, scrollBody, eventStore, eventHandler, watchFocus);
1421
+ // Engine
1422
+ const engine = {
1423
+ ownerDocument,
1424
+ ownerWindow,
1425
+ eventHandler,
1426
+ containerRect,
1427
+ slideRects,
1428
+ animation,
1429
+ axis,
1430
+ dragHandler: DragHandler(axis, root, ownerDocument, ownerWindow, target, DragTracker(axis, ownerWindow), location, animation, scrollTo, scrollBody, scrollTarget, index, eventHandler, percentOfView, dragFree, dragThreshold, skipSnaps, friction, watchDrag),
1431
+ eventStore,
1432
+ percentOfView,
1433
+ index,
1434
+ indexPrevious,
1435
+ limit,
1436
+ location,
1437
+ offsetLocation,
1438
+ previousLocation,
1439
+ options,
1440
+ resizeHandler: ResizeHandler(container, eventHandler, ownerWindow, slides, axis, watchResize, nodeRects),
1441
+ scrollBody,
1442
+ scrollBounds: ScrollBounds(limit, offsetLocation, target, scrollBody, percentOfView),
1443
+ scrollLooper: ScrollLooper(contentSize, limit, offsetLocation, [location, offsetLocation, previousLocation, target]),
1444
+ scrollProgress,
1445
+ scrollSnapList: scrollSnaps.map(scrollProgress.get),
1446
+ scrollSnaps,
1447
+ scrollTarget,
1448
+ scrollTo,
1449
+ slideLooper: SlideLooper(axis, viewSize, contentSize, slideSizes, slideSizesWithGaps, snaps, scrollSnaps, offsetLocation, slides),
1450
+ slideFocus,
1451
+ slidesHandler: SlidesHandler(container, eventHandler, watchSlides),
1452
+ slidesInView,
1453
+ slideIndexes,
1454
+ slideRegistry,
1455
+ slidesToScroll,
1456
+ target,
1457
+ translate: Translate(axis, container)
1458
+ };
1459
+ return engine;
1460
+ }
1461
+
1462
+ function EventHandler() {
1463
+ let listeners = {};
1464
+ let api;
1465
+ function init(emblaApi) {
1466
+ api = emblaApi;
1467
+ }
1468
+ function getListeners(evt) {
1469
+ return listeners[evt] || [];
1470
+ }
1471
+ function emit(evt) {
1472
+ getListeners(evt).forEach(e => e(api, evt));
1473
+ return self;
1474
+ }
1475
+ function on(evt, cb) {
1476
+ listeners[evt] = getListeners(evt).concat([cb]);
1477
+ return self;
1478
+ }
1479
+ function off(evt, cb) {
1480
+ listeners[evt] = getListeners(evt).filter(e => e !== cb);
1481
+ return self;
1482
+ }
1483
+ function clear() {
1484
+ listeners = {};
1485
+ }
1486
+ const self = {
1487
+ init,
1488
+ emit,
1489
+ off,
1490
+ on,
1491
+ clear
1492
+ };
1493
+ return self;
1494
+ }
1495
+
1496
+ const defaultOptions = {
1497
+ align: 'center',
1498
+ axis: 'x',
1499
+ container: null,
1500
+ slides: null,
1501
+ containScroll: 'trimSnaps',
1502
+ direction: 'ltr',
1503
+ slidesToScroll: 1,
1504
+ inViewThreshold: 0,
1505
+ breakpoints: {},
1506
+ dragFree: false,
1507
+ dragThreshold: 10,
1508
+ loop: false,
1509
+ skipSnaps: false,
1510
+ duration: 25,
1511
+ startIndex: 0,
1512
+ active: true,
1513
+ watchDrag: true,
1514
+ watchResize: true,
1515
+ watchSlides: true,
1516
+ watchFocus: true
1517
+ };
1518
+
1519
+ function OptionsHandler(ownerWindow) {
1520
+ function mergeOptions(optionsA, optionsB) {
1521
+ return objectsMergeDeep(optionsA, optionsB || {});
1522
+ }
1523
+ function optionsAtMedia(options) {
1524
+ const optionsAtMedia = options.breakpoints || {};
1525
+ const matchedMediaOptions = objectKeys(optionsAtMedia).filter(media => ownerWindow.matchMedia(media).matches).map(media => optionsAtMedia[media]).reduce((a, mediaOption) => mergeOptions(a, mediaOption), {});
1526
+ return mergeOptions(options, matchedMediaOptions);
1527
+ }
1528
+ function optionsMediaQueries(optionsList) {
1529
+ return optionsList.map(options => objectKeys(options.breakpoints || {})).reduce((acc, mediaQueries) => acc.concat(mediaQueries), []).map(ownerWindow.matchMedia);
1530
+ }
1531
+ const self = {
1532
+ mergeOptions,
1533
+ optionsAtMedia,
1534
+ optionsMediaQueries
1535
+ };
1536
+ return self;
1537
+ }
1538
+
1539
+ function PluginsHandler(optionsHandler) {
1540
+ let activePlugins = [];
1541
+ function init(emblaApi, plugins) {
1542
+ activePlugins = plugins.filter(({
1543
+ options
1544
+ }) => optionsHandler.optionsAtMedia(options).active !== false);
1545
+ activePlugins.forEach(plugin => plugin.init(emblaApi, optionsHandler));
1546
+ return plugins.reduce((map, plugin) => Object.assign(map, {
1547
+ [plugin.name]: plugin
1548
+ }), {});
1549
+ }
1550
+ function destroy() {
1551
+ activePlugins = activePlugins.filter(plugin => plugin.destroy());
1552
+ }
1553
+ const self = {
1554
+ init,
1555
+ destroy
1556
+ };
1557
+ return self;
1558
+ }
1559
+
1560
+ function EmblaCarousel(root, userOptions, userPlugins) {
1561
+ const ownerDocument = root.ownerDocument;
1562
+ const ownerWindow = ownerDocument.defaultView;
1563
+ const optionsHandler = OptionsHandler(ownerWindow);
1564
+ const pluginsHandler = PluginsHandler(optionsHandler);
1565
+ const mediaHandlers = EventStore();
1566
+ const eventHandler = EventHandler();
1567
+ const {
1568
+ mergeOptions,
1569
+ optionsAtMedia,
1570
+ optionsMediaQueries
1571
+ } = optionsHandler;
1572
+ const {
1573
+ on,
1574
+ off,
1575
+ emit
1576
+ } = eventHandler;
1577
+ const reInit = reActivate;
1578
+ let destroyed = false;
1579
+ let engine;
1580
+ let optionsBase = mergeOptions(defaultOptions, EmblaCarousel.globalOptions);
1581
+ let options = mergeOptions(optionsBase);
1582
+ let pluginList = [];
1583
+ let pluginApis;
1584
+ let container;
1585
+ let slides;
1586
+ function storeElements() {
1587
+ const {
1588
+ container: userContainer,
1589
+ slides: userSlides
1590
+ } = options;
1591
+ const customContainer = isString(userContainer) ? root.querySelector(userContainer) : userContainer;
1592
+ container = customContainer || root.children[0];
1593
+ const customSlides = isString(userSlides) ? container.querySelectorAll(userSlides) : userSlides;
1594
+ slides = [].slice.call(customSlides || container.children);
1595
+ }
1596
+ function createEngine(options) {
1597
+ const engine = Engine(root, container, slides, ownerDocument, ownerWindow, options, eventHandler);
1598
+ if (options.loop && !engine.slideLooper.canLoop()) {
1599
+ const optionsWithoutLoop = Object.assign({}, options, {
1600
+ loop: false
1601
+ });
1602
+ return createEngine(optionsWithoutLoop);
1603
+ }
1604
+ return engine;
1605
+ }
1606
+ function activate(withOptions, withPlugins) {
1607
+ if (destroyed) return;
1608
+ optionsBase = mergeOptions(optionsBase, withOptions);
1609
+ options = optionsAtMedia(optionsBase);
1610
+ pluginList = withPlugins || pluginList;
1611
+ storeElements();
1612
+ engine = createEngine(options);
1613
+ optionsMediaQueries([optionsBase, ...pluginList.map(({
1614
+ options
1615
+ }) => options)]).forEach(query => mediaHandlers.add(query, 'change', reActivate));
1616
+ if (!options.active) return;
1617
+ engine.translate.to(engine.location.get());
1618
+ engine.animation.init();
1619
+ engine.slidesInView.init();
1620
+ engine.slideFocus.init(self);
1621
+ engine.eventHandler.init(self);
1622
+ engine.resizeHandler.init(self);
1623
+ engine.slidesHandler.init(self);
1624
+ if (engine.options.loop) engine.slideLooper.loop();
1625
+ if (container.offsetParent && slides.length) engine.dragHandler.init(self);
1626
+ pluginApis = pluginsHandler.init(self, pluginList);
1627
+ }
1628
+ function reActivate(withOptions, withPlugins) {
1629
+ const startIndex = selectedScrollSnap();
1630
+ deActivate();
1631
+ activate(mergeOptions({
1632
+ startIndex
1633
+ }, withOptions), withPlugins);
1634
+ eventHandler.emit('reInit');
1635
+ }
1636
+ function deActivate() {
1637
+ engine.dragHandler.destroy();
1638
+ engine.eventStore.clear();
1639
+ engine.translate.clear();
1640
+ engine.slideLooper.clear();
1641
+ engine.resizeHandler.destroy();
1642
+ engine.slidesHandler.destroy();
1643
+ engine.slidesInView.destroy();
1644
+ engine.animation.destroy();
1645
+ pluginsHandler.destroy();
1646
+ mediaHandlers.clear();
1647
+ }
1648
+ function destroy() {
1649
+ if (destroyed) return;
1650
+ destroyed = true;
1651
+ mediaHandlers.clear();
1652
+ deActivate();
1653
+ eventHandler.emit('destroy');
1654
+ eventHandler.clear();
1655
+ }
1656
+ function scrollTo(index, jump, direction) {
1657
+ if (!options.active || destroyed) return;
1658
+ engine.scrollBody.useBaseFriction().useDuration(jump === true ? 0 : options.duration);
1659
+ engine.scrollTo.index(index, direction || 0);
1660
+ }
1661
+ function scrollNext(jump) {
1662
+ const next = engine.index.add(1).get();
1663
+ scrollTo(next, jump, -1);
1664
+ }
1665
+ function scrollPrev(jump) {
1666
+ const prev = engine.index.add(-1).get();
1667
+ scrollTo(prev, jump, 1);
1668
+ }
1669
+ function canScrollNext() {
1670
+ const next = engine.index.add(1).get();
1671
+ return next !== selectedScrollSnap();
1672
+ }
1673
+ function canScrollPrev() {
1674
+ const prev = engine.index.add(-1).get();
1675
+ return prev !== selectedScrollSnap();
1676
+ }
1677
+ function scrollSnapList() {
1678
+ return engine.scrollSnapList;
1679
+ }
1680
+ function scrollProgress() {
1681
+ return engine.scrollProgress.get(engine.offsetLocation.get());
1682
+ }
1683
+ function selectedScrollSnap() {
1684
+ return engine.index.get();
1685
+ }
1686
+ function previousScrollSnap() {
1687
+ return engine.indexPrevious.get();
1688
+ }
1689
+ function slidesInView() {
1690
+ return engine.slidesInView.get();
1691
+ }
1692
+ function slidesNotInView() {
1693
+ return engine.slidesInView.get(false);
1694
+ }
1695
+ function plugins() {
1696
+ return pluginApis;
1697
+ }
1698
+ function internalEngine() {
1699
+ return engine;
1700
+ }
1701
+ function rootNode() {
1702
+ return root;
1703
+ }
1704
+ function containerNode() {
1705
+ return container;
1706
+ }
1707
+ function slideNodes() {
1708
+ return slides;
1709
+ }
1710
+ const self = {
1711
+ canScrollNext,
1712
+ canScrollPrev,
1713
+ containerNode,
1714
+ internalEngine,
1715
+ destroy,
1716
+ off,
1717
+ on,
1718
+ emit,
1719
+ plugins,
1720
+ previousScrollSnap,
1721
+ reInit,
1722
+ rootNode,
1723
+ scrollNext,
1724
+ scrollPrev,
1725
+ scrollProgress,
1726
+ scrollSnapList,
1727
+ scrollTo,
1728
+ selectedScrollSnap,
1729
+ slideNodes,
1730
+ slidesInView,
1731
+ slidesNotInView
1732
+ };
1733
+ activate(userOptions, userPlugins);
1734
+ setTimeout(() => eventHandler.emit('init'), 0);
1735
+ return self;
1736
+ }
1737
+ EmblaCarousel.globalOptions = undefined;
1738
+
1739
+ function useEmblaCarousel(options = {}, plugins = []) {
1740
+ const storedOptions = React.useRef(options);
1741
+ const storedPlugins = React.useRef(plugins);
1742
+ const [emblaApi, setEmblaApi] = React.useState();
1743
+ const [viewport, setViewport] = React.useState();
1744
+ const reInit = React.useCallback(() => {
1745
+ if (emblaApi) emblaApi.reInit(storedOptions.current, storedPlugins.current);
1746
+ }, [emblaApi]);
1747
+ React.useEffect(() => {
1748
+ if (areOptionsEqual(storedOptions.current, options)) return;
1749
+ storedOptions.current = options;
1750
+ reInit();
1751
+ }, [options, reInit]);
1752
+ React.useEffect(() => {
1753
+ if (arePluginsEqual(storedPlugins.current, plugins)) return;
1754
+ storedPlugins.current = plugins;
1755
+ reInit();
1756
+ }, [plugins, reInit]);
1757
+ React.useEffect(() => {
1758
+ if (canUseDOM() && viewport) {
1759
+ EmblaCarousel.globalOptions = useEmblaCarousel.globalOptions;
1760
+ const newEmblaApi = EmblaCarousel(viewport, storedOptions.current, storedPlugins.current);
1761
+ setEmblaApi(newEmblaApi);
1762
+ return () => newEmblaApi.destroy();
1763
+ } else {
1764
+ setEmblaApi(undefined);
1765
+ }
1766
+ }, [viewport, setEmblaApi]);
1767
+ return [setViewport, emblaApi];
1768
+ }
1769
+ useEmblaCarousel.globalOptions = undefined;
1770
+
1771
+ const CarouselContext = React__namespace.createContext(null);
1772
+ function useCarousel() {
1773
+ const context = React__namespace.useContext(CarouselContext);
1774
+ if (!context) {
1775
+ throw new Error("useCarousel must be used within a <Carousel />");
1776
+ }
1777
+ return context;
1778
+ }
1779
+ function Carousel$1({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
1780
+ const [carouselRef, api] = useEmblaCarousel({
1781
+ ...opts,
1782
+ axis: orientation === "horizontal" ? "x" : "y",
1783
+ }, plugins);
1784
+ const [canScrollPrev, setCanScrollPrev] = React__namespace.useState(false);
1785
+ const [canScrollNext, setCanScrollNext] = React__namespace.useState(false);
1786
+ const onSelect = React__namespace.useCallback((api) => {
1787
+ if (!api)
1788
+ return;
1789
+ setCanScrollPrev(api.canScrollPrev());
1790
+ setCanScrollNext(api.canScrollNext());
1791
+ }, []);
1792
+ const scrollPrev = React__namespace.useCallback(() => {
1793
+ api?.scrollPrev();
1794
+ }, [api]);
1795
+ const scrollNext = React__namespace.useCallback(() => {
1796
+ api?.scrollNext();
1797
+ }, [api]);
1798
+ const handleKeyDown = React__namespace.useCallback((event) => {
1799
+ if (event.key === "ArrowLeft") {
1800
+ event.preventDefault();
1801
+ scrollPrev();
1802
+ }
1803
+ else if (event.key === "ArrowRight") {
1804
+ event.preventDefault();
1805
+ scrollNext();
1806
+ }
1807
+ }, [scrollPrev, scrollNext]);
1808
+ React__namespace.useEffect(() => {
1809
+ if (!api || !setApi)
1810
+ return;
1811
+ setApi(api);
1812
+ }, [api, setApi]);
1813
+ React__namespace.useEffect(() => {
1814
+ if (!api)
1815
+ return;
1816
+ onSelect(api);
1817
+ api.on("reInit", onSelect);
1818
+ api.on("select", onSelect);
1819
+ return () => {
1820
+ api?.off("select", onSelect);
1821
+ };
1822
+ }, [api, onSelect]);
1823
+ return (jsxRuntime.jsx(CarouselContext.Provider, { value: {
1824
+ carouselRef,
1825
+ api: api,
1826
+ opts,
1827
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
1828
+ scrollPrev,
1829
+ scrollNext,
1830
+ canScrollPrev,
1831
+ canScrollNext,
1832
+ }, children: jsxRuntime.jsx("div", { onKeyDownCapture: handleKeyDown, className: utils.cn("relative", className), role: "region", "aria-roledescription": "carousel", "data-slot": "carousel", ...props, children: children }) }));
1833
+ }
1834
+ function CarouselContent$1({ className, ...props }) {
1835
+ const { carouselRef, orientation } = useCarousel();
1836
+ return (jsxRuntime.jsx("div", { ref: carouselRef, className: "overflow-hidden", "data-slot": "carousel-content", children: jsxRuntime.jsx("div", { className: utils.cn("flex", orientation === "horizontal" ? "-ms-4" : "-mt-4 flex-col", className), ...props }) }));
1837
+ }
1838
+ function CarouselItem$1({ className, ...props }) {
1839
+ const { orientation } = useCarousel();
1840
+ return (jsxRuntime.jsx("div", { role: "group", "aria-roledescription": "slide", "data-slot": "carousel-item", className: utils.cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "ps-4" : "pt-4", className), ...props }));
1841
+ }
1842
+ function CarouselPrevious$1({ className, variant = "outline", size = "icon-sm", ...props }) {
1843
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
1844
+ return (jsxRuntime.jsxs(button.Button, { "data-slot": "carousel-previous", variant: variant, size: size, className: utils.cn("absolute touch-manipulation rounded-full", orientation === "horizontal"
1845
+ ? "top-1/2 -start-12 -translate-y-1/2"
1846
+ : "-top-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90", className), disabled: !canScrollPrev, onClick: scrollPrev, ...props, children: [jsxRuntime.jsx(chevronLeft.ChevronLeft, { className: "rtl:rotate-180" }), jsxRuntime.jsx("span", { className: "sr-only", children: "Previous slide" })] }));
1847
+ }
1848
+ function CarouselNext$1({ className, variant = "outline", size = "icon-sm", ...props }) {
1849
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
1850
+ return (jsxRuntime.jsxs(button.Button, { "data-slot": "carousel-next", variant: variant, size: size, className: utils.cn("absolute touch-manipulation rounded-full", orientation === "horizontal"
1851
+ ? "top-1/2 -end-12 -translate-y-1/2"
1852
+ : "-bottom-12 start-1/2 -translate-x-1/2 rtl:translate-x-1/2 rotate-90", className), disabled: !canScrollNext, onClick: scrollNext, ...props, children: [jsxRuntime.jsx(chevronRight.ChevronRight, { className: "rtl:rotate-180" }), jsxRuntime.jsx("span", { className: "sr-only", children: "Next slide" })] }));
1853
+ }
1854
+
1855
+ const Carousel = (props) => (jsxRuntime.jsx(Carousel$1, { ...props }));
1856
+ const CarouselContent = (props) => jsxRuntime.jsx(CarouselContent$1, { ...props });
1857
+ const CarouselItem = (props) => jsxRuntime.jsx(CarouselItem$1, { ...props });
1858
+ const CarouselPrevious = (props) => jsxRuntime.jsx(CarouselPrevious$1, { ...props });
1859
+ const CarouselNext = (props) => jsxRuntime.jsx(CarouselNext$1, { ...props });
1860
+
1861
+ exports.Carousel = Carousel;
1862
+ exports.CarouselContent = CarouselContent;
1863
+ exports.CarouselItem = CarouselItem;
1864
+ exports.CarouselNext = CarouselNext;
1865
+ exports.CarouselPrevious = CarouselPrevious;
1866
+ exports.useCarousel = useCarousel;
1867
+ //# sourceMappingURL=Carousel.js.map