@siemens/ix 2.0.0 → 2.0.1

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 (404) hide show
  1. package/components/_commonjsHelpers.js +21 -0
  2. package/components/_commonjsHelpers.js.map +1 -0
  3. package/components/a11y.js +79 -0
  4. package/components/a11y.js.map +1 -0
  5. package/components/animation.js +19 -0
  6. package/components/animation.js.map +1 -0
  7. package/components/anime.es.js +1311 -0
  8. package/components/anime.es.js.map +1 -0
  9. package/components/application-header.js +95 -0
  10. package/components/application-header.js.map +1 -0
  11. package/components/avatar.js +53 -0
  12. package/components/avatar.js.map +1 -0
  13. package/components/base-button.js +47 -0
  14. package/components/base-button.js.map +1 -0
  15. package/components/base-icon-button.js +18 -0
  16. package/components/base-icon-button.js.map +1 -0
  17. package/components/breadcrumb-item.js +92 -0
  18. package/components/breadcrumb-item.js.map +1 -0
  19. package/components/breakpoints.js +25 -0
  20. package/components/breakpoints.js.map +1 -0
  21. package/components/burger-menu.js +55 -0
  22. package/components/burger-menu.js.map +1 -0
  23. package/components/button.js +91 -0
  24. package/components/button.js.map +1 -0
  25. package/components/card-accordion.js +72 -0
  26. package/components/card-accordion.js.map +1 -0
  27. package/components/card-content.js +32 -0
  28. package/components/card-content.js.map +1 -0
  29. package/components/card-title.js +32 -0
  30. package/components/card-title.js.map +1 -0
  31. package/components/card.js +36 -0
  32. package/components/card.js.map +1 -0
  33. package/components/context.js +101 -0
  34. package/components/context.js.map +1 -0
  35. package/components/custom-elements.d.ts +10 -0
  36. package/components/date-picker.js +372 -0
  37. package/components/date-picker.js.map +1 -0
  38. package/components/date-time-card.js +45 -0
  39. package/components/date-time-card.js.map +1 -0
  40. package/components/default-tree-item.js +22 -0
  41. package/components/default-tree-item.js.map +1 -0
  42. package/components/divider.js +32 -0
  43. package/components/divider.js.map +1 -0
  44. package/components/dropdown-item.js +69 -0
  45. package/components/dropdown-item.js.map +1 -0
  46. package/components/dropdown.js +346 -0
  47. package/components/dropdown.js.map +1 -0
  48. package/components/filter-chip.js +56 -0
  49. package/components/filter-chip.js.map +1 -0
  50. package/components/flip-tile-state.js +20 -0
  51. package/components/flip-tile-state.js.map +1 -0
  52. package/components/floating-ui.dom.esm.js +1512 -0
  53. package/components/floating-ui.dom.esm.js.map +1 -0
  54. package/components/group-context-menu.js +73 -0
  55. package/components/group-context-menu.js.map +1 -0
  56. package/components/group-item.js +58 -0
  57. package/components/group-item.js.map +1 -0
  58. package/components/icon-button.js +99 -0
  59. package/components/icon-button.js.map +1 -0
  60. package/components/index.d.ts +27 -0
  61. package/components/index.js +101 -0
  62. package/components/index.js.map +1 -0
  63. package/components/ix-action-card.d.ts +11 -0
  64. package/components/ix-action-card.js +66 -0
  65. package/components/ix-action-card.js.map +1 -0
  66. package/components/ix-application-header.d.ts +11 -0
  67. package/components/ix-application-header.js +8 -0
  68. package/components/ix-application-header.js.map +1 -0
  69. package/components/ix-application-sidebar.d.ts +11 -0
  70. package/components/ix-application-sidebar.js +63 -0
  71. package/components/ix-application-sidebar.js.map +1 -0
  72. package/components/ix-application.d.ts +11 -0
  73. package/components/ix-application.js +128 -0
  74. package/components/ix-application.js.map +1 -0
  75. package/components/ix-avatar.d.ts +11 -0
  76. package/components/ix-avatar.js +8 -0
  77. package/components/ix-avatar.js.map +1 -0
  78. package/components/ix-basic-navigation.d.ts +11 -0
  79. package/components/ix-basic-navigation.js +132 -0
  80. package/components/ix-basic-navigation.js.map +1 -0
  81. package/components/ix-blind.d.ts +11 -0
  82. package/components/ix-blind.js +128 -0
  83. package/components/ix-blind.js.map +1 -0
  84. package/components/ix-breadcrumb-item.d.ts +11 -0
  85. package/components/ix-breadcrumb-item.js +8 -0
  86. package/components/ix-breadcrumb-item.js.map +1 -0
  87. package/components/ix-breadcrumb.d.ts +11 -0
  88. package/components/ix-breadcrumb.js +151 -0
  89. package/components/ix-breadcrumb.js.map +1 -0
  90. package/components/ix-burger-menu.d.ts +11 -0
  91. package/components/ix-burger-menu.js +8 -0
  92. package/components/ix-burger-menu.js.map +1 -0
  93. package/components/ix-button.d.ts +11 -0
  94. package/components/ix-button.js +8 -0
  95. package/components/ix-button.js.map +1 -0
  96. package/components/ix-card-accordion.d.ts +11 -0
  97. package/components/ix-card-accordion.js +8 -0
  98. package/components/ix-card-accordion.js.map +1 -0
  99. package/components/ix-card-content.d.ts +11 -0
  100. package/components/ix-card-content.js +8 -0
  101. package/components/ix-card-content.js.map +1 -0
  102. package/components/ix-card-list.d.ts +11 -0
  103. package/components/ix-card-list.js +228 -0
  104. package/components/ix-card-list.js.map +1 -0
  105. package/components/ix-card-title.d.ts +11 -0
  106. package/components/ix-card-title.js +8 -0
  107. package/components/ix-card-title.js.map +1 -0
  108. package/components/ix-card.d.ts +11 -0
  109. package/components/ix-card.js +8 -0
  110. package/components/ix-card.js.map +1 -0
  111. package/components/ix-category-filter.d.ts +11 -0
  112. package/components/ix-category-filter.js +464 -0
  113. package/components/ix-category-filter.js.map +1 -0
  114. package/components/ix-chip.d.ts +11 -0
  115. package/components/ix-chip.js +98 -0
  116. package/components/ix-chip.js.map +1 -0
  117. package/components/ix-col.d.ts +11 -0
  118. package/components/ix-col.js +96 -0
  119. package/components/ix-col.js.map +1 -0
  120. package/components/ix-content-header.d.ts +11 -0
  121. package/components/ix-content-header.js +63 -0
  122. package/components/ix-content-header.js.map +1 -0
  123. package/components/ix-content.d.ts +11 -0
  124. package/components/ix-content.js +48 -0
  125. package/components/ix-content.js.map +1 -0
  126. package/components/ix-css-grid-item.d.ts +11 -0
  127. package/components/ix-css-grid-item.js +40 -0
  128. package/components/ix-css-grid-item.js.map +1 -0
  129. package/components/ix-css-grid.d.ts +11 -0
  130. package/components/ix-css-grid.js +113 -0
  131. package/components/ix-css-grid.js.map +1 -0
  132. package/components/ix-date-picker.d.ts +11 -0
  133. package/components/ix-date-picker.js +8 -0
  134. package/components/ix-date-picker.js.map +1 -0
  135. package/components/ix-date-time-card.d.ts +11 -0
  136. package/components/ix-date-time-card.js +8 -0
  137. package/components/ix-date-time-card.js.map +1 -0
  138. package/components/ix-datetime-picker.d.ts +11 -0
  139. package/components/ix-datetime-picker.js +149 -0
  140. package/components/ix-datetime-picker.js.map +1 -0
  141. package/components/ix-divider.d.ts +11 -0
  142. package/components/ix-divider.js +8 -0
  143. package/components/ix-divider.js.map +1 -0
  144. package/components/ix-drawer.d.ts +11 -0
  145. package/components/ix-drawer.js +145 -0
  146. package/components/ix-drawer.js.map +1 -0
  147. package/components/ix-dropdown-button.d.ts +11 -0
  148. package/components/ix-dropdown-button.js +92 -0
  149. package/components/ix-dropdown-button.js.map +1 -0
  150. package/components/ix-dropdown-header.d.ts +11 -0
  151. package/components/ix-dropdown-header.js +44 -0
  152. package/components/ix-dropdown-header.js.map +1 -0
  153. package/components/ix-dropdown-item.d.ts +11 -0
  154. package/components/ix-dropdown-item.js +8 -0
  155. package/components/ix-dropdown-item.js.map +1 -0
  156. package/components/ix-dropdown-quick-actions.d.ts +11 -0
  157. package/components/ix-dropdown-quick-actions.js +35 -0
  158. package/components/ix-dropdown-quick-actions.js.map +1 -0
  159. package/components/ix-dropdown.d.ts +11 -0
  160. package/components/ix-dropdown.js +8 -0
  161. package/components/ix-dropdown.js.map +1 -0
  162. package/components/ix-empty-state.d.ts +11 -0
  163. package/components/ix-empty-state.js +65 -0
  164. package/components/ix-empty-state.js.map +1 -0
  165. package/components/ix-event-list-item.d.ts +11 -0
  166. package/components/ix-event-list-item.js +61 -0
  167. package/components/ix-event-list-item.js.map +1 -0
  168. package/components/ix-event-list.d.ts +11 -0
  169. package/components/ix-event-list.js +143 -0
  170. package/components/ix-event-list.js.map +1 -0
  171. package/components/ix-expanding-search.d.ts +11 -0
  172. package/components/ix-expanding-search.js +119 -0
  173. package/components/ix-expanding-search.js.map +1 -0
  174. package/components/ix-filter-chip.d.ts +11 -0
  175. package/components/ix-filter-chip.js +8 -0
  176. package/components/ix-filter-chip.js.map +1 -0
  177. package/components/ix-flip-tile-content.d.ts +11 -0
  178. package/components/ix-flip-tile-content.js +38 -0
  179. package/components/ix-flip-tile-content.js.map +1 -0
  180. package/components/ix-flip-tile.d.ts +11 -0
  181. package/components/ix-flip-tile.js +121 -0
  182. package/components/ix-flip-tile.js.map +1 -0
  183. package/components/ix-form-field.d.ts +11 -0
  184. package/components/ix-form-field.js +43 -0
  185. package/components/ix-form-field.js.map +1 -0
  186. package/components/ix-group-context-menu.d.ts +11 -0
  187. package/components/ix-group-context-menu.js +8 -0
  188. package/components/ix-group-context-menu.js.map +1 -0
  189. package/components/ix-group-item.d.ts +11 -0
  190. package/components/ix-group-item.js +8 -0
  191. package/components/ix-group-item.js.map +1 -0
  192. package/components/ix-group.d.ts +11 -0
  193. package/components/ix-group.js +178 -0
  194. package/components/ix-group.js.map +1 -0
  195. package/components/ix-icon-button.d.ts +11 -0
  196. package/components/ix-icon-button.js +8 -0
  197. package/components/ix-icon-button.js.map +1 -0
  198. package/components/ix-icon-toggle-button.d.ts +11 -0
  199. package/components/ix-icon-toggle-button.js +116 -0
  200. package/components/ix-icon-toggle-button.js.map +1 -0
  201. package/components/ix-input-group.d.ts +11 -0
  202. package/components/ix-input-group.js +130 -0
  203. package/components/ix-input-group.js.map +1 -0
  204. package/components/ix-key-value-list.d.ts +11 -0
  205. package/components/ix-key-value-list.js +38 -0
  206. package/components/ix-key-value-list.js.map +1 -0
  207. package/components/ix-key-value.d.ts +11 -0
  208. package/components/ix-key-value.js +47 -0
  209. package/components/ix-key-value.js.map +1 -0
  210. package/components/ix-kpi.d.ts +11 -0
  211. package/components/ix-kpi.js +69 -0
  212. package/components/ix-kpi.js.map +1 -0
  213. package/components/ix-layout-grid.d.ts +11 -0
  214. package/components/ix-layout-grid.js +47 -0
  215. package/components/ix-layout-grid.js.map +1 -0
  216. package/components/ix-link-button.d.ts +11 -0
  217. package/components/ix-link-button.js +48 -0
  218. package/components/ix-link-button.js.map +1 -0
  219. package/components/ix-map-navigation-overlay.d.ts +11 -0
  220. package/components/ix-map-navigation-overlay.js +8 -0
  221. package/components/ix-map-navigation-overlay.js.map +1 -0
  222. package/components/ix-map-navigation.d.ts +11 -0
  223. package/components/ix-map-navigation.js +226 -0
  224. package/components/ix-map-navigation.js.map +1 -0
  225. package/components/ix-menu-about-item.d.ts +11 -0
  226. package/components/ix-menu-about-item.js +38 -0
  227. package/components/ix-menu-about-item.js.map +1 -0
  228. package/components/ix-menu-about-news.d.ts +11 -0
  229. package/components/ix-menu-about-news.js +83 -0
  230. package/components/ix-menu-about-news.js.map +1 -0
  231. package/components/ix-menu-about.d.ts +11 -0
  232. package/components/ix-menu-about.js +119 -0
  233. package/components/ix-menu-about.js.map +1 -0
  234. package/components/ix-menu-avatar-item.d.ts +11 -0
  235. package/components/ix-menu-avatar-item.js +8 -0
  236. package/components/ix-menu-avatar-item.js.map +1 -0
  237. package/components/ix-menu-avatar.d.ts +11 -0
  238. package/components/ix-menu-avatar.js +77 -0
  239. package/components/ix-menu-avatar.js.map +1 -0
  240. package/components/ix-menu-category.d.ts +11 -0
  241. package/components/ix-menu-category.js +190 -0
  242. package/components/ix-menu-category.js.map +1 -0
  243. package/components/ix-menu-item.d.ts +11 -0
  244. package/components/ix-menu-item.js +8 -0
  245. package/components/ix-menu-item.js.map +1 -0
  246. package/components/ix-menu-settings-item.d.ts +11 -0
  247. package/components/ix-menu-settings-item.js +38 -0
  248. package/components/ix-menu-settings-item.js.map +1 -0
  249. package/components/ix-menu-settings.d.ts +11 -0
  250. package/components/ix-menu-settings.js +106 -0
  251. package/components/ix-menu-settings.js.map +1 -0
  252. package/components/ix-menu.d.ts +11 -0
  253. package/components/ix-menu.js +508 -0
  254. package/components/ix-menu.js.map +1 -0
  255. package/components/ix-message-bar.d.ts +11 -0
  256. package/components/ix-message-bar.js +87 -0
  257. package/components/ix-message-bar.js.map +1 -0
  258. package/components/ix-modal-content.d.ts +11 -0
  259. package/components/ix-modal-content.js +35 -0
  260. package/components/ix-modal-content.js.map +1 -0
  261. package/components/ix-modal-example.d.ts +11 -0
  262. package/components/ix-modal-example.js +58 -0
  263. package/components/ix-modal-example.js.map +1 -0
  264. package/components/ix-modal-footer.d.ts +11 -0
  265. package/components/ix-modal-footer.js +35 -0
  266. package/components/ix-modal-footer.js.map +1 -0
  267. package/components/ix-modal-header.d.ts +11 -0
  268. package/components/ix-modal-header.js +84 -0
  269. package/components/ix-modal-header.js.map +1 -0
  270. package/components/ix-modal-loading.d.ts +11 -0
  271. package/components/ix-modal-loading.js +41 -0
  272. package/components/ix-modal-loading.js.map +1 -0
  273. package/components/ix-modal.d.ts +11 -0
  274. package/components/ix-modal.js +156 -0
  275. package/components/ix-modal.js.map +1 -0
  276. package/components/ix-pagination.d.ts +11 -0
  277. package/components/ix-pagination.js +211 -0
  278. package/components/ix-pagination.js.map +1 -0
  279. package/components/ix-pill.d.ts +11 -0
  280. package/components/ix-pill.js +78 -0
  281. package/components/ix-pill.js.map +1 -0
  282. package/components/ix-push-card.d.ts +11 -0
  283. package/components/ix-push-card.js +80 -0
  284. package/components/ix-push-card.js.map +1 -0
  285. package/components/ix-row.d.ts +11 -0
  286. package/components/ix-row.js +35 -0
  287. package/components/ix-row.js.map +1 -0
  288. package/components/ix-select-item.d.ts +11 -0
  289. package/components/ix-select-item.js +8 -0
  290. package/components/ix-select-item.js.map +1 -0
  291. package/components/ix-select.d.ts +11 -0
  292. package/components/ix-select.js +8 -0
  293. package/components/ix-select.js.map +1 -0
  294. package/components/ix-slider.d.ts +11 -0
  295. package/components/ix-slider.js +192 -0
  296. package/components/ix-slider.js.map +1 -0
  297. package/components/ix-spinner.d.ts +11 -0
  298. package/components/ix-spinner.js +8 -0
  299. package/components/ix-spinner.js.map +1 -0
  300. package/components/ix-split-button-item.d.ts +11 -0
  301. package/components/ix-split-button-item.js +51 -0
  302. package/components/ix-split-button-item.js.map +1 -0
  303. package/components/ix-split-button.d.ts +11 -0
  304. package/components/ix-split-button.js +97 -0
  305. package/components/ix-split-button.js.map +1 -0
  306. package/components/ix-tab-item.d.ts +11 -0
  307. package/components/ix-tab-item.js +8 -0
  308. package/components/ix-tab-item.js.map +1 -0
  309. package/components/ix-tabs.d.ts +11 -0
  310. package/components/ix-tabs.js +8 -0
  311. package/components/ix-tabs.js.map +1 -0
  312. package/components/ix-tile.d.ts +11 -0
  313. package/components/ix-tile.js +59 -0
  314. package/components/ix-tile.js.map +1 -0
  315. package/components/ix-time-picker.d.ts +11 -0
  316. package/components/ix-time-picker.js +8 -0
  317. package/components/ix-time-picker.js.map +1 -0
  318. package/components/ix-toast-container.d.ts +11 -0
  319. package/components/ix-toast-container.js +124 -0
  320. package/components/ix-toast-container.js.map +1 -0
  321. package/components/ix-toast.d.ts +11 -0
  322. package/components/ix-toast.js +8 -0
  323. package/components/ix-toast.js.map +1 -0
  324. package/components/ix-toggle-button.d.ts +11 -0
  325. package/components/ix-toggle-button.js +105 -0
  326. package/components/ix-toggle-button.js.map +1 -0
  327. package/components/ix-toggle.d.ts +11 -0
  328. package/components/ix-toggle.js +62 -0
  329. package/components/ix-toggle.js.map +1 -0
  330. package/components/ix-tooltip.d.ts +11 -0
  331. package/components/ix-tooltip.js +8 -0
  332. package/components/ix-tooltip.js.map +1 -0
  333. package/components/ix-tree-item.d.ts +11 -0
  334. package/components/ix-tree-item.js +8 -0
  335. package/components/ix-tree-item.js.map +1 -0
  336. package/components/ix-tree.d.ts +11 -0
  337. package/components/ix-tree.js +727 -0
  338. package/components/ix-tree.js.map +1 -0
  339. package/components/ix-typography.d.ts +11 -0
  340. package/components/ix-typography.js +8 -0
  341. package/components/ix-typography.js.map +1 -0
  342. package/components/ix-upload.d.ts +11 -0
  343. package/components/ix-upload.js +147 -0
  344. package/components/ix-upload.js.map +1 -0
  345. package/components/ix-validation-tooltip.d.ts +11 -0
  346. package/components/ix-validation-tooltip.js +170 -0
  347. package/components/ix-validation-tooltip.js.map +1 -0
  348. package/components/ix-workflow-step.d.ts +11 -0
  349. package/components/ix-workflow-step.js +120 -0
  350. package/components/ix-workflow-step.js.map +1 -0
  351. package/components/ix-workflow-steps.d.ts +11 -0
  352. package/components/ix-workflow-steps.js +99 -0
  353. package/components/ix-workflow-steps.js.map +1 -0
  354. package/components/logical-filter-operator.js +35 -0
  355. package/components/logical-filter-operator.js.map +1 -0
  356. package/components/luxon.js +7828 -0
  357. package/components/luxon.js.map +1 -0
  358. package/components/map-navigation-overlay.js +89 -0
  359. package/components/map-navigation-overlay.js.map +1 -0
  360. package/components/menu-avatar-item.js +45 -0
  361. package/components/menu-avatar-item.js.map +1 -0
  362. package/components/menu-item.js +92 -0
  363. package/components/menu-item.js.map +1 -0
  364. package/components/menu-service.js +156 -0
  365. package/components/menu-service.js.map +1 -0
  366. package/components/modal.js +245 -0
  367. package/components/modal.js.map +1 -0
  368. package/components/mutation-observer.js +13 -0
  369. package/components/mutation-observer.js.map +1 -0
  370. package/components/my-component.d.ts +11 -0
  371. package/components/my-component.js +34 -0
  372. package/components/my-component.js.map +1 -0
  373. package/components/package.json +8 -0
  374. package/components/rwd.util.js +41 -0
  375. package/components/rwd.util.js.map +1 -0
  376. package/components/select-item.js +92 -0
  377. package/components/select-item.js.map +1 -0
  378. package/components/select.js +410 -0
  379. package/components/select.js.map +1 -0
  380. package/components/shadow-dom.js +21 -0
  381. package/components/shadow-dom.js.map +1 -0
  382. package/components/spinner.js +48 -0
  383. package/components/spinner.js.map +1 -0
  384. package/components/tab-item.js +87 -0
  385. package/components/tab-item.js.map +1 -0
  386. package/components/tabs.js +227 -0
  387. package/components/tabs.js.map +1 -0
  388. package/components/theme-switcher.js +123 -0
  389. package/components/theme-switcher.js.map +1 -0
  390. package/components/time-picker.js +252 -0
  391. package/components/time-picker.js.map +1 -0
  392. package/components/toast.js +105 -0
  393. package/components/toast.js.map +1 -0
  394. package/components/tooltip.js +197 -0
  395. package/components/tooltip.js.map +1 -0
  396. package/components/tree-item.js +51 -0
  397. package/components/tree-item.js.map +1 -0
  398. package/components/typed-event.js +46 -0
  399. package/components/typed-event.js.map +1 -0
  400. package/components/typography.js +76 -0
  401. package/components/typography.js.map +1 -0
  402. package/components/upload-file-state.js +19 -0
  403. package/components/upload-file-state.js.map +1 -0
  404. package/package.json +1 -1
@@ -0,0 +1,1311 @@
1
+ /*
2
+ * anime.js v3.2.1
3
+ * (c) 2020 Julian Garnier
4
+ * Released under the MIT license
5
+ * animejs.com
6
+ */
7
+
8
+ // Defaults
9
+
10
+ var defaultInstanceSettings = {
11
+ update: null,
12
+ begin: null,
13
+ loopBegin: null,
14
+ changeBegin: null,
15
+ change: null,
16
+ changeComplete: null,
17
+ loopComplete: null,
18
+ complete: null,
19
+ loop: 1,
20
+ direction: 'normal',
21
+ autoplay: true,
22
+ timelineOffset: 0
23
+ };
24
+
25
+ var defaultTweenSettings = {
26
+ duration: 1000,
27
+ delay: 0,
28
+ endDelay: 0,
29
+ easing: 'easeOutElastic(1, .5)',
30
+ round: 0
31
+ };
32
+
33
+ var validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective', 'matrix', 'matrix3d'];
34
+
35
+ // Caching
36
+
37
+ var cache = {
38
+ CSS: {},
39
+ springs: {}
40
+ };
41
+
42
+ // Utils
43
+
44
+ function minMax(val, min, max) {
45
+ return Math.min(Math.max(val, min), max);
46
+ }
47
+
48
+ function stringContains(str, text) {
49
+ return str.indexOf(text) > -1;
50
+ }
51
+
52
+ function applyArguments(func, args) {
53
+ return func.apply(null, args);
54
+ }
55
+
56
+ var is = {
57
+ arr: function (a) { return Array.isArray(a); },
58
+ obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },
59
+ pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },
60
+ svg: function (a) { return a instanceof SVGElement; },
61
+ inp: function (a) { return a instanceof HTMLInputElement; },
62
+ dom: function (a) { return a.nodeType || is.svg(a); },
63
+ str: function (a) { return typeof a === 'string'; },
64
+ fnc: function (a) { return typeof a === 'function'; },
65
+ und: function (a) { return typeof a === 'undefined'; },
66
+ nil: function (a) { return is.und(a) || a === null; },
67
+ hex: function (a) { return /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(a); },
68
+ rgb: function (a) { return /^rgb/.test(a); },
69
+ hsl: function (a) { return /^hsl/.test(a); },
70
+ col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },
71
+ key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; },
72
+ };
73
+
74
+ // Easings
75
+
76
+ function parseEasingParameters(string) {
77
+ var match = /\(([^)]+)\)/.exec(string);
78
+ return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];
79
+ }
80
+
81
+ // Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js
82
+
83
+ function spring(string, duration) {
84
+
85
+ var params = parseEasingParameters(string);
86
+ var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);
87
+ var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);
88
+ var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);
89
+ var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);
90
+ var w0 = Math.sqrt(stiffness / mass);
91
+ var zeta = damping / (2 * Math.sqrt(stiffness * mass));
92
+ var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;
93
+ var a = 1;
94
+ var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;
95
+
96
+ function solver(t) {
97
+ var progress = duration ? (duration * t) / 1000 : t;
98
+ if (zeta < 1) {
99
+ progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));
100
+ } else {
101
+ progress = (a + b * progress) * Math.exp(-progress * w0);
102
+ }
103
+ if (t === 0 || t === 1) { return t; }
104
+ return 1 - progress;
105
+ }
106
+
107
+ function getDuration() {
108
+ var cached = cache.springs[string];
109
+ if (cached) { return cached; }
110
+ var frame = 1/6;
111
+ var elapsed = 0;
112
+ var rest = 0;
113
+ while(true) {
114
+ elapsed += frame;
115
+ if (solver(elapsed) === 1) {
116
+ rest++;
117
+ if (rest >= 16) { break; }
118
+ } else {
119
+ rest = 0;
120
+ }
121
+ }
122
+ var duration = elapsed * frame * 1000;
123
+ cache.springs[string] = duration;
124
+ return duration;
125
+ }
126
+
127
+ return duration ? solver : getDuration;
128
+
129
+ }
130
+
131
+ // Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function
132
+
133
+ function steps(steps) {
134
+ if ( steps === void 0 ) steps = 10;
135
+
136
+ return function (t) { return Math.ceil((minMax(t, 0.000001, 1)) * steps) * (1 / steps); };
137
+ }
138
+
139
+ // BezierEasing https://github.com/gre/bezier-easing
140
+
141
+ var bezier = (function () {
142
+
143
+ var kSplineTableSize = 11;
144
+ var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);
145
+
146
+ function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }
147
+ function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }
148
+ function C(aA1) { return 3.0 * aA1 }
149
+
150
+ function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }
151
+ function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }
152
+
153
+ function binarySubdivide(aX, aA, aB, mX1, mX2) {
154
+ var currentX, currentT, i = 0;
155
+ do {
156
+ currentT = aA + (aB - aA) / 2.0;
157
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
158
+ if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }
159
+ } while (Math.abs(currentX) > 0.0000001 && ++i < 10);
160
+ return currentT;
161
+ }
162
+
163
+ function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {
164
+ for (var i = 0; i < 4; ++i) {
165
+ var currentSlope = getSlope(aGuessT, mX1, mX2);
166
+ if (currentSlope === 0.0) { return aGuessT; }
167
+ var currentX = calcBezier(aGuessT, mX1, mX2) - aX;
168
+ aGuessT -= currentX / currentSlope;
169
+ }
170
+ return aGuessT;
171
+ }
172
+
173
+ function bezier(mX1, mY1, mX2, mY2) {
174
+
175
+ if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }
176
+ var sampleValues = new Float32Array(kSplineTableSize);
177
+
178
+ if (mX1 !== mY1 || mX2 !== mY2) {
179
+ for (var i = 0; i < kSplineTableSize; ++i) {
180
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
181
+ }
182
+ }
183
+
184
+ function getTForX(aX) {
185
+
186
+ var intervalStart = 0;
187
+ var currentSample = 1;
188
+ var lastSample = kSplineTableSize - 1;
189
+
190
+ for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
191
+ intervalStart += kSampleStepSize;
192
+ }
193
+
194
+ --currentSample;
195
+
196
+ var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
197
+ var guessForT = intervalStart + dist * kSampleStepSize;
198
+ var initialSlope = getSlope(guessForT, mX1, mX2);
199
+
200
+ if (initialSlope >= 0.001) {
201
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
202
+ } else if (initialSlope === 0.0) {
203
+ return guessForT;
204
+ } else {
205
+ return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);
206
+ }
207
+
208
+ }
209
+
210
+ return function (x) {
211
+ if (mX1 === mY1 && mX2 === mY2) { return x; }
212
+ if (x === 0 || x === 1) { return x; }
213
+ return calcBezier(getTForX(x), mY1, mY2);
214
+ }
215
+
216
+ }
217
+
218
+ return bezier;
219
+
220
+ })();
221
+
222
+ var penner = (function () {
223
+
224
+ // Based on jQuery UI's implemenation of easing equations from Robert Penner (http://www.robertpenner.com/easing)
225
+
226
+ var eases = { linear: function () { return function (t) { return t; }; } };
227
+
228
+ var functionEasings = {
229
+ Sine: function () { return function (t) { return 1 - Math.cos(t * Math.PI / 2); }; },
230
+ Circ: function () { return function (t) { return 1 - Math.sqrt(1 - t * t); }; },
231
+ Back: function () { return function (t) { return t * t * (3 * t - 2); }; },
232
+ Bounce: function () { return function (t) {
233
+ var pow2, b = 4;
234
+ while (t < (( pow2 = Math.pow(2, --b)) - 1) / 11) {}
235
+ return 1 / Math.pow(4, 3 - b) - 7.5625 * Math.pow(( pow2 * 3 - 2 ) / 22 - t, 2)
236
+ }; },
237
+ Elastic: function (amplitude, period) {
238
+ if ( amplitude === void 0 ) amplitude = 1;
239
+ if ( period === void 0 ) period = .5;
240
+
241
+ var a = minMax(amplitude, 1, 10);
242
+ var p = minMax(period, .1, 2);
243
+ return function (t) {
244
+ return (t === 0 || t === 1) ? t :
245
+ -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);
246
+ }
247
+ }
248
+ };
249
+
250
+ var baseEasings = ['Quad', 'Cubic', 'Quart', 'Quint', 'Expo'];
251
+
252
+ baseEasings.forEach(function (name, i) {
253
+ functionEasings[name] = function () { return function (t) { return Math.pow(t, i + 2); }; };
254
+ });
255
+
256
+ Object.keys(functionEasings).forEach(function (name) {
257
+ var easeIn = functionEasings[name];
258
+ eases['easeIn' + name] = easeIn;
259
+ eases['easeOut' + name] = function (a, b) { return function (t) { return 1 - easeIn(a, b)(1 - t); }; };
260
+ eases['easeInOut' + name] = function (a, b) { return function (t) { return t < 0.5 ? easeIn(a, b)(t * 2) / 2 :
261
+ 1 - easeIn(a, b)(t * -2 + 2) / 2; }; };
262
+ eases['easeOutIn' + name] = function (a, b) { return function (t) { return t < 0.5 ? (1 - easeIn(a, b)(1 - t * 2)) / 2 :
263
+ (easeIn(a, b)(t * 2 - 1) + 1) / 2; }; };
264
+ });
265
+
266
+ return eases;
267
+
268
+ })();
269
+
270
+ function parseEasings(easing, duration) {
271
+ if (is.fnc(easing)) { return easing; }
272
+ var name = easing.split('(')[0];
273
+ var ease = penner[name];
274
+ var args = parseEasingParameters(easing);
275
+ switch (name) {
276
+ case 'spring' : return spring(easing, duration);
277
+ case 'cubicBezier' : return applyArguments(bezier, args);
278
+ case 'steps' : return applyArguments(steps, args);
279
+ default : return applyArguments(ease, args);
280
+ }
281
+ }
282
+
283
+ // Strings
284
+
285
+ function selectString(str) {
286
+ try {
287
+ var nodes = document.querySelectorAll(str);
288
+ return nodes;
289
+ } catch(e) {
290
+ return;
291
+ }
292
+ }
293
+
294
+ // Arrays
295
+
296
+ function filterArray(arr, callback) {
297
+ var len = arr.length;
298
+ var thisArg = arguments.length >= 2 ? arguments[1] : void 0;
299
+ var result = [];
300
+ for (var i = 0; i < len; i++) {
301
+ if (i in arr) {
302
+ var val = arr[i];
303
+ if (callback.call(thisArg, val, i, arr)) {
304
+ result.push(val);
305
+ }
306
+ }
307
+ }
308
+ return result;
309
+ }
310
+
311
+ function flattenArray(arr) {
312
+ return arr.reduce(function (a, b) { return a.concat(is.arr(b) ? flattenArray(b) : b); }, []);
313
+ }
314
+
315
+ function toArray(o) {
316
+ if (is.arr(o)) { return o; }
317
+ if (is.str(o)) { o = selectString(o) || o; }
318
+ if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }
319
+ return [o];
320
+ }
321
+
322
+ function arrayContains(arr, val) {
323
+ return arr.some(function (a) { return a === val; });
324
+ }
325
+
326
+ // Objects
327
+
328
+ function cloneObject(o) {
329
+ var clone = {};
330
+ for (var p in o) { clone[p] = o[p]; }
331
+ return clone;
332
+ }
333
+
334
+ function replaceObjectProps(o1, o2) {
335
+ var o = cloneObject(o1);
336
+ for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }
337
+ return o;
338
+ }
339
+
340
+ function mergeObjects(o1, o2) {
341
+ var o = cloneObject(o1);
342
+ for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }
343
+ return o;
344
+ }
345
+
346
+ // Colors
347
+
348
+ function rgbToRgba(rgbValue) {
349
+ var rgb = /rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(rgbValue);
350
+ return rgb ? ("rgba(" + (rgb[1]) + ",1)") : rgbValue;
351
+ }
352
+
353
+ function hexToRgba(hexValue) {
354
+ var rgx = /^#?([a-f\d])([a-f\d])([a-f\d])$/i;
355
+ var hex = hexValue.replace(rgx, function (m, r, g, b) { return r + r + g + g + b + b; } );
356
+ var rgb = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
357
+ var r = parseInt(rgb[1], 16);
358
+ var g = parseInt(rgb[2], 16);
359
+ var b = parseInt(rgb[3], 16);
360
+ return ("rgba(" + r + "," + g + "," + b + ",1)");
361
+ }
362
+
363
+ function hslToRgba(hslValue) {
364
+ var hsl = /hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(hslValue) || /hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(hslValue);
365
+ var h = parseInt(hsl[1], 10) / 360;
366
+ var s = parseInt(hsl[2], 10) / 100;
367
+ var l = parseInt(hsl[3], 10) / 100;
368
+ var a = hsl[4] || 1;
369
+ function hue2rgb(p, q, t) {
370
+ if (t < 0) { t += 1; }
371
+ if (t > 1) { t -= 1; }
372
+ if (t < 1/6) { return p + (q - p) * 6 * t; }
373
+ if (t < 1/2) { return q; }
374
+ if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }
375
+ return p;
376
+ }
377
+ var r, g, b;
378
+ if (s == 0) {
379
+ r = g = b = l;
380
+ } else {
381
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
382
+ var p = 2 * l - q;
383
+ r = hue2rgb(p, q, h + 1/3);
384
+ g = hue2rgb(p, q, h);
385
+ b = hue2rgb(p, q, h - 1/3);
386
+ }
387
+ return ("rgba(" + (r * 255) + "," + (g * 255) + "," + (b * 255) + "," + a + ")");
388
+ }
389
+
390
+ function colorToRgb(val) {
391
+ if (is.rgb(val)) { return rgbToRgba(val); }
392
+ if (is.hex(val)) { return hexToRgba(val); }
393
+ if (is.hsl(val)) { return hslToRgba(val); }
394
+ }
395
+
396
+ // Units
397
+
398
+ function getUnit(val) {
399
+ var split = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(val);
400
+ if (split) { return split[1]; }
401
+ }
402
+
403
+ function getTransformUnit(propName) {
404
+ if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }
405
+ if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }
406
+ }
407
+
408
+ // Values
409
+
410
+ function getFunctionValue(val, animatable) {
411
+ if (!is.fnc(val)) { return val; }
412
+ return val(animatable.target, animatable.id, animatable.total);
413
+ }
414
+
415
+ function getAttribute(el, prop) {
416
+ return el.getAttribute(prop);
417
+ }
418
+
419
+ function convertPxToUnit(el, value, unit) {
420
+ var valueUnit = getUnit(value);
421
+ if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }
422
+ var cached = cache.CSS[value + unit];
423
+ if (!is.und(cached)) { return cached; }
424
+ var baseline = 100;
425
+ var tempEl = document.createElement(el.tagName);
426
+ var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;
427
+ parentEl.appendChild(tempEl);
428
+ tempEl.style.position = 'absolute';
429
+ tempEl.style.width = baseline + unit;
430
+ var factor = baseline / tempEl.offsetWidth;
431
+ parentEl.removeChild(tempEl);
432
+ var convertedUnit = factor * parseFloat(value);
433
+ cache.CSS[value + unit] = convertedUnit;
434
+ return convertedUnit;
435
+ }
436
+
437
+ function getCSSValue(el, prop, unit) {
438
+ if (prop in el.style) {
439
+ var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
440
+ var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';
441
+ return unit ? convertPxToUnit(el, value, unit) : value;
442
+ }
443
+ }
444
+
445
+ function getAnimationType(el, prop) {
446
+ if (is.dom(el) && !is.inp(el) && (!is.nil(getAttribute(el, prop)) || (is.svg(el) && el[prop]))) { return 'attribute'; }
447
+ if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }
448
+ if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }
449
+ if (el[prop] != null) { return 'object'; }
450
+ }
451
+
452
+ function getElementTransforms(el) {
453
+ if (!is.dom(el)) { return; }
454
+ var str = el.style.transform || '';
455
+ var reg = /(\w+)\(([^)]*)\)/g;
456
+ var transforms = new Map();
457
+ var m; while (m = reg.exec(str)) { transforms.set(m[1], m[2]); }
458
+ return transforms;
459
+ }
460
+
461
+ function getTransformValue(el, propName, animatable, unit) {
462
+ var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);
463
+ var value = getElementTransforms(el).get(propName) || defaultVal;
464
+ if (animatable) {
465
+ animatable.transforms.list.set(propName, value);
466
+ animatable.transforms['last'] = propName;
467
+ }
468
+ return unit ? convertPxToUnit(el, value, unit) : value;
469
+ }
470
+
471
+ function getOriginalTargetValue(target, propName, unit, animatable) {
472
+ switch (getAnimationType(target, propName)) {
473
+ case 'transform': return getTransformValue(target, propName, animatable, unit);
474
+ case 'css': return getCSSValue(target, propName, unit);
475
+ case 'attribute': return getAttribute(target, propName);
476
+ default: return target[propName] || 0;
477
+ }
478
+ }
479
+
480
+ function getRelativeValue(to, from) {
481
+ var operator = /^(\*=|\+=|-=)/.exec(to);
482
+ if (!operator) { return to; }
483
+ var u = getUnit(to) || 0;
484
+ var x = parseFloat(from);
485
+ var y = parseFloat(to.replace(operator[0], ''));
486
+ switch (operator[0][0]) {
487
+ case '+': return x + y + u;
488
+ case '-': return x - y + u;
489
+ case '*': return x * y + u;
490
+ }
491
+ }
492
+
493
+ function validateValue(val, unit) {
494
+ if (is.col(val)) { return colorToRgb(val); }
495
+ if (/\s/g.test(val)) { return val; }
496
+ var originalUnit = getUnit(val);
497
+ var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;
498
+ if (unit) { return unitLess + unit; }
499
+ return unitLess;
500
+ }
501
+
502
+ // getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes
503
+ // adapted from https://gist.github.com/SebLambla/3e0550c496c236709744
504
+
505
+ function getDistance(p1, p2) {
506
+ return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));
507
+ }
508
+
509
+ function getCircleLength(el) {
510
+ return Math.PI * 2 * getAttribute(el, 'r');
511
+ }
512
+
513
+ function getRectLength(el) {
514
+ return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);
515
+ }
516
+
517
+ function getLineLength(el) {
518
+ return getDistance(
519
+ {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},
520
+ {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}
521
+ );
522
+ }
523
+
524
+ function getPolylineLength(el) {
525
+ var points = el.points;
526
+ var totalLength = 0;
527
+ var previousPos;
528
+ for (var i = 0 ; i < points.numberOfItems; i++) {
529
+ var currentPos = points.getItem(i);
530
+ if (i > 0) { totalLength += getDistance(previousPos, currentPos); }
531
+ previousPos = currentPos;
532
+ }
533
+ return totalLength;
534
+ }
535
+
536
+ function getPolygonLength(el) {
537
+ var points = el.points;
538
+ return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));
539
+ }
540
+
541
+ // Path animation
542
+
543
+ function getTotalLength(el) {
544
+ if (el.getTotalLength) { return el.getTotalLength(); }
545
+ switch(el.tagName.toLowerCase()) {
546
+ case 'circle': return getCircleLength(el);
547
+ case 'rect': return getRectLength(el);
548
+ case 'line': return getLineLength(el);
549
+ case 'polyline': return getPolylineLength(el);
550
+ case 'polygon': return getPolygonLength(el);
551
+ }
552
+ }
553
+
554
+ function setDashoffset(el) {
555
+ var pathLength = getTotalLength(el);
556
+ el.setAttribute('stroke-dasharray', pathLength);
557
+ return pathLength;
558
+ }
559
+
560
+ // Motion path
561
+
562
+ function getParentSvgEl(el) {
563
+ var parentEl = el.parentNode;
564
+ while (is.svg(parentEl)) {
565
+ if (!is.svg(parentEl.parentNode)) { break; }
566
+ parentEl = parentEl.parentNode;
567
+ }
568
+ return parentEl;
569
+ }
570
+
571
+ function getParentSvg(pathEl, svgData) {
572
+ var svg = svgData || {};
573
+ var parentSvgEl = svg.el || getParentSvgEl(pathEl);
574
+ var rect = parentSvgEl.getBoundingClientRect();
575
+ var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');
576
+ var width = rect.width;
577
+ var height = rect.height;
578
+ var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);
579
+ return {
580
+ el: parentSvgEl,
581
+ viewBox: viewBox,
582
+ x: viewBox[0] / 1,
583
+ y: viewBox[1] / 1,
584
+ w: width,
585
+ h: height,
586
+ vW: viewBox[2],
587
+ vH: viewBox[3]
588
+ }
589
+ }
590
+
591
+ function getPath(path, percent) {
592
+ var pathEl = is.str(path) ? selectString(path)[0] : path;
593
+ var p = percent || 100;
594
+ return function(property) {
595
+ return {
596
+ property: property,
597
+ el: pathEl,
598
+ svg: getParentSvg(pathEl),
599
+ totalLength: getTotalLength(pathEl) * (p / 100)
600
+ }
601
+ }
602
+ }
603
+
604
+ function getPathProgress(path, progress, isPathTargetInsideSVG) {
605
+ function point(offset) {
606
+ if ( offset === void 0 ) offset = 0;
607
+
608
+ var l = progress + offset >= 1 ? progress + offset : 0;
609
+ return path.el.getPointAtLength(l);
610
+ }
611
+ var svg = getParentSvg(path.el, path.svg);
612
+ var p = point();
613
+ var p0 = point(-1);
614
+ var p1 = point(+1);
615
+ var scaleX = isPathTargetInsideSVG ? 1 : svg.w / svg.vW;
616
+ var scaleY = isPathTargetInsideSVG ? 1 : svg.h / svg.vH;
617
+ switch (path.property) {
618
+ case 'x': return (p.x - svg.x) * scaleX;
619
+ case 'y': return (p.y - svg.y) * scaleY;
620
+ case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
621
+ }
622
+ }
623
+
624
+ // Decompose value
625
+
626
+ function decomposeValue(val, unit) {
627
+ // const rgx = /-?\d*\.?\d+/g; // handles basic numbers
628
+ // const rgx = /[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
629
+ var rgx = /[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g; // handles exponents notation
630
+ var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';
631
+ return {
632
+ original: value,
633
+ numbers: value.match(rgx) ? value.match(rgx).map(Number) : [0],
634
+ strings: (is.str(val) || unit) ? value.split(rgx) : []
635
+ }
636
+ }
637
+
638
+ // Animatables
639
+
640
+ function parseTargets(targets) {
641
+ var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];
642
+ return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });
643
+ }
644
+
645
+ function getAnimatables(targets) {
646
+ var parsed = parseTargets(targets);
647
+ return parsed.map(function (t, i) {
648
+ return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };
649
+ });
650
+ }
651
+
652
+ // Properties
653
+
654
+ function normalizePropertyTweens(prop, tweenSettings) {
655
+ var settings = cloneObject(tweenSettings);
656
+ // Override duration if easing is a spring
657
+ if (/^spring/.test(settings.easing)) { settings.duration = spring(settings.easing); }
658
+ if (is.arr(prop)) {
659
+ var l = prop.length;
660
+ var isFromTo = (l === 2 && !is.obj(prop[0]));
661
+ if (!isFromTo) {
662
+ // Duration divided by the number of tweens
663
+ if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }
664
+ } else {
665
+ // Transform [from, to] values shorthand to a valid tween value
666
+ prop = {value: prop};
667
+ }
668
+ }
669
+ var propArray = is.arr(prop) ? prop : [prop];
670
+ return propArray.map(function (v, i) {
671
+ var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};
672
+ // Default delay value should only be applied to the first tween
673
+ if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }
674
+ // Default endDelay value should only be applied to the last tween
675
+ if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }
676
+ return obj;
677
+ }).map(function (k) { return mergeObjects(k, settings); });
678
+ }
679
+
680
+
681
+ function flattenKeyframes(keyframes) {
682
+ var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })
683
+ .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);
684
+ var properties = {};
685
+ var loop = function ( i ) {
686
+ var propName = propertyNames[i];
687
+ properties[propName] = keyframes.map(function (key) {
688
+ var newKey = {};
689
+ for (var p in key) {
690
+ if (is.key(p)) {
691
+ if (p == propName) { newKey.value = key[p]; }
692
+ } else {
693
+ newKey[p] = key[p];
694
+ }
695
+ }
696
+ return newKey;
697
+ });
698
+ };
699
+
700
+ for (var i = 0; i < propertyNames.length; i++) loop( i );
701
+ return properties;
702
+ }
703
+
704
+ function getProperties(tweenSettings, params) {
705
+ var properties = [];
706
+ var keyframes = params.keyframes;
707
+ if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }
708
+ for (var p in params) {
709
+ if (is.key(p)) {
710
+ properties.push({
711
+ name: p,
712
+ tweens: normalizePropertyTweens(params[p], tweenSettings)
713
+ });
714
+ }
715
+ }
716
+ return properties;
717
+ }
718
+
719
+ // Tweens
720
+
721
+ function normalizeTweenValues(tween, animatable) {
722
+ var t = {};
723
+ for (var p in tween) {
724
+ var value = getFunctionValue(tween[p], animatable);
725
+ if (is.arr(value)) {
726
+ value = value.map(function (v) { return getFunctionValue(v, animatable); });
727
+ if (value.length === 1) { value = value[0]; }
728
+ }
729
+ t[p] = value;
730
+ }
731
+ t.duration = parseFloat(t.duration);
732
+ t.delay = parseFloat(t.delay);
733
+ return t;
734
+ }
735
+
736
+ function normalizeTweens(prop, animatable) {
737
+ var previousTween;
738
+ return prop.tweens.map(function (t) {
739
+ var tween = normalizeTweenValues(t, animatable);
740
+ var tweenValue = tween.value;
741
+ var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;
742
+ var toUnit = getUnit(to);
743
+ var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);
744
+ var previousValue = previousTween ? previousTween.to.original : originalValue;
745
+ var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;
746
+ var fromUnit = getUnit(from) || getUnit(originalValue);
747
+ var unit = toUnit || fromUnit;
748
+ if (is.und(to)) { to = previousValue; }
749
+ tween.from = decomposeValue(from, unit);
750
+ tween.to = decomposeValue(getRelativeValue(to, from), unit);
751
+ tween.start = previousTween ? previousTween.end : 0;
752
+ tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;
753
+ tween.easing = parseEasings(tween.easing, tween.duration);
754
+ tween.isPath = is.pth(tweenValue);
755
+ tween.isPathTargetInsideSVG = tween.isPath && is.svg(animatable.target);
756
+ tween.isColor = is.col(tween.from.original);
757
+ if (tween.isColor) { tween.round = 1; }
758
+ previousTween = tween;
759
+ return tween;
760
+ });
761
+ }
762
+
763
+ // Tween progress
764
+
765
+ var setProgressValue = {
766
+ css: function (t, p, v) { return t.style[p] = v; },
767
+ attribute: function (t, p, v) { return t.setAttribute(p, v); },
768
+ object: function (t, p, v) { return t[p] = v; },
769
+ transform: function (t, p, v, transforms, manual) {
770
+ transforms.list.set(p, v);
771
+ if (p === transforms.last || manual) {
772
+ var str = '';
773
+ transforms.list.forEach(function (value, prop) { str += prop + "(" + value + ") "; });
774
+ t.style.transform = str;
775
+ }
776
+ }
777
+ };
778
+
779
+ // Set Value helper
780
+
781
+ function setTargetsValue(targets, properties) {
782
+ var animatables = getAnimatables(targets);
783
+ animatables.forEach(function (animatable) {
784
+ for (var property in properties) {
785
+ var value = getFunctionValue(properties[property], animatable);
786
+ var target = animatable.target;
787
+ var valueUnit = getUnit(value);
788
+ var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);
789
+ var unit = valueUnit || getUnit(originalValue);
790
+ var to = getRelativeValue(validateValue(value, unit), originalValue);
791
+ var animType = getAnimationType(target, property);
792
+ setProgressValue[animType](target, property, to, animatable.transforms, true);
793
+ }
794
+ });
795
+ }
796
+
797
+ // Animations
798
+
799
+ function createAnimation(animatable, prop) {
800
+ var animType = getAnimationType(animatable.target, prop.name);
801
+ if (animType) {
802
+ var tweens = normalizeTweens(prop, animatable);
803
+ var lastTween = tweens[tweens.length - 1];
804
+ return {
805
+ type: animType,
806
+ property: prop.name,
807
+ animatable: animatable,
808
+ tweens: tweens,
809
+ duration: lastTween.end,
810
+ delay: tweens[0].delay,
811
+ endDelay: lastTween.endDelay
812
+ }
813
+ }
814
+ }
815
+
816
+ function getAnimations(animatables, properties) {
817
+ return filterArray(flattenArray(animatables.map(function (animatable) {
818
+ return properties.map(function (prop) {
819
+ return createAnimation(animatable, prop);
820
+ });
821
+ })), function (a) { return !is.und(a); });
822
+ }
823
+
824
+ // Create Instance
825
+
826
+ function getInstanceTimings(animations, tweenSettings) {
827
+ var animLength = animations.length;
828
+ var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };
829
+ var timings = {};
830
+ timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;
831
+ timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;
832
+ timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;
833
+ return timings;
834
+ }
835
+
836
+ var instanceID = 0;
837
+
838
+ function createNewInstance(params) {
839
+ var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);
840
+ var tweenSettings = replaceObjectProps(defaultTweenSettings, params);
841
+ var properties = getProperties(tweenSettings, params);
842
+ var animatables = getAnimatables(params.targets);
843
+ var animations = getAnimations(animatables, properties);
844
+ var timings = getInstanceTimings(animations, tweenSettings);
845
+ var id = instanceID;
846
+ instanceID++;
847
+ return mergeObjects(instanceSettings, {
848
+ id: id,
849
+ children: [],
850
+ animatables: animatables,
851
+ animations: animations,
852
+ duration: timings.duration,
853
+ delay: timings.delay,
854
+ endDelay: timings.endDelay
855
+ });
856
+ }
857
+
858
+ // Core
859
+
860
+ var activeInstances = [];
861
+
862
+ var engine = (function () {
863
+ var raf;
864
+
865
+ function play() {
866
+ if (!raf && (!isDocumentHidden() || !anime.suspendWhenDocumentHidden) && activeInstances.length > 0) {
867
+ raf = requestAnimationFrame(step);
868
+ }
869
+ }
870
+ function step(t) {
871
+ // memo on algorithm issue:
872
+ // dangerous iteration over mutable `activeInstances`
873
+ // (that collection may be updated from within callbacks of `tick`-ed animation instances)
874
+ var activeInstancesLength = activeInstances.length;
875
+ var i = 0;
876
+ while (i < activeInstancesLength) {
877
+ var activeInstance = activeInstances[i];
878
+ if (!activeInstance.paused) {
879
+ activeInstance.tick(t);
880
+ i++;
881
+ } else {
882
+ activeInstances.splice(i, 1);
883
+ activeInstancesLength--;
884
+ }
885
+ }
886
+ raf = i > 0 ? requestAnimationFrame(step) : undefined;
887
+ }
888
+
889
+ function handleVisibilityChange() {
890
+ if (!anime.suspendWhenDocumentHidden) { return; }
891
+
892
+ if (isDocumentHidden()) {
893
+ // suspend ticks
894
+ raf = cancelAnimationFrame(raf);
895
+ } else { // is back to active tab
896
+ // first adjust animations to consider the time that ticks were suspended
897
+ activeInstances.forEach(
898
+ function (instance) { return instance ._onDocumentVisibility(); }
899
+ );
900
+ engine();
901
+ }
902
+ }
903
+ if (typeof document !== 'undefined') {
904
+ document.addEventListener('visibilitychange', handleVisibilityChange);
905
+ }
906
+
907
+ return play;
908
+ })();
909
+
910
+ function isDocumentHidden() {
911
+ return !!document && document.hidden;
912
+ }
913
+
914
+ // Public Instance
915
+
916
+ function anime(params) {
917
+ if ( params === void 0 ) params = {};
918
+
919
+
920
+ var startTime = 0, lastTime = 0, now = 0;
921
+ var children, childrenLength = 0;
922
+ var resolve = null;
923
+
924
+ function makePromise(instance) {
925
+ var promise = window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });
926
+ instance.finished = promise;
927
+ return promise;
928
+ }
929
+
930
+ var instance = createNewInstance(params);
931
+ makePromise(instance);
932
+
933
+ function toggleInstanceDirection() {
934
+ var direction = instance.direction;
935
+ if (direction !== 'alternate') {
936
+ instance.direction = direction !== 'normal' ? 'normal' : 'reverse';
937
+ }
938
+ instance.reversed = !instance.reversed;
939
+ children.forEach(function (child) { return child.reversed = instance.reversed; });
940
+ }
941
+
942
+ function adjustTime(time) {
943
+ return instance.reversed ? instance.duration - time : time;
944
+ }
945
+
946
+ function resetTime() {
947
+ startTime = 0;
948
+ lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);
949
+ }
950
+
951
+ function seekChild(time, child) {
952
+ if (child) { child.seek(time - child.timelineOffset); }
953
+ }
954
+
955
+ function syncInstanceChildren(time) {
956
+ if (!instance.reversePlayback) {
957
+ for (var i = 0; i < childrenLength; i++) { seekChild(time, children[i]); }
958
+ } else {
959
+ for (var i$1 = childrenLength; i$1--;) { seekChild(time, children[i$1]); }
960
+ }
961
+ }
962
+
963
+ function setAnimationsProgress(insTime) {
964
+ var i = 0;
965
+ var animations = instance.animations;
966
+ var animationsLength = animations.length;
967
+ while (i < animationsLength) {
968
+ var anim = animations[i];
969
+ var animatable = anim.animatable;
970
+ var tweens = anim.tweens;
971
+ var tweenLength = tweens.length - 1;
972
+ var tween = tweens[tweenLength];
973
+ // Only check for keyframes if there is more than one tween
974
+ if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }
975
+ var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;
976
+ var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);
977
+ var strings = tween.to.strings;
978
+ var round = tween.round;
979
+ var numbers = [];
980
+ var toNumbersLength = tween.to.numbers.length;
981
+ var progress = (void 0);
982
+ for (var n = 0; n < toNumbersLength; n++) {
983
+ var value = (void 0);
984
+ var toNumber = tween.to.numbers[n];
985
+ var fromNumber = tween.from.numbers[n] || 0;
986
+ if (!tween.isPath) {
987
+ value = fromNumber + (eased * (toNumber - fromNumber));
988
+ } else {
989
+ value = getPathProgress(tween.value, eased * toNumber, tween.isPathTargetInsideSVG);
990
+ }
991
+ if (round) {
992
+ if (!(tween.isColor && n > 2)) {
993
+ value = Math.round(value * round) / round;
994
+ }
995
+ }
996
+ numbers.push(value);
997
+ }
998
+ // Manual Array.reduce for better performances
999
+ var stringsLength = strings.length;
1000
+ if (!stringsLength) {
1001
+ progress = numbers[0];
1002
+ } else {
1003
+ progress = strings[0];
1004
+ for (var s = 0; s < stringsLength; s++) {
1005
+ var b = strings[s + 1];
1006
+ var n$1 = numbers[s];
1007
+ if (!isNaN(n$1)) {
1008
+ if (!b) {
1009
+ progress += n$1 + ' ';
1010
+ } else {
1011
+ progress += n$1 + b;
1012
+ }
1013
+ }
1014
+ }
1015
+ }
1016
+ setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);
1017
+ anim.currentValue = progress;
1018
+ i++;
1019
+ }
1020
+ }
1021
+
1022
+ function setCallback(cb) {
1023
+ if (instance[cb] && !instance.passThrough) { instance[cb](instance); }
1024
+ }
1025
+
1026
+ function countIteration() {
1027
+ if (instance.remaining && instance.remaining !== true) {
1028
+ instance.remaining--;
1029
+ }
1030
+ }
1031
+
1032
+ function setInstanceProgress(engineTime) {
1033
+ var insDuration = instance.duration;
1034
+ var insDelay = instance.delay;
1035
+ var insEndDelay = insDuration - instance.endDelay;
1036
+ var insTime = adjustTime(engineTime);
1037
+ instance.progress = minMax((insTime / insDuration) * 100, 0, 100);
1038
+ instance.reversePlayback = insTime < instance.currentTime;
1039
+ if (children) { syncInstanceChildren(insTime); }
1040
+ if (!instance.began && instance.currentTime > 0) {
1041
+ instance.began = true;
1042
+ setCallback('begin');
1043
+ }
1044
+ if (!instance.loopBegan && instance.currentTime > 0) {
1045
+ instance.loopBegan = true;
1046
+ setCallback('loopBegin');
1047
+ }
1048
+ if (insTime <= insDelay && instance.currentTime !== 0) {
1049
+ setAnimationsProgress(0);
1050
+ }
1051
+ if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {
1052
+ setAnimationsProgress(insDuration);
1053
+ }
1054
+ if (insTime > insDelay && insTime < insEndDelay) {
1055
+ if (!instance.changeBegan) {
1056
+ instance.changeBegan = true;
1057
+ instance.changeCompleted = false;
1058
+ setCallback('changeBegin');
1059
+ }
1060
+ setCallback('change');
1061
+ setAnimationsProgress(insTime);
1062
+ } else {
1063
+ if (instance.changeBegan) {
1064
+ instance.changeCompleted = true;
1065
+ instance.changeBegan = false;
1066
+ setCallback('changeComplete');
1067
+ }
1068
+ }
1069
+ instance.currentTime = minMax(insTime, 0, insDuration);
1070
+ if (instance.began) { setCallback('update'); }
1071
+ if (engineTime >= insDuration) {
1072
+ lastTime = 0;
1073
+ countIteration();
1074
+ if (!instance.remaining) {
1075
+ instance.paused = true;
1076
+ if (!instance.completed) {
1077
+ instance.completed = true;
1078
+ setCallback('loopComplete');
1079
+ setCallback('complete');
1080
+ if (!instance.passThrough && 'Promise' in window) {
1081
+ resolve();
1082
+ makePromise(instance);
1083
+ }
1084
+ }
1085
+ } else {
1086
+ startTime = now;
1087
+ setCallback('loopComplete');
1088
+ instance.loopBegan = false;
1089
+ if (instance.direction === 'alternate') {
1090
+ toggleInstanceDirection();
1091
+ }
1092
+ }
1093
+ }
1094
+ }
1095
+
1096
+ instance.reset = function() {
1097
+ var direction = instance.direction;
1098
+ instance.passThrough = false;
1099
+ instance.currentTime = 0;
1100
+ instance.progress = 0;
1101
+ instance.paused = true;
1102
+ instance.began = false;
1103
+ instance.loopBegan = false;
1104
+ instance.changeBegan = false;
1105
+ instance.completed = false;
1106
+ instance.changeCompleted = false;
1107
+ instance.reversePlayback = false;
1108
+ instance.reversed = direction === 'reverse';
1109
+ instance.remaining = instance.loop;
1110
+ children = instance.children;
1111
+ childrenLength = children.length;
1112
+ for (var i = childrenLength; i--;) { instance.children[i].reset(); }
1113
+ if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }
1114
+ setAnimationsProgress(instance.reversed ? instance.duration : 0);
1115
+ };
1116
+
1117
+ // internal method (for engine) to adjust animation timings before restoring engine ticks (rAF)
1118
+ instance._onDocumentVisibility = resetTime;
1119
+
1120
+ // Set Value helper
1121
+
1122
+ instance.set = function(targets, properties) {
1123
+ setTargetsValue(targets, properties);
1124
+ return instance;
1125
+ };
1126
+
1127
+ instance.tick = function(t) {
1128
+ now = t;
1129
+ if (!startTime) { startTime = now; }
1130
+ setInstanceProgress((now + (lastTime - startTime)) * anime.speed);
1131
+ };
1132
+
1133
+ instance.seek = function(time) {
1134
+ setInstanceProgress(adjustTime(time));
1135
+ };
1136
+
1137
+ instance.pause = function() {
1138
+ instance.paused = true;
1139
+ resetTime();
1140
+ };
1141
+
1142
+ instance.play = function() {
1143
+ if (!instance.paused) { return; }
1144
+ if (instance.completed) { instance.reset(); }
1145
+ instance.paused = false;
1146
+ activeInstances.push(instance);
1147
+ resetTime();
1148
+ engine();
1149
+ };
1150
+
1151
+ instance.reverse = function() {
1152
+ toggleInstanceDirection();
1153
+ instance.completed = instance.reversed ? false : true;
1154
+ resetTime();
1155
+ };
1156
+
1157
+ instance.restart = function() {
1158
+ instance.reset();
1159
+ instance.play();
1160
+ };
1161
+
1162
+ instance.remove = function(targets) {
1163
+ var targetsArray = parseTargets(targets);
1164
+ removeTargetsFromInstance(targetsArray, instance);
1165
+ };
1166
+
1167
+ instance.reset();
1168
+
1169
+ if (instance.autoplay) { instance.play(); }
1170
+
1171
+ return instance;
1172
+
1173
+ }
1174
+
1175
+ // Remove targets from animation
1176
+
1177
+ function removeTargetsFromAnimations(targetsArray, animations) {
1178
+ for (var a = animations.length; a--;) {
1179
+ if (arrayContains(targetsArray, animations[a].animatable.target)) {
1180
+ animations.splice(a, 1);
1181
+ }
1182
+ }
1183
+ }
1184
+
1185
+ function removeTargetsFromInstance(targetsArray, instance) {
1186
+ var animations = instance.animations;
1187
+ var children = instance.children;
1188
+ removeTargetsFromAnimations(targetsArray, animations);
1189
+ for (var c = children.length; c--;) {
1190
+ var child = children[c];
1191
+ var childAnimations = child.animations;
1192
+ removeTargetsFromAnimations(targetsArray, childAnimations);
1193
+ if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }
1194
+ }
1195
+ if (!animations.length && !children.length) { instance.pause(); }
1196
+ }
1197
+
1198
+ function removeTargetsFromActiveInstances(targets) {
1199
+ var targetsArray = parseTargets(targets);
1200
+ for (var i = activeInstances.length; i--;) {
1201
+ var instance = activeInstances[i];
1202
+ removeTargetsFromInstance(targetsArray, instance);
1203
+ }
1204
+ }
1205
+
1206
+ // Stagger helpers
1207
+
1208
+ function stagger(val, params) {
1209
+ if ( params === void 0 ) params = {};
1210
+
1211
+ var direction = params.direction || 'normal';
1212
+ var easing = params.easing ? parseEasings(params.easing) : null;
1213
+ var grid = params.grid;
1214
+ var axis = params.axis;
1215
+ var fromIndex = params.from || 0;
1216
+ var fromFirst = fromIndex === 'first';
1217
+ var fromCenter = fromIndex === 'center';
1218
+ var fromLast = fromIndex === 'last';
1219
+ var isRange = is.arr(val);
1220
+ var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);
1221
+ var val2 = isRange ? parseFloat(val[1]) : 0;
1222
+ var unit = getUnit(isRange ? val[1] : val) || 0;
1223
+ var start = params.start || 0 + (isRange ? val1 : 0);
1224
+ var values = [];
1225
+ var maxValue = 0;
1226
+ return function (el, i, t) {
1227
+ if (fromFirst) { fromIndex = 0; }
1228
+ if (fromCenter) { fromIndex = (t - 1) / 2; }
1229
+ if (fromLast) { fromIndex = t - 1; }
1230
+ if (!values.length) {
1231
+ for (var index = 0; index < t; index++) {
1232
+ if (!grid) {
1233
+ values.push(Math.abs(fromIndex - index));
1234
+ } else {
1235
+ var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;
1236
+ var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;
1237
+ var toX = index%grid[0];
1238
+ var toY = Math.floor(index/grid[0]);
1239
+ var distanceX = fromX - toX;
1240
+ var distanceY = fromY - toY;
1241
+ var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);
1242
+ if (axis === 'x') { value = -distanceX; }
1243
+ if (axis === 'y') { value = -distanceY; }
1244
+ values.push(value);
1245
+ }
1246
+ maxValue = Math.max.apply(Math, values);
1247
+ }
1248
+ if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }
1249
+ if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }
1250
+ }
1251
+ var spacing = isRange ? (val2 - val1) / maxValue : val1;
1252
+ return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;
1253
+ }
1254
+ }
1255
+
1256
+ // Timeline
1257
+
1258
+ function timeline(params) {
1259
+ if ( params === void 0 ) params = {};
1260
+
1261
+ var tl = anime(params);
1262
+ tl.duration = 0;
1263
+ tl.add = function(instanceParams, timelineOffset) {
1264
+ var tlIndex = activeInstances.indexOf(tl);
1265
+ var children = tl.children;
1266
+ if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }
1267
+ function passThrough(ins) { ins.passThrough = true; }
1268
+ for (var i = 0; i < children.length; i++) { passThrough(children[i]); }
1269
+ var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));
1270
+ insParams.targets = insParams.targets || params.targets;
1271
+ var tlDuration = tl.duration;
1272
+ insParams.autoplay = false;
1273
+ insParams.direction = tl.direction;
1274
+ insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);
1275
+ passThrough(tl);
1276
+ tl.seek(insParams.timelineOffset);
1277
+ var ins = anime(insParams);
1278
+ passThrough(ins);
1279
+ children.push(ins);
1280
+ var timings = getInstanceTimings(children, params);
1281
+ tl.delay = timings.delay;
1282
+ tl.endDelay = timings.endDelay;
1283
+ tl.duration = timings.duration;
1284
+ tl.seek(0);
1285
+ tl.reset();
1286
+ if (tl.autoplay) { tl.play(); }
1287
+ return tl;
1288
+ };
1289
+ return tl;
1290
+ }
1291
+
1292
+ anime.version = '3.2.1';
1293
+ anime.speed = 1;
1294
+ // TODO:#review: naming, documentation
1295
+ anime.suspendWhenDocumentHidden = true;
1296
+ anime.running = activeInstances;
1297
+ anime.remove = removeTargetsFromActiveInstances;
1298
+ anime.get = getOriginalTargetValue;
1299
+ anime.set = setTargetsValue;
1300
+ anime.convertPx = convertPxToUnit;
1301
+ anime.path = getPath;
1302
+ anime.setDashoffset = setDashoffset;
1303
+ anime.stagger = stagger;
1304
+ anime.timeline = timeline;
1305
+ anime.easing = parseEasings;
1306
+ anime.penner = penner;
1307
+ anime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };
1308
+
1309
+ export { anime as a };
1310
+
1311
+ //# sourceMappingURL=anime.es.js.map