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