@nanoporetech-digital/components 5.10.0 → 5.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (737) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/dist/cjs/{algolia-data-6841724e.js → algolia-data-dba27b97.js} +2 -2
  3. package/dist/cjs/{algolia-data-6841724e.js.map → algolia-data-dba27b97.js.map} +1 -1
  4. package/dist/cjs/{algoliasearch-lite.esm.browser-992a2eff.js → algoliasearch-lite.esm.browser-b74ca774.js} +30 -5
  5. package/dist/cjs/algoliasearch-lite.esm.browser-b74ca774.js.map +1 -0
  6. package/dist/cjs/{component-store-6d7b8855.js → component-store-149aeffe.js} +2 -2
  7. package/dist/cjs/{component-store-6d7b8855.js.map → component-store-149aeffe.js.map} +1 -1
  8. package/dist/cjs/fade-dcabf3c1.js +211 -0
  9. package/dist/cjs/fade-dcabf3c1.js.map +1 -0
  10. package/dist/cjs/{form-control-8db579a2.js → form-control-f100407e.js} +2 -2
  11. package/dist/cjs/{form-control-8db579a2.js.map → form-control-f100407e.js.map} +1 -1
  12. package/dist/cjs/fullscreen-d24940a1.js +133 -0
  13. package/dist/cjs/fullscreen-d24940a1.js.map +1 -0
  14. package/dist/cjs/{global-3a6a7873.js → global-a5710651.js} +7 -7
  15. package/dist/cjs/{global-3a6a7873.js.map → global-a5710651.js.map} +1 -1
  16. package/dist/cjs/{index-1d3ebe1a.js → index-14451c95.js} +8 -6
  17. package/dist/cjs/index-14451c95.js.map +1 -0
  18. package/dist/cjs/{index-0f470227.js → index-f6f89d47.js} +2 -2
  19. package/dist/cjs/{index-0f470227.js.map → index-f6f89d47.js.map} +1 -1
  20. package/dist/cjs/lazyload-f6be7590.js +95 -0
  21. package/dist/cjs/lazyload-f6be7590.js.map +1 -0
  22. package/dist/cjs/loader.cjs.js +4 -4
  23. package/dist/cjs/loader.cjs.js.map +1 -1
  24. package/dist/cjs/nano-accordion.cjs.entry.js +1 -1
  25. package/dist/cjs/nano-alert.cjs.entry.js +3 -3
  26. package/dist/cjs/nano-alert.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nano-algolia-filter.cjs.entry.js +3 -3
  28. package/dist/cjs/nano-algolia-filter.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nano-algolia-pagination.cjs.entry.js +2 -7
  30. package/dist/cjs/nano-algolia-pagination.cjs.entry.js.map +1 -1
  31. package/dist/cjs/nano-algolia-results.cjs.entry.js +2 -2
  32. package/dist/cjs/nano-algolia-results.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nano-algolia.cjs.entry.js +982 -26
  34. package/dist/cjs/nano-algolia.cjs.entry.js.map +1 -1
  35. package/dist/cjs/nano-aspect-ratio.cjs.entry.js +1 -1
  36. package/dist/cjs/nano-checkbox-group.cjs.entry.js +10 -4
  37. package/dist/cjs/nano-checkbox-group.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nano-checkbox.cjs.entry.js +4 -2
  39. package/dist/cjs/nano-checkbox.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nano-components.cjs.js +4 -4
  41. package/dist/cjs/nano-components.cjs.js.map +1 -1
  42. package/dist/cjs/nano-datalist_3.cjs.entry.js +4 -4
  43. package/dist/cjs/nano-datalist_3.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nano-date-input.cjs.entry.js +1 -1
  45. package/dist/cjs/nano-date-picker.cjs.entry.js +2 -2
  46. package/dist/cjs/nano-date-picker.cjs.entry.js.map +1 -1
  47. package/dist/cjs/nano-demo.cjs.entry.js +1 -1
  48. package/dist/cjs/nano-details.cjs.entry.js +2 -2
  49. package/dist/cjs/nano-details.cjs.entry.js.map +1 -1
  50. package/dist/cjs/nano-dialog.cjs.entry.js +5 -5
  51. package/dist/cjs/nano-dialog.cjs.entry.js.map +1 -1
  52. package/dist/cjs/nano-drawer.cjs.entry.js +5 -5
  53. package/dist/cjs/nano-drawer.cjs.entry.js.map +1 -1
  54. package/dist/cjs/nano-dropdown.cjs.entry.js +1 -1
  55. package/dist/cjs/nano-dropdown.cjs.entry.js.map +1 -1
  56. package/dist/cjs/nano-field-validator.cjs.entry.js +7 -5
  57. package/dist/cjs/nano-field-validator.cjs.entry.js.map +1 -1
  58. package/dist/cjs/nano-file-upload.cjs.entry.js +2 -2
  59. package/dist/cjs/nano-file-upload.cjs.entry.js.map +1 -1
  60. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js +4 -4
  61. package/dist/cjs/nano-global-nav-user-profile_3.cjs.entry.js.map +1 -1
  62. package/dist/cjs/nano-global-nav.cjs.entry.js +122 -153
  63. package/dist/cjs/nano-global-nav.cjs.entry.js.map +1 -1
  64. package/dist/cjs/nano-global-search-results.cjs.entry.js +3 -3
  65. package/dist/cjs/nano-global-search-results.cjs.entry.js.map +1 -1
  66. package/dist/cjs/nano-grid-item.cjs.entry.js +1 -1
  67. package/dist/cjs/nano-grid_2.cjs.entry.js +2 -2
  68. package/dist/cjs/nano-grid_2.cjs.entry.js.map +1 -1
  69. package/dist/cjs/nano-hero.cjs.entry.js +2 -2
  70. package/dist/cjs/nano-hero.cjs.entry.js.map +1 -1
  71. package/dist/cjs/nano-icon-button_2.cjs.entry.js +24 -4
  72. package/dist/cjs/nano-icon-button_2.cjs.entry.js.map +1 -1
  73. package/dist/cjs/nano-icon.cjs.entry.js +4 -4
  74. package/dist/cjs/nano-icon.cjs.entry.js.map +1 -1
  75. package/dist/cjs/nano-input.cjs.entry.js +3 -3
  76. package/dist/cjs/nano-input.cjs.entry.js.map +1 -1
  77. package/dist/cjs/nano-menu-drawer.cjs.entry.js +2 -2
  78. package/dist/cjs/nano-menu-drawer.cjs.entry.js.map +1 -1
  79. package/dist/cjs/nano-overflow-nav.cjs.entry.js +2 -2
  80. package/dist/cjs/nano-overflow-nav.cjs.entry.js.map +1 -1
  81. package/dist/cjs/nano-progress-bar.cjs.entry.js +2 -2
  82. package/dist/cjs/nano-progress-bar.cjs.entry.js.map +1 -1
  83. package/dist/cjs/nano-range.cjs.entry.js +2 -2
  84. package/dist/cjs/nano-range.cjs.entry.js.map +1 -1
  85. package/dist/cjs/nano-rating.cjs.entry.js +2 -2
  86. package/dist/cjs/nano-rating.cjs.entry.js.map +1 -1
  87. package/dist/cjs/nano-resize-observe_2.cjs.entry.js +1 -1
  88. package/dist/cjs/nano-slide.cjs.entry.js +1 -1
  89. package/dist/cjs/nano-slides-2f3dcc02.js +2975 -0
  90. package/dist/cjs/nano-slides-2f3dcc02.js.map +1 -0
  91. package/dist/cjs/nano-slides.cjs.entry.js +3 -4292
  92. package/dist/cjs/nano-slides.cjs.entry.js.map +1 -1
  93. package/dist/cjs/nano-sortable.cjs.entry.js +1 -1
  94. package/dist/cjs/nano-spinner.cjs.entry.js +2 -2
  95. package/dist/cjs/nano-spinner.cjs.entry.js.map +1 -1
  96. package/dist/cjs/nano-split-pane.cjs.entry.js +1 -1
  97. package/dist/cjs/nano-sticker.cjs.entry.js +3 -2
  98. package/dist/cjs/nano-sticker.cjs.entry.js.map +1 -1
  99. package/dist/cjs/nano-tab-content.cjs.entry.js +1 -1
  100. package/dist/cjs/nano-tab-group.cjs.entry.js +4 -4
  101. package/dist/cjs/nano-tab-group.cjs.entry.js.map +1 -1
  102. package/dist/cjs/nano-tab.cjs.entry.js +2 -2
  103. package/dist/cjs/nano-tab.cjs.entry.js.map +1 -1
  104. package/dist/cjs/{nano-table-72d5dc63.js → nano-table-26845696.js} +5 -5
  105. package/dist/cjs/{nano-table-72d5dc63.js.map → nano-table-26845696.js.map} +1 -1
  106. package/dist/cjs/nano-table.cjs.entry.js +3 -3
  107. package/dist/cjs/page-dots-ae2cefb4.js +140 -0
  108. package/dist/cjs/page-dots-ae2cefb4.js.map +1 -0
  109. package/dist/cjs/{scroll-fc1b8387.js → scroll-e8c21f80.js} +8 -4
  110. package/dist/cjs/scroll-e8c21f80.js.map +1 -0
  111. package/dist/cjs/{table.worker-3df34efe.js → table.worker-a5996745.js} +4 -4
  112. package/dist/cjs/table.worker-a5996745.js.map +1 -0
  113. package/dist/collection/collection-manifest.json +1 -1
  114. package/dist/collection/components/alert/alert.css +1 -2
  115. package/dist/collection/components/algolia/algolia-data.js.map +1 -1
  116. package/dist/collection/components/algolia/algolia-filter.js.map +1 -1
  117. package/dist/collection/components/algolia/algolia-pagination.js +0 -5
  118. package/dist/collection/components/algolia/algolia-pagination.js.map +1 -1
  119. package/dist/collection/components/algolia/algolia-results.js.map +1 -1
  120. package/dist/collection/components/algolia/algolia.js +4 -27
  121. package/dist/collection/components/algolia/algolia.js.map +1 -1
  122. package/dist/collection/components/algolia/lib/squirrelly/browser.js +10 -0
  123. package/dist/collection/components/algolia/lib/squirrelly/browser.js.map +1 -0
  124. package/dist/collection/components/algolia/lib/squirrelly/compile-string.js +151 -0
  125. package/dist/collection/components/algolia/lib/squirrelly/compile-string.js.map +1 -0
  126. package/dist/collection/components/algolia/lib/squirrelly/compile.js +44 -0
  127. package/dist/collection/components/algolia/lib/squirrelly/compile.js.map +1 -0
  128. package/dist/collection/components/algolia/lib/squirrelly/config.js +68 -0
  129. package/dist/collection/components/algolia/lib/squirrelly/config.js.map +1 -0
  130. package/dist/collection/components/algolia/lib/squirrelly/container-utils.js +57 -0
  131. package/dist/collection/components/algolia/lib/squirrelly/container-utils.js.map +1 -0
  132. package/dist/collection/components/algolia/lib/squirrelly/containers.js +128 -0
  133. package/dist/collection/components/algolia/lib/squirrelly/containers.js.map +1 -0
  134. package/dist/collection/components/algolia/lib/squirrelly/err.js +39 -0
  135. package/dist/collection/components/algolia/lib/squirrelly/err.js.map +1 -0
  136. package/dist/collection/components/algolia/lib/squirrelly/parse.js +327 -0
  137. package/dist/collection/components/algolia/lib/squirrelly/parse.js.map +1 -0
  138. package/dist/collection/components/algolia/lib/squirrelly/render.js +62 -0
  139. package/dist/collection/components/algolia/lib/squirrelly/render.js.map +1 -0
  140. package/dist/collection/components/algolia/lib/squirrelly/storage.js +32 -0
  141. package/dist/collection/components/algolia/lib/squirrelly/storage.js.map +1 -0
  142. package/dist/collection/components/algolia/lib/squirrelly/utils.js +102 -0
  143. package/dist/collection/components/algolia/lib/squirrelly/utils.js.map +1 -0
  144. package/dist/collection/{utils → components/algolia/lib}/template.js +1 -2
  145. package/dist/collection/components/algolia/lib/template.js.map +1 -0
  146. package/dist/collection/components/checkbox/checkbox-group.css +17 -15
  147. package/dist/collection/components/checkbox/checkbox-group.js +29 -2
  148. package/dist/collection/components/checkbox/checkbox-group.js.map +1 -1
  149. package/dist/collection/components/checkbox/checkbox.css +20 -22
  150. package/dist/collection/components/checkbox/checkbox.js +2 -0
  151. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  152. package/dist/collection/components/date-picker/date-picker.css +5 -10
  153. package/dist/collection/components/details/details.css +4 -4
  154. package/dist/collection/components/dialog/dialog.css +3 -6
  155. package/dist/collection/components/dialog/dialog.js +1 -1
  156. package/dist/collection/components/dialog/dialog.js.map +1 -1
  157. package/dist/collection/components/drawer/drawer.css +18 -24
  158. package/dist/collection/components/drawer/drawer.js +1 -1
  159. package/dist/collection/components/drawer/drawer.js.map +1 -1
  160. package/dist/collection/components/dropdown/dropdown.js +1 -1
  161. package/dist/collection/components/dropdown/dropdown.js.map +1 -1
  162. package/dist/collection/components/field-validator/field-validator.js +5 -3
  163. package/dist/collection/components/field-validator/field-validator.js.map +1 -1
  164. package/dist/collection/components/file-upload/file-upload.css +16 -30
  165. package/dist/collection/components/global-nav/global-nav.js +118 -157
  166. package/dist/collection/components/global-nav/global-nav.js.map +1 -1
  167. package/dist/collection/components/global-nav/style/global-nav.css +97 -138
  168. package/dist/collection/components/global-search-results/global-search-results.css +85 -127
  169. package/dist/collection/components/global-search-results/global-search-results.js +1 -1
  170. package/dist/collection/components/global-search-results/global-search-results.js.map +1 -1
  171. package/dist/collection/components/hero/hero.css +13 -26
  172. package/dist/collection/components/icon/icon.css +6 -6
  173. package/dist/collection/components/icon/icon.js +2 -2
  174. package/dist/collection/components/icon/icon.js.map +1 -1
  175. package/dist/collection/components/img/img.css +7 -17
  176. package/dist/collection/components/input/input.css +15 -36
  177. package/dist/collection/components/menu/menu.css +1 -1
  178. package/dist/collection/components/menu/menu.js +1 -1
  179. package/dist/collection/components/menu/menu.js.map +1 -1
  180. package/dist/collection/components/menu-drawer/menu-drawer.css +5 -14
  181. package/dist/collection/components/nav-item/nav-item.css +25 -46
  182. package/dist/collection/components/option/option.css +3 -5
  183. package/dist/collection/components/overflow-nav/overflow-nav.css +16 -27
  184. package/dist/collection/components/progress-bar/progress-bar.css +2 -2
  185. package/dist/collection/components/range/range.css +17 -19
  186. package/dist/collection/components/rating/rating.css +2 -8
  187. package/dist/collection/components/select/select.css +30 -53
  188. package/dist/collection/components/slides/lib/js/animate.js +29 -54
  189. package/dist/collection/components/slides/lib/js/animate.js.map +1 -0
  190. package/dist/collection/components/slides/lib/js/cell.js +12 -24
  191. package/dist/collection/components/slides/lib/js/cell.js.map +1 -0
  192. package/dist/collection/components/slides/lib/js/drag.js +65 -116
  193. package/dist/collection/components/slides/lib/js/drag.js.map +1 -0
  194. package/dist/collection/components/slides/lib/js/fade.js +52 -79
  195. package/dist/collection/components/slides/lib/js/fade.js.map +1 -0
  196. package/dist/collection/components/slides/lib/js/flickity.js +118 -206
  197. package/dist/collection/components/slides/lib/js/flickity.js.map +1 -0
  198. package/dist/collection/components/slides/lib/js/fullscreen.js +21 -40
  199. package/dist/collection/components/slides/lib/js/fullscreen.js.map +1 -0
  200. package/dist/collection/components/slides/lib/js/index.js +4 -6
  201. package/dist/collection/components/slides/lib/js/index.js.map +1 -0
  202. package/dist/collection/components/slides/lib/js/lazyload.js +21 -36
  203. package/dist/collection/components/slides/lib/js/lazyload.js.map +1 -0
  204. package/dist/collection/components/slides/lib/js/page-dots.js +21 -45
  205. package/dist/collection/components/slides/lib/js/page-dots.js.map +1 -0
  206. package/dist/collection/components/slides/lib/js/player.js +12 -40
  207. package/dist/collection/components/slides/lib/js/player.js.map +1 -0
  208. package/dist/collection/components/slides/lib/js/prev-next-button.js +24 -52
  209. package/dist/collection/components/slides/lib/js/prev-next-button.js.map +1 -0
  210. package/dist/collection/components/slides/lib/js/slide.js +10 -15
  211. package/dist/collection/components/slides/lib/js/slide.js.map +1 -0
  212. package/dist/collection/components/slides/lib/js/utils/event-emitter.js +75 -0
  213. package/dist/collection/components/slides/lib/js/utils/event-emitter.js.map +1 -0
  214. package/dist/collection/components/slides/lib/js/utils/gestures.js +436 -0
  215. package/dist/collection/components/slides/lib/js/utils/gestures.js.map +1 -0
  216. package/dist/collection/components/slides/lib/js/utils/get-size.js +160 -0
  217. package/dist/collection/components/slides/lib/js/utils/get-size.js.map +1 -0
  218. package/dist/collection/components/slides/lib/js/utils/utils.js +166 -0
  219. package/dist/collection/components/slides/lib/js/utils/utils.js.map +1 -0
  220. package/dist/collection/components/slides/slides.css +18 -19
  221. package/dist/collection/components/slides/slides.js +31 -5
  222. package/dist/collection/components/slides/slides.js.map +1 -1
  223. package/dist/collection/components/spinner/spinner.css +1 -2
  224. package/dist/collection/components/sticker/sticker.js +2 -1
  225. package/dist/collection/components/sticker/sticker.js.map +1 -1
  226. package/dist/collection/components/table/table.css +29 -48
  227. package/dist/collection/components/tabs/tab-group.css +10 -14
  228. package/dist/collection/components/tabs/tab.css +8 -18
  229. package/dist/collection/components/tooltip/tooltip.css +34 -31
  230. package/dist/collection/components/tooltip/tooltip.js +23 -3
  231. package/dist/collection/components/tooltip/tooltip.js.map +1 -1
  232. package/dist/collection/global/script/global.js +6 -6
  233. package/dist/collection/global/script/global.js.map +1 -1
  234. package/dist/collection/utils/scroll.js +7 -3
  235. package/dist/collection/utils/scroll.js.map +1 -1
  236. package/dist/components/algolia-data.js.map +1 -1
  237. package/dist/components/algolia.js +978 -23
  238. package/dist/components/algolia.js.map +1 -1
  239. package/dist/components/algoliasearch-lite.esm.browser.js +29 -4
  240. package/dist/components/algoliasearch-lite.esm.browser.js.map +1 -1
  241. package/dist/components/date-picker.js +1 -1
  242. package/dist/components/date-picker.js.map +1 -1
  243. package/dist/components/dropdown.js +1 -1
  244. package/dist/components/dropdown.js.map +1 -1
  245. package/dist/components/fade.js +208 -0
  246. package/dist/components/fade.js.map +1 -0
  247. package/dist/components/fullscreen.js +130 -0
  248. package/dist/components/fullscreen.js.map +1 -0
  249. package/dist/components/icon.js +3 -3
  250. package/dist/components/icon.js.map +1 -1
  251. package/dist/components/img.js +1 -1
  252. package/dist/components/img.js.map +1 -1
  253. package/dist/components/index.js +6 -6
  254. package/dist/components/index.js.map +1 -1
  255. package/dist/components/input.js +1 -1
  256. package/dist/components/input.js.map +1 -1
  257. package/dist/components/lazyload.js +92 -0
  258. package/dist/components/lazyload.js.map +1 -0
  259. package/dist/components/menu.js +2 -2
  260. package/dist/components/menu.js.map +1 -1
  261. package/dist/components/nano-alert.js +1 -1
  262. package/dist/components/nano-alert.js.map +1 -1
  263. package/dist/components/nano-algolia-filter.js.map +1 -1
  264. package/dist/components/nano-algolia-pagination.js +0 -5
  265. package/dist/components/nano-algolia-pagination.js.map +1 -1
  266. package/dist/components/nano-algolia-results.js.map +1 -1
  267. package/dist/components/nano-checkbox-group.js +10 -3
  268. package/dist/components/nano-checkbox-group.js.map +1 -1
  269. package/dist/components/nano-checkbox.js +3 -1
  270. package/dist/components/nano-checkbox.js.map +1 -1
  271. package/dist/components/nano-details.js +1 -1
  272. package/dist/components/nano-details.js.map +1 -1
  273. package/dist/components/nano-dialog.js +2 -2
  274. package/dist/components/nano-dialog.js.map +1 -1
  275. package/dist/components/nano-drawer.js +2 -2
  276. package/dist/components/nano-drawer.js.map +1 -1
  277. package/dist/components/nano-field-validator.js +5 -3
  278. package/dist/components/nano-field-validator.js.map +1 -1
  279. package/dist/components/nano-file-upload.js +1 -1
  280. package/dist/components/nano-file-upload.js.map +1 -1
  281. package/dist/components/nano-global-nav.js +119 -152
  282. package/dist/components/nano-global-nav.js.map +1 -1
  283. package/dist/components/nano-global-search-results.js +2 -2
  284. package/dist/components/nano-global-search-results.js.map +1 -1
  285. package/dist/components/nano-hero.js +1 -1
  286. package/dist/components/nano-hero.js.map +1 -1
  287. package/dist/components/nano-menu-drawer.js +1 -1
  288. package/dist/components/nano-menu-drawer.js.map +1 -1
  289. package/dist/components/nano-overflow-nav.js +1 -1
  290. package/dist/components/nano-overflow-nav.js.map +1 -1
  291. package/dist/components/nano-range.js +1 -1
  292. package/dist/components/nano-range.js.map +1 -1
  293. package/dist/components/nano-rating.js +1 -1
  294. package/dist/components/nano-rating.js.map +1 -1
  295. package/dist/components/nano-slides.js +760 -2090
  296. package/dist/components/nano-slides.js.map +1 -1
  297. package/dist/components/nano-tab-group.js +1 -1
  298. package/dist/components/nano-tab-group.js.map +1 -1
  299. package/dist/components/nano-tab.js +1 -1
  300. package/dist/components/nano-tab.js.map +1 -1
  301. package/dist/components/nav-item.js +1 -1
  302. package/dist/components/nav-item.js.map +1 -1
  303. package/dist/components/option.js +1 -1
  304. package/dist/components/option.js.map +1 -1
  305. package/dist/components/page-dots.js +137 -0
  306. package/dist/components/page-dots.js.map +1 -0
  307. package/dist/components/progress-bar.js +1 -1
  308. package/dist/components/progress-bar.js.map +1 -1
  309. package/dist/components/scroll.js +7 -3
  310. package/dist/components/scroll.js.map +1 -1
  311. package/dist/components/select.js +1 -1
  312. package/dist/components/select.js.map +1 -1
  313. package/dist/components/spinner.js +1 -1
  314. package/dist/components/spinner.js.map +1 -1
  315. package/dist/components/sticker.js +2 -1
  316. package/dist/components/sticker.js.map +1 -1
  317. package/dist/components/table.js +1 -1
  318. package/dist/components/table.js.map +1 -1
  319. package/dist/components/tooltip.js +24 -4
  320. package/dist/components/tooltip.js.map +1 -1
  321. package/dist/esm/{algolia-data-ebf2a439.js → algolia-data-1b42827c.js} +2 -2
  322. package/dist/esm/{algolia-data-ebf2a439.js.map → algolia-data-1b42827c.js.map} +1 -1
  323. package/dist/esm/{algoliasearch-lite.esm.browser-04891fdc.js → algoliasearch-lite.esm.browser-d71a28dc.js} +30 -5
  324. package/dist/esm/algoliasearch-lite.esm.browser-d71a28dc.js.map +1 -0
  325. package/dist/esm/{component-store-54df2005.js → component-store-f7eb0a56.js} +2 -2
  326. package/dist/esm/{component-store-54df2005.js.map → component-store-f7eb0a56.js.map} +1 -1
  327. package/dist/esm/fade-1aa7a6db.js +209 -0
  328. package/dist/esm/fade-1aa7a6db.js.map +1 -0
  329. package/dist/esm/{form-control-eb06e009.js → form-control-881fa3af.js} +2 -2
  330. package/dist/esm/{form-control-eb06e009.js.map → form-control-881fa3af.js.map} +1 -1
  331. package/dist/esm/fullscreen-86fa276a.js +131 -0
  332. package/dist/esm/fullscreen-86fa276a.js.map +1 -0
  333. package/dist/esm/{global-f6e05656.js → global-be484e8c.js} +7 -7
  334. package/dist/esm/{global-f6e05656.js.map → global-be484e8c.js.map} +1 -1
  335. package/dist/esm/{index-e8891229.js → index-3003356f.js} +2 -2
  336. package/dist/esm/{index-e8891229.js.map → index-3003356f.js.map} +1 -1
  337. package/dist/esm/{index-06666022.js → index-9695db0a.js} +8 -6
  338. package/dist/esm/index-9695db0a.js.map +1 -0
  339. package/dist/esm/lazyload-994232a6.js +93 -0
  340. package/dist/esm/lazyload-994232a6.js.map +1 -0
  341. package/dist/esm/loader.js +5 -5
  342. package/dist/esm/loader.js.map +1 -1
  343. package/dist/esm/nano-accordion.entry.js +1 -1
  344. package/dist/esm/nano-alert.entry.js +3 -3
  345. package/dist/esm/nano-alert.entry.js.map +1 -1
  346. package/dist/esm/nano-algolia-filter.entry.js +3 -3
  347. package/dist/esm/nano-algolia-filter.entry.js.map +1 -1
  348. package/dist/esm/nano-algolia-pagination.entry.js +2 -7
  349. package/dist/esm/nano-algolia-pagination.entry.js.map +1 -1
  350. package/dist/esm/nano-algolia-results.entry.js +2 -2
  351. package/dist/esm/nano-algolia-results.entry.js.map +1 -1
  352. package/dist/esm/nano-algolia.entry.js +982 -26
  353. package/dist/esm/nano-algolia.entry.js.map +1 -1
  354. package/dist/esm/nano-aspect-ratio.entry.js +1 -1
  355. package/dist/esm/nano-checkbox-group.entry.js +10 -4
  356. package/dist/esm/nano-checkbox-group.entry.js.map +1 -1
  357. package/dist/esm/nano-checkbox.entry.js +4 -2
  358. package/dist/esm/nano-checkbox.entry.js.map +1 -1
  359. package/dist/esm/nano-components.js +5 -5
  360. package/dist/esm/nano-components.js.map +1 -1
  361. package/dist/esm/nano-datalist_3.entry.js +4 -4
  362. package/dist/esm/nano-datalist_3.entry.js.map +1 -1
  363. package/dist/esm/nano-date-input.entry.js +1 -1
  364. package/dist/esm/nano-date-picker.entry.js +2 -2
  365. package/dist/esm/nano-date-picker.entry.js.map +1 -1
  366. package/dist/esm/nano-demo.entry.js +1 -1
  367. package/dist/esm/nano-details.entry.js +2 -2
  368. package/dist/esm/nano-details.entry.js.map +1 -1
  369. package/dist/esm/nano-dialog.entry.js +5 -5
  370. package/dist/esm/nano-dialog.entry.js.map +1 -1
  371. package/dist/esm/nano-drawer.entry.js +5 -5
  372. package/dist/esm/nano-drawer.entry.js.map +1 -1
  373. package/dist/esm/nano-dropdown.entry.js +1 -1
  374. package/dist/esm/nano-dropdown.entry.js.map +1 -1
  375. package/dist/esm/nano-field-validator.entry.js +7 -5
  376. package/dist/esm/nano-field-validator.entry.js.map +1 -1
  377. package/dist/esm/nano-file-upload.entry.js +2 -2
  378. package/dist/esm/nano-file-upload.entry.js.map +1 -1
  379. package/dist/esm/nano-global-nav-user-profile_3.entry.js +4 -4
  380. package/dist/esm/nano-global-nav-user-profile_3.entry.js.map +1 -1
  381. package/dist/esm/nano-global-nav.entry.js +122 -153
  382. package/dist/esm/nano-global-nav.entry.js.map +1 -1
  383. package/dist/esm/nano-global-search-results.entry.js +3 -3
  384. package/dist/esm/nano-global-search-results.entry.js.map +1 -1
  385. package/dist/esm/nano-grid-item.entry.js +1 -1
  386. package/dist/esm/nano-grid_2.entry.js +2 -2
  387. package/dist/esm/nano-grid_2.entry.js.map +1 -1
  388. package/dist/esm/nano-hero.entry.js +2 -2
  389. package/dist/esm/nano-hero.entry.js.map +1 -1
  390. package/dist/esm/nano-icon-button_2.entry.js +24 -4
  391. package/dist/esm/nano-icon-button_2.entry.js.map +1 -1
  392. package/dist/esm/nano-icon.entry.js +4 -4
  393. package/dist/esm/nano-icon.entry.js.map +1 -1
  394. package/dist/esm/nano-input.entry.js +3 -3
  395. package/dist/esm/nano-input.entry.js.map +1 -1
  396. package/dist/esm/nano-menu-drawer.entry.js +2 -2
  397. package/dist/esm/nano-menu-drawer.entry.js.map +1 -1
  398. package/dist/esm/nano-overflow-nav.entry.js +2 -2
  399. package/dist/esm/nano-overflow-nav.entry.js.map +1 -1
  400. package/dist/esm/nano-progress-bar.entry.js +2 -2
  401. package/dist/esm/nano-progress-bar.entry.js.map +1 -1
  402. package/dist/esm/nano-range.entry.js +2 -2
  403. package/dist/esm/nano-range.entry.js.map +1 -1
  404. package/dist/esm/nano-rating.entry.js +2 -2
  405. package/dist/esm/nano-rating.entry.js.map +1 -1
  406. package/dist/esm/nano-resize-observe_2.entry.js +1 -1
  407. package/dist/esm/nano-slide.entry.js +1 -1
  408. package/dist/esm/nano-slides-9908c44d.js +2970 -0
  409. package/dist/esm/nano-slides-9908c44d.js.map +1 -0
  410. package/dist/esm/nano-slides.entry.js +2 -4295
  411. package/dist/esm/nano-slides.entry.js.map +1 -1
  412. package/dist/esm/nano-sortable.entry.js +1 -1
  413. package/dist/esm/nano-spinner.entry.js +2 -2
  414. package/dist/esm/nano-spinner.entry.js.map +1 -1
  415. package/dist/esm/nano-split-pane.entry.js +1 -1
  416. package/dist/esm/nano-sticker.entry.js +3 -2
  417. package/dist/esm/nano-sticker.entry.js.map +1 -1
  418. package/dist/esm/nano-tab-content.entry.js +1 -1
  419. package/dist/esm/nano-tab-group.entry.js +4 -4
  420. package/dist/esm/nano-tab-group.entry.js.map +1 -1
  421. package/dist/esm/nano-tab.entry.js +2 -2
  422. package/dist/esm/nano-tab.entry.js.map +1 -1
  423. package/dist/esm/{nano-table-5af42ba4.js → nano-table-55d753cb.js} +5 -5
  424. package/dist/esm/{nano-table-5af42ba4.js.map → nano-table-55d753cb.js.map} +1 -1
  425. package/dist/esm/nano-table.entry.js +3 -3
  426. package/dist/esm/page-dots-467ace2e.js +138 -0
  427. package/dist/esm/page-dots-467ace2e.js.map +1 -0
  428. package/dist/esm/{scroll-ec7ac257.js → scroll-ac332213.js} +8 -4
  429. package/dist/esm/scroll-ac332213.js.map +1 -0
  430. package/dist/esm/{table.worker-3cae908c.js → table.worker-34706ecc.js} +4 -4
  431. package/dist/esm/table.worker-34706ecc.js.map +1 -0
  432. package/dist/nano-components/{p-74a7fc4f.js → active-element-75b7c8a0.js} +1 -1
  433. package/dist/nano-components/algolia-data-1b42827c.js +5 -0
  434. package/dist/nano-components/{p-a26bdb65.js.map → algolia-data-1b42827c.js.map} +1 -1
  435. package/dist/nano-components/algoliasearch-lite.esm.browser-d71a28dc.js +5 -0
  436. package/dist/nano-components/algoliasearch-lite.esm.browser-d71a28dc.js.map +1 -0
  437. package/dist/nano-components/component-store-f7eb0a56.js +5 -0
  438. package/dist/nano-components/{p-dd5687db.js.map → component-store-f7eb0a56.js.map} +1 -1
  439. package/dist/nano-components/{p-cecb9af1.js → date-utils-6b7a6e1f.js} +1 -1
  440. package/dist/nano-components/{p-cdfc507e.js → dom-8599fac1.js} +1 -1
  441. package/dist/nano-components/{p-842cf127.js → drag-1723a4cc.js} +1 -1
  442. package/dist/nano-components/{p-9bfdee71.js → events-6a805b42.js} +1 -1
  443. package/dist/nano-components/fade-1aa7a6db.js +5 -0
  444. package/dist/nano-components/fade-1aa7a6db.js.map +1 -0
  445. package/dist/nano-components/{p-f8f89998.js → focus-visible-8b2c14da.js} +1 -1
  446. package/dist/nano-components/form-control-881fa3af.js +5 -0
  447. package/dist/nano-components/{p-dc805ecc.js.map → form-control-881fa3af.js.map} +1 -1
  448. package/dist/nano-components/fullscreen-86fa276a.js +5 -0
  449. package/dist/nano-components/fullscreen-86fa276a.js.map +1 -0
  450. package/dist/nano-components/{p-d4f6ec9f.js → global-be484e8c.js} +2 -2
  451. package/dist/nano-components/{p-d4f6ec9f.js.map → global-be484e8c.js.map} +1 -1
  452. package/dist/nano-components/index-3003356f.js +5 -0
  453. package/dist/nano-components/{p-70747f20.js.map → index-3003356f.js.map} +1 -1
  454. package/dist/nano-components/{p-d6a04b3a.js → index-9695db0a.js} +2 -2
  455. package/dist/nano-components/{p-d6a04b3a.js.map → index-9695db0a.js.map} +1 -1
  456. package/dist/nano-components/{p-bb07c3d0.js → index-f626f476.js} +1 -1
  457. package/dist/nano-components/index.esm.js +1 -1
  458. package/dist/nano-components/index.esm.js.map +1 -1
  459. package/dist/nano-components/lazyload-994232a6.js +5 -0
  460. package/dist/nano-components/lazyload-994232a6.js.map +1 -0
  461. package/dist/nano-components/{p-2155fc2c.js → local-my-account-6662da72.js} +1 -1
  462. package/dist/nano-components/{p-ee045579.js → math-c02ddfda.js} +1 -1
  463. package/dist/nano-components/modal-bd9638c0.js +5 -0
  464. package/dist/nano-components/{p-2234694a.js.map → modal-bd9638c0.js.map} +1 -1
  465. package/dist/nano-components/nano-accordion.entry.js +5 -0
  466. package/dist/nano-components/{p-9f60ff14.entry.js.map → nano-accordion.entry.js.map} +1 -1
  467. package/dist/nano-components/nano-alert.entry.js +5 -0
  468. package/dist/nano-components/{p-191352c4.entry.js.map → nano-alert.entry.js.map} +1 -1
  469. package/dist/nano-components/nano-algolia-filter.entry.js +5 -0
  470. package/dist/nano-components/nano-algolia-filter.entry.js.map +1 -0
  471. package/dist/nano-components/nano-algolia-pagination.entry.js +5 -0
  472. package/dist/nano-components/nano-algolia-pagination.entry.js.map +1 -0
  473. package/dist/nano-components/nano-algolia-results.entry.js +5 -0
  474. package/dist/nano-components/nano-algolia-results.entry.js.map +1 -0
  475. package/dist/nano-components/nano-algolia.entry.js +5 -0
  476. package/dist/nano-components/nano-algolia.entry.js.map +1 -0
  477. package/dist/nano-components/nano-aspect-ratio.entry.js +5 -0
  478. package/dist/nano-components/{p-87329424.entry.js.map → nano-aspect-ratio.entry.js.map} +1 -1
  479. package/dist/nano-components/nano-checkbox-group.entry.js +5 -0
  480. package/dist/nano-components/nano-checkbox-group.entry.js.map +1 -0
  481. package/dist/nano-components/nano-checkbox.entry.js +5 -0
  482. package/dist/nano-components/nano-checkbox.entry.js.map +1 -0
  483. package/dist/nano-components/nano-components.css +1 -1
  484. package/dist/nano-components/nano-components.esm.js +1 -1
  485. package/dist/nano-components/nano-components.esm.js.map +1 -1
  486. package/dist/nano-components/nano-datalist_3.entry.js +5 -0
  487. package/dist/nano-components/nano-datalist_3.entry.js.map +1 -0
  488. package/dist/nano-components/nano-date-input.entry.js +5 -0
  489. package/dist/nano-components/{p-d4e44f93.entry.js.map → nano-date-input.entry.js.map} +1 -1
  490. package/dist/nano-components/nano-date-picker.entry.js +5 -0
  491. package/dist/nano-components/{p-efd3e121.entry.js.map → nano-date-picker.entry.js.map} +1 -1
  492. package/dist/nano-components/nano-demo.entry.js +5 -0
  493. package/dist/nano-components/{p-e98835e2.entry.js.map → nano-demo.entry.js.map} +1 -1
  494. package/dist/nano-components/nano-details.entry.js +5 -0
  495. package/dist/nano-components/nano-details.entry.js.map +1 -0
  496. package/dist/nano-components/nano-dialog.entry.js +5 -0
  497. package/dist/nano-components/{p-79fff4fd.entry.js.map → nano-dialog.entry.js.map} +1 -1
  498. package/dist/nano-components/nano-drawer.entry.js +5 -0
  499. package/dist/nano-components/nano-drawer.entry.js.map +1 -0
  500. package/dist/nano-components/nano-dropdown.entry.js +5 -0
  501. package/dist/nano-components/nano-dropdown.entry.js.map +1 -0
  502. package/dist/nano-components/nano-field-validator.entry.js +5 -0
  503. package/dist/nano-components/nano-field-validator.entry.js.map +1 -0
  504. package/dist/nano-components/nano-file-upload.entry.js +5 -0
  505. package/dist/nano-components/nano-file-upload.entry.js.map +1 -0
  506. package/dist/nano-components/nano-global-nav-user-profile_3.entry.js +5 -0
  507. package/dist/nano-components/nano-global-nav-user-profile_3.entry.js.map +1 -0
  508. package/dist/nano-components/nano-global-nav.entry.js +5 -0
  509. package/dist/nano-components/nano-global-nav.entry.js.map +1 -0
  510. package/dist/nano-components/nano-global-search-results.entry.js +5 -0
  511. package/dist/nano-components/nano-global-search-results.entry.js.map +1 -0
  512. package/dist/nano-components/nano-grid-item.entry.js +5 -0
  513. package/dist/nano-components/{p-9c290055.entry.js.map → nano-grid-item.entry.js.map} +1 -1
  514. package/dist/nano-components/nano-grid_2.entry.js +5 -0
  515. package/dist/nano-components/{p-7c82af28.entry.js.map → nano-grid_2.entry.js.map} +1 -1
  516. package/dist/nano-components/nano-hero.entry.js +5 -0
  517. package/dist/nano-components/{p-328ef9d3.entry.js.map → nano-hero.entry.js.map} +1 -1
  518. package/dist/nano-components/nano-icon-button_2.entry.js +5 -0
  519. package/dist/nano-components/nano-icon-button_2.entry.js.map +1 -0
  520. package/dist/nano-components/nano-icon.entry.js +5 -0
  521. package/dist/nano-components/nano-icon.entry.js.map +1 -0
  522. package/dist/nano-components/nano-input.entry.js +5 -0
  523. package/dist/nano-components/nano-input.entry.js.map +1 -0
  524. package/dist/nano-components/nano-menu-drawer.entry.js +5 -0
  525. package/dist/nano-components/nano-menu-drawer.entry.js.map +1 -0
  526. package/dist/nano-components/nano-overflow-nav.entry.js +5 -0
  527. package/dist/nano-components/nano-overflow-nav.entry.js.map +1 -0
  528. package/dist/nano-components/nano-progress-bar.entry.js +5 -0
  529. package/dist/nano-components/nano-progress-bar.entry.js.map +1 -0
  530. package/dist/nano-components/nano-range.entry.js +5 -0
  531. package/dist/nano-components/nano-range.entry.js.map +1 -0
  532. package/dist/nano-components/nano-rating.entry.js +5 -0
  533. package/dist/nano-components/nano-rating.entry.js.map +1 -0
  534. package/dist/nano-components/nano-resize-observe_2.entry.js +5 -0
  535. package/dist/nano-components/{p-e6a0675e.entry.js.map → nano-resize-observe_2.entry.js.map} +1 -1
  536. package/dist/nano-components/nano-slide.entry.js +5 -0
  537. package/dist/nano-components/{p-3d8fb8a1.entry.js.map → nano-slide.entry.js.map} +1 -1
  538. package/dist/nano-components/nano-slides-9908c44d.js +20 -0
  539. package/dist/nano-components/nano-slides-9908c44d.js.map +1 -0
  540. package/dist/nano-components/nano-slides.entry.js +5 -0
  541. package/dist/nano-components/nano-sortable.entry.js +5 -0
  542. package/dist/nano-components/{p-3ae362ae.entry.js.map → nano-sortable.entry.js.map} +1 -1
  543. package/dist/nano-components/nano-spinner.entry.js +5 -0
  544. package/dist/nano-components/{p-9925e504.entry.js.map → nano-spinner.entry.js.map} +1 -1
  545. package/dist/nano-components/nano-split-pane.entry.js +5 -0
  546. package/dist/nano-components/{p-6c4171fa.entry.js.map → nano-split-pane.entry.js.map} +1 -1
  547. package/dist/nano-components/nano-sticker.entry.js +5 -0
  548. package/dist/nano-components/nano-sticker.entry.js.map +1 -0
  549. package/dist/nano-components/nano-tab-content.entry.js +5 -0
  550. package/dist/nano-components/{p-3f40e370.entry.js.map → nano-tab-content.entry.js.map} +1 -1
  551. package/dist/nano-components/nano-tab-group.entry.js +5 -0
  552. package/dist/nano-components/nano-tab-group.entry.js.map +1 -0
  553. package/dist/nano-components/nano-tab.entry.js +5 -0
  554. package/dist/nano-components/{p-3cac5f6d.entry.js.map → nano-tab.entry.js.map} +1 -1
  555. package/dist/nano-components/nano-table-55d753cb.js +5 -0
  556. package/dist/nano-components/nano-table-55d753cb.js.map +1 -0
  557. package/dist/nano-components/nano-table.entry.js +5 -0
  558. package/dist/nano-components/page-dots-467ace2e.js +5 -0
  559. package/dist/nano-components/page-dots-467ace2e.js.map +1 -0
  560. package/dist/nano-components/{p-cd1fd454.js → popover-e5e7a641.js} +1 -1
  561. package/dist/nano-components/scroll-ac332213.js +5 -0
  562. package/dist/nano-components/scroll-ac332213.js.map +1 -0
  563. package/dist/nano-components/{p-dc565459.js → slot-8126e238.js} +1 -1
  564. package/dist/nano-components/{p-f88fa15c.js → tabbable-26a66a22.js} +1 -1
  565. package/dist/nano-components/table.worker-34706ecc.js +5 -0
  566. package/dist/nano-components/{p-411bb8f1.js → theme-82feb8cf.js} +1 -1
  567. package/dist/nano-components/{p-7bff5224.js → throttle-ac4fcefa.js} +1 -1
  568. package/dist/nano-components/{p-c3e8e3f9.js → transitions-fb09eb32.js} +1 -1
  569. package/dist/themes/nanopore.cn.css +1 -1
  570. package/dist/themes/nanopore.cn.css.map +1 -1
  571. package/dist/themes/nanopore.css +1 -1
  572. package/dist/themes/nanopore.css.map +1 -1
  573. package/dist/types/components/algolia/algolia-data.d.ts +1 -1
  574. package/dist/types/components/algolia/algolia-filter.d.ts +1 -1
  575. package/dist/types/components/algolia/algolia-pagination.d.ts +1 -1
  576. package/dist/types/components/algolia/algolia-results.d.ts +1 -1
  577. package/dist/types/components/algolia/algolia.d.ts +1 -7
  578. package/dist/types/components/algolia/lib/squirrelly/browser.d.ts +6 -0
  579. package/dist/types/components/algolia/lib/squirrelly/compile-string.d.ts +5 -0
  580. package/dist/types/components/algolia/lib/squirrelly/compile.d.ts +3 -0
  581. package/dist/types/components/algolia/lib/squirrelly/config.d.ts +48 -0
  582. package/dist/types/components/algolia/lib/squirrelly/container-utils.d.ts +8 -0
  583. package/dist/types/components/algolia/lib/squirrelly/containers.d.ts +18 -0
  584. package/dist/types/components/algolia/lib/squirrelly/err.d.ts +6 -0
  585. package/dist/types/components/algolia/lib/squirrelly/parse.d.ts +23 -0
  586. package/dist/types/components/algolia/lib/squirrelly/render.d.ts +3 -0
  587. package/dist/types/components/algolia/lib/squirrelly/storage.d.ts +13 -0
  588. package/dist/types/components/algolia/lib/squirrelly/utils.d.ts +8 -0
  589. package/dist/types/components/algolia/lib/template.d.ts +2 -0
  590. package/dist/types/components/checkbox/checkbox-group.d.ts +5 -0
  591. package/dist/types/components/global-nav/global-nav.d.ts +15 -20
  592. package/dist/types/components/slides/lib/js/animate.d.ts +2 -0
  593. package/dist/types/components/slides/lib/js/cell.d.ts +1 -0
  594. package/dist/types/components/slides/lib/js/drag.d.ts +1 -0
  595. package/dist/types/components/slides/lib/js/fade.d.ts +1 -0
  596. package/dist/types/components/slides/lib/js/flickity.d.ts +23 -0
  597. package/dist/types/components/slides/lib/js/fullscreen.d.ts +1 -0
  598. package/dist/types/components/slides/lib/js/index.d.ts +5 -0
  599. package/dist/types/components/slides/lib/js/lazyload.d.ts +1 -0
  600. package/dist/types/components/slides/lib/js/page-dots.d.ts +1 -0
  601. package/dist/types/components/slides/lib/js/player.d.ts +1 -0
  602. package/dist/types/components/slides/lib/js/prev-next-button.d.ts +1 -0
  603. package/dist/types/components/slides/lib/js/slide.d.ts +1 -0
  604. package/dist/types/components/slides/lib/js/utils/event-emitter.d.ts +1 -0
  605. package/dist/types/components/slides/lib/js/utils/gestures.d.ts +26 -0
  606. package/dist/types/components/slides/lib/js/utils/get-size.d.ts +6 -0
  607. package/dist/types/components/slides/lib/js/utils/utils.d.ts +5 -0
  608. package/dist/types/components/slides/slides-interface.d.ts +17 -7
  609. package/dist/types/components/slides/slides.d.ts +5 -0
  610. package/dist/types/components.d.ts +10 -10
  611. package/dist/types/utils/scroll.d.ts +5 -1
  612. package/docs-json.json +33 -24
  613. package/docs-vscode.json +4 -0
  614. package/hydrate/index.js +4147 -3953
  615. package/package.json +5 -8
  616. package/dist/cjs/_commonjsHelpers-29614748.js +0 -30
  617. package/dist/cjs/_commonjsHelpers-29614748.js.map +0 -1
  618. package/dist/cjs/algoliasearch-lite.esm.browser-992a2eff.js.map +0 -1
  619. package/dist/cjs/index-1d3ebe1a.js.map +0 -1
  620. package/dist/cjs/scroll-fc1b8387.js.map +0 -1
  621. package/dist/cjs/table.worker-3df34efe.js.map +0 -1
  622. package/dist/collection/components/slides/lib/js/add-remove-cell.js +0 -128
  623. package/dist/collection/components/slides/lib/js/images-loaded.js +0 -24
  624. package/dist/collection/components/slides/slides-interface.js +0 -2
  625. package/dist/collection/components/slides/slides-interface.js.map +0 -1
  626. package/dist/collection/utils/template.js.map +0 -1
  627. package/dist/components/_commonjsHelpers.js +0 -26
  628. package/dist/components/_commonjsHelpers.js.map +0 -1
  629. package/dist/esm/_commonjsHelpers-04a0e019.js +0 -26
  630. package/dist/esm/_commonjsHelpers-04a0e019.js.map +0 -1
  631. package/dist/esm/algoliasearch-lite.esm.browser-04891fdc.js.map +0 -1
  632. package/dist/esm/index-06666022.js.map +0 -1
  633. package/dist/esm/scroll-ec7ac257.js.map +0 -1
  634. package/dist/esm/table.worker-3cae908c.js.map +0 -1
  635. package/dist/nano-components/p-0563e812.entry.js +0 -5
  636. package/dist/nano-components/p-0563e812.entry.js.map +0 -1
  637. package/dist/nano-components/p-0bc40dd1.entry.js +0 -5
  638. package/dist/nano-components/p-0bc40dd1.entry.js.map +0 -1
  639. package/dist/nano-components/p-0e0f07f0.entry.js +0 -5
  640. package/dist/nano-components/p-0e0f07f0.entry.js.map +0 -1
  641. package/dist/nano-components/p-0e4da739.entry.js +0 -5
  642. package/dist/nano-components/p-0e4da739.entry.js.map +0 -1
  643. package/dist/nano-components/p-16e75af9.entry.js +0 -5
  644. package/dist/nano-components/p-16e75af9.entry.js.map +0 -1
  645. package/dist/nano-components/p-17eb456c.entry.js +0 -5
  646. package/dist/nano-components/p-17eb456c.entry.js.map +0 -1
  647. package/dist/nano-components/p-191352c4.entry.js +0 -5
  648. package/dist/nano-components/p-1987f7a9.js +0 -5
  649. package/dist/nano-components/p-1a55e282.entry.js +0 -5
  650. package/dist/nano-components/p-1a55e282.entry.js.map +0 -1
  651. package/dist/nano-components/p-2234694a.js +0 -5
  652. package/dist/nano-components/p-2a105609.entry.js +0 -5
  653. package/dist/nano-components/p-2a105609.entry.js.map +0 -1
  654. package/dist/nano-components/p-2c0218e6.entry.js +0 -5
  655. package/dist/nano-components/p-2c0218e6.entry.js.map +0 -1
  656. package/dist/nano-components/p-328ef9d3.entry.js +0 -5
  657. package/dist/nano-components/p-359b7cd2.entry.js +0 -5
  658. package/dist/nano-components/p-359b7cd2.entry.js.map +0 -1
  659. package/dist/nano-components/p-36c3ded8.entry.js +0 -5
  660. package/dist/nano-components/p-36c3ded8.entry.js.map +0 -1
  661. package/dist/nano-components/p-3ae362ae.entry.js +0 -5
  662. package/dist/nano-components/p-3cac5f6d.entry.js +0 -5
  663. package/dist/nano-components/p-3d8fb8a1.entry.js +0 -5
  664. package/dist/nano-components/p-3eeaba47.entry.js +0 -5
  665. package/dist/nano-components/p-3eeaba47.entry.js.map +0 -1
  666. package/dist/nano-components/p-3f40e370.entry.js +0 -5
  667. package/dist/nano-components/p-51133e62.entry.js +0 -5
  668. package/dist/nano-components/p-51133e62.entry.js.map +0 -1
  669. package/dist/nano-components/p-54c4a2f5.entry.js +0 -5
  670. package/dist/nano-components/p-54c4a2f5.entry.js.map +0 -1
  671. package/dist/nano-components/p-5fc3035d.entry.js +0 -5
  672. package/dist/nano-components/p-5fc3035d.entry.js.map +0 -1
  673. package/dist/nano-components/p-650aa197.entry.js +0 -5
  674. package/dist/nano-components/p-650aa197.entry.js.map +0 -1
  675. package/dist/nano-components/p-67ab5a5f.entry.js +0 -5
  676. package/dist/nano-components/p-67ab5a5f.entry.js.map +0 -1
  677. package/dist/nano-components/p-688f1a55.entry.js +0 -5
  678. package/dist/nano-components/p-688f1a55.entry.js.map +0 -1
  679. package/dist/nano-components/p-6c4171fa.entry.js +0 -5
  680. package/dist/nano-components/p-70747f20.js +0 -5
  681. package/dist/nano-components/p-7670058b.entry.js +0 -5
  682. package/dist/nano-components/p-7670058b.entry.js.map +0 -1
  683. package/dist/nano-components/p-79fff4fd.entry.js +0 -5
  684. package/dist/nano-components/p-7c82af28.entry.js +0 -5
  685. package/dist/nano-components/p-87329424.entry.js +0 -5
  686. package/dist/nano-components/p-8fe51abf.js +0 -5
  687. package/dist/nano-components/p-935968b8.entry.js +0 -23
  688. package/dist/nano-components/p-935968b8.entry.js.map +0 -1
  689. package/dist/nano-components/p-9925e504.entry.js +0 -5
  690. package/dist/nano-components/p-9c290055.entry.js +0 -5
  691. package/dist/nano-components/p-9f60ff14.entry.js +0 -5
  692. package/dist/nano-components/p-a225e976.entry.js +0 -5
  693. package/dist/nano-components/p-a225e976.entry.js.map +0 -1
  694. package/dist/nano-components/p-a26bdb65.js +0 -5
  695. package/dist/nano-components/p-abd11243.entry.js +0 -5
  696. package/dist/nano-components/p-abd11243.entry.js.map +0 -1
  697. package/dist/nano-components/p-b27b56d3.js +0 -5
  698. package/dist/nano-components/p-b27b56d3.js.map +0 -1
  699. package/dist/nano-components/p-c80336b2.entry.js +0 -5
  700. package/dist/nano-components/p-c80336b2.entry.js.map +0 -1
  701. package/dist/nano-components/p-cad86fb8.js +0 -5
  702. package/dist/nano-components/p-cad86fb8.js.map +0 -1
  703. package/dist/nano-components/p-d4e44f93.entry.js +0 -5
  704. package/dist/nano-components/p-dc4020f8.js +0 -5
  705. package/dist/nano-components/p-dc4020f8.js.map +0 -1
  706. package/dist/nano-components/p-dc6cb252.entry.js +0 -5
  707. package/dist/nano-components/p-dc6cb252.entry.js.map +0 -1
  708. package/dist/nano-components/p-dc805ecc.js +0 -5
  709. package/dist/nano-components/p-dd5687db.js +0 -5
  710. package/dist/nano-components/p-e6a0675e.entry.js +0 -5
  711. package/dist/nano-components/p-e98835e2.entry.js +0 -5
  712. package/dist/nano-components/p-efd3e121.entry.js +0 -5
  713. package/dist/nano-components/p-f73f52ed.entry.js +0 -5
  714. package/dist/nano-components/p-f73f52ed.entry.js.map +0 -1
  715. package/dist/nano-components/p-fbde7010.entry.js +0 -5
  716. package/dist/nano-components/p-fcbc9122.entry.js +0 -5
  717. package/dist/nano-components/p-fcbc9122.entry.js.map +0 -1
  718. package/dist/types/utils/template.d.ts +0 -2
  719. /package/dist/nano-components/{p-74a7fc4f.js.map → active-element-75b7c8a0.js.map} +0 -0
  720. /package/dist/nano-components/{p-cecb9af1.js.map → date-utils-6b7a6e1f.js.map} +0 -0
  721. /package/dist/nano-components/{p-cdfc507e.js.map → dom-8599fac1.js.map} +0 -0
  722. /package/dist/nano-components/{p-842cf127.js.map → drag-1723a4cc.js.map} +0 -0
  723. /package/dist/nano-components/{p-9bfdee71.js.map → events-6a805b42.js.map} +0 -0
  724. /package/dist/nano-components/{p-f8f89998.js.map → focus-visible-8b2c14da.js.map} +0 -0
  725. /package/dist/nano-components/{p-bb07c3d0.js.map → index-f626f476.js.map} +0 -0
  726. /package/dist/nano-components/{p-1987f7a9.js.map → local-my-account-6662da72.js.map} +0 -0
  727. /package/dist/nano-components/{p-ee045579.js.map → math-c02ddfda.js.map} +0 -0
  728. /package/dist/nano-components/{p-2155fc2c.js.map → nano-slides.entry.js.map} +0 -0
  729. /package/dist/nano-components/{p-8fe51abf.js.map → nano-table.entry.js.map} +0 -0
  730. /package/dist/nano-components/{p-cd1fd454.js.map → popover-e5e7a641.js.map} +0 -0
  731. /package/dist/nano-components/{p-dc565459.js.map → slot-8126e238.js.map} +0 -0
  732. /package/dist/nano-components/{p-f88fa15c.js.map → tabbable-26a66a22.js.map} +0 -0
  733. /package/dist/nano-components/{p-fbde7010.entry.js.map → table.worker-34706ecc.js.map} +0 -0
  734. /package/dist/nano-components/{p-f258383d.js → table.worker-f258383d.js} +0 -0
  735. /package/dist/nano-components/{p-411bb8f1.js.map → theme-82feb8cf.js.map} +0 -0
  736. /package/dist/nano-components/{p-7bff5224.js.map → throttle-ac4fcefa.js.map} +0 -0
  737. /package/dist/nano-components/{p-c3e8e3f9.js.map → transitions-fb09eb32.js.map} +0 -0
@@ -0,0 +1,2975 @@
1
+ /*!
2
+ * Web Components for Nanopore digital Web Apps
3
+ */
4
+ 'use strict';
5
+
6
+ const index = require('./index-14451c95.js');
7
+
8
+ function EvEmitter() { }
9
+ const proto$7 = EvEmitter.prototype;
10
+ proto$7.on = function (eventName, listener) {
11
+ if (!eventName || !listener) {
12
+ return;
13
+ }
14
+ // set events hash
15
+ const events = (this._events = this._events || {});
16
+ // set listeners array
17
+ const listeners = (events[eventName] = events[eventName] || []);
18
+ // only add once
19
+ if (listeners.indexOf(listener) == -1) {
20
+ listeners.push(listener);
21
+ }
22
+ return this;
23
+ };
24
+ proto$7.once = function (eventName, listener) {
25
+ if (!eventName || !listener) {
26
+ return;
27
+ }
28
+ // add event
29
+ this.on(eventName, listener);
30
+ // set once flag
31
+ // set onceEvents hash
32
+ const onceEvents = (this._onceEvents = this._onceEvents || {});
33
+ // set onceListeners object
34
+ const onceListeners = (onceEvents[eventName] = onceEvents[eventName] || {});
35
+ // set flag
36
+ onceListeners[listener] = true;
37
+ return this;
38
+ };
39
+ proto$7.off = function (eventName, listener) {
40
+ const listeners = this._events && this._events[eventName];
41
+ if (!listeners || !listeners.length) {
42
+ return;
43
+ }
44
+ const index = listeners.indexOf(listener);
45
+ if (index != -1) {
46
+ listeners.splice(index, 1);
47
+ }
48
+ return this;
49
+ };
50
+ proto$7.emitEvent = function (eventName, args) {
51
+ let listeners = this._events && this._events[eventName];
52
+ if (!listeners || !listeners.length) {
53
+ return;
54
+ }
55
+ // copy over to avoid interference if .off() in listener
56
+ listeners = listeners.slice(0);
57
+ args = args || [];
58
+ // once stuff
59
+ const onceListeners = this._onceEvents && this._onceEvents[eventName];
60
+ for (let i = 0; i < listeners.length; i++) {
61
+ const listener = listeners[i];
62
+ const isOnce = onceListeners && onceListeners[listener];
63
+ if (isOnce) {
64
+ // remove listener
65
+ // remove before trigger to prevent recursion
66
+ this.off(eventName, listener);
67
+ // unset once flag
68
+ delete onceListeners[listener];
69
+ }
70
+ // trigger listener
71
+ listener.apply(this, args);
72
+ }
73
+ return this;
74
+ };
75
+ proto$7.allOff = function () {
76
+ delete this._events;
77
+ delete this._onceEvents;
78
+ };
79
+
80
+ /*!
81
+ * getSize v2.0.3
82
+ * measure size of elements
83
+ * MIT license
84
+ */
85
+ // get a number from a string, not a percentage
86
+ function getStyleSize(value) {
87
+ const num = parseFloat(value);
88
+ // not a percent like '100%', and a number
89
+ const isValid = value.indexOf('%') == -1 && !isNaN(num);
90
+ return isValid && num;
91
+ }
92
+ function noop$1() { }
93
+ const logError = typeof console == 'undefined'
94
+ ? noop$1
95
+ : function (message) {
96
+ console.error(message);
97
+ };
98
+ // -------------------------- measurements -------------------------- //
99
+ const measurements = [
100
+ 'paddingLeft',
101
+ 'paddingRight',
102
+ 'paddingTop',
103
+ 'paddingBottom',
104
+ 'marginLeft',
105
+ 'marginRight',
106
+ 'marginTop',
107
+ 'marginBottom',
108
+ 'borderLeftWidth',
109
+ 'borderRightWidth',
110
+ 'borderTopWidth',
111
+ 'borderBottomWidth',
112
+ ];
113
+ const measurementsLength = measurements.length;
114
+ function getZeroSize() {
115
+ const size = {
116
+ width: 0,
117
+ height: 0,
118
+ innerWidth: 0,
119
+ innerHeight: 0,
120
+ outerWidth: 0,
121
+ outerHeight: 0,
122
+ };
123
+ for (let i = 0; i < measurementsLength; i++) {
124
+ const measurement = measurements[i];
125
+ size[measurement] = 0;
126
+ }
127
+ return size;
128
+ }
129
+ // -------------------------- getStyle -------------------------- //
130
+ /**
131
+ * getStyle, get style of element, check for Firefox bug
132
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=548397
133
+ * @param elem element to get styles for
134
+ * @returns {CSSStyleDeclaration} styles of element
135
+ */
136
+ function getStyle(elem) {
137
+ const style = getComputedStyle(elem);
138
+ if (!style) {
139
+ logError('Style returned ' +
140
+ style +
141
+ '. Are you running this code in a hidden iframe on Firefox? ' +
142
+ 'See https://bit.ly/getsizebug1');
143
+ }
144
+ return style;
145
+ }
146
+ // -------------------------- setup -------------------------- //
147
+ let isSetup = false;
148
+ let isBoxSizeOuter;
149
+ /**
150
+ * setup
151
+ * check isBoxSizerOuter
152
+ * do on first getSize() rather than on page load for Firefox bug
153
+ */
154
+ function setup() {
155
+ // setup once
156
+ if (isSetup) {
157
+ return;
158
+ }
159
+ isSetup = true;
160
+ // -------------------------- box sizing -------------------------- //
161
+ /**
162
+ * Chrome & Safari measure the outer-width on style.width on border-box elems
163
+ * IE11 & Firefox<29 measures the inner-width
164
+ */
165
+ const div = document.createElement('div');
166
+ div.style.width = '200px';
167
+ div.style.padding = '1px 2px 3px 4px';
168
+ div.style.borderStyle = 'solid';
169
+ div.style.borderWidth = '1px 2px 3px 4px';
170
+ div.style.boxSizing = 'border-box';
171
+ const body = document.body || document.documentElement;
172
+ body.appendChild(div);
173
+ const style = getStyle(div);
174
+ // round value for browser zoom. desandro/masonry#928
175
+ isBoxSizeOuter = Math.round(getStyleSize(style.width)) == 200;
176
+ // @ts-ignore
177
+ getSize.isBoxSizeOuter = isBoxSizeOuter;
178
+ body.removeChild(div);
179
+ }
180
+ // -------------------------- getSize -------------------------- //
181
+ function getSize(elem) {
182
+ setup();
183
+ // use querySeletor if elem is string
184
+ if (typeof elem == 'string') {
185
+ elem = document.querySelector(elem);
186
+ }
187
+ // do not proceed on non-objects
188
+ if (!elem || typeof elem != 'object' || !elem.nodeType) {
189
+ return;
190
+ }
191
+ const style = getStyle(elem);
192
+ // if hidden, everything is 0
193
+ if (style.display == 'none') {
194
+ return getZeroSize();
195
+ }
196
+ const size = {};
197
+ size.width = elem.offsetWidth;
198
+ size.height = elem.offsetHeight;
199
+ const isBorderBox = (size.isBorderBox = style.boxSizing == 'border-box');
200
+ // get all measurements
201
+ for (let i = 0; i < measurementsLength; i++) {
202
+ const measurement = measurements[i];
203
+ const value = style[measurement];
204
+ const num = parseFloat(value);
205
+ // any 'auto', 'medium' value will be 0
206
+ size[measurement] = !isNaN(num) ? num : 0;
207
+ }
208
+ const paddingWidth = size.paddingLeft + size.paddingRight;
209
+ const paddingHeight = size.paddingTop + size.paddingBottom;
210
+ const marginWidth = size.marginLeft + size.marginRight;
211
+ const marginHeight = size.marginTop + size.marginBottom;
212
+ const borderWidth = size.borderLeftWidth + size.borderRightWidth;
213
+ const borderHeight = size.borderTopWidth + size.borderBottomWidth;
214
+ const isBorderBoxSizeOuter = isBorderBox && isBoxSizeOuter;
215
+ // overwrite width and height if we can get it from style
216
+ const styleWidth = getStyleSize(style.width);
217
+ if (styleWidth !== false) {
218
+ size.width =
219
+ styleWidth +
220
+ // add padding and border unless it's already including it
221
+ (isBorderBoxSizeOuter ? 0 : paddingWidth + borderWidth);
222
+ }
223
+ const styleHeight = getStyleSize(style.height);
224
+ if (styleHeight !== false) {
225
+ size.height =
226
+ styleHeight +
227
+ // add padding and border unless it's already including it
228
+ (isBorderBoxSizeOuter ? 0 : paddingHeight + borderHeight);
229
+ }
230
+ size.innerWidth = size.width - (paddingWidth + borderWidth);
231
+ size.innerHeight = size.height - (paddingHeight + borderHeight);
232
+ size.outerWidth = size.width + marginWidth;
233
+ size.outerHeight = size.height + marginHeight;
234
+ return size;
235
+ }
236
+
237
+ /**
238
+ * Fizzy UI utils v2.0.7
239
+ * MIT license
240
+ */
241
+ /*jshint browser: true, undef: true, unused: true, strict: true */
242
+ const utils = {};
243
+ // ----- extend ----- //
244
+ // extends objects
245
+ utils.extend = function (a, b) {
246
+ for (const prop in b) {
247
+ a[prop] = b[prop];
248
+ }
249
+ return a;
250
+ };
251
+ // ----- docReady ----- //
252
+ utils.docReady = function (callback) {
253
+ const readyState = document.readyState;
254
+ if (readyState == 'complete' || readyState == 'interactive') {
255
+ // do async to allow for other scripts to run. metafizzy/flickity#441
256
+ setTimeout(callback);
257
+ }
258
+ else {
259
+ document.addEventListener('DOMContentLoaded', callback);
260
+ }
261
+ };
262
+ // ----- toDashed ----- //
263
+ utils.toDashed = function (str) {
264
+ return str
265
+ .replace(/(.)([A-Z])/g, function (_match, $1, $2) {
266
+ return $1 + '-' + $2;
267
+ })
268
+ .toLowerCase();
269
+ };
270
+ // ----- modulo ----- //
271
+ utils.modulo = function (num, div) {
272
+ return ((num % div) + div) % div;
273
+ };
274
+ // ----- makeArray ----- //
275
+ const arraySlice = Array.prototype.slice;
276
+ // turn element or nodeList into an array
277
+ utils.makeArray = function (obj) {
278
+ if (Array.isArray(obj)) {
279
+ // use object if already an array
280
+ return obj;
281
+ }
282
+ // return empty array if undefined or null. #6
283
+ if (obj === null || obj === undefined) {
284
+ return [];
285
+ }
286
+ const isArrayLike = typeof obj == 'object' && typeof obj.length == 'number';
287
+ if (isArrayLike) {
288
+ // convert nodeList to array
289
+ return arraySlice.call(obj);
290
+ }
291
+ // array of single index
292
+ return [obj];
293
+ };
294
+ // ----- getParent ----- //
295
+ utils.getParent = function (elem, selector) {
296
+ while (elem.parentNode && elem != document.body) {
297
+ elem = elem.parentElement;
298
+ if (elem.matches(selector)) {
299
+ return elem;
300
+ }
301
+ }
302
+ };
303
+ // ----- getQueryElement ----- //
304
+ // use element as selector string
305
+ utils.getQueryElement = function (elem) {
306
+ if (typeof elem == 'string') {
307
+ return document.querySelector(elem);
308
+ }
309
+ return elem;
310
+ };
311
+ // ----- handleEvent ----- //
312
+ // enable .ontype to trigger from .addEventListener( elem, 'type' )
313
+ utils.handleEvent = function (event) {
314
+ const method = 'on' + event.type;
315
+ if (this[method]) {
316
+ this[method](event);
317
+ }
318
+ };
319
+ // ----- filterFindElements ----- //
320
+ utils.filterFindElements = function (elems, selector) {
321
+ // make array of elems
322
+ elems = utils.makeArray(elems);
323
+ const ffElems = [];
324
+ elems.forEach(function (elem) {
325
+ // check that elem is an actual element
326
+ if (!(elem instanceof HTMLElement)) {
327
+ return;
328
+ }
329
+ // add elem if no selector
330
+ if (!selector) {
331
+ ffElems.push(elem);
332
+ return;
333
+ }
334
+ // filter & find items if we have a selector
335
+ // filter
336
+ if (elem.matches(selector)) {
337
+ ffElems.push(elem);
338
+ }
339
+ // find children
340
+ const childElems = elem.querySelectorAll(selector);
341
+ // concat childElems to filterFound array
342
+ for (let i = 0; i < childElems.length; i++) {
343
+ ffElems.push(childElems[i]);
344
+ }
345
+ });
346
+ return ffElems;
347
+ };
348
+ // ----- debounceMethod ----- //
349
+ utils.debounceMethod = function (_class, methodName, threshold) {
350
+ threshold = threshold || 100;
351
+ // original method
352
+ const method = _class.prototype[methodName];
353
+ const timeoutName = methodName + 'Timeout';
354
+ _class.prototype[methodName] = function (...args) {
355
+ const timeout = this[timeoutName];
356
+ clearTimeout(timeout);
357
+ const _this = this;
358
+ this[timeoutName] = setTimeout(function () {
359
+ method.apply(_this, args);
360
+ delete _this[timeoutName];
361
+ }, threshold);
362
+ };
363
+ };
364
+ const console$2 = window.console;
365
+ /**
366
+ * allow user to initialize classes via [data-namespace] or .js-namespace class
367
+ * htmlInit( Widget, 'widgetName' )
368
+ * options are parsed from data-namespace-options
369
+ */
370
+ utils.htmlInit = function (WidgetClass, namespace) {
371
+ utils.docReady(function () {
372
+ const dashedNamespace = utils.toDashed(namespace);
373
+ const dataAttr = 'data-' + dashedNamespace;
374
+ const dataAttrElems = document.querySelectorAll('[' + dataAttr + ']');
375
+ const jsDashElems = document.querySelectorAll('.js-' + dashedNamespace);
376
+ const elems = utils
377
+ .makeArray(dataAttrElems)
378
+ .concat(utils.makeArray(jsDashElems));
379
+ const dataOptionsAttr = dataAttr + '-options';
380
+ elems.forEach(function (elem) {
381
+ const attr = elem.getAttribute(dataAttr) || elem.getAttribute(dataOptionsAttr);
382
+ let options;
383
+ try {
384
+ options = attr && JSON.parse(attr);
385
+ }
386
+ catch (error) {
387
+ // log error, do not initialize
388
+ if (console$2) {
389
+ console$2.error('Error parsing ' + dataAttr + ' on ' + elem.className + ': ' + error);
390
+ }
391
+ return;
392
+ }
393
+ // initialize
394
+ // @ts-ignore
395
+ new WidgetClass(elem, options);
396
+ });
397
+ });
398
+ };
399
+
400
+ function Cell(elem, parent) {
401
+ this.element = elem;
402
+ this.parent = parent;
403
+ this.create();
404
+ }
405
+ const proto$6 = Cell.prototype;
406
+ proto$6.create = function () {
407
+ this.element.style.position = 'absolute';
408
+ this.element.setAttribute('aria-hidden', 'true');
409
+ this.x = 0;
410
+ this.shift = 0;
411
+ Array.from(this.element.querySelectorAll('*')).forEach((element) => {
412
+ element.setAttribute('tabindex', '-1');
413
+ });
414
+ };
415
+ proto$6.destroy = function () {
416
+ // reset style
417
+ this.unselect();
418
+ this.element.style.position = '';
419
+ const side = this.parent.originSide;
420
+ this.element.style[side] = '';
421
+ };
422
+ proto$6.getSize = function () {
423
+ this.size = getSize(this.element);
424
+ };
425
+ proto$6.setPosition = function (x) {
426
+ this.x = x;
427
+ this.updateTarget();
428
+ this.renderPosition(x);
429
+ };
430
+ // setDefaultTarget v1 method, backwards compatibility, remove in v3
431
+ proto$6.updateTarget = proto$6.setDefaultTarget = function () {
432
+ const marginProperty = this.parent.originSide == 'left' ? 'marginLeft' : 'marginRight';
433
+ this.target =
434
+ this.x +
435
+ this.size[marginProperty] +
436
+ this.size.width * this.parent.cellAlign;
437
+ };
438
+ proto$6.renderPosition = function (x) {
439
+ // render position of cell with in slider
440
+ const side = this.parent.originSide;
441
+ this.element.style[side] = this.parent.getPositionValue(x);
442
+ };
443
+ proto$6.select = function () {
444
+ this.element.classList.add('is-selected');
445
+ this.element.removeAttribute('aria-hidden');
446
+ Array.from(this.element.querySelectorAll('*')).forEach((element) => {
447
+ element.removeAttribute('tabindex');
448
+ });
449
+ };
450
+ proto$6.unselect = function () {
451
+ this.element.classList.remove('is-selected');
452
+ this.element.setAttribute('aria-hidden', 'true');
453
+ Array.from(this.element.querySelectorAll('*')).forEach((element) => {
454
+ element.setAttribute('tabindex', '-1');
455
+ });
456
+ };
457
+ /**
458
+ * @param {Integer} shift - 0, 1, or -1
459
+ **/
460
+ proto$6.wrapShift = function (shift) {
461
+ this.shift = shift;
462
+ this.renderPosition(this.x + this.parent.slideableWidth * shift);
463
+ };
464
+ proto$6.remove = function () {
465
+ this.element.parentNode.removeChild(this.element);
466
+ };
467
+
468
+ function Slide(parent) {
469
+ this.parent = parent;
470
+ this.isOriginLeft = parent.originSide == 'left';
471
+ this.cells = [];
472
+ this.outerWidth = 0;
473
+ this.height = 0;
474
+ }
475
+ const proto$5 = Slide.prototype;
476
+ proto$5.addCell = function (cell) {
477
+ this.cells.push(cell);
478
+ this.outerWidth += cell.size.outerWidth;
479
+ this.height = Math.max(cell.size.outerHeight, this.height);
480
+ // first cell stuff
481
+ if (this.cells.length == 1) {
482
+ this.x = cell.x; // x comes from first cell
483
+ const beginMargin = this.isOriginLeft ? 'marginLeft' : 'marginRight';
484
+ this.firstMargin = cell.size[beginMargin];
485
+ }
486
+ };
487
+ proto$5.updateTarget = function () {
488
+ const endMargin = this.isOriginLeft ? 'marginRight' : 'marginLeft';
489
+ const lastCell = this.getLastCell();
490
+ const lastMargin = lastCell ? lastCell.size[endMargin] : 0;
491
+ const slideWidth = this.outerWidth - (this.firstMargin + lastMargin);
492
+ this.target = this.x + this.firstMargin + slideWidth * this.parent.cellAlign;
493
+ };
494
+ proto$5.getLastCell = function () {
495
+ return this.cells[this.cells.length - 1];
496
+ };
497
+ proto$5.select = function () {
498
+ this.cells.forEach(function (cell) {
499
+ cell.select();
500
+ });
501
+ };
502
+ proto$5.unselect = function () {
503
+ this.cells.forEach(function (cell) {
504
+ cell.unselect();
505
+ });
506
+ };
507
+ proto$5.getCellElements = function () {
508
+ return this.cells.map(function (cell) {
509
+ return cell.element;
510
+ });
511
+ };
512
+
513
+ const proto$4 = {};
514
+ proto$4.startAnimation = function () {
515
+ if (this.isAnimating) {
516
+ return;
517
+ }
518
+ this.isAnimating = true;
519
+ this.restingFrames = 0;
520
+ this.animate();
521
+ };
522
+ proto$4.animate = function () {
523
+ this.applyDragForce();
524
+ this.applySelectedAttraction();
525
+ const previousX = this.x;
526
+ this.integratePhysics();
527
+ this.positionSlider();
528
+ this.settle(previousX);
529
+ // animate next frame
530
+ if (this.isAnimating) {
531
+ const _this = this;
532
+ requestAnimationFrame(function animateFrame() {
533
+ _this.animate();
534
+ });
535
+ }
536
+ };
537
+ proto$4.positionSlider = function () {
538
+ let x = this.x;
539
+ // wrap position around
540
+ if (this.options.wrapAround && this.cells.length > 1) {
541
+ x = utils.modulo(x, this.slideableWidth);
542
+ x = x - this.slideableWidth;
543
+ this.shiftWrapCells(x);
544
+ }
545
+ this.setTranslateX(x, this.isAnimating);
546
+ this.dispatchScrollEvent();
547
+ };
548
+ proto$4.setTranslateX = function (x, _is3d) {
549
+ x += this.cursorPosition;
550
+ // reverse if right-to-left and using transform
551
+ x = this.options.rightToLeft ? -x : x;
552
+ const translateX = this.getPositionValue(x);
553
+ // use 3D tranforms for hardware acceleration on iOS
554
+ // but use 2D when settled, for better font-rendering
555
+ // this.slider.style.transform = is3d
556
+ // ? 'translate3d(' + translateX + ',0,0)'
557
+ // : 'translateX(' + translateX + ')';
558
+ this.slider.style.transform = 'translate3d(' + translateX + ',0,0)';
559
+ };
560
+ proto$4.dispatchScrollEvent = function () {
561
+ const firstSlide = this.slides[0];
562
+ if (!firstSlide) {
563
+ return;
564
+ }
565
+ const positionX = -this.x - firstSlide.target;
566
+ const progress = positionX / this.slidesWidth;
567
+ this.dispatchEvent('scroll', null, [progress, positionX]);
568
+ };
569
+ proto$4.positionSliderAtSelected = function () {
570
+ if (!this.cells.length) {
571
+ return;
572
+ }
573
+ this.x = -this.selectedSlide.target;
574
+ this.velocity = 0; // stop wobble
575
+ this.positionSlider();
576
+ };
577
+ proto$4.getPositionValue = function (position) {
578
+ if (this.options.percentPosition) {
579
+ // percent position, round to 2 digits, like 12.34%
580
+ return Math.round((position / this.size.innerWidth) * 10000) * 0.01 + '%';
581
+ }
582
+ else {
583
+ // pixel positioning
584
+ return Math.round(position) + 'px';
585
+ }
586
+ };
587
+ proto$4.settle = function (previousX) {
588
+ // keep track of frames where x hasn't moved
589
+ if (!this.isPointerDown &&
590
+ Math.round(this.x * 100) == Math.round(previousX * 100)) {
591
+ this.restingFrames++;
592
+ }
593
+ // stop animating if resting for 3 or more frames
594
+ if (this.restingFrames > 2) {
595
+ this.isAnimating = false;
596
+ delete this.isFreeScrolling;
597
+ // render position with translateX when settled
598
+ this.positionSlider();
599
+ this.dispatchEvent('settle', null, [this.selectedIndex]);
600
+ }
601
+ };
602
+ proto$4.shiftWrapCells = function (x) {
603
+ // shift before cells
604
+ const beforeGap = this.cursorPosition + x;
605
+ this._shiftCells(this.beforeShiftCells, beforeGap, -1);
606
+ // shift after cells
607
+ const afterGap = this.size.innerWidth - (x + this.slideableWidth + this.cursorPosition);
608
+ this._shiftCells(this.afterShiftCells, afterGap, 1);
609
+ };
610
+ proto$4._shiftCells = function (cells, gap, shift) {
611
+ for (let i = 0; i < cells.length; i++) {
612
+ const cell = cells[i];
613
+ const cellShift = gap > 0 ? shift : 0;
614
+ cell.wrapShift(cellShift);
615
+ gap -= cell.size.outerWidth;
616
+ }
617
+ };
618
+ proto$4._unshiftCells = function (cells) {
619
+ if (!cells || !cells.length) {
620
+ return;
621
+ }
622
+ for (let i = 0; i < cells.length; i++) {
623
+ cells[i].wrapShift(0);
624
+ }
625
+ };
626
+ // -------------------------- physics -------------------------- //
627
+ proto$4.integratePhysics = function () {
628
+ this.x += this.velocity;
629
+ this.velocity *= this.getFrictionFactor();
630
+ };
631
+ proto$4.applyForce = function (force) {
632
+ this.velocity += force;
633
+ };
634
+ proto$4.getFrictionFactor = function () {
635
+ return (1 - this.options[this.isFreeScrolling ? 'freeScrollFriction' : 'friction']);
636
+ };
637
+ proto$4.getRestingPosition = function () {
638
+ // my thanks to Steven Wittens, who simplified this math greatly
639
+ return this.x + this.velocity / (1 - this.getFrictionFactor());
640
+ };
641
+ proto$4.applyDragForce = function () {
642
+ if (!this.isDraggable || !this.isPointerDown) {
643
+ return;
644
+ }
645
+ // change the position to drag position by applying force
646
+ const dragVelocity = this.dragX - this.x;
647
+ const dragForce = dragVelocity - this.velocity;
648
+ this.applyForce(dragForce);
649
+ };
650
+ proto$4.applySelectedAttraction = function () {
651
+ // do not attract if pointer down or no slides
652
+ const dragDown = this.isDraggable && this.isPointerDown;
653
+ if (dragDown || this.isFreeScrolling || !this.slides.length) {
654
+ return;
655
+ }
656
+ const distance = this.selectedSlide.target * -1 - this.x;
657
+ const force = distance * this.options.selectedAttraction;
658
+ this.applyForce(force);
659
+ };
660
+
661
+ // vars
662
+ const getComputedStyle$1 = window.getComputedStyle;
663
+ const console$1 = window.console;
664
+ function moveElements(elems, toElem) {
665
+ elems = utils.makeArray(elems);
666
+ while (elems.length) {
667
+ toElem.appendChild(elems.shift());
668
+ }
669
+ }
670
+ // -------------------------- Flickity -------------------------- //
671
+ // globally unique identifiers
672
+ let GUID = 0;
673
+ // internal store of all Flickity intances
674
+ const instances = {};
675
+ function Flickity(element, options) {
676
+ const queryElement = utils.getQueryElement(element);
677
+ if (!queryElement) {
678
+ if (console$1) {
679
+ console$1.error('Bad element for Flickity: ' + (queryElement || element));
680
+ }
681
+ return;
682
+ }
683
+ this.element = queryElement;
684
+ // do not initialize twice on same element
685
+ if (this.element.flickityGUID) {
686
+ const instance = instances[this.element.flickityGUID];
687
+ if (!instances[this.element.flickityGUID])
688
+ return;
689
+ instance.option(options);
690
+ return instance;
691
+ }
692
+ // options
693
+ this.options = utils.extend({}, this.constructor.defaults);
694
+ this.option(options);
695
+ // kick things off
696
+ this._create();
697
+ }
698
+ Flickity.defaults = {
699
+ accessibility: true,
700
+ // adaptiveHeight: false,
701
+ cellAlign: 'center',
702
+ // cellSelector: undefined,
703
+ // contain: false,
704
+ freeScrollFriction: 0.075,
705
+ friction: 0.28,
706
+ namespaceJQueryEvents: true,
707
+ // initialIndex: 0,
708
+ percentPosition: true,
709
+ resize: true,
710
+ selectedAttraction: 0.025,
711
+ setGallerySize: true,
712
+ // watchCSS: false,
713
+ // wrapAround: false
714
+ };
715
+ // hash of methods triggered on _create()
716
+ Flickity.createMethods = [];
717
+ const proto$3 = Flickity.prototype;
718
+ // inherit EventEmitter
719
+ utils.extend(proto$3, EvEmitter.prototype);
720
+ proto$3._create = function () {
721
+ // add id for Flickity.data
722
+ const id = (this.guid = ++GUID);
723
+ this.element.flickityGUID = id; // expando
724
+ instances[id] = this; // associate via id
725
+ // initial properties
726
+ this.selectedIndex = 0;
727
+ // how many frames slider has been in same position
728
+ this.restingFrames = 0;
729
+ // initial physics properties
730
+ this.x = 0;
731
+ this.velocity = 0;
732
+ this.originSide = this.options.rightToLeft ? 'right' : 'left';
733
+ // create viewport & slider
734
+ this.viewport = document.createElement('div');
735
+ this.viewport.className = 'flickity-viewport';
736
+ this.viewport.part.add('slide-viewport');
737
+ this._createSlider();
738
+ if (this.options.resize || this.options.watchCSS) {
739
+ window.addEventListener('resize', this);
740
+ }
741
+ // add listeners from on option
742
+ for (const eventName in this.options.on) {
743
+ const listener = this.options.on[eventName];
744
+ this.on(eventName, listener);
745
+ }
746
+ Flickity.createMethods.forEach(function (method) {
747
+ this[method]();
748
+ }, this);
749
+ if (this.options.watchCSS) {
750
+ this.watchCSS();
751
+ }
752
+ else {
753
+ this.activate();
754
+ }
755
+ };
756
+ /**
757
+ * set options
758
+ * @param {Object} opts
759
+ */
760
+ proto$3.option = function (opts) {
761
+ utils.extend(this.options, opts);
762
+ };
763
+ proto$3.activate = function () {
764
+ if (this.isActive) {
765
+ return;
766
+ }
767
+ this.isActive = true;
768
+ this.element.classList.add('flickity-enabled');
769
+ if (this.options.rightToLeft) {
770
+ this.element.classList.add('flickity-rtl');
771
+ }
772
+ this.getSize();
773
+ // move initial cell elements so they can be loaded as cells
774
+ const cellElems = this.element.children; //this._filterFindCellElements( this.element.children );
775
+ moveElements(cellElems, this.slider);
776
+ this.viewport.appendChild(this.slider);
777
+ this.element.appendChild(this.viewport);
778
+ // get cells from children
779
+ this.reloadCells();
780
+ if (this.options.accessibility) {
781
+ // allow element to focusable
782
+ this.element.tabIndex = 0;
783
+ // listen for key presses
784
+ this.element.addEventListener('keydown', this);
785
+ }
786
+ this.emitEvent('activate');
787
+ this.selectInitialIndex();
788
+ // flag for initial activation, for using initialIndex
789
+ this.isInitActivated = true;
790
+ // ready event. #493
791
+ this.dispatchEvent('ready');
792
+ };
793
+ // slider positions the cells
794
+ proto$3._createSlider = function () {
795
+ // slider element does all the positioning
796
+ const slider = document.createElement('div');
797
+ slider.className = 'flickity-slider';
798
+ slider.style[this.originSide] = 0;
799
+ this.slider = slider;
800
+ };
801
+ proto$3._filterFindCellElements = function (elems) {
802
+ return utils.filterFindElements(elems, this.options.cellSelector);
803
+ };
804
+ // goes through all children
805
+ proto$3.reloadCells = function () {
806
+ // collection of item elements
807
+ this.cells = this._makeCells(this.slider.getRootNode().host
808
+ ? this.slider.getRootNode().host.children
809
+ : this.slider.children);
810
+ this.positionCells();
811
+ this._getWrapShiftCells();
812
+ this.setGallerySize();
813
+ };
814
+ /**
815
+ * turn elements into Flickity.Cells
816
+ * @param {Array or NodeList or HTMLElement} elems
817
+ * @returns {Array} items - collection of new Flickity Cells
818
+ */
819
+ proto$3._makeCells = function (elems) {
820
+ const cellElems = this._filterFindCellElements(elems);
821
+ // create new Flickity for collection
822
+ const cells = cellElems.map(function (cellElem) {
823
+ return new Cell(cellElem, this);
824
+ }, this);
825
+ return cells;
826
+ };
827
+ proto$3.getLastCell = function () {
828
+ return this.cells[this.cells.length - 1];
829
+ };
830
+ proto$3.getLastSlide = function () {
831
+ return this.slides[this.slides.length - 1];
832
+ };
833
+ // positions all cells
834
+ proto$3.positionCells = function () {
835
+ // size all cells
836
+ this._sizeCells(this.cells);
837
+ // position all cells
838
+ this._positionCells(0);
839
+ };
840
+ /**
841
+ * position certain cells
842
+ * @param {Integer} index - which cell to start with
843
+ */
844
+ proto$3._positionCells = function (index) {
845
+ index = index || 0;
846
+ // also measure maxCellHeight
847
+ // start 0 if positioning all cells
848
+ this.maxCellHeight = index ? this.maxCellHeight || 0 : 0;
849
+ let cellX = 0;
850
+ // get cellX
851
+ if (index > 0) {
852
+ const startCell = this.cells[index - 1];
853
+ cellX = startCell.x + startCell.size.outerWidth;
854
+ }
855
+ const len = this.cells.length;
856
+ for (let i = index; i < len; i++) {
857
+ const cell = this.cells[i];
858
+ cell.setPosition(cellX);
859
+ cellX += cell.size.outerWidth;
860
+ this.maxCellHeight = Math.max(cell.size.outerHeight, this.maxCellHeight);
861
+ }
862
+ // keep track of cellX for wrap-around
863
+ this.slideableWidth = cellX;
864
+ // slides
865
+ this.updateSlides();
866
+ // contain slides target
867
+ this._containSlides();
868
+ // update slidesWidth
869
+ this.slidesWidth = len
870
+ ? this.getLastSlide().target - this.slides[0].target
871
+ : 0;
872
+ };
873
+ /**
874
+ * cell.getSize() on multiple cells
875
+ * @param {Array} cells
876
+ */
877
+ proto$3._sizeCells = function (cells) {
878
+ cells.forEach(function (cell) {
879
+ cell.getSize();
880
+ });
881
+ };
882
+ // -------------------------- -------------------------- //
883
+ proto$3.updateSlides = function () {
884
+ this.slides = [];
885
+ if (!this.cells.length) {
886
+ return;
887
+ }
888
+ let slide = new Slide(this);
889
+ this.slides.push(slide);
890
+ const isOriginLeft = this.originSide == 'left';
891
+ const nextMargin = isOriginLeft ? 'marginRight' : 'marginLeft';
892
+ const canCellFit = this._getCanCellFit();
893
+ this.cells.forEach(function (cell, i) {
894
+ // just add cell if first cell in slide
895
+ if (!slide.cells.length) {
896
+ slide.addCell(cell);
897
+ return;
898
+ }
899
+ const slideWidth = slide.outerWidth -
900
+ slide.firstMargin +
901
+ (cell.size.outerWidth - cell.size[nextMargin]);
902
+ if (canCellFit.call(this, i, slideWidth)) {
903
+ slide.addCell(cell);
904
+ }
905
+ else {
906
+ // doesn't fit, new slide
907
+ slide.updateTarget();
908
+ slide = new Slide(this);
909
+ this.slides.push(slide);
910
+ slide.addCell(cell);
911
+ }
912
+ }, this);
913
+ // last slide
914
+ slide.updateTarget();
915
+ // update .selectedSlide
916
+ this.updateSelectedSlide();
917
+ };
918
+ proto$3._getCanCellFit = function () {
919
+ const groupCells = this.options.groupCells;
920
+ if (!groupCells) {
921
+ return function () {
922
+ return false;
923
+ };
924
+ }
925
+ else if (typeof groupCells == 'number') {
926
+ // group by number. 3 -> [0,1,2], [3,4,5], ...
927
+ // @ts-ignore
928
+ const number = parseInt(groupCells, 10);
929
+ return function (i) {
930
+ return i % number !== 0;
931
+ };
932
+ }
933
+ // default, group by width of slide
934
+ // parse '75%
935
+ const percentMatch = typeof groupCells == 'string' && groupCells.match(/^(\d+)%$/);
936
+ const percent = percentMatch ? parseInt(percentMatch[1], 10) / 100 : 1;
937
+ return function (_i, slideWidth) {
938
+ return slideWidth <= (this.size.innerWidth + 1) * percent;
939
+ };
940
+ };
941
+ // alias _init for jQuery plugin .flickity()
942
+ proto$3._init = proto$3.reposition = function () {
943
+ this.positionCells();
944
+ this.positionSliderAtSelected();
945
+ };
946
+ proto$3.getSize = function () {
947
+ this.size = getSize(this.element);
948
+ this.setCellAlign();
949
+ this.cursorPosition = this.size.innerWidth * this.cellAlign;
950
+ };
951
+ const cellAlignShorthands = {
952
+ // cell align, then based on origin side
953
+ center: {
954
+ left: 0.5,
955
+ right: 0.5,
956
+ },
957
+ left: {
958
+ left: 0,
959
+ right: 1,
960
+ },
961
+ right: {
962
+ right: 0,
963
+ left: 1,
964
+ },
965
+ };
966
+ proto$3.setCellAlign = function () {
967
+ const shorthand = cellAlignShorthands[this.options.cellAlign];
968
+ this.cellAlign = shorthand
969
+ ? shorthand[this.originSide]
970
+ : this.options.cellAlign;
971
+ };
972
+ proto$3.setGallerySize = function () {
973
+ if (this.options.setGallerySize) {
974
+ const height = this.options.adaptiveHeight && this.selectedSlide
975
+ ? this.selectedSlide.height
976
+ : this.maxCellHeight;
977
+ this.viewport.style.height = height + 'px';
978
+ }
979
+ };
980
+ proto$3._getWrapShiftCells = function () {
981
+ // only for wrap-around
982
+ if (!this.options.wrapAround) {
983
+ return;
984
+ }
985
+ // unshift previous cells
986
+ this._unshiftCells(this.beforeShiftCells);
987
+ this._unshiftCells(this.afterShiftCells);
988
+ // get before cells
989
+ // initial gap
990
+ let gapX = this.cursorPosition;
991
+ const cellIndex = this.cells.length - 1;
992
+ this.beforeShiftCells = this._getGapCells(gapX, cellIndex, -1);
993
+ // get after cells
994
+ // ending gap between last cell and end of gallery viewport
995
+ gapX = this.size.innerWidth - this.cursorPosition;
996
+ // start cloning at first cell, working forwards
997
+ this.afterShiftCells = this._getGapCells(gapX, 0, 1);
998
+ };
999
+ proto$3._getGapCells = function (gapX, cellIndex, increment) {
1000
+ // keep adding cells until the cover the initial gap
1001
+ const cells = [];
1002
+ while (gapX > 0) {
1003
+ const cell = this.cells[cellIndex];
1004
+ if (!cell) {
1005
+ break;
1006
+ }
1007
+ cells.push(cell);
1008
+ cellIndex += increment;
1009
+ gapX -= cell.size.outerWidth;
1010
+ }
1011
+ return cells;
1012
+ };
1013
+ // ----- contain ----- //
1014
+ // contain cell targets so no excess sliding
1015
+ proto$3._containSlides = function () {
1016
+ if (!this.options.contain || this.options.wrapAround || !this.cells.length) {
1017
+ return;
1018
+ }
1019
+ const isRightToLeft = this.options.rightToLeft;
1020
+ const beginMargin = isRightToLeft ? 'marginRight' : 'marginLeft';
1021
+ const endMargin = isRightToLeft ? 'marginLeft' : 'marginRight';
1022
+ const contentWidth = this.slideableWidth - this.getLastCell().size[endMargin];
1023
+ // content is less than gallery size
1024
+ const isContentSmaller = contentWidth < this.size.innerWidth;
1025
+ // bounds
1026
+ const beginBound = this.cursorPosition + this.cells[0].size[beginMargin];
1027
+ const endBound = contentWidth - this.size.innerWidth * (1 - this.cellAlign);
1028
+ // contain each cell target
1029
+ this.slides.forEach(function (slide) {
1030
+ if (isContentSmaller) {
1031
+ // all cells fit inside gallery
1032
+ slide.target = contentWidth * this.cellAlign;
1033
+ }
1034
+ else {
1035
+ // contain to bounds
1036
+ slide.target = Math.max(slide.target, beginBound);
1037
+ slide.target = Math.min(slide.target, endBound);
1038
+ }
1039
+ }, this);
1040
+ };
1041
+ // ----- ----- //
1042
+ /**
1043
+ * emits events via eventEmitter and jQuery events
1044
+ * @param {String} type - name of event
1045
+ * @param {Event} event - original event
1046
+ * @param {Array} args - extra arguments
1047
+ */
1048
+ proto$3.dispatchEvent = function (type, event, args) {
1049
+ const emitArgs = event ? [event].concat(args) : args;
1050
+ this.emitEvent(type, emitArgs);
1051
+ };
1052
+ // -------------------------- select -------------------------- //
1053
+ /**
1054
+ * @param {Integer} index - index of the slide
1055
+ * @param {Boolean} isWrap - will wrap-around to last/first if at the end
1056
+ * @param {Boolean} isInstant - will immediately set position at selected cell
1057
+ */
1058
+ proto$3.select = function (index, isWrap, isInstant) {
1059
+ if (!this.isActive) {
1060
+ return;
1061
+ }
1062
+ index = parseInt(index, 10);
1063
+ this._wrapSelect(index);
1064
+ if (this.options.wrapAround || isWrap) {
1065
+ index = utils.modulo(index, this.slides.length);
1066
+ }
1067
+ // bail if invalid index
1068
+ if (!this.slides[index]) {
1069
+ return;
1070
+ }
1071
+ const prevIndex = this.selectedIndex;
1072
+ this.selectedIndex = index;
1073
+ this.updateSelectedSlide();
1074
+ if (isInstant) {
1075
+ this.positionSliderAtSelected();
1076
+ }
1077
+ else {
1078
+ this.startAnimation();
1079
+ }
1080
+ if (this.options.adaptiveHeight) {
1081
+ this.setGallerySize();
1082
+ }
1083
+ // events
1084
+ this.dispatchEvent('select', null, [index]);
1085
+ // change event if new index
1086
+ if (index != prevIndex) {
1087
+ this.dispatchEvent('change', null, [index]);
1088
+ }
1089
+ // old v1 event name, remove in v3
1090
+ this.dispatchEvent('cellSelect');
1091
+ };
1092
+ // wraps position for wrapAround, to move to closest slide. #113
1093
+ proto$3._wrapSelect = function (index) {
1094
+ const len = this.slides.length;
1095
+ const isWrapping = this.options.wrapAround && len > 1;
1096
+ if (!isWrapping) {
1097
+ return index;
1098
+ }
1099
+ const wrapIndex = utils.modulo(index, len);
1100
+ // go to shortest
1101
+ const delta = Math.abs(wrapIndex - this.selectedIndex);
1102
+ const backWrapDelta = Math.abs(wrapIndex + len - this.selectedIndex);
1103
+ const forewardWrapDelta = Math.abs(wrapIndex - len - this.selectedIndex);
1104
+ if (!this.isDragSelect && backWrapDelta < delta) {
1105
+ index += len;
1106
+ }
1107
+ else if (!this.isDragSelect && forewardWrapDelta < delta) {
1108
+ index -= len;
1109
+ }
1110
+ // wrap position so slider is within normal area
1111
+ if (index < 0) {
1112
+ this.x -= this.slideableWidth;
1113
+ }
1114
+ else if (index >= len) {
1115
+ this.x += this.slideableWidth;
1116
+ }
1117
+ };
1118
+ proto$3.previous = function (isWrap, isInstant) {
1119
+ this.select(this.selectedIndex - 1, isWrap, isInstant);
1120
+ };
1121
+ proto$3.next = function (isWrap, isInstant) {
1122
+ this.select(this.selectedIndex + 1, isWrap, isInstant);
1123
+ };
1124
+ proto$3.updateSelectedSlide = function () {
1125
+ const slide = this.slides[this.selectedIndex];
1126
+ // selectedIndex could be outside of slides, if triggered before resize()
1127
+ if (!slide) {
1128
+ return;
1129
+ }
1130
+ // unselect previous selected slide
1131
+ this.unselectSelectedSlide();
1132
+ // update new selected slide
1133
+ this.selectedSlide = slide;
1134
+ slide.select();
1135
+ this.selectedCells = slide.cells;
1136
+ this.selectedElements = slide.getCellElements();
1137
+ // HACK: selectedCell & selectedElement is first cell in slide, backwards compatibility
1138
+ // Remove in v3?
1139
+ this.selectedCell = slide.cells[0];
1140
+ this.selectedElement = this.selectedElements[0];
1141
+ };
1142
+ proto$3.unselectSelectedSlide = function () {
1143
+ if (this.selectedSlide) {
1144
+ this.selectedSlide.unselect();
1145
+ }
1146
+ };
1147
+ proto$3.selectInitialIndex = function () {
1148
+ const initialIndex = this.options.initialIndex;
1149
+ // already activated, select previous selectedIndex
1150
+ if (this.isInitActivated) {
1151
+ this.select(this.selectedIndex, false, true);
1152
+ return;
1153
+ }
1154
+ // select with selector string
1155
+ if (initialIndex && typeof initialIndex == 'string') {
1156
+ const cell = this.queryCell(initialIndex);
1157
+ if (cell) {
1158
+ this.selectCell(initialIndex, false, true);
1159
+ return;
1160
+ }
1161
+ }
1162
+ let index = 0;
1163
+ // select with number
1164
+ if (initialIndex && this.slides[initialIndex]) {
1165
+ index = initialIndex;
1166
+ }
1167
+ // select instantly
1168
+ this.select(index, false, true);
1169
+ };
1170
+ /**
1171
+ * select slide from number or cell element
1172
+ * @param {Element or Number} elem
1173
+ * @param { Boolean } isWrap
1174
+ * @param { Boolean } isInstant
1175
+ */
1176
+ proto$3.selectCell = function (elem, isWrap, isInstant) {
1177
+ // get cell
1178
+ const cell = this.queryCell(elem);
1179
+ if (!cell) {
1180
+ return;
1181
+ }
1182
+ const index = this.getCellSlideIndex(cell);
1183
+ this.select(index, isWrap, isInstant);
1184
+ };
1185
+ proto$3.getCellSlideIndex = function (cell) {
1186
+ // get index of slides that has cell
1187
+ for (let i = 0; i < this.slides.length; i++) {
1188
+ const slide = this.slides[i];
1189
+ const index = slide.cells.indexOf(cell);
1190
+ if (index != -1) {
1191
+ return i;
1192
+ }
1193
+ }
1194
+ };
1195
+ // -------------------------- get cells -------------------------- //
1196
+ /**
1197
+ * get Flickity.Cell, given an Element
1198
+ * @param {Element} elem
1199
+ * @returns found flickity cell
1200
+ */
1201
+ proto$3.getCell = function (elem) {
1202
+ // loop through cells to get the one that matches
1203
+ for (let i = 0; i < this.cells.length; i++) {
1204
+ const cell = this.cells[i];
1205
+ if (cell.element == elem) {
1206
+ return cell;
1207
+ }
1208
+ }
1209
+ };
1210
+ /**
1211
+ * get collection of Flickity.Cells, given Elements
1212
+ * @param {Element, Array, NodeList} elems
1213
+ * @returns {Array} cells - Flickity.Cells
1214
+ */
1215
+ proto$3.getCells = function (elems) {
1216
+ elems = utils.makeArray(elems);
1217
+ const cells = [];
1218
+ elems.forEach(function (elem) {
1219
+ const cell = this.getCell(elem);
1220
+ if (cell) {
1221
+ cells.push(cell);
1222
+ }
1223
+ }, this);
1224
+ return cells;
1225
+ };
1226
+ /**
1227
+ * get cell elements
1228
+ * @returns {Array} cellElems
1229
+ */
1230
+ proto$3.getCellElements = function () {
1231
+ return this.cells.map(function (cell) {
1232
+ return cell.element;
1233
+ });
1234
+ };
1235
+ /**
1236
+ * get parent cell from an element
1237
+ * @param {Element} elem
1238
+ * @returns {Flickit.Cell} cell
1239
+ */
1240
+ proto$3.getParentCell = function (elem) {
1241
+ // first check if elem is cell
1242
+ const cell = this.getCell(elem);
1243
+ if (cell) {
1244
+ return cell;
1245
+ }
1246
+ // try to get parent cell elem
1247
+ elem = utils.getParent(elem, '.flickity-slider > *');
1248
+ return this.getCell(elem);
1249
+ };
1250
+ /**
1251
+ * get cells adjacent to a slide
1252
+ * @param {Integer} adjCount - number of adjacent slides
1253
+ * @param {Integer} index - index of slide to start
1254
+ * @returns {Array} cells - array of Flickity.Cells
1255
+ */
1256
+ proto$3.getAdjacentCellElements = function (adjCount, index) {
1257
+ if (!adjCount) {
1258
+ return this.selectedSlide.getCellElements();
1259
+ }
1260
+ index = index === undefined ? this.selectedIndex : index;
1261
+ const len = this.slides.length;
1262
+ if (1 + adjCount * 2 >= len) {
1263
+ return this.getCellElements();
1264
+ }
1265
+ let cellElems = [];
1266
+ for (let i = index - adjCount; i <= index + adjCount; i++) {
1267
+ const slideIndex = this.options.wrapAround ? utils.modulo(i, len) : i;
1268
+ const slide = this.slides[slideIndex];
1269
+ if (slide) {
1270
+ cellElems = cellElems.concat(slide.getCellElements());
1271
+ }
1272
+ }
1273
+ return cellElems;
1274
+ };
1275
+ /**
1276
+ * select slide from number or cell element
1277
+ * @param {Element, Selector String, or Number} selector
1278
+ * @returns {Flickity.Cell} found flickity cell
1279
+ */
1280
+ proto$3.queryCell = function (selector) {
1281
+ if (typeof selector == 'number') {
1282
+ // use number as index
1283
+ return this.cells[selector];
1284
+ }
1285
+ if (typeof selector == 'string') {
1286
+ // do not select invalid selectors from hash: #123, #/. #791
1287
+ if (selector.match(/^[#\.]?[\d\/]/)) {
1288
+ return;
1289
+ }
1290
+ // use string as selector, get element
1291
+ selector = this.element.querySelector(selector);
1292
+ }
1293
+ // get cell from element
1294
+ return this.getCell(selector);
1295
+ };
1296
+ // -------------------------- events -------------------------- //
1297
+ proto$3.uiChange = function () {
1298
+ this.emitEvent('uiChange');
1299
+ };
1300
+ // keep focus on element when child UI elements are clicked
1301
+ proto$3.childUIPointerDown = function (event) {
1302
+ // HACK iOS does not allow touch events to bubble up?!
1303
+ if (event.type != 'touchstart') {
1304
+ event.preventDefault();
1305
+ }
1306
+ this.focus();
1307
+ };
1308
+ // ----- resize ----- //
1309
+ proto$3.onresize = function () {
1310
+ this.watchCSS();
1311
+ this.resize();
1312
+ };
1313
+ utils.debounceMethod(Flickity, 'onresize', 150);
1314
+ proto$3.resize = function () {
1315
+ if (!this.isActive) {
1316
+ return;
1317
+ }
1318
+ this.getSize();
1319
+ // wrap values
1320
+ if (this.options.wrapAround) {
1321
+ this.x = utils.modulo(this.x, this.slideableWidth);
1322
+ }
1323
+ this.positionCells();
1324
+ this._getWrapShiftCells();
1325
+ this.setGallerySize();
1326
+ this.emitEvent('resize');
1327
+ // update selected index for group slides, instant
1328
+ // TODO: position can be lost between groups of various numbers
1329
+ const selectedElement = this.selectedElements && this.selectedElements[0];
1330
+ this.selectCell(selectedElement, false, true);
1331
+ };
1332
+ // watches the :after property, activates/deactivates
1333
+ proto$3.watchCSS = function () {
1334
+ const watchOption = this.options.watchCSS;
1335
+ if (!watchOption) {
1336
+ return;
1337
+ }
1338
+ const afterContent = getComputedStyle$1(this.element, ':after').content;
1339
+ // activate if :after { content: 'flickity' }
1340
+ if (afterContent.indexOf('flickity') != -1) {
1341
+ this.activate();
1342
+ }
1343
+ else {
1344
+ this.deactivate();
1345
+ }
1346
+ };
1347
+ // ----- keydown ----- //
1348
+ // go previous/next if left/right keys pressed
1349
+ proto$3.onkeydown = function (event) {
1350
+ // only work if element is in focus
1351
+ const isNotFocused = document.activeElement && document.activeElement != this.element;
1352
+ if (!this.options.accessibility || isNotFocused) {
1353
+ return;
1354
+ }
1355
+ const handler = Flickity.keyboardHandlers[event.keyCode];
1356
+ if (handler) {
1357
+ handler.call(this);
1358
+ }
1359
+ };
1360
+ Flickity.keyboardHandlers = {
1361
+ // left arrow
1362
+ 37: function () {
1363
+ const leftMethod = this.options.rightToLeft ? 'next' : 'previous';
1364
+ this.uiChange();
1365
+ this[leftMethod]();
1366
+ },
1367
+ // right arrow
1368
+ 39: function () {
1369
+ const rightMethod = this.options.rightToLeft ? 'previous' : 'next';
1370
+ this.uiChange();
1371
+ this[rightMethod]();
1372
+ },
1373
+ };
1374
+ // ----- focus ----- //
1375
+ proto$3.focus = function () {
1376
+ // TODO remove scrollTo once focus options gets more support
1377
+ // https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#Browser_compatibility
1378
+ const prevScrollY = window.pageYOffset;
1379
+ this.element.focus({ preventScroll: true });
1380
+ // hack to fix scroll jump after focus, #76
1381
+ if (window.pageYOffset != prevScrollY) {
1382
+ window.scrollTo(window.pageXOffset, prevScrollY);
1383
+ }
1384
+ };
1385
+ // -------------------------- destroy -------------------------- //
1386
+ // deactivate all Flickity functionality, but keep stuff available
1387
+ proto$3.deactivate = function () {
1388
+ if (!this.isActive) {
1389
+ return;
1390
+ }
1391
+ this.element.classList.remove('flickity-enabled');
1392
+ this.element.classList.remove('flickity-rtl');
1393
+ this.unselectSelectedSlide();
1394
+ // destroy cells
1395
+ this.cells.forEach(function (cell) {
1396
+ cell.destroy();
1397
+ });
1398
+ this.element.removeChild(this.viewport);
1399
+ // move child elements back into element
1400
+ moveElements(this.slider.children, this.element);
1401
+ if (this.options.accessibility) {
1402
+ this.element.removeAttribute('tabIndex');
1403
+ this.element.removeEventListener('keydown', this);
1404
+ }
1405
+ // set flags
1406
+ this.isActive = false;
1407
+ this.emitEvent('deactivate');
1408
+ };
1409
+ proto$3.destroy = function () {
1410
+ this.deactivate();
1411
+ window.removeEventListener('resize', this);
1412
+ this.allOff();
1413
+ this.emitEvent('destroy');
1414
+ delete this.element.flickityGUID;
1415
+ delete instances[this.guid];
1416
+ };
1417
+ // -------------------------- prototype -------------------------- //
1418
+ utils.extend(proto$3, proto$4);
1419
+ // -------------------------- extras -------------------------- //
1420
+ /**
1421
+ * get Flickity instance from element
1422
+ * @param {Element} elem
1423
+ * @returns {Flickity} Flickity instance
1424
+ */
1425
+ Flickity.data = function (elem) {
1426
+ elem = utils.getQueryElement(elem);
1427
+ const id = elem && elem.flickityGUID;
1428
+ return id && instances[id];
1429
+ };
1430
+ utils.htmlInit(Flickity, 'flickity');
1431
+ Flickity.Cell = Cell;
1432
+ Flickity.Slide = Slide;
1433
+
1434
+ /*!
1435
+ * Unipointer v2.4.0
1436
+ * base class for doing one thing with pointer event
1437
+ * MIT license
1438
+ */
1439
+ function noop() { }
1440
+ function Unipointer() { }
1441
+ // inherit EvEmitter
1442
+ const pointerProto = (Unipointer.prototype = Object.create(EvEmitter.prototype));
1443
+ pointerProto.bindStartEvent = function (elem) {
1444
+ this._bindStartEvent(elem, true);
1445
+ };
1446
+ pointerProto.unbindStartEvent = function (elem) {
1447
+ this._bindStartEvent(elem, false);
1448
+ };
1449
+ /**
1450
+ * Add or remove start event
1451
+ * @param {Element} elem
1452
+ * @param {Boolean} isAdd - remove if falsey
1453
+ */
1454
+ pointerProto._bindStartEvent = function (elem, isAdd) {
1455
+ // munge isAdd, default to true
1456
+ isAdd = isAdd === undefined ? true : isAdd;
1457
+ const bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
1458
+ // default to mouse events
1459
+ let startEvent = 'mousedown';
1460
+ if ('ontouchstart' in window) {
1461
+ // HACK prefer Touch Events as you can preventDefault on touchstart to
1462
+ // disable scroll in iOS & mobile Chrome metafizzy/flickity#1177
1463
+ startEvent = 'touchstart';
1464
+ }
1465
+ else if (window.PointerEvent) {
1466
+ // Pointer Events
1467
+ startEvent = 'pointerdown';
1468
+ }
1469
+ elem[bindMethod](startEvent, this);
1470
+ };
1471
+ // trigger handler methods for events
1472
+ pointerProto.handleEvent = function (event) {
1473
+ const method = 'on' + event.type;
1474
+ if (this[method]) {
1475
+ this[method](event);
1476
+ }
1477
+ };
1478
+ // returns the touch that we're keeping track of
1479
+ pointerProto.getTouch = function (touches) {
1480
+ for (let i = 0; i < touches.length; i++) {
1481
+ const touch = touches[i];
1482
+ if (touch.identifier == this.pointerIdentifier) {
1483
+ return touch;
1484
+ }
1485
+ }
1486
+ };
1487
+ // ----- start event ----- //
1488
+ pointerProto.onmousedown = function (event) {
1489
+ // dismiss clicks from right or middle buttons
1490
+ const button = event.button;
1491
+ if (button && button !== 0 && button !== 1) {
1492
+ return;
1493
+ }
1494
+ this._pointerDown(event, event);
1495
+ };
1496
+ pointerProto.ontouchstart = function (event) {
1497
+ this._pointerDown(event, event.changedTouches[0]);
1498
+ };
1499
+ pointerProto.onpointerdown = function (event) {
1500
+ this._pointerDown(event, event);
1501
+ };
1502
+ /**
1503
+ * pointer start
1504
+ * @param {Event} event
1505
+ * @param {Event or Touch} pointer
1506
+ */
1507
+ pointerProto._pointerDown = function (event, pointer) {
1508
+ // dismiss right click and other pointers
1509
+ // button = 0 is okay, 1-4 not
1510
+ if (event.button || this.isPointerDown) {
1511
+ return;
1512
+ }
1513
+ this.isPointerDown = true;
1514
+ // save pointer identifier to match up touch events
1515
+ this.pointerIdentifier =
1516
+ pointer.pointerId !== undefined
1517
+ ? // pointerId for pointer events, touch.indentifier for touch events
1518
+ pointer.pointerId
1519
+ : pointer.identifier;
1520
+ this.pointerDown(event, pointer);
1521
+ };
1522
+ pointerProto.pointerDown = function (event, pointer) {
1523
+ this._bindPostStartEvents(event);
1524
+ this.emitEvent('pointerDown', [event, pointer]);
1525
+ };
1526
+ // hash of events to be bound after start event
1527
+ const postStartEvents = {
1528
+ mousedown: ['mousemove', 'mouseup'],
1529
+ touchstart: ['touchmove', 'touchend', 'touchcancel'],
1530
+ pointerdown: ['pointermove', 'pointerup', 'pointercancel'],
1531
+ };
1532
+ pointerProto._bindPostStartEvents = function (event) {
1533
+ if (!event) {
1534
+ return;
1535
+ }
1536
+ // get proper events to match start event
1537
+ const events = postStartEvents[event.type];
1538
+ // bind events to node
1539
+ events.forEach(function (eventName) {
1540
+ window.addEventListener(eventName, this);
1541
+ }, this);
1542
+ // save these arguments
1543
+ this._boundPointerEvents = events;
1544
+ };
1545
+ pointerProto._unbindPostStartEvents = function () {
1546
+ // check for _boundEvents, in case dragEnd triggered twice (old IE8 bug)
1547
+ if (!this._boundPointerEvents) {
1548
+ return;
1549
+ }
1550
+ this._boundPointerEvents.forEach(function (eventName) {
1551
+ window.removeEventListener(eventName, this);
1552
+ }, this);
1553
+ delete this._boundPointerEvents;
1554
+ };
1555
+ // ----- move event ----- //
1556
+ pointerProto.onmousemove = function (event) {
1557
+ this._pointerMove(event, event);
1558
+ };
1559
+ pointerProto.onpointermove = function (event) {
1560
+ if (event.pointerId == this.pointerIdentifier) {
1561
+ this._pointerMove(event, event);
1562
+ }
1563
+ };
1564
+ pointerProto.ontouchmove = function (event) {
1565
+ const touch = this.getTouch(event.changedTouches);
1566
+ if (touch) {
1567
+ this._pointerMove(event, touch);
1568
+ }
1569
+ };
1570
+ /**
1571
+ * pointer move
1572
+ * @param {Event} event
1573
+ * @param {Event or Touch} pointer
1574
+ * @private
1575
+ */
1576
+ pointerProto._pointerMove = function (event, pointer) {
1577
+ this.pointerMove(event, pointer);
1578
+ };
1579
+ // public
1580
+ pointerProto.pointerMove = function (event, pointer) {
1581
+ this.emitEvent('pointerMove', [event, pointer]);
1582
+ };
1583
+ // ----- end event ----- //
1584
+ pointerProto.onmouseup = function (event) {
1585
+ this._pointerUp(event, event);
1586
+ };
1587
+ pointerProto.onpointerup = function (event) {
1588
+ if (event.pointerId == this.pointerIdentifier) {
1589
+ this._pointerUp(event, event);
1590
+ }
1591
+ };
1592
+ pointerProto.ontouchend = function (event) {
1593
+ const touch = this.getTouch(event.changedTouches);
1594
+ if (touch) {
1595
+ this._pointerUp(event, touch);
1596
+ }
1597
+ };
1598
+ /**
1599
+ * pointer up
1600
+ * @param {Event} event
1601
+ * @param {Event or Touch} pointer
1602
+ * @private
1603
+ */
1604
+ pointerProto._pointerUp = function (event, pointer) {
1605
+ this._pointerDone();
1606
+ this.pointerUp(event, pointer);
1607
+ };
1608
+ // public
1609
+ pointerProto.pointerUp = function (event, pointer) {
1610
+ this.emitEvent('pointerUp', [event, pointer]);
1611
+ };
1612
+ // ----- pointer done ----- //
1613
+ // triggered on pointer up & pointer cancel
1614
+ pointerProto._pointerDone = function () {
1615
+ this._pointerReset();
1616
+ this._unbindPostStartEvents();
1617
+ this.pointerDone();
1618
+ };
1619
+ pointerProto._pointerReset = function () {
1620
+ // reset properties
1621
+ this.isPointerDown = false;
1622
+ delete this.pointerIdentifier;
1623
+ };
1624
+ pointerProto.pointerDone = noop;
1625
+ // ----- pointer cancel ----- //
1626
+ pointerProto.onpointercancel = function (event) {
1627
+ if (event.pointerId == this.pointerIdentifier) {
1628
+ this._pointerCancel(event, event);
1629
+ }
1630
+ };
1631
+ pointerProto.ontouchcancel = function (event) {
1632
+ const touch = this.getTouch(event.changedTouches);
1633
+ if (touch) {
1634
+ this._pointerCancel(event, touch);
1635
+ }
1636
+ };
1637
+ /**
1638
+ * pointer cancel
1639
+ * @param {Event} event
1640
+ * @param {Event or Touch} pointer
1641
+ * @private
1642
+ */
1643
+ pointerProto._pointerCancel = function (event, pointer) {
1644
+ this._pointerDone();
1645
+ this.pointerCancel(event, pointer);
1646
+ };
1647
+ // public
1648
+ pointerProto.pointerCancel = function (event, pointer) {
1649
+ this.emitEvent('pointerCancel', [event, pointer]);
1650
+ };
1651
+ // ----- ----- //
1652
+ // utility function for getting x/y coords from event
1653
+ Unipointer.getPointerPoint = function (pointer) {
1654
+ return {
1655
+ x: pointer.pageX,
1656
+ y: pointer.pageY,
1657
+ };
1658
+ };
1659
+ /*!
1660
+ * Unidragger v2.4.0
1661
+ * Draggable base class
1662
+ * MIT license
1663
+ */
1664
+ function Unidragger() { }
1665
+ // inherit Unipointer & EvEmitter
1666
+ const draggerProto = (Unidragger.prototype = Object.create(Unipointer.prototype));
1667
+ // ----- bind start ----- //
1668
+ draggerProto.bindHandles = function () {
1669
+ this._bindHandles(true);
1670
+ };
1671
+ draggerProto.unbindHandles = function () {
1672
+ this._bindHandles(false);
1673
+ };
1674
+ /**
1675
+ * Add or remove start event
1676
+ * @param {Boolean} isAdd
1677
+ */
1678
+ draggerProto._bindHandles = function (isAdd) {
1679
+ // munge isAdd, default to true
1680
+ isAdd = isAdd === undefined ? true : isAdd;
1681
+ // bind each handle
1682
+ const bindMethod = isAdd ? 'addEventListener' : 'removeEventListener';
1683
+ const touchAction = isAdd ? this._touchActionValue : '';
1684
+ for (let i = 0; i < this.handles.length; i++) {
1685
+ const handle = this.handles[i];
1686
+ this._bindStartEvent(handle, isAdd);
1687
+ handle[bindMethod]('click', this);
1688
+ // touch-action: none to override browser touch gestures. metafizzy/flickity#540
1689
+ if (window.PointerEvent) {
1690
+ handle.style.touchAction = touchAction;
1691
+ }
1692
+ }
1693
+ };
1694
+ // prototype so it can be overwriteable by Flickity
1695
+ draggerProto._touchActionValue = 'none';
1696
+ // ----- start event ----- //
1697
+ /**
1698
+ * pointer start
1699
+ * @param {Event} event
1700
+ * @param {Event or Touch} pointer
1701
+ */
1702
+ draggerProto.pointerDown = function (event, pointer) {
1703
+ const isOkay = this.okayPointerDown(event);
1704
+ if (!isOkay) {
1705
+ return;
1706
+ }
1707
+ // track start event position
1708
+ // Safari 9 overrides pageX and pageY. These values needs to be copied. flickity#842
1709
+ this.pointerDownPointer = {
1710
+ pageX: pointer.pageX,
1711
+ pageY: pointer.pageY,
1712
+ };
1713
+ event.preventDefault();
1714
+ this.pointerDownBlur();
1715
+ // bind move and end events
1716
+ this._bindPostStartEvents(event);
1717
+ this.emitEvent('pointerDown', [event, pointer]);
1718
+ };
1719
+ // nodes that have text fields
1720
+ const cursorNodes = {
1721
+ TEXTAREA: true,
1722
+ INPUT: true,
1723
+ SELECT: true,
1724
+ OPTION: true,
1725
+ };
1726
+ // input types that do not have text fields
1727
+ const clickTypes = {
1728
+ radio: true,
1729
+ checkbox: true,
1730
+ button: true,
1731
+ submit: true,
1732
+ image: true,
1733
+ file: true,
1734
+ };
1735
+ // dismiss inputs with text fields. flickity#403, flickity#404
1736
+ draggerProto.okayPointerDown = function (event) {
1737
+ const isCursorNode = cursorNodes[event.target.nodeName];
1738
+ const isClickType = clickTypes[event.target.type];
1739
+ const isOkay = !isCursorNode || isClickType;
1740
+ if (!isOkay) {
1741
+ this._pointerReset();
1742
+ }
1743
+ return isOkay;
1744
+ };
1745
+ // kludge to blur previously focused input
1746
+ draggerProto.pointerDownBlur = function () {
1747
+ const focused = document.activeElement;
1748
+ // do not blur body for IE10, metafizzy/flickity#117
1749
+ const canBlur = focused && focused.blur && focused != document.body;
1750
+ if (canBlur) {
1751
+ focused.blur();
1752
+ }
1753
+ };
1754
+ // ----- move event ----- //
1755
+ /**
1756
+ * drag move
1757
+ * @param {Event} event
1758
+ * @param {Event or Touch} pointer
1759
+ */
1760
+ draggerProto.pointerMove = function (event, pointer) {
1761
+ const moveVector = this._dragPointerMove(event, pointer);
1762
+ this.emitEvent('pointerMove', [event, pointer, moveVector]);
1763
+ this._dragMove(event, pointer, moveVector);
1764
+ };
1765
+ // base pointer move logic
1766
+ draggerProto._dragPointerMove = function (event, pointer) {
1767
+ const moveVector = {
1768
+ x: pointer.pageX - this.pointerDownPointer.pageX,
1769
+ y: pointer.pageY - this.pointerDownPointer.pageY,
1770
+ };
1771
+ // start drag if pointer has moved far enough to start drag
1772
+ if (!this.isDragging && this.hasDragStarted(moveVector)) {
1773
+ this._dragStart(event, pointer);
1774
+ }
1775
+ return moveVector;
1776
+ };
1777
+ // condition if pointer has moved far enough to start drag
1778
+ draggerProto.hasDragStarted = function (moveVector) {
1779
+ return Math.abs(moveVector.x) > 3 || Math.abs(moveVector.y) > 3;
1780
+ };
1781
+ // ----- end event ----- //
1782
+ /**
1783
+ * pointer up
1784
+ * @param {Event} event
1785
+ * @param {Event or Touch} pointer
1786
+ */
1787
+ draggerProto.pointerUp = function (event, pointer) {
1788
+ this.emitEvent('pointerUp', [event, pointer]);
1789
+ this._dragPointerUp(event, pointer);
1790
+ };
1791
+ draggerProto._dragPointerUp = function (event, pointer) {
1792
+ if (this.isDragging) {
1793
+ this._dragEnd(event, pointer);
1794
+ }
1795
+ else {
1796
+ // pointer didn't move enough for drag to start
1797
+ this._staticClick(event, pointer);
1798
+ }
1799
+ };
1800
+ // -------------------------- drag -------------------------- //
1801
+ // dragStart
1802
+ draggerProto._dragStart = function (event, pointer) {
1803
+ this.isDragging = true;
1804
+ // prevent clicks
1805
+ this.isPreventingClicks = true;
1806
+ this.dragStart(event, pointer);
1807
+ };
1808
+ draggerProto.dragStart = function (event, pointer) {
1809
+ this.emitEvent('dragStart', [event, pointer]);
1810
+ };
1811
+ // dragMove
1812
+ draggerProto._dragMove = function (event, pointer, moveVector) {
1813
+ // do not drag if not dragging yet
1814
+ if (!this.isDragging) {
1815
+ return;
1816
+ }
1817
+ this.dragMove(event, pointer, moveVector);
1818
+ };
1819
+ draggerProto.dragMove = function (event, pointer, moveVector) {
1820
+ event.preventDefault();
1821
+ this.emitEvent('dragMove', [event, pointer, moveVector]);
1822
+ };
1823
+ // dragEnd
1824
+ draggerProto._dragEnd = function (event, pointer) {
1825
+ // set flags
1826
+ this.isDragging = false;
1827
+ // re-enable clicking async
1828
+ setTimeout(function () {
1829
+ delete this.isPreventingClicks;
1830
+ }.bind(this));
1831
+ this.dragEnd(event, pointer);
1832
+ };
1833
+ draggerProto.dragEnd = function (event, pointer) {
1834
+ this.emitEvent('dragEnd', [event, pointer]);
1835
+ };
1836
+ // ----- onclick ----- //
1837
+ // handle all clicks and prevent clicks when dragging
1838
+ draggerProto.onclick = function (event) {
1839
+ if (this.isPreventingClicks) {
1840
+ event.preventDefault();
1841
+ }
1842
+ };
1843
+ // ----- staticClick ----- //
1844
+ // triggered after pointer down & up with no/tiny movement
1845
+ draggerProto._staticClick = function (event, pointer) {
1846
+ // ignore emulated mouse up clicks
1847
+ if (this.isIgnoringMouseUp && event.type == 'mouseup') {
1848
+ return;
1849
+ }
1850
+ this.staticClick(event, pointer);
1851
+ // set flag for emulated clicks 300ms after touchend
1852
+ if (event.type != 'mouseup') {
1853
+ this.isIgnoringMouseUp = true;
1854
+ // reset flag after 300ms
1855
+ setTimeout(function () {
1856
+ delete this.isIgnoringMouseUp;
1857
+ }.bind(this), 400);
1858
+ }
1859
+ };
1860
+ draggerProto.staticClick = function (event, pointer) {
1861
+ this.emitEvent('staticClick', [event, pointer]);
1862
+ };
1863
+ // ----- utils ----- //
1864
+ Unidragger.getPointerPoint = Unipointer.getPointerPoint;
1865
+
1866
+ // ----- defaults ----- //
1867
+ utils.extend(Flickity.defaults, {
1868
+ draggable: '>1',
1869
+ dragThreshold: 3,
1870
+ });
1871
+ // ----- create ----- //
1872
+ Flickity.createMethods.push('_createDrag');
1873
+ // -------------------------- drag prototype -------------------------- //
1874
+ const proto$2 = Flickity.prototype;
1875
+ utils.extend(proto$2, Unidragger.prototype);
1876
+ proto$2._touchActionValue = 'pan-y';
1877
+ // -------------------------- -------------------------- //
1878
+ const isTouch = 'createTouch' in document;
1879
+ let isTouchmoveScrollCanceled = false;
1880
+ proto$2._createDrag = function () {
1881
+ this.on('activate', this.onActivateDrag);
1882
+ this.on('uiChange', this._uiChangeDrag);
1883
+ this.on('deactivate', this.onDeactivateDrag);
1884
+ this.on('cellChange', this.updateDraggable);
1885
+ // TODO updateDraggable on resize? if groupCells & slides change
1886
+ // HACK - add seemingly innocuous handler to fix iOS 10 scroll behavior
1887
+ // #457, RubaXa/Sortable#973
1888
+ if (isTouch && !isTouchmoveScrollCanceled) {
1889
+ window.addEventListener('touchmove', function () { });
1890
+ isTouchmoveScrollCanceled = true;
1891
+ }
1892
+ };
1893
+ proto$2.onActivateDrag = function () {
1894
+ this.handles = [this.viewport];
1895
+ this.bindHandles();
1896
+ this.updateDraggable();
1897
+ };
1898
+ proto$2.onDeactivateDrag = function () {
1899
+ this.unbindHandles();
1900
+ this.element.classList.remove('is-draggable');
1901
+ };
1902
+ proto$2.updateDraggable = function () {
1903
+ // disable dragging if less than 2 slides. #278
1904
+ if (this.options.draggable == '>1') {
1905
+ this.isDraggable = this.slides.length > 1;
1906
+ }
1907
+ else {
1908
+ this.isDraggable = this.options.draggable;
1909
+ }
1910
+ if (this.isDraggable) {
1911
+ this.element.classList.add('is-draggable');
1912
+ }
1913
+ else {
1914
+ this.element.classList.remove('is-draggable');
1915
+ }
1916
+ };
1917
+ // backwards compatibility
1918
+ proto$2.bindDrag = function () {
1919
+ this.options.draggable = true;
1920
+ this.updateDraggable();
1921
+ };
1922
+ proto$2.unbindDrag = function () {
1923
+ this.options.draggable = false;
1924
+ this.updateDraggable();
1925
+ };
1926
+ proto$2._uiChangeDrag = function () {
1927
+ delete this.isFreeScrolling;
1928
+ };
1929
+ // -------------------------- pointer events -------------------------- //
1930
+ proto$2.pointerDown = function (event, pointer) {
1931
+ if (!this.isDraggable) {
1932
+ this._pointerDownDefault(event, pointer);
1933
+ return;
1934
+ }
1935
+ const isOkay = this.okayPointerDown(event);
1936
+ if (!isOkay) {
1937
+ return;
1938
+ }
1939
+ this._pointerDownPreventDefault(event);
1940
+ this.pointerDownFocus(event);
1941
+ // blur
1942
+ if (document.activeElement != this.element) {
1943
+ // do not blur if already focused
1944
+ this.pointerDownBlur();
1945
+ }
1946
+ // stop if it was moving
1947
+ this.dragX = this.x;
1948
+ this.viewport.classList.add('is-pointer-down');
1949
+ // track scrolling
1950
+ this.pointerDownScroll = getScrollPosition();
1951
+ window.addEventListener('scroll', this);
1952
+ this._pointerDownDefault(event, pointer);
1953
+ };
1954
+ // default pointerDown logic, used for staticClick
1955
+ proto$2._pointerDownDefault = function (event, pointer) {
1956
+ // track start event position
1957
+ // Safari 9 overrides pageX and pageY. These values needs to be copied. #779
1958
+ this.pointerDownPointer = {
1959
+ pageX: pointer.pageX,
1960
+ pageY: pointer.pageY,
1961
+ };
1962
+ // bind move and end events
1963
+ this._bindPostStartEvents(event);
1964
+ this.dispatchEvent('pointerDown', event, [pointer]);
1965
+ };
1966
+ const focusNodes = {
1967
+ INPUT: true,
1968
+ TEXTAREA: true,
1969
+ SELECT: true,
1970
+ };
1971
+ proto$2.pointerDownFocus = function (event) {
1972
+ const isFocusNode = focusNodes[event.target.nodeName];
1973
+ if (!isFocusNode) {
1974
+ this.focus();
1975
+ }
1976
+ };
1977
+ proto$2._pointerDownPreventDefault = function (event) {
1978
+ const isTouchStart = event.type == 'touchstart';
1979
+ const isTouchPointer = event.pointerType == 'touch';
1980
+ const isFocusNode = focusNodes[event.target.nodeName];
1981
+ if (!isTouchStart && !isTouchPointer && !isFocusNode) {
1982
+ event.preventDefault();
1983
+ }
1984
+ };
1985
+ // ----- move ----- //
1986
+ proto$2.hasDragStarted = function (moveVector) {
1987
+ return Math.abs(moveVector.x) > this.options.dragThreshold;
1988
+ };
1989
+ // ----- up ----- //
1990
+ proto$2.pointerUp = function (event, pointer) {
1991
+ delete this.isTouchScrolling;
1992
+ this.viewport.classList.remove('is-pointer-down');
1993
+ this.dispatchEvent('pointerUp', event, [pointer]);
1994
+ this._dragPointerUp(event, pointer);
1995
+ };
1996
+ proto$2.pointerDone = function () {
1997
+ window.removeEventListener('scroll', this);
1998
+ delete this.pointerDownScroll;
1999
+ };
2000
+ // -------------------------- dragging -------------------------- //
2001
+ proto$2.dragStart = function (event, pointer) {
2002
+ if (!this.isDraggable) {
2003
+ return;
2004
+ }
2005
+ this.dragStartPosition = this.x;
2006
+ this.startAnimation();
2007
+ window.removeEventListener('scroll', this);
2008
+ this.dispatchEvent('dragStart', event, [pointer]);
2009
+ };
2010
+ proto$2.pointerMove = function (event, pointer) {
2011
+ const moveVector = this._dragPointerMove(event, pointer);
2012
+ this.dispatchEvent('pointerMove', event, [pointer, moveVector]);
2013
+ this._dragMove(event, pointer, moveVector);
2014
+ };
2015
+ proto$2.dragMove = function (event, pointer, moveVector) {
2016
+ if (!this.isDraggable) {
2017
+ return;
2018
+ }
2019
+ event.preventDefault();
2020
+ this.previousDragX = this.dragX;
2021
+ // reverse if right-to-left
2022
+ const direction = this.options.rightToLeft ? -1 : 1;
2023
+ if (this.options.wrapAround) {
2024
+ // wrap around move. #589
2025
+ moveVector.x = moveVector.x % this.slideableWidth;
2026
+ }
2027
+ let dragX = this.dragStartPosition + moveVector.x * direction;
2028
+ if (!this.options.wrapAround && this.slides.length) {
2029
+ // slow drag
2030
+ const originBound = Math.max(-this.slides[0].target, this.dragStartPosition);
2031
+ dragX = dragX > originBound ? (dragX + originBound) * 0.5 : dragX;
2032
+ const endBound = Math.min(-this.getLastSlide().target, this.dragStartPosition);
2033
+ dragX = dragX < endBound ? (dragX + endBound) * 0.5 : dragX;
2034
+ }
2035
+ this.dragX = dragX;
2036
+ this.dragMoveTime = new Date();
2037
+ this.dispatchEvent('dragMove', event, [pointer, moveVector]);
2038
+ };
2039
+ proto$2.dragEnd = function (event, pointer) {
2040
+ if (!this.isDraggable) {
2041
+ return;
2042
+ }
2043
+ if (this.options.freeScroll) {
2044
+ this.isFreeScrolling = true;
2045
+ }
2046
+ // set selectedIndex based on where flick will end up
2047
+ let index = this.dragEndRestingSelect();
2048
+ if (this.options.freeScroll && !this.options.wrapAround) {
2049
+ // if free-scroll & not wrap around
2050
+ // do not free-scroll if going outside of bounding slides
2051
+ // so bounding slides can attract slider, and keep it in bounds
2052
+ const restingX = this.getRestingPosition();
2053
+ this.isFreeScrolling =
2054
+ -restingX > this.slides[0].target &&
2055
+ -restingX < this.getLastSlide().target;
2056
+ }
2057
+ else if (!this.options.freeScroll && index == this.selectedIndex) {
2058
+ // boost selection if selected index has not changed
2059
+ index += this.dragEndBoostSelect();
2060
+ }
2061
+ delete this.previousDragX;
2062
+ // apply selection
2063
+ // TODO refactor this, selecting here feels weird
2064
+ // HACK, set flag so dragging stays in correct direction
2065
+ this.isDragSelect = this.options.wrapAround;
2066
+ this.select(index);
2067
+ delete this.isDragSelect;
2068
+ this.dispatchEvent('dragEnd', event, [pointer]);
2069
+ };
2070
+ proto$2.dragEndRestingSelect = function () {
2071
+ const restingX = this.getRestingPosition();
2072
+ // how far away from selected slide
2073
+ const distance = Math.abs(this.getSlideDistance(-restingX, this.selectedIndex));
2074
+ // get closet resting going up and going down
2075
+ const positiveResting = this._getClosestResting(restingX, distance, 1);
2076
+ const negativeResting = this._getClosestResting(restingX, distance, -1);
2077
+ // use closer resting for wrap-around
2078
+ const index = positiveResting.distance < negativeResting.distance
2079
+ ? positiveResting.index
2080
+ : negativeResting.index;
2081
+ return index;
2082
+ };
2083
+ /**
2084
+ * given resting X and distance to selected cell
2085
+ * get the distance and index of the closest cell
2086
+ * @param {Number} restingX - estimated post-flick resting position
2087
+ * @param {Number} distance - distance to selected cell
2088
+ * @param {Integer} increment - +1 or -1, going up or down
2089
+ * @returns {Object} - { distance: {Number}, index: {Integer} }
2090
+ */
2091
+ proto$2._getClosestResting = function (restingX, distance, increment) {
2092
+ let index = this.selectedIndex;
2093
+ let minDistance = Infinity;
2094
+ const condition = this.options.contain && !this.options.wrapAround
2095
+ ? // if contain, keep going if distance is equal to minDistance
2096
+ function (d, md) {
2097
+ return d <= md;
2098
+ }
2099
+ : function (d, md) {
2100
+ return d < md;
2101
+ };
2102
+ while (condition(distance, minDistance)) {
2103
+ // measure distance to next cell
2104
+ index += increment;
2105
+ minDistance = distance;
2106
+ distance = this.getSlideDistance(-restingX, index);
2107
+ if (distance === null) {
2108
+ break;
2109
+ }
2110
+ distance = Math.abs(distance);
2111
+ }
2112
+ return {
2113
+ distance: minDistance,
2114
+ // selected was previous index
2115
+ index: index - increment,
2116
+ };
2117
+ };
2118
+ /**
2119
+ * measure distance between x and a slide target
2120
+ * @param {Number} x
2121
+ * @param {Integer} index - slide index
2122
+ * @returns null or distance number
2123
+ */
2124
+ proto$2.getSlideDistance = function (x, index) {
2125
+ const len = this.slides.length;
2126
+ // wrap around if at least 2 slides
2127
+ const isWrapAround = this.options.wrapAround && len > 1;
2128
+ const slideIndex = isWrapAround ? utils.modulo(index, len) : index;
2129
+ const slide = this.slides[slideIndex];
2130
+ if (!slide) {
2131
+ return null;
2132
+ }
2133
+ // add distance for wrap-around slides
2134
+ const wrap = isWrapAround ? this.slideableWidth * Math.floor(index / len) : 0;
2135
+ return x - (slide.target + wrap);
2136
+ };
2137
+ proto$2.dragEndBoostSelect = function () {
2138
+ // do not boost if no previousDragX or dragMoveTime
2139
+ if (this.previousDragX === undefined ||
2140
+ !this.dragMoveTime ||
2141
+ // or if drag was held for 100 ms
2142
+ new Date() - this.dragMoveTime > 100) {
2143
+ return 0;
2144
+ }
2145
+ const distance = this.getSlideDistance(-this.dragX, this.selectedIndex);
2146
+ const delta = this.previousDragX - this.dragX;
2147
+ if (distance > 0 && delta > 0) {
2148
+ // boost to next if moving towards the right, and positive velocity
2149
+ return 1;
2150
+ }
2151
+ else if (distance < 0 && delta < 0) {
2152
+ // boost to previous if moving towards the left, and negative velocity
2153
+ return -1;
2154
+ }
2155
+ return 0;
2156
+ };
2157
+ // ----- staticClick ----- //
2158
+ proto$2.staticClick = function (event, pointer) {
2159
+ // get clickedCell, if cell was clicked
2160
+ const clickedCell = this.getParentCell(event.target);
2161
+ const cellElem = clickedCell && clickedCell.element;
2162
+ const cellIndex = clickedCell && this.cells.indexOf(clickedCell);
2163
+ this.dispatchEvent('staticClick', event, [pointer, cellElem, cellIndex]);
2164
+ };
2165
+ // ----- scroll ----- //
2166
+ proto$2.onscroll = function () {
2167
+ const scroll = getScrollPosition();
2168
+ const scrollMoveX = this.pointerDownScroll.x - scroll.x;
2169
+ const scrollMoveY = this.pointerDownScroll.y - scroll.y;
2170
+ // cancel click/tap if scroll is too much
2171
+ if (Math.abs(scrollMoveX) > 3 || Math.abs(scrollMoveY) > 3) {
2172
+ this._pointerDone();
2173
+ }
2174
+ };
2175
+ // ----- utils ----- //
2176
+ function getScrollPosition() {
2177
+ return {
2178
+ x: window.pageXOffset,
2179
+ y: window.pageYOffset,
2180
+ };
2181
+ }
2182
+ // ----- ----- //
2183
+
2184
+ const svgURI = 'http://www.w3.org/2000/svg';
2185
+ // -------------------------- PrevNextButton -------------------------- //
2186
+ function PrevNextButton(direction, parent) {
2187
+ this.direction = direction;
2188
+ this.parent = parent;
2189
+ this.parentElement = this.parent.element.shadowRoot || this.parent.element;
2190
+ this._create();
2191
+ }
2192
+ PrevNextButton.prototype = Object.create(Unipointer.prototype);
2193
+ PrevNextButton.prototype._create = function () {
2194
+ // properties
2195
+ this.isEnabled = true;
2196
+ this.isPrevious = this.direction == -1;
2197
+ const leftDirection = this.parent.options.rightToLeft ? 1 : -1;
2198
+ this.isLeft = this.direction == leftDirection;
2199
+ const button = (this.element = document.createElement('button'));
2200
+ button.className = 'flickity-button flickity-prev-next-button';
2201
+ button.part.add('navigation-button');
2202
+ if (this.isPrevious) {
2203
+ button.classList.add('previous');
2204
+ button.part.add('navigation-button--previous');
2205
+ }
2206
+ else {
2207
+ button.classList.add('next');
2208
+ button.part.add('navigation-button--next');
2209
+ }
2210
+ // prevent button from submitting form http://stackoverflow.com/a/10836076/182183
2211
+ button.setAttribute('type', 'button');
2212
+ // init as disabled
2213
+ this.disable();
2214
+ button.setAttribute('aria-label', this.isPrevious ? 'Previous' : 'Next');
2215
+ const slot = document.createElement('slot');
2216
+ slot.name = this.isPrevious ? 'previous-icon' : 'next-icon';
2217
+ button.appendChild(slot);
2218
+ slot.addEventListener('slotchange', () => {
2219
+ slot.assignedElements({ flatten: true }).forEach((ele) => {
2220
+ ele.removeAttribute('hidden');
2221
+ });
2222
+ });
2223
+ // create arrow
2224
+ const svg = this.createSVG();
2225
+ slot.appendChild(svg);
2226
+ // events
2227
+ this.parent.on('select', this.update.bind(this));
2228
+ this.on('pointerDown', this.parent.childUIPointerDown.bind(this.parent));
2229
+ };
2230
+ PrevNextButton.prototype.activate = function () {
2231
+ this.bindStartEvent(this.element);
2232
+ this.element.addEventListener('click', this);
2233
+ // add to DOM
2234
+ this.parentElement.appendChild(this.element);
2235
+ };
2236
+ PrevNextButton.prototype.deactivate = function () {
2237
+ // remove from DOM
2238
+ this.parentElement.removeChild(this.element);
2239
+ // click events
2240
+ this.unbindStartEvent(this.element);
2241
+ this.element.removeEventListener('click', this);
2242
+ };
2243
+ PrevNextButton.prototype.createSVG = function () {
2244
+ const svg = document.createElementNS(svgURI, 'svg');
2245
+ svg.setAttribute('class', 'flickity-button-icon');
2246
+ svg.setAttribute('viewBox', '0 0 100 100');
2247
+ svg.part.add('navigation-icon');
2248
+ const path = document.createElementNS(svgURI, 'path');
2249
+ const pathMovements = getArrowMovements(this.parent.options.arrowShape);
2250
+ path.setAttribute('d', pathMovements);
2251
+ path.setAttribute('class', 'arrow');
2252
+ // rotate arrow
2253
+ if (!this.isLeft) {
2254
+ path.setAttribute('transform', 'translate(100, 100) rotate(180) ');
2255
+ }
2256
+ svg.appendChild(path);
2257
+ return svg;
2258
+ };
2259
+ // get SVG path movmement
2260
+ function getArrowMovements(shape) {
2261
+ // use shape as movement if string
2262
+ if (typeof shape == 'string') {
2263
+ return shape;
2264
+ }
2265
+ // create movement string
2266
+ return ('M ' +
2267
+ shape.x0 +
2268
+ ',50' +
2269
+ ' L ' +
2270
+ shape.x1 +
2271
+ ',' +
2272
+ (shape.y1 + 50) +
2273
+ ' L ' +
2274
+ shape.x2 +
2275
+ ',' +
2276
+ (shape.y2 + 50) +
2277
+ ' L ' +
2278
+ shape.x3 +
2279
+ ',50 ' +
2280
+ ' L ' +
2281
+ shape.x2 +
2282
+ ',' +
2283
+ (50 - shape.y2) +
2284
+ ' L ' +
2285
+ shape.x1 +
2286
+ ',' +
2287
+ (50 - shape.y1) +
2288
+ ' Z');
2289
+ }
2290
+ PrevNextButton.prototype.handleEvent = utils.handleEvent;
2291
+ PrevNextButton.prototype.onclick = function () {
2292
+ if (!this.isEnabled) {
2293
+ return;
2294
+ }
2295
+ this.parent.uiChange();
2296
+ const method = this.isPrevious ? 'previous' : 'next';
2297
+ this.parent[method]();
2298
+ };
2299
+ // ----- ----- //
2300
+ PrevNextButton.prototype.enable = function () {
2301
+ if (this.isEnabled) {
2302
+ return;
2303
+ }
2304
+ this.element.disabled = false;
2305
+ this.isEnabled = true;
2306
+ };
2307
+ PrevNextButton.prototype.disable = function () {
2308
+ if (!this.isEnabled) {
2309
+ return;
2310
+ }
2311
+ this.element.disabled = true;
2312
+ this.isEnabled = false;
2313
+ };
2314
+ PrevNextButton.prototype.update = function () {
2315
+ // index of first or last slide, if previous or next
2316
+ const slides = this.parent.slides;
2317
+ // enable is wrapAround and at least 2 slides
2318
+ if (this.parent.options.wrapAround && slides.length > 1) {
2319
+ this.enable();
2320
+ return;
2321
+ }
2322
+ const lastIndex = slides.length ? slides.length - 1 : 0;
2323
+ const boundIndex = this.isPrevious ? 0 : lastIndex;
2324
+ const method = this.parent.selectedIndex == boundIndex ? 'disable' : 'enable';
2325
+ this[method]();
2326
+ };
2327
+ PrevNextButton.prototype.destroy = function () {
2328
+ this.deactivate();
2329
+ this.allOff();
2330
+ };
2331
+ // -------------------------- Flickity prototype -------------------------- //
2332
+ utils.extend(Flickity.defaults, {
2333
+ prevNextButtons: true,
2334
+ arrowShape: {
2335
+ x0: 10,
2336
+ x1: 60,
2337
+ y1: 50,
2338
+ x2: 70,
2339
+ y2: 40,
2340
+ x3: 30,
2341
+ },
2342
+ });
2343
+ Flickity.createMethods.push('_createPrevNextButtons');
2344
+ const proto$1 = Flickity.prototype;
2345
+ proto$1._createPrevNextButtons = function () {
2346
+ if (!this.options.prevNextButtons) {
2347
+ return;
2348
+ }
2349
+ this.prevButton = new PrevNextButton(-1, this);
2350
+ this.nextButton = new PrevNextButton(1, this);
2351
+ this.on('activate', this.activatePrevNextButtons);
2352
+ };
2353
+ proto$1.activatePrevNextButtons = function () {
2354
+ this.prevButton.activate();
2355
+ this.nextButton.activate();
2356
+ this.on('deactivate', this.deactivatePrevNextButtons);
2357
+ };
2358
+ proto$1.deactivatePrevNextButtons = function () {
2359
+ this.prevButton.deactivate();
2360
+ this.nextButton.deactivate();
2361
+ this.off('deactivate', this.deactivatePrevNextButtons);
2362
+ };
2363
+ // @ts-ignore
2364
+ Flickity.PrevNextButton = PrevNextButton;
2365
+
2366
+ // -------------------------- Player -------------------------- //
2367
+ function Player(parent) {
2368
+ this.parent = parent;
2369
+ this.state = 'stopped';
2370
+ // visibility change event handler
2371
+ this.onVisibilityChange = this.visibilityChange.bind(this);
2372
+ this.onVisibilityPlay = this.visibilityPlay.bind(this);
2373
+ }
2374
+ Player.prototype = Object.create(EvEmitter.prototype);
2375
+ // start play
2376
+ Player.prototype.play = function () {
2377
+ if (this.state == 'playing') {
2378
+ return;
2379
+ }
2380
+ // do not play if page is hidden, start playing when page is visible
2381
+ const isPageHidden = document.hidden;
2382
+ if (isPageHidden) {
2383
+ document.addEventListener('visibilitychange', this.onVisibilityPlay);
2384
+ return;
2385
+ }
2386
+ this.state = 'playing';
2387
+ // listen to visibility change
2388
+ document.addEventListener('visibilitychange', this.onVisibilityChange);
2389
+ // start ticking
2390
+ this.tick();
2391
+ };
2392
+ Player.prototype.tick = function () {
2393
+ // do not tick if not playing
2394
+ if (this.state != 'playing') {
2395
+ return;
2396
+ }
2397
+ let time = this.parent.options.autoPlay;
2398
+ // default to 3 seconds
2399
+ time = typeof time == 'number' ? time : 3000;
2400
+ const _this = this;
2401
+ // HACK: reset ticks if stopped and started within interval
2402
+ this.clear();
2403
+ this.timeout = setTimeout(function () {
2404
+ _this.parent.next(true);
2405
+ _this.tick();
2406
+ }, time);
2407
+ };
2408
+ Player.prototype.stop = function () {
2409
+ this.state = 'stopped';
2410
+ this.clear();
2411
+ // remove visibility change event
2412
+ document.removeEventListener('visibilitychange', this.onVisibilityChange);
2413
+ };
2414
+ Player.prototype.clear = function () {
2415
+ clearTimeout(this.timeout);
2416
+ };
2417
+ Player.prototype.pause = function () {
2418
+ if (this.state == 'playing') {
2419
+ this.state = 'paused';
2420
+ this.clear();
2421
+ }
2422
+ };
2423
+ Player.prototype.unpause = function () {
2424
+ // re-start play if paused
2425
+ if (this.state == 'paused') {
2426
+ this.play();
2427
+ }
2428
+ };
2429
+ // pause if page visibility is hidden, unpause if visible
2430
+ Player.prototype.visibilityChange = function () {
2431
+ const isPageHidden = document.hidden;
2432
+ this[isPageHidden ? 'pause' : 'unpause']();
2433
+ };
2434
+ Player.prototype.visibilityPlay = function () {
2435
+ this.play();
2436
+ document.removeEventListener('visibilitychange', this.onVisibilityPlay);
2437
+ };
2438
+ // -------------------------- Flickity -------------------------- //
2439
+ utils.extend(Flickity.defaults, {
2440
+ pauseAutoPlayOnHover: true,
2441
+ });
2442
+ Flickity.createMethods.push('_createPlayer');
2443
+ const proto = Flickity.prototype;
2444
+ proto._createPlayer = function () {
2445
+ this.player = new Player(this);
2446
+ this.on('activate', this.activatePlayer);
2447
+ this.on('uiChange', this.stopPlayer);
2448
+ this.on('pointerDown', this.stopPlayer);
2449
+ this.on('deactivate', this.deactivatePlayer);
2450
+ };
2451
+ proto.activatePlayer = function () {
2452
+ if (!this.options.autoPlay) {
2453
+ return;
2454
+ }
2455
+ this.player.play();
2456
+ this.element.addEventListener('mouseenter', this);
2457
+ };
2458
+ // Player API, don't hate the ... thanks I know where the door is
2459
+ proto.playPlayer = function () {
2460
+ this.player.play();
2461
+ };
2462
+ proto.stopPlayer = function () {
2463
+ this.player.stop();
2464
+ };
2465
+ proto.pausePlayer = function () {
2466
+ this.player.pause();
2467
+ };
2468
+ proto.unpausePlayer = function () {
2469
+ this.player.unpause();
2470
+ };
2471
+ proto.deactivatePlayer = function () {
2472
+ this.player.stop();
2473
+ this.element.removeEventListener('mouseenter', this);
2474
+ };
2475
+ // ----- mouseenter/leave ----- //
2476
+ // pause auto-play on hover
2477
+ proto.onmouseenter = function () {
2478
+ if (!this.options.pauseAutoPlayOnHover) {
2479
+ return;
2480
+ }
2481
+ this.player.pause();
2482
+ this.element.addEventListener('mouseleave', this);
2483
+ };
2484
+ // resume auto-play on hover off
2485
+ proto.onmouseleave = function () {
2486
+ this.player.unpause();
2487
+ this.element.removeEventListener('mouseleave', this);
2488
+ };
2489
+ // @ts-ignore
2490
+ Flickity.Player = Player;
2491
+
2492
+ const flickity = Flickity;
2493
+
2494
+ const slidesCss = ":host{box-sizing:border-box}*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}:host{--dot-color:#ccc;--dot-color-active:var(--nano-color-primary, #007495);--navbtns-icon-color:var(--dot-color-active);--navbtns-bg-color:white;--navbtns-icon-color-disabled:var(--dot-color-active);--navbtns-bg-color-disabled:white;--fsbtn-icon-color:var(--dot-color-active);--fsbtn-bg-color:white;display:block;-webkit-user-select:none;user-select:none;overflow:hidden;transition:opacity 0.2s;opacity:0;max-inline-size:100vw}:host([ready]){opacity:1}.slideshow{max-block-size:100%;min-block-size:inherit;block-size:inherit;position:relative}.slideshow.not-ready{inline-size:100%;overflow:hidden}.flickity-container{opacity:0;transition:opacity 0.2s;display:flex;inline-size:-moz-fit-content;inline-size:fit-content;block-size:-moz-fit-content;block-size:fit-content}.not-ready .flickity-container{inline-size:-moz-fit-content;inline-size:fit-content;block-size:-moz-fit-content;block-size:fit-content}.flickity-container.slides-ready{min-block-size:inherit;max-block-size:inherit;block-size:inherit;inline-size:auto}[hidden]{display:none !important}.ui-extras{pointer-events:none;position:absolute;block-size:100%;inline-size:100%;inset-block-start:0;inset-inline-start:0}.ui-extras *{pointer-events:all}/*! Flickity v2.2.1\nhttps://flickity.metafizzy.co\n---------------------------------------------- */.flickity-enabled{position:relative;opacity:1}.flickity-enabled:focus{outline:none}.flickity-viewport{overflow:hidden;position:relative;min-block-size:100%;flex:1}.flickity-slider{position:absolute;inline-size:100%;block-size:100%}.flickity-enabled.is-draggable{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}.flickity-enabled.is-draggable .flickity-viewport{cursor:move;cursor:grab;cursor:grab}.flickity-enabled.is-draggable .flickity-viewport.is-pointer-down{cursor:grabbing}.flickity-button{position:absolute;background:var(--navbtns-bg-color);border:none;color:#333;opacity:0.75}.flickity-button:hover{opacity:1;cursor:pointer}.flickity-button:focus{outline:none;box-shadow:0 0 0 5px #19f}.flickity-button:active{opacity:0.6}.flickity-button:disabled{opacity:0.3;cursor:auto;pointer-events:none;background:var(--navbtns-bg-color-disabled)}.flickity-button-icon{fill:var(--navbtns-icon-color)}.flickity-button:disabled .flickity-button-icon{fill:var(--navbtns-icon-color-disabled)}.flickity-prev-next-button{inset-block-start:50%;inline-size:44px;block-size:44px;border-radius:50%;transform:translateY(-50%)}.flickity-prev-next-button.previous{inset-inline-start:10px}.flickity-prev-next-button.next{inset-inline-end:10px}.flickity-rtl .flickity-prev-next-button.previous{inset-inline:auto 10px}.flickity-rtl .flickity-prev-next-button.next{inset-inline:10px auto}.flickity-prev-next-button .flickity-button-icon{position:absolute;inset-inline-start:20%;inset-block-start:20%;inline-size:60%;block-size:60%}.flickity-page-dots{position:absolute;inline-size:100%;inset-block-end:10px;padding:0;margin:0;list-style:none;text-align:center;line-height:1;z-index:4}.flickity-rtl .flickity-page-dots{direction:rtl}.flickity-page-dots .dot{display:inline-block;inline-size:10px;block-size:10px;margin-block:0;margin-inline:8px;border-radius:50%;cursor:pointer;background:var(--dot-color)}.flickity-page-dots .dot.is-selected{opacity:1;background:var(--dot-color-active)}.flickity-enabled.is-fullscreen{position:fixed;inset-inline-start:0;inset-block-start:0;inline-size:100%;block-size:100%;background:rgba(0, 0, 0, 0.9);padding-block-end:35px;z-index:100}.flickity-enabled.is-fullscreen .flickity-page-dots{inset-block-end:45px}html.is-flickity-fullscreen{overflow:hidden}.flickity-fullscreen-button{display:block;inset-inline-end:10px;inset-block-start:10px;inline-size:24px;block-size:24px;border-radius:4px;background:var(--fsbtn-bg-color);fill:var(--fsbtn-icon-color)}.flickity-rtl .flickity-fullscreen-button{inset-inline:10px auto}.flickity-fullscreen-button-exit{display:none}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-exit{display:block}.flickity-enabled.is-fullscreen .flickity-fullscreen-button-view{display:none}.flickity-fullscreen-button .flickity-button-icon{position:absolute;inline-size:16px;block-size:16px;inset-inline-start:4px;inset-block-start:4px}.flickity-enabled.is-fade .flickity-slider>*{pointer-events:none;z-index:0}.flickity-enabled.is-fade .flickity-slider ::slotted(.is-selected){pointer-events:auto;z-index:1}";
2495
+
2496
+ const modulo = (num, div) => {
2497
+ return ((num % div) + div) % div;
2498
+ };
2499
+ const Slides = class {
2500
+ constructor(hostRef) {
2501
+ index.registerInstance(this, hostRef);
2502
+ this.nanoSlidesDidLoad = index.createEvent(this, "nanoSlidesDidLoad", 7);
2503
+ this.nanoSlidesReady = index.createEvent(this, "nanoSlidesReady", 7);
2504
+ this.nanoSlidesSelect = index.createEvent(this, "nanoSlidesSelect", 7);
2505
+ this.nanoSlidesChange = index.createEvent(this, "nanoSlidesChange", 7);
2506
+ this.nanoSlidesScroll = index.createEvent(this, "nanoSlidesScroll", 7);
2507
+ this.nanoSlidesTransitionEnd = index.createEvent(this, "nanoSlidesTransitionEnd", 7);
2508
+ this.nanoSlidesDragStart = index.createEvent(this, "nanoSlidesDragStart", 7);
2509
+ this.nanoSlidesDragMove = index.createEvent(this, "nanoSlidesDragMove", 7);
2510
+ this.nanoSlidesDragEnd = index.createEvent(this, "nanoSlidesDragEnd", 7);
2511
+ this.nanoSlidesTap = index.createEvent(this, "nanoSlidesTap", 7);
2512
+ this.nanoSlidesFullscreenChange = index.createEvent(this, "nanoSlidesFullscreenChange", 7);
2513
+ this.flickityReady = false;
2514
+ this.flickity = new Promise((resolve) => {
2515
+ this.readyflickity = resolve;
2516
+ });
2517
+ this.hasFullScreenModule = false;
2518
+ this.hasLazyLoadModule = false;
2519
+ this.hasDotsModule = false;
2520
+ this.hasFadeModule = false;
2521
+ this.parallax = async () => {
2522
+ const flkty = await this.flickity;
2523
+ const cells = flkty.cells;
2524
+ cells.forEach((cell) => {
2525
+ const ele = cell.element.children[0];
2526
+ let flkX = flkty.x;
2527
+ if (flkty.options.wrapAround && flkty.cells.length > 1) {
2528
+ flkX = modulo(flkX, flkty.slideableWidth);
2529
+ flkX = flkX - flkty.slideableWidth;
2530
+ }
2531
+ let x = ((cell.target + flkX) * -1) / 3;
2532
+ if (cell.shift < 0) {
2533
+ x = ((cell.target - flkty.slideableWidth + flkX) * -1) / 3;
2534
+ }
2535
+ else if (cell.shift > 0) {
2536
+ x = ((cell.target + (flkX + flkty.slideableWidth)) * -1) / 3;
2537
+ }
2538
+ ele.style.transform = 'translate3d(' + x + 'px, 0, 0)';
2539
+ const animAmount = ((x * 3) / cell.size.width) * 100;
2540
+ cell.element.style.setProperty('--animation-amount', animAmount.toString());
2541
+ });
2542
+ };
2543
+ this.handleFullscreen = (isFullScreen) => {
2544
+ this.fullscreen = isFullScreen;
2545
+ this.nanoSlidesFullscreenChange.emit(isFullScreen);
2546
+ };
2547
+ this.handleSlideSelect = (slide) => {
2548
+ this.iCurrentSlide = slide;
2549
+ this.nanoSlidesSelect.emit(slide);
2550
+ };
2551
+ this.iCurrentSlide = undefined;
2552
+ this.slidesReady = undefined;
2553
+ this.didInit = false;
2554
+ this.options = {};
2555
+ this.navbtns = false;
2556
+ this.pager = false;
2557
+ this.fullscreenbtn = false;
2558
+ this.fullscreen = false;
2559
+ this.animation = 'scroll';
2560
+ this.currentSlide = 0;
2561
+ this.autoplay = false;
2562
+ this.ready = false;
2563
+ }
2564
+ async optionsChanged() {
2565
+ if (this.flickityReady) {
2566
+ const flickity = await this.getflickity();
2567
+ const newOpts = Object.assign(flickity.options, this.options);
2568
+ await this.loadFlickityModules(newOpts);
2569
+ await this.update();
2570
+ }
2571
+ }
2572
+ async navbtnsChanged() {
2573
+ Array.from(this._getRoot().querySelectorAll('.flickity-prev-next-button')).forEach((btn) => {
2574
+ btn.hidden = !this.navbtns;
2575
+ });
2576
+ }
2577
+ async pagerChanged() {
2578
+ const dots = this._getRoot().querySelector('.flickity-page-dots');
2579
+ if (dots)
2580
+ dots.hidden = !this.pager;
2581
+ }
2582
+ async fullscreenBtnChanged() {
2583
+ const btn = this._getRoot().querySelector('.flickity-fullscreen-button');
2584
+ if (btn)
2585
+ btn.hidden = !this.fullscreenbtn;
2586
+ }
2587
+ async fullscreenChanged(_, oldFs) {
2588
+ const flickity = await this.getflickity();
2589
+ if (this.fullscreen)
2590
+ flickity.viewFullscreen();
2591
+ else if (typeof oldFs !== 'undefined')
2592
+ flickity.exitFullscreen();
2593
+ }
2594
+ async animationChange(_, oldAnim) {
2595
+ const [flkty, slides] = await Promise.all([
2596
+ this.getflickity(),
2597
+ waitForSlides(this.host),
2598
+ ]);
2599
+ // clear old stuff
2600
+ slides.forEach((slide) => {
2601
+ slide.style['left'] = undefined;
2602
+ });
2603
+ if (oldAnim === 'parallax') {
2604
+ flkty.off('scroll', this.parallax);
2605
+ slides.forEach((_, i) => {
2606
+ if (this.childrenEles && this.childrenEles[i])
2607
+ this.childrenEles[i].style['transform'] = undefined;
2608
+ });
2609
+ this.update();
2610
+ }
2611
+ // was a custom animation
2612
+ if (typeof oldAnim === 'function') {
2613
+ flkty.off('scroll', oldAnim);
2614
+ }
2615
+ // is a custom animation
2616
+ if (typeof this.animation === 'function') {
2617
+ this.options = { fade: false, percentPosition: true };
2618
+ flkty.on('scroll', this.animation);
2619
+ return;
2620
+ }
2621
+ // setup new stuff
2622
+ switch (this.animation) {
2623
+ case 'fade':
2624
+ this.options = { fade: true, percentPosition: true };
2625
+ break;
2626
+ case 'parallax':
2627
+ this.options = { fade: false, percentPosition: true };
2628
+ flkty.on('scroll', this.parallax);
2629
+ break;
2630
+ default:
2631
+ this.options = { fade: false, percentPosition: true };
2632
+ break;
2633
+ }
2634
+ }
2635
+ currentSlideChange() {
2636
+ if (this.currentSlide !== this.iCurrentSlide)
2637
+ this.slideTo(this.currentSlide);
2638
+ }
2639
+ internalSlideChange() {
2640
+ this.currentSlide = this.iCurrentSlide;
2641
+ }
2642
+ async autoPlayChange() {
2643
+ await this.stopAutoplay();
2644
+ if (this.autoplay) {
2645
+ if (typeof this.autoplay === 'string')
2646
+ this.autoplay = parseInt(this.autoplay);
2647
+ if (this.autoplay > 0)
2648
+ this.startAutoplay(this.autoplay);
2649
+ }
2650
+ }
2651
+ /**
2652
+ * Update the underlying flickity implementation. Call this if you've added or removed
2653
+ * child slides.
2654
+ */
2655
+ async update() {
2656
+ const [flickity] = await Promise.all([
2657
+ this.getflickity(),
2658
+ waitForSlides(this.host),
2659
+ ]);
2660
+ this.childrenEles = this.host.querySelectorAll('nano-slide > *');
2661
+ flickity.reloadCells();
2662
+ flickity.resize();
2663
+ flickity.reposition();
2664
+ }
2665
+ /**
2666
+ * Force flickity to update its height (when adaptiveHeight is enabled) for the duration
2667
+ * equal to 'speed' parameter.
2668
+ *
2669
+ * @param speed The transition duration (in ms).
2670
+ */
2671
+ async updateAutoHeight(speed) {
2672
+ const vp = document.querySelector('.flickity-viewport');
2673
+ if (vp)
2674
+ vp.style.transition = speed + 'ms';
2675
+ }
2676
+ /**
2677
+ * Transition to the specified slide.
2678
+ *
2679
+ * @param index The index of the slide to transition to.
2680
+ * @param instant Immediately view the selected slide without animation.
2681
+ */
2682
+ async slideTo(index, instant) {
2683
+ const flickity = await this.getflickity();
2684
+ flickity.select(index, instant);
2685
+ }
2686
+ /**
2687
+ * Transition to the next slide.
2688
+ *
2689
+ * @param instant The transition duration (in ms).
2690
+ * @param wrap If true, the first slide will be selected if at the last slide.
2691
+ */
2692
+ async slideNext(instant, wrap) {
2693
+ const flickity = await this.getflickity();
2694
+ flickity.next(wrap, instant);
2695
+ }
2696
+ /**
2697
+ * Transition to the previous slide.
2698
+ *
2699
+ * @param instant The transition duration (in ms).
2700
+ * @param wrap If true, the last slide will be selected if at the first slide.
2701
+ */
2702
+ async slidePrev(instant, wrap) {
2703
+ const flickity = await this.getflickity();
2704
+ flickity.previous(instant, wrap);
2705
+ }
2706
+ /** Get the index of the active slide. */
2707
+ async getActiveIndex() {
2708
+ const flickity = await this.getflickity();
2709
+ return flickity.selectedIndex;
2710
+ }
2711
+ /** Get the total number of slides. */
2712
+ async length() {
2713
+ const flickity = await this.getflickity();
2714
+ return flickity.slides.length;
2715
+ }
2716
+ /** Get whether or not the current slide is the last slide. */
2717
+ async isEnd() {
2718
+ const flickity = await this.getflickity();
2719
+ return flickity.selectedIndex === flickity.slides.length - 1;
2720
+ }
2721
+ /** Get whether or not the current slide is the first slide. */
2722
+ async isBeginning() {
2723
+ const flickity = await this.getflickity();
2724
+ return flickity.selectedIndex === 0;
2725
+ }
2726
+ /**
2727
+ * Start auto play.
2728
+ * @param time - optional time duration to show slides
2729
+ */
2730
+ async startAutoplay(time) {
2731
+ const flickity = await this.getflickity();
2732
+ if (time)
2733
+ this.options = { autoPlay: time };
2734
+ setTimeout(() => flickity.playPlayer());
2735
+ }
2736
+ /** Stop auto play. */
2737
+ async stopAutoplay() {
2738
+ const flickity = await this.getflickity();
2739
+ flickity.stopPlayer();
2740
+ }
2741
+ /**
2742
+ * Lock or unlock the ability to slide to the next slide.
2743
+ *
2744
+ * @param lock If `true`, disable swiping
2745
+ */
2746
+ async lockSwipes(lock) {
2747
+ const flickity = await this.getflickity();
2748
+ flickity.options.draggable = !lock;
2749
+ flickity.updateDraggable();
2750
+ }
2751
+ /**
2752
+ * Get the flickity instance.
2753
+ * Use this to access the full flickity API.
2754
+ * See https://flickity.metafizzy.co/ for all API options.
2755
+ */
2756
+ async getflickity() {
2757
+ return this.flickity;
2758
+ }
2759
+ /**
2760
+ * Hard destroy / create.
2761
+ * Certain flickity options, you will require the instance to be re-initialised
2762
+ */
2763
+ async reload() {
2764
+ this.destroyflickity();
2765
+ setTimeout(() => this.initflickity(), 20);
2766
+ }
2767
+ _getRoot() {
2768
+ return this.host.shadowRoot ? this.host.shadowRoot : this.host;
2769
+ }
2770
+ destroyflickity() {
2771
+ /**
2772
+ * We need to synchronously destroy
2773
+ * flickity otherwise it is possible
2774
+ * that it will be left in a
2775
+ * destroyed state if connectedCallback
2776
+ * is called multiple times
2777
+ */
2778
+ const flickity = this.syncflickity;
2779
+ if (flickity !== undefined) {
2780
+ flickity.destroy();
2781
+ this.flickity = new Promise((resolve) => {
2782
+ this.readyflickity = resolve;
2783
+ });
2784
+ this.flickityReady = false;
2785
+ this.syncflickity = undefined;
2786
+ this.ready = false;
2787
+ }
2788
+ this.didInit = false;
2789
+ }
2790
+ async loadFlickityModules(opts) {
2791
+ if (!this.hasFullScreenModule && opts.fullscreen) {
2792
+ await Promise.resolve().then(function () { return require('./fullscreen-d24940a1.js'); });
2793
+ this.hasFullScreenModule = true;
2794
+ }
2795
+ if (!this.hasLazyLoadModule && opts.lazyLoad) {
2796
+ await Promise.resolve().then(function () { return require('./lazyload-f6be7590.js'); });
2797
+ this.hasLazyLoadModule = true;
2798
+ }
2799
+ if (!this.hasDotsModule && opts.pageDots) {
2800
+ await Promise.resolve().then(function () { return require('./page-dots-ae2cefb4.js'); });
2801
+ this.hasDotsModule = true;
2802
+ }
2803
+ if (!this.hasFadeModule && opts.fade) {
2804
+ await Promise.resolve().then(function () { return require('./fade-dcabf3c1.js'); });
2805
+ this.hasFadeModule = true;
2806
+ }
2807
+ }
2808
+ async initflickity() {
2809
+ const finalOptions = this.normalizeOptions();
2810
+ await this.loadFlickityModules(finalOptions);
2811
+ // init flickity core
2812
+ await waitForSlides(this.host);
2813
+ this.flickityEl =
2814
+ this.flickityEl || this._getRoot().querySelector('.flickity-container');
2815
+ if (!this.flickityEl)
2816
+ return;
2817
+ this.slidesReady = true;
2818
+ if (this.flickityEl.classList.contains('flickity-enabled')) {
2819
+ this.destroyflickity();
2820
+ }
2821
+ this.flickityEl.style.height =
2822
+ this.flickityEl.getBoundingClientRect().height + 'px';
2823
+ setTimeout(() => {
2824
+ this.flickityEl.style.height = '';
2825
+ const flick = new flickity(this.flickityEl, finalOptions);
2826
+ this.flickityReady = true;
2827
+ this.syncflickity = flick;
2828
+ this.animationChange();
2829
+ this.navbtnsChanged();
2830
+ this.pagerChanged();
2831
+ this.fullscreenChanged();
2832
+ this.fullscreenBtnChanged();
2833
+ this.readyflickity(flick);
2834
+ this.ready = true;
2835
+ if (!window['ResizeObserver'])
2836
+ return;
2837
+ // just boots and braces to make sure it's the correct size oninit
2838
+ const ro = (this.resizeO = new ResizeObserver(() => {
2839
+ flick.resize();
2840
+ // this.resizeO.disconnect();
2841
+ }));
2842
+ ro.observe(this.host);
2843
+ }, 100);
2844
+ }
2845
+ normalizeOptions() {
2846
+ // Base options, can be changed
2847
+ const flickityOptions = {
2848
+ cellSelector: 'nano-slide',
2849
+ contain: true,
2850
+ prevNextButtons: true,
2851
+ fullscreen: this.fullscreen,
2852
+ accessibility: true,
2853
+ imagesLoaded: true,
2854
+ pageDots: this.pager,
2855
+ };
2856
+ if (this.animation === 'fade') {
2857
+ flickityOptions.fade = true;
2858
+ }
2859
+ if (this.currentSlide > 0) {
2860
+ flickityOptions.initialIndex = this.currentSlide;
2861
+ }
2862
+ if (this.autoplay) {
2863
+ if (typeof this.autoplay === 'string')
2864
+ this.autoplay = parseInt(this.autoplay);
2865
+ if (this.autoplay > 0)
2866
+ flickityOptions.autoPlay = this.autoplay;
2867
+ }
2868
+ // Keep the event options separate, we dont want users
2869
+ // overwriting these
2870
+ const eventOptions = {
2871
+ ready: () => {
2872
+ setTimeout(() => {
2873
+ this.nanoSlidesReady.emit();
2874
+ }, 20);
2875
+ },
2876
+ select: this.handleSlideSelect,
2877
+ change: this.nanoSlidesChange.emit,
2878
+ scroll: this.nanoSlidesScroll.emit,
2879
+ settle: this.nanoSlidesTransitionEnd.emit,
2880
+ dragStart: this.nanoSlidesDragStart.emit,
2881
+ dragMove: this.nanoSlidesDragMove.emit,
2882
+ dragEnd: this.nanoSlidesDragEnd.emit,
2883
+ staticClick: this.nanoSlidesTap.emit,
2884
+ fullscreenChange: this.handleFullscreen,
2885
+ };
2886
+ const customEvents = !!this.options && !!this.options.on ? this.options.on : {};
2887
+ // merge "on" event listeners, while giving our event listeners priority
2888
+ const mergedEventOptions = { on: Object.assign(Object.assign({}, customEvents), eventOptions) };
2889
+ // Merge the base, user options, and events together then pass to flickity
2890
+ // @ts-ignore
2891
+ return Object.assign(Object.assign(Object.assign({}, flickityOptions), mergedEventOptions), this.options);
2892
+ }
2893
+ componentDidLoad() {
2894
+ if (typeof window !== 'undefined' &&
2895
+ window.MutationObserver) {
2896
+ const mut = (this.mutationO = new MutationObserver((e) => {
2897
+ if (e[0].addedNodes[0] &&
2898
+ e[0].addedNodes[0].nodeName.toLowerCase() === 'nano-slide' &&
2899
+ this.flickityReady) {
2900
+ this.update();
2901
+ }
2902
+ }));
2903
+ mut.observe(this.host, {
2904
+ childList: true,
2905
+ subtree: true,
2906
+ });
2907
+ }
2908
+ }
2909
+ componentWillLoad() {
2910
+ this.nanoSlidesDidLoad.emit();
2911
+ if (!this.didInit) {
2912
+ this.didInit = true;
2913
+ this.initflickity();
2914
+ }
2915
+ }
2916
+ disconnectedCallback() {
2917
+ if (this.mutationO) {
2918
+ this.mutationO.disconnect();
2919
+ this.mutationO = undefined;
2920
+ }
2921
+ if (this.resizeO)
2922
+ this.resizeO.disconnect();
2923
+ this.destroyflickity();
2924
+ }
2925
+ render() {
2926
+ return (index.h(index.Host, null, index.h("div", { class: {
2927
+ slideshow: true,
2928
+ ready: this.ready,
2929
+ 'not-ready': !this.ready,
2930
+ }, part: "base" }, index.h("div", { ref: (div) => (this.flickityEl = div), class: {
2931
+ 'flickity-container': true,
2932
+ 'slides-ready': this.slidesReady,
2933
+ 'slides-not-ready': !this.slidesReady,
2934
+ }, part: "slide-container" }, index.h("slot", null)), index.h("div", { class: "ui-extras" }, index.h("slot", { name: "ui" })))));
2935
+ }
2936
+ get host() { return index.getElement(this); }
2937
+ static get watchers() { return {
2938
+ "options": ["optionsChanged"],
2939
+ "navbtns": ["navbtnsChanged"],
2940
+ "pager": ["pagerChanged"],
2941
+ "fullscreenbtn": ["fullscreenBtnChanged"],
2942
+ "fullscreen": ["fullscreenChanged"],
2943
+ "animation": ["animationChange"],
2944
+ "currentSlide": ["currentSlideChange"],
2945
+ "iCurrentSlide": ["internalSlideChange"],
2946
+ "autoplay": ["autoPlayChange"]
2947
+ }; }
2948
+ };
2949
+ const waitForSlides = (host) => {
2950
+ const allSlides = Array.from(host.querySelectorAll('nano-slide'));
2951
+ let toLoadSlides = allSlides.filter((ele) => !ele.ready);
2952
+ if (!toLoadSlides.length)
2953
+ return Promise.resolve(allSlides);
2954
+ return new Promise((resolve) => {
2955
+ const slideResolver = (ev) => {
2956
+ toLoadSlides = toLoadSlides.filter((ele) => ele !== ev.target);
2957
+ if (!toLoadSlides.length) {
2958
+ resolve(allSlides);
2959
+ host.removeEventListener('nanoSlideReady', slideResolver);
2960
+ host.removeEventListener('nano-slide-ready', slideResolver);
2961
+ }
2962
+ };
2963
+ host.addEventListener('nanoSlideReady', slideResolver);
2964
+ // fallback for vue who can't handle camelcase event names
2965
+ host.addEventListener('nano-slide-ready', slideResolver);
2966
+ });
2967
+ };
2968
+ Slides.style = slidesCss;
2969
+
2970
+ exports.Flickity = Flickity;
2971
+ exports.Slides = Slides;
2972
+ exports.Unipointer = Unipointer;
2973
+ exports.utils = utils;
2974
+
2975
+ //# sourceMappingURL=nano-slides-2f3dcc02.js.map