@pine-ds/core 1.3.0-dev.0 → 1.3.0-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (631) hide show
  1. package/components/closest.js +11 -0
  2. package/components/closest.js.map +1 -0
  3. package/components/index.js +33 -0
  4. package/components/index.js.map +1 -0
  5. package/components/index2.js +14 -0
  6. package/components/index2.js.map +1 -0
  7. package/components/pds-accordion.js +62 -0
  8. package/components/pds-accordion.js.map +1 -0
  9. package/components/pds-avatar.js +97 -0
  10. package/components/pds-avatar.js.map +1 -0
  11. package/components/pds-box.js +124 -0
  12. package/components/pds-box.js.map +1 -0
  13. package/components/pds-button.js +8 -0
  14. package/components/pds-button.js.map +1 -0
  15. package/components/pds-button2.js +78 -0
  16. package/components/pds-button2.js.map +1 -0
  17. package/components/pds-checkbox.js +8 -0
  18. package/components/pds-checkbox.js.map +1 -0
  19. package/components/pds-checkbox2.js +101 -0
  20. package/components/pds-checkbox2.js.map +1 -0
  21. package/components/pds-chip.js +72 -0
  22. package/components/pds-chip.js.map +1 -0
  23. package/components/pds-copytext.js +82 -0
  24. package/components/pds-copytext.js.map +1 -0
  25. package/components/pds-divider.js +54 -0
  26. package/components/pds-divider.js.map +1 -0
  27. package/components/pds-image.js +55 -0
  28. package/components/pds-image.js.map +1 -0
  29. package/components/pds-input.js +72 -0
  30. package/components/pds-input.js.map +1 -0
  31. package/components/pds-label.js +39 -0
  32. package/components/pds-label.js.map +1 -0
  33. package/components/pds-link.js +59 -0
  34. package/components/pds-link.js.map +1 -0
  35. package/components/pds-loader.js +68 -0
  36. package/components/pds-loader.js.map +1 -0
  37. package/components/pds-progress.js +49 -0
  38. package/components/pds-progress.js.map +1 -0
  39. package/components/pds-radio.js +78 -0
  40. package/components/pds-radio.js.map +1 -0
  41. package/components/pds-row.js +72 -0
  42. package/components/pds-row.js.map +1 -0
  43. package/components/pds-sortable-item.js +52 -0
  44. package/components/pds-sortable-item.js.map +1 -0
  45. package/components/pds-sortable.js +2722 -0
  46. package/components/pds-sortable.js.map +1 -0
  47. package/components/pds-switch.js +82 -0
  48. package/components/pds-switch.js.map +1 -0
  49. package/components/pds-tab.js +53 -0
  50. package/components/pds-tab.js.map +1 -0
  51. package/components/pds-table-body.js +36 -0
  52. package/components/pds-table-body.js.map +1 -0
  53. package/components/pds-table-cell.js +8 -0
  54. package/components/pds-table-cell.js.map +1 -0
  55. package/components/pds-table-cell2.js +72 -0
  56. package/components/pds-table-cell2.js.map +1 -0
  57. package/components/pds-table-head-cell.js +8 -0
  58. package/components/pds-table-head-cell.js.map +1 -0
  59. package/components/pds-table-head-cell2.js +92 -0
  60. package/components/pds-table-head-cell2.js.map +1 -0
  61. package/components/pds-table-head.js +84 -0
  62. package/components/pds-table-head.js.map +1 -0
  63. package/components/pds-table-row.js +95 -0
  64. package/components/pds-table-row.js.map +1 -0
  65. package/components/pds-table.js +124 -0
  66. package/components/pds-table.js.map +1 -0
  67. package/components/pds-tabpanel.js +45 -0
  68. package/components/pds-tabpanel.js.map +1 -0
  69. package/components/pds-tabs.js +119 -0
  70. package/components/pds-tabs.js.map +1 -0
  71. package/components/pds-textarea.js +82 -0
  72. package/components/pds-textarea.js.map +1 -0
  73. package/components/pds-tooltip.js +178 -0
  74. package/components/pds-tooltip.js.map +1 -0
  75. package/dist/cjs/app-globals-3a1e7e63.js +7 -0
  76. package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
  77. package/dist/cjs/closest-b45138d3.js +13 -0
  78. package/dist/cjs/closest-b45138d3.js.map +1 -0
  79. package/dist/{pine-core/index-cccc19b7.js → cjs/index-11f95019.js} +220 -1563
  80. package/dist/cjs/index-11f95019.js.map +1 -0
  81. package/dist/cjs/index-dd191bbe.js +24 -0
  82. package/dist/cjs/index-dd191bbe.js.map +1 -0
  83. package/dist/cjs/index.cjs.js +6 -0
  84. package/dist/cjs/index.cjs.js.map +1 -0
  85. package/dist/cjs/loader.cjs.js +17 -0
  86. package/dist/cjs/loader.cjs.js.map +1 -0
  87. package/dist/cjs/pds-accordion.cjs.entry.js +43 -0
  88. package/dist/cjs/pds-accordion.cjs.entry.js.map +1 -0
  89. package/dist/cjs/pds-avatar.cjs.entry.js +75 -0
  90. package/dist/cjs/pds-avatar.cjs.entry.js.map +1 -0
  91. package/dist/cjs/pds-box.cjs.entry.js +82 -0
  92. package/dist/cjs/pds-box.cjs.entry.js.map +1 -0
  93. package/dist/cjs/pds-button.cjs.entry.js +59 -0
  94. package/dist/cjs/pds-button.cjs.entry.js.map +1 -0
  95. package/dist/cjs/pds-checkbox.cjs.entry.js +75 -0
  96. package/dist/cjs/pds-checkbox.cjs.entry.js.map +1 -0
  97. package/dist/cjs/pds-chip.cjs.entry.js +51 -0
  98. package/dist/cjs/pds-chip.cjs.entry.js.map +1 -0
  99. package/dist/cjs/pds-copytext.cjs.entry.js +56 -0
  100. package/dist/cjs/pds-copytext.cjs.entry.js.map +1 -0
  101. package/dist/cjs/pds-divider.cjs.entry.js +36 -0
  102. package/dist/cjs/pds-divider.cjs.entry.js.map +1 -0
  103. package/dist/cjs/pds-image.cjs.entry.js +32 -0
  104. package/dist/cjs/pds-image.cjs.entry.js.map +1 -0
  105. package/dist/cjs/pds-input.cjs.entry.js +45 -0
  106. package/dist/cjs/pds-input.cjs.entry.js.map +1 -0
  107. package/dist/cjs/pds-label-7acec6ab.js +44 -0
  108. package/dist/cjs/pds-label-7acec6ab.js.map +1 -0
  109. package/dist/cjs/pds-link.cjs.entry.js +39 -0
  110. package/dist/cjs/pds-link.cjs.entry.js.map +1 -0
  111. package/dist/cjs/pds-loader.cjs.entry.js +49 -0
  112. package/dist/cjs/pds-loader.cjs.entry.js.map +1 -0
  113. package/dist/cjs/pds-progress.cjs.entry.js +28 -0
  114. package/dist/cjs/pds-progress.cjs.entry.js.map +1 -0
  115. package/dist/cjs/pds-radio.cjs.entry.js +54 -0
  116. package/dist/cjs/pds-radio.cjs.entry.js.map +1 -0
  117. package/dist/cjs/pds-row.cjs.entry.js +51 -0
  118. package/dist/cjs/pds-row.cjs.entry.js.map +1 -0
  119. package/dist/cjs/pds-sortable-item.cjs.entry.js +35 -0
  120. package/dist/cjs/pds-sortable-item.cjs.entry.js.map +1 -0
  121. package/dist/cjs/pds-sortable.cjs.entry.js +2704 -0
  122. package/dist/cjs/pds-sortable.cjs.entry.js.map +1 -0
  123. package/dist/cjs/pds-switch.cjs.entry.js +56 -0
  124. package/dist/cjs/pds-switch.cjs.entry.js.map +1 -0
  125. package/dist/cjs/pds-tab.cjs.entry.js +34 -0
  126. package/dist/cjs/pds-tab.cjs.entry.js.map +1 -0
  127. package/dist/cjs/pds-table-body.cjs.entry.js +22 -0
  128. package/dist/cjs/pds-table-body.cjs.entry.js.map +1 -0
  129. package/dist/cjs/pds-table-cell.cjs.entry.js +58 -0
  130. package/dist/cjs/pds-table-cell.cjs.entry.js.map +1 -0
  131. package/dist/cjs/pds-table-head-cell.cjs.entry.js +76 -0
  132. package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +1 -0
  133. package/dist/cjs/pds-table-head.cjs.entry.js +55 -0
  134. package/dist/cjs/pds-table-head.cjs.entry.js.map +1 -0
  135. package/dist/cjs/pds-table-row.cjs.entry.js +66 -0
  136. package/dist/cjs/pds-table-row.cjs.entry.js.map +1 -0
  137. package/dist/cjs/pds-table.cjs.entry.js +102 -0
  138. package/dist/cjs/pds-table.cjs.entry.js.map +1 -0
  139. package/dist/cjs/pds-tabpanel.cjs.entry.js +27 -0
  140. package/dist/cjs/pds-tabpanel.cjs.entry.js.map +1 -0
  141. package/dist/cjs/pds-tabs.cjs.entry.js +99 -0
  142. package/dist/cjs/pds-tabs.cjs.entry.js.map +1 -0
  143. package/dist/cjs/pds-textarea.cjs.entry.js +55 -0
  144. package/dist/cjs/pds-textarea.cjs.entry.js.map +1 -0
  145. package/dist/cjs/pds-tooltip.cjs.entry.js +152 -0
  146. package/dist/cjs/pds-tooltip.cjs.entry.js.map +1 -0
  147. package/dist/cjs/pine-core.cjs.js +27 -0
  148. package/dist/cjs/pine-core.cjs.js.map +1 -0
  149. package/dist/collection/collection-manifest.json +40 -0
  150. package/dist/collection/components/_internal/pds-label/pds-label.js +7 -0
  151. package/dist/collection/components/_internal/pds-label/pds-label.js.map +1 -0
  152. package/dist/collection/components/pds-accordion/pds-accordion.css +65 -0
  153. package/dist/collection/components/pds-accordion/pds-accordion.js +94 -0
  154. package/dist/collection/components/pds-accordion/pds-accordion.js.map +1 -0
  155. package/dist/collection/components/pds-accordion/stories/pds-accordion.stories.js +34 -0
  156. package/dist/collection/components/pds-avatar/pds-avatar.css +65 -0
  157. package/dist/collection/components/pds-avatar/pds-avatar.js +224 -0
  158. package/dist/collection/components/pds-avatar/pds-avatar.js.map +1 -0
  159. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +65 -0
  160. package/dist/collection/components/pds-box/pds-box.css +1234 -0
  161. package/dist/collection/components/pds-box/pds-box.js +678 -0
  162. package/dist/collection/components/pds-box/pds-box.js.map +1 -0
  163. package/dist/collection/components/pds-box/stories/pds-box.stories.js +50 -0
  164. package/dist/collection/components/pds-button/pds-button.css +131 -0
  165. package/dist/collection/components/pds-button/pds-button.js +193 -0
  166. package/dist/collection/components/pds-button/pds-button.js.map +1 -0
  167. package/dist/collection/components/pds-button/stories/pds-button.stories.js +66 -0
  168. package/dist/collection/components/pds-checkbox/checkbox-interface.js +2 -0
  169. package/dist/collection/components/pds-checkbox/checkbox-interface.js.map +1 -0
  170. package/dist/collection/components/pds-checkbox/pds-checkbox.css +135 -0
  171. package/dist/collection/components/pds-checkbox/pds-checkbox.js +330 -0
  172. package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +1 -0
  173. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +82 -0
  174. package/dist/collection/components/pds-chip/pds-chip.css +239 -0
  175. package/dist/collection/components/pds-chip/pds-chip.js +189 -0
  176. package/dist/collection/components/pds-chip/pds-chip.js.map +1 -0
  177. package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +79 -0
  178. package/dist/collection/components/pds-copytext/pds-copytext.css +87 -0
  179. package/dist/collection/components/pds-copytext/pds-copytext.js +173 -0
  180. package/dist/collection/components/pds-copytext/pds-copytext.js.map +1 -0
  181. package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +57 -0
  182. package/dist/collection/components/pds-divider/pds-divider.css +92 -0
  183. package/dist/collection/components/pds-divider/pds-divider.js +94 -0
  184. package/dist/collection/components/pds-divider/pds-divider.js.map +1 -0
  185. package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +25 -0
  186. package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +16 -0
  187. package/dist/collection/components/pds-image/pds-image.css +13 -0
  188. package/dist/collection/components/pds-image/pds-image.js +173 -0
  189. package/dist/collection/components/pds-image/pds-image.js.map +1 -0
  190. package/dist/collection/components/pds-image/stories/pds-image.stories.js +35 -0
  191. package/dist/collection/components/pds-input/pds-input.css +92 -0
  192. package/dist/collection/components/pds-input/pds-input.js +279 -0
  193. package/dist/collection/components/pds-input/pds-input.js.map +1 -0
  194. package/dist/collection/components/pds-input/stories/pds-input.stories.js +110 -0
  195. package/dist/collection/components/pds-link/pds-link.css +68 -0
  196. package/dist/collection/components/pds-link/pds-link.js +140 -0
  197. package/dist/collection/components/pds-link/pds-link.js.map +1 -0
  198. package/dist/collection/components/pds-link/stories/pds-link.stories.js +49 -0
  199. package/dist/collection/components/pds-loader/pds-loader.css +93 -0
  200. package/dist/collection/components/pds-loader/pds-loader.js +127 -0
  201. package/dist/collection/components/pds-loader/pds-loader.js.map +1 -0
  202. package/dist/collection/components/pds-loader/stories/pds-loader.stories.js +36 -0
  203. package/dist/collection/components/pds-progress/pds-progress.css +79 -0
  204. package/dist/collection/components/pds-progress/pds-progress.js +148 -0
  205. package/dist/collection/components/pds-progress/pds-progress.js.map +1 -0
  206. package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +65 -0
  207. package/dist/collection/components/pds-radio/pds-radio.css +104 -0
  208. package/dist/collection/components/pds-radio/pds-radio.js +261 -0
  209. package/dist/collection/components/pds-radio/pds-radio.js.map +1 -0
  210. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +71 -0
  211. package/dist/collection/components/pds-row/pds-row.css +78 -0
  212. package/dist/collection/components/pds-row/pds-row.js +186 -0
  213. package/dist/collection/components/pds-row/pds-row.js.map +1 -0
  214. package/dist/collection/components/pds-row/stories/pds-row.stories.js +75 -0
  215. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +63 -0
  216. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +100 -0
  217. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +1 -0
  218. package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +24 -0
  219. package/dist/collection/components/pds-sortable/pds-sortable.css +10 -0
  220. package/dist/collection/components/pds-sortable/pds-sortable.js +150 -0
  221. package/dist/collection/components/pds-sortable/pds-sortable.js.map +1 -0
  222. package/dist/collection/components/pds-sortable/sortable-interface.js +2 -0
  223. package/dist/collection/components/pds-sortable/sortable-interface.js.map +1 -0
  224. package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +130 -0
  225. package/dist/collection/components/pds-switch/pds-switch.css +136 -0
  226. package/dist/collection/components/pds-switch/pds-switch.js +277 -0
  227. package/dist/collection/components/pds-switch/pds-switch.js.map +1 -0
  228. package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +102 -0
  229. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.css +5 -0
  230. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +19 -0
  231. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js.map +1 -0
  232. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +45 -0
  233. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +83 -0
  234. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +1 -0
  235. package/dist/collection/components/pds-table/pds-table-cell/stories/pds-table-cell.stories.js +26 -0
  236. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.css +18 -0
  237. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +109 -0
  238. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +1 -0
  239. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +54 -0
  240. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +120 -0
  241. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js.map +1 -0
  242. package/dist/collection/components/pds-table/pds-table-head-cell/stories/pds-table-head-cell.stories.js +24 -0
  243. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.css +22 -0
  244. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +120 -0
  245. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +1 -0
  246. package/dist/collection/components/pds-table/pds-table-row/stories/pds-table-row.stories.js +26 -0
  247. package/dist/collection/components/pds-table/pds-table.css +27 -0
  248. package/dist/collection/components/pds-table/pds-table.js +248 -0
  249. package/dist/collection/components/pds-table/pds-table.js.map +1 -0
  250. package/dist/collection/components/pds-table/stories/pds-table.stories.js +227 -0
  251. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +160 -0
  252. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +154 -0
  253. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +1 -0
  254. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +12 -0
  255. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +107 -0
  256. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +1 -0
  257. package/dist/collection/components/pds-tabs/pds-tabs.css +29 -0
  258. package/dist/collection/components/pds-tabs/pds-tabs.js +209 -0
  259. package/dist/collection/components/pds-tabs/pds-tabs.js.map +1 -0
  260. package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +63 -0
  261. package/dist/collection/components/pds-textarea/pds-textarea.css +88 -0
  262. package/dist/collection/components/pds-textarea/pds-textarea.js +303 -0
  263. package/dist/collection/components/pds-textarea/pds-textarea.js.map +1 -0
  264. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +111 -0
  265. package/dist/collection/components/pds-textarea/textarea-interface.js +2 -0
  266. package/dist/collection/components/pds-textarea/textarea-interface.js.map +1 -0
  267. package/dist/collection/components/pds-tooltip/pds-tooltip.css +147 -0
  268. package/dist/collection/components/pds-tooltip/pds-tooltip.js +287 -0
  269. package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +1 -0
  270. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +103 -0
  271. package/dist/collection/global/pine-ui-global.js +2 -0
  272. package/dist/collection/global/pine-ui-global.js.map +1 -0
  273. package/dist/collection/index.js +2 -0
  274. package/dist/collection/index.js.map +1 -0
  275. package/dist/collection/stories/_helpers/index.js +15 -0
  276. package/dist/collection/stories/_helpers/index.js.map +1 -0
  277. package/dist/collection/utils/closest.js +8 -0
  278. package/dist/collection/utils/closest.js.map +1 -0
  279. package/dist/collection/utils/form.js +28 -0
  280. package/dist/collection/utils/form.js.map +1 -0
  281. package/dist/collection/utils/overlay.js +68 -0
  282. package/dist/collection/utils/overlay.js.map +1 -0
  283. package/dist/collection/utils/types.js +2 -0
  284. package/dist/collection/utils/types.js.map +1 -0
  285. package/dist/collection/utils/utils.js +7 -0
  286. package/dist/collection/utils/utils.js.map +1 -0
  287. package/dist/docs.json +1 -1
  288. package/dist/esm/index-b8872c16.js +14 -0
  289. package/dist/esm/index-b8872c16.js.map +1 -0
  290. package/dist/esm/index-cd2796be.js +2811 -0
  291. package/dist/esm/index-cd2796be.js.map +1 -0
  292. package/dist/esm/index.js +3 -0
  293. package/dist/esm/index.js.map +1 -0
  294. package/dist/esm/loader.js +13 -0
  295. package/dist/esm/loader.js.map +1 -0
  296. package/dist/{pine-core → esm}/pds-accordion.entry.js +5 -4
  297. package/dist/esm/pds-accordion.entry.js.map +1 -0
  298. package/dist/{pine-core → esm}/pds-avatar.entry.js +5 -4
  299. package/dist/esm/pds-avatar.entry.js.map +1 -0
  300. package/dist/esm/pds-box.entry.js +78 -0
  301. package/dist/esm/pds-box.entry.js.map +1 -0
  302. package/dist/{pine-core → esm}/pds-button.entry.js +5 -7
  303. package/dist/esm/pds-button.entry.js.map +1 -0
  304. package/dist/{pine-core → esm}/pds-checkbox.entry.js +5 -4
  305. package/dist/esm/pds-checkbox.entry.js.map +1 -0
  306. package/dist/esm/pds-chip.entry.js +47 -0
  307. package/dist/esm/pds-chip.entry.js.map +1 -0
  308. package/dist/{pine-core → esm}/pds-copytext.entry.js +5 -4
  309. package/dist/esm/pds-copytext.entry.js.map +1 -0
  310. package/dist/esm/pds-divider.entry.js +32 -0
  311. package/dist/esm/pds-divider.entry.js.map +1 -0
  312. package/dist/{pine-core → esm}/pds-image.entry.js +3 -2
  313. package/dist/esm/pds-image.entry.js.map +1 -0
  314. package/dist/{pine-core → esm}/pds-input.entry.js +5 -4
  315. package/dist/esm/pds-input.entry.js.map +1 -0
  316. package/dist/{pine-core/pds-label-7201663d.js → esm/pds-label-7abc6d85.js} +2 -2
  317. package/dist/{pine-core/pds-label-7201663d.js.map → esm/pds-label-7abc6d85.js.map} +1 -1
  318. package/dist/{pine-core → esm}/pds-link.entry.js +5 -4
  319. package/dist/esm/pds-link.entry.js.map +1 -0
  320. package/dist/esm/pds-loader.entry.js +45 -0
  321. package/dist/esm/pds-loader.entry.js.map +1 -0
  322. package/dist/esm/pds-progress.entry.js +24 -0
  323. package/dist/esm/pds-progress.entry.js.map +1 -0
  324. package/dist/{pine-core → esm}/pds-radio.entry.js +5 -4
  325. package/dist/esm/pds-radio.entry.js.map +1 -0
  326. package/dist/esm/pds-row.entry.js +47 -0
  327. package/dist/esm/pds-row.entry.js.map +1 -0
  328. package/dist/esm/pds-sortable-item.entry.js +31 -0
  329. package/dist/esm/pds-sortable-item.entry.js.map +1 -0
  330. package/dist/{pine-core → esm}/pds-sortable.entry.js +4 -704
  331. package/dist/esm/pds-sortable.entry.js.map +1 -0
  332. package/dist/{pine-core → esm}/pds-switch.entry.js +5 -4
  333. package/dist/esm/pds-switch.entry.js.map +1 -0
  334. package/dist/esm/pds-tab.entry.js +30 -0
  335. package/dist/esm/pds-tab.entry.js.map +1 -0
  336. package/dist/{pine-core → esm}/pds-table-body.entry.js +3 -2
  337. package/dist/esm/pds-table-body.entry.js.map +1 -0
  338. package/dist/{pine-core → esm}/pds-table-cell.entry.js +4 -3
  339. package/dist/esm/pds-table-cell.entry.js.map +1 -0
  340. package/dist/{pine-core → esm}/pds-table-head-cell.entry.js +5 -4
  341. package/dist/esm/pds-table-head-cell.entry.js.map +1 -0
  342. package/dist/{pine-core → esm}/pds-table-head.entry.js +4 -3
  343. package/dist/esm/pds-table-head.entry.js.map +1 -0
  344. package/dist/{pine-core → esm}/pds-table-row.entry.js +4 -3
  345. package/dist/esm/pds-table-row.entry.js.map +1 -0
  346. package/dist/{pine-core → esm}/pds-table.entry.js +4 -3
  347. package/dist/esm/pds-table.entry.js.map +1 -0
  348. package/dist/{pine-core → esm}/pds-tabpanel.entry.js +3 -2
  349. package/dist/esm/pds-tabpanel.entry.js.map +1 -0
  350. package/dist/{pine-core → esm}/pds-tabs.entry.js +4 -3
  351. package/dist/esm/pds-tabs.entry.js.map +1 -0
  352. package/dist/{pine-core → esm}/pds-textarea.entry.js +5 -4
  353. package/dist/esm/pds-textarea.entry.js.map +1 -0
  354. package/dist/{pine-core → esm}/pds-tooltip.entry.js +4 -3
  355. package/dist/esm/pds-tooltip.entry.js.map +1 -0
  356. package/dist/esm/pine-core.js +22 -0
  357. package/dist/esm/pine-core.js.map +1 -0
  358. package/dist/esm/polyfills/core-js.js +11 -0
  359. package/dist/esm/polyfills/dom.js +79 -0
  360. package/dist/esm/polyfills/es5-html-element.js +1 -0
  361. package/dist/esm/polyfills/index.js +34 -0
  362. package/dist/esm/polyfills/system.js +6 -0
  363. package/dist/esm-es5/app-globals-0f993ce5.js +2 -0
  364. package/dist/esm-es5/app-globals-0f993ce5.js.map +1 -0
  365. package/dist/esm-es5/closest-d2d192be.js +2 -0
  366. package/dist/esm-es5/closest-d2d192be.js.map +1 -0
  367. package/dist/esm-es5/index-b8872c16.js +2 -0
  368. package/dist/esm-es5/index-b8872c16.js.map +1 -0
  369. package/dist/esm-es5/index-cd2796be.js +3 -0
  370. package/dist/esm-es5/index-cd2796be.js.map +1 -0
  371. package/dist/esm-es5/index.js +2 -0
  372. package/dist/esm-es5/index.js.map +1 -0
  373. package/dist/esm-es5/loader.js +2 -0
  374. package/dist/esm-es5/loader.js.map +1 -0
  375. package/dist/esm-es5/pds-accordion.entry.js +2 -0
  376. package/dist/esm-es5/pds-accordion.entry.js.map +1 -0
  377. package/dist/esm-es5/pds-avatar.entry.js +2 -0
  378. package/dist/esm-es5/pds-avatar.entry.js.map +1 -0
  379. package/dist/esm-es5/pds-box.entry.js +2 -0
  380. package/dist/esm-es5/pds-box.entry.js.map +1 -0
  381. package/dist/esm-es5/pds-button.entry.js +2 -0
  382. package/dist/esm-es5/pds-button.entry.js.map +1 -0
  383. package/dist/esm-es5/pds-checkbox.entry.js +2 -0
  384. package/dist/esm-es5/pds-checkbox.entry.js.map +1 -0
  385. package/dist/esm-es5/pds-chip.entry.js +2 -0
  386. package/dist/esm-es5/pds-chip.entry.js.map +1 -0
  387. package/dist/esm-es5/pds-copytext.entry.js +2 -0
  388. package/dist/esm-es5/pds-copytext.entry.js.map +1 -0
  389. package/dist/esm-es5/pds-divider.entry.js +2 -0
  390. package/dist/esm-es5/pds-divider.entry.js.map +1 -0
  391. package/dist/esm-es5/pds-image.entry.js +2 -0
  392. package/dist/esm-es5/pds-image.entry.js.map +1 -0
  393. package/dist/esm-es5/pds-input.entry.js +2 -0
  394. package/dist/esm-es5/pds-input.entry.js.map +1 -0
  395. package/dist/esm-es5/pds-label-7abc6d85.js +2 -0
  396. package/dist/esm-es5/pds-label-7abc6d85.js.map +1 -0
  397. package/dist/esm-es5/pds-link.entry.js +2 -0
  398. package/dist/esm-es5/pds-link.entry.js.map +1 -0
  399. package/dist/esm-es5/pds-loader.entry.js +2 -0
  400. package/dist/esm-es5/pds-loader.entry.js.map +1 -0
  401. package/dist/esm-es5/pds-progress.entry.js +2 -0
  402. package/dist/esm-es5/pds-progress.entry.js.map +1 -0
  403. package/dist/esm-es5/pds-radio.entry.js +2 -0
  404. package/dist/esm-es5/pds-radio.entry.js.map +1 -0
  405. package/dist/esm-es5/pds-row.entry.js +2 -0
  406. package/dist/esm-es5/pds-row.entry.js.map +1 -0
  407. package/dist/esm-es5/pds-sortable-item.entry.js +2 -0
  408. package/dist/esm-es5/pds-sortable-item.entry.js.map +1 -0
  409. package/dist/esm-es5/pds-sortable.entry.js +8 -0
  410. package/dist/esm-es5/pds-sortable.entry.js.map +1 -0
  411. package/dist/esm-es5/pds-switch.entry.js +2 -0
  412. package/dist/esm-es5/pds-switch.entry.js.map +1 -0
  413. package/dist/esm-es5/pds-tab.entry.js +2 -0
  414. package/dist/esm-es5/pds-tab.entry.js.map +1 -0
  415. package/dist/esm-es5/pds-table-body.entry.js +2 -0
  416. package/dist/esm-es5/pds-table-body.entry.js.map +1 -0
  417. package/dist/esm-es5/pds-table-cell.entry.js +2 -0
  418. package/dist/esm-es5/pds-table-cell.entry.js.map +1 -0
  419. package/dist/esm-es5/pds-table-head-cell.entry.js +2 -0
  420. package/dist/esm-es5/pds-table-head-cell.entry.js.map +1 -0
  421. package/dist/esm-es5/pds-table-head.entry.js +2 -0
  422. package/dist/esm-es5/pds-table-head.entry.js.map +1 -0
  423. package/dist/esm-es5/pds-table-row.entry.js +2 -0
  424. package/dist/esm-es5/pds-table-row.entry.js.map +1 -0
  425. package/dist/esm-es5/pds-table.entry.js +2 -0
  426. package/dist/{pine-core → esm-es5}/pds-table.entry.js.map +1 -1
  427. package/dist/esm-es5/pds-tabpanel.entry.js +2 -0
  428. package/dist/esm-es5/pds-tabpanel.entry.js.map +1 -0
  429. package/dist/esm-es5/pds-tabs.entry.js +2 -0
  430. package/dist/esm-es5/pds-tabs.entry.js.map +1 -0
  431. package/dist/esm-es5/pds-textarea.entry.js +2 -0
  432. package/dist/esm-es5/pds-textarea.entry.js.map +1 -0
  433. package/dist/esm-es5/pds-tooltip.entry.js +2 -0
  434. package/dist/esm-es5/pds-tooltip.entry.js.map +1 -0
  435. package/dist/esm-es5/pine-core.js +2 -0
  436. package/dist/esm-es5/pine-core.js.map +1 -0
  437. package/dist/index.cjs.js +1 -0
  438. package/dist/index.js +1 -0
  439. package/dist/pine-core/index.esm.js +1 -2
  440. package/dist/pine-core/index.esm.js.map +1 -1
  441. package/dist/pine-core/p-03ac85bb.system.entry.js +2 -0
  442. package/dist/pine-core/p-03ac85bb.system.entry.js.map +1 -0
  443. package/dist/pine-core/p-0935a593.system.js +3 -0
  444. package/dist/pine-core/p-0935a593.system.js.map +1 -0
  445. package/dist/pine-core/p-0b77685e.js +2 -0
  446. package/dist/pine-core/p-0b77685e.js.map +1 -0
  447. package/dist/pine-core/p-0ca08a85.system.js +2 -0
  448. package/dist/pine-core/p-0ca08a85.system.js.map +1 -0
  449. package/dist/pine-core/p-1b1c6e9e.system.entry.js +2 -0
  450. package/dist/pine-core/p-1b1c6e9e.system.entry.js.map +1 -0
  451. package/dist/pine-core/p-1d34a83d.system.entry.js +2 -0
  452. package/dist/pine-core/p-1d34a83d.system.entry.js.map +1 -0
  453. package/dist/pine-core/p-224a435b.system.js +2 -0
  454. package/dist/pine-core/p-224a435b.system.js.map +1 -0
  455. package/dist/pine-core/p-23d97662.js +3 -0
  456. package/dist/pine-core/p-23d97662.js.map +1 -0
  457. package/dist/pine-core/p-24d43a5d.system.entry.js +2 -0
  458. package/dist/pine-core/p-24d43a5d.system.entry.js.map +1 -0
  459. package/dist/pine-core/p-252bcd1c.system.entry.js +2 -0
  460. package/dist/pine-core/p-252bcd1c.system.entry.js.map +1 -0
  461. package/dist/pine-core/p-27dfade4.system.entry.js +2 -0
  462. package/dist/pine-core/p-27dfade4.system.entry.js.map +1 -0
  463. package/dist/pine-core/p-28d205e0.system.entry.js +2 -0
  464. package/dist/pine-core/p-28d205e0.system.entry.js.map +1 -0
  465. package/dist/pine-core/p-2ac1781f.entry.js +2 -0
  466. package/dist/pine-core/p-2ac1781f.entry.js.map +1 -0
  467. package/dist/pine-core/p-35f2208a.system.entry.js +2 -0
  468. package/dist/pine-core/p-35f2208a.system.entry.js.map +1 -0
  469. package/dist/pine-core/p-38a23fac.system.entry.js +2 -0
  470. package/dist/pine-core/p-38a23fac.system.entry.js.map +1 -0
  471. package/dist/pine-core/p-39bc5dc9.system.entry.js +2 -0
  472. package/dist/pine-core/p-39bc5dc9.system.entry.js.map +1 -0
  473. package/dist/pine-core/p-3c02b099.entry.js +2 -0
  474. package/dist/pine-core/p-3c02b099.entry.js.map +1 -0
  475. package/dist/pine-core/p-41d6881e.system.entry.js +2 -0
  476. package/dist/pine-core/p-41d6881e.system.entry.js.map +1 -0
  477. package/dist/pine-core/p-443202f8.entry.js +8 -0
  478. package/dist/pine-core/p-443202f8.entry.js.map +1 -0
  479. package/dist/pine-core/p-4df579f2.entry.js +2 -0
  480. package/dist/pine-core/p-4df579f2.entry.js.map +1 -0
  481. package/dist/pine-core/p-519ef0c4.system.js +2 -0
  482. package/dist/pine-core/p-519ef0c4.system.js.map +1 -0
  483. package/dist/pine-core/p-56588c5d.entry.js +2 -0
  484. package/dist/pine-core/p-56588c5d.entry.js.map +1 -0
  485. package/dist/pine-core/p-56ba5cbf.system.js +2 -0
  486. package/dist/pine-core/p-56ba5cbf.system.js.map +1 -0
  487. package/dist/pine-core/p-5c60147f.system.entry.js +9 -0
  488. package/dist/pine-core/p-5c60147f.system.entry.js.map +1 -0
  489. package/dist/pine-core/p-5c8608cd.system.entry.js +2 -0
  490. package/dist/pine-core/p-5c8608cd.system.entry.js.map +1 -0
  491. package/dist/pine-core/p-5d08fe24.entry.js +2 -0
  492. package/dist/pine-core/p-5d08fe24.entry.js.map +1 -0
  493. package/dist/pine-core/p-606b6dbb.entry.js +2 -0
  494. package/dist/pine-core/p-606b6dbb.entry.js.map +1 -0
  495. package/dist/pine-core/p-60f4dc68.system.entry.js +2 -0
  496. package/dist/pine-core/p-60f4dc68.system.entry.js.map +1 -0
  497. package/dist/pine-core/p-6525ed78.entry.js +2 -0
  498. package/dist/pine-core/p-6525ed78.entry.js.map +1 -0
  499. package/dist/pine-core/p-684d04ae.entry.js +2 -0
  500. package/dist/pine-core/p-684d04ae.entry.js.map +1 -0
  501. package/dist/pine-core/p-6f38bc8e.entry.js +2 -0
  502. package/dist/pine-core/p-6f38bc8e.entry.js.map +1 -0
  503. package/dist/pine-core/p-6f511f31.entry.js +2 -0
  504. package/dist/pine-core/p-6f511f31.entry.js.map +1 -0
  505. package/dist/pine-core/p-74d57e61.system.entry.js +2 -0
  506. package/dist/pine-core/p-74d57e61.system.entry.js.map +1 -0
  507. package/dist/pine-core/p-806b41c3.entry.js +2 -0
  508. package/dist/pine-core/p-806b41c3.entry.js.map +1 -0
  509. package/dist/pine-core/p-807d5d68.system.entry.js +2 -0
  510. package/dist/pine-core/p-807d5d68.system.entry.js.map +1 -0
  511. package/dist/pine-core/p-854fa9e2.entry.js +2 -0
  512. package/dist/pine-core/p-854fa9e2.entry.js.map +1 -0
  513. package/dist/pine-core/p-867aee19.entry.js +2 -0
  514. package/dist/pine-core/p-867aee19.entry.js.map +1 -0
  515. package/dist/pine-core/p-8701cb7b.system.entry.js +2 -0
  516. package/dist/pine-core/p-8701cb7b.system.entry.js.map +1 -0
  517. package/dist/pine-core/p-87b61d15.system.entry.js +2 -0
  518. package/dist/pine-core/p-87b61d15.system.entry.js.map +1 -0
  519. package/dist/pine-core/p-8a1b3866.entry.js +2 -0
  520. package/dist/pine-core/p-8a1b3866.entry.js.map +1 -0
  521. package/dist/pine-core/p-8c719c49.entry.js +2 -0
  522. package/dist/pine-core/p-8c719c49.entry.js.map +1 -0
  523. package/dist/pine-core/p-8f3273ed.system.entry.js +2 -0
  524. package/dist/pine-core/p-8f3273ed.system.entry.js.map +1 -0
  525. package/dist/pine-core/p-8fcfa336.entry.js +2 -0
  526. package/dist/pine-core/p-8fcfa336.entry.js.map +1 -0
  527. package/dist/pine-core/p-90694e70.entry.js +2 -0
  528. package/dist/pine-core/p-90694e70.entry.js.map +1 -0
  529. package/dist/pine-core/p-91bb8017.entry.js +2 -0
  530. package/dist/pine-core/p-91bb8017.entry.js.map +1 -0
  531. package/dist/pine-core/p-924a951b.system.entry.js +2 -0
  532. package/dist/pine-core/p-924a951b.system.entry.js.map +1 -0
  533. package/dist/pine-core/p-9c538ab0.entry.js +2 -0
  534. package/dist/pine-core/p-9c538ab0.entry.js.map +1 -0
  535. package/dist/pine-core/p-9d959d25.system.entry.js +2 -0
  536. package/dist/pine-core/p-9d959d25.system.entry.js.map +1 -0
  537. package/dist/pine-core/p-ad997571.system.entry.js +2 -0
  538. package/dist/pine-core/p-ad997571.system.entry.js.map +1 -0
  539. package/dist/pine-core/p-b1363254.entry.js +2 -0
  540. package/dist/pine-core/p-b1363254.entry.js.map +1 -0
  541. package/dist/pine-core/p-b47f8855.entry.js +2 -0
  542. package/dist/pine-core/p-b47f8855.entry.js.map +1 -0
  543. package/dist/pine-core/p-b480d80a.entry.js +2 -0
  544. package/dist/pine-core/p-b480d80a.entry.js.map +1 -0
  545. package/dist/pine-core/p-b5859bbd.system.entry.js +2 -0
  546. package/dist/pine-core/p-b5859bbd.system.entry.js.map +1 -0
  547. package/dist/pine-core/p-b978c861.entry.js +2 -0
  548. package/dist/pine-core/p-b978c861.entry.js.map +1 -0
  549. package/dist/pine-core/p-bdc39517.system.entry.js +2 -0
  550. package/dist/pine-core/p-bdc39517.system.entry.js.map +1 -0
  551. package/dist/pine-core/p-c03cfc96.js +2 -0
  552. package/dist/pine-core/p-c03cfc96.js.map +1 -0
  553. package/dist/pine-core/p-c56d871e.system.entry.js +2 -0
  554. package/dist/pine-core/p-c56d871e.system.entry.js.map +1 -0
  555. package/dist/pine-core/p-cca53530.system.entry.js +2 -0
  556. package/dist/pine-core/p-cca53530.system.entry.js.map +1 -0
  557. package/dist/pine-core/p-cddeae53.entry.js +2 -0
  558. package/dist/pine-core/p-cddeae53.entry.js.map +1 -0
  559. package/dist/pine-core/p-d33de2b3.system.entry.js +2 -0
  560. package/dist/pine-core/p-d33de2b3.system.entry.js.map +1 -0
  561. package/dist/pine-core/p-dcc876d5.entry.js +2 -0
  562. package/dist/pine-core/p-dcc876d5.entry.js.map +1 -0
  563. package/dist/pine-core/p-e1255160.js +2 -0
  564. package/dist/pine-core/p-e1255160.js.map +1 -0
  565. package/dist/pine-core/p-ece97e5b.system.js +2 -0
  566. package/dist/pine-core/p-ece97e5b.system.js.map +1 -0
  567. package/dist/pine-core/p-ee65aef1.system.js +2 -0
  568. package/dist/pine-core/p-ee65aef1.system.js.map +1 -0
  569. package/dist/pine-core/p-efc85823.js +2 -0
  570. package/dist/pine-core/p-efc85823.js.map +1 -0
  571. package/dist/pine-core/p-f1610dff.system.entry.js +2 -0
  572. package/dist/pine-core/p-f1610dff.system.entry.js.map +1 -0
  573. package/dist/pine-core/p-f666c482.entry.js +2 -0
  574. package/dist/pine-core/p-f666c482.entry.js.map +1 -0
  575. package/dist/pine-core/p-f80b45a9.system.entry.js +2 -0
  576. package/dist/pine-core/p-f80b45a9.system.entry.js.map +1 -0
  577. package/dist/pine-core/p-f92e85c4.entry.js +2 -0
  578. package/dist/pine-core/p-f92e85c4.entry.js.map +1 -0
  579. package/dist/pine-core/p-fc202585.entry.js +2 -0
  580. package/dist/pine-core/p-fc202585.entry.js.map +1 -0
  581. package/dist/pine-core/pine-core.css +1 -180
  582. package/dist/pine-core/pine-core.esm.js +1 -52
  583. package/dist/pine-core/pine-core.esm.js.map +1 -1
  584. package/dist/pine-core/pine-core.js +127 -0
  585. package/hydrate/index.js +28 -28
  586. package/package.json +1 -1
  587. package/dist/pine-core/index-00e73f84.js +0 -329
  588. package/dist/pine-core/index-00e73f84.js.map +0 -1
  589. package/dist/pine-core/index-cccc19b7.js.map +0 -1
  590. package/dist/pine-core/pds-accordion.entry.js.map +0 -1
  591. package/dist/pine-core/pds-avatar.entry.js.map +0 -1
  592. package/dist/pine-core/pds-box.entry.js +0 -77
  593. package/dist/pine-core/pds-box.entry.js.map +0 -1
  594. package/dist/pine-core/pds-button.entry.js.map +0 -1
  595. package/dist/pine-core/pds-checkbox.entry.js.map +0 -1
  596. package/dist/pine-core/pds-chip.entry.js +0 -46
  597. package/dist/pine-core/pds-chip.entry.js.map +0 -1
  598. package/dist/pine-core/pds-copytext.entry.js.map +0 -1
  599. package/dist/pine-core/pds-divider.entry.js +0 -31
  600. package/dist/pine-core/pds-divider.entry.js.map +0 -1
  601. package/dist/pine-core/pds-image.entry.js.map +0 -1
  602. package/dist/pine-core/pds-input.entry.js.map +0 -1
  603. package/dist/pine-core/pds-link.entry.js.map +0 -1
  604. package/dist/pine-core/pds-loader.entry.js +0 -44
  605. package/dist/pine-core/pds-loader.entry.js.map +0 -1
  606. package/dist/pine-core/pds-progress.entry.js +0 -23
  607. package/dist/pine-core/pds-progress.entry.js.map +0 -1
  608. package/dist/pine-core/pds-radio.entry.js.map +0 -1
  609. package/dist/pine-core/pds-row.entry.js +0 -46
  610. package/dist/pine-core/pds-row.entry.js.map +0 -1
  611. package/dist/pine-core/pds-sortable-item.entry.js +0 -30
  612. package/dist/pine-core/pds-sortable-item.entry.js.map +0 -1
  613. package/dist/pine-core/pds-sortable.entry.js.map +0 -1
  614. package/dist/pine-core/pds-switch.entry.js.map +0 -1
  615. package/dist/pine-core/pds-tab.entry.js +0 -29
  616. package/dist/pine-core/pds-tab.entry.js.map +0 -1
  617. package/dist/pine-core/pds-table-body.entry.js.map +0 -1
  618. package/dist/pine-core/pds-table-cell.entry.js.map +0 -1
  619. package/dist/pine-core/pds-table-head-cell.entry.js.map +0 -1
  620. package/dist/pine-core/pds-table-head.entry.js.map +0 -1
  621. package/dist/pine-core/pds-table-row.entry.js.map +0 -1
  622. package/dist/pine-core/pds-tabpanel.entry.js.map +0 -1
  623. package/dist/pine-core/pds-tabs.entry.js.map +0 -1
  624. package/dist/pine-core/pds-textarea.entry.js.map +0 -1
  625. package/dist/pine-core/pds-tooltip.entry.js.map +0 -1
  626. package/dist/pine-core/shadow-css-2e0fed52.js +0 -478
  627. package/dist/pine-core/shadow-css-2e0fed52.js.map +0 -1
  628. /package/dist/{pine-core → esm}/app-globals-0f993ce5.js +0 -0
  629. /package/dist/{pine-core → esm}/app-globals-0f993ce5.js.map +0 -0
  630. /package/dist/{pine-core → esm}/closest-d2d192be.js +0 -0
  631. /package/dist/{pine-core → esm}/closest-d2d192be.js.map +0 -0
@@ -0,0 +1,2704 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index$1 = require('./index-11f95019.js');
6
+
7
+ /**!
8
+ * Sortable 1.15.2
9
+ * @author RubaXa <trash@rubaxa.org>
10
+ * @author owenm <owen23355@gmail.com>
11
+ * @license MIT
12
+ */
13
+ function ownKeys(object, enumerableOnly) {
14
+ var keys = Object.keys(object);
15
+ if (Object.getOwnPropertySymbols) {
16
+ var symbols = Object.getOwnPropertySymbols(object);
17
+ if (enumerableOnly) {
18
+ symbols = symbols.filter(function (sym) {
19
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
20
+ });
21
+ }
22
+ keys.push.apply(keys, symbols);
23
+ }
24
+ return keys;
25
+ }
26
+ function _objectSpread2(target) {
27
+ for (var i = 1; i < arguments.length; i++) {
28
+ var source = arguments[i] != null ? arguments[i] : {};
29
+ if (i % 2) {
30
+ ownKeys(Object(source), true).forEach(function (key) {
31
+ _defineProperty(target, key, source[key]);
32
+ });
33
+ } else if (Object.getOwnPropertyDescriptors) {
34
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
35
+ } else {
36
+ ownKeys(Object(source)).forEach(function (key) {
37
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
38
+ });
39
+ }
40
+ }
41
+ return target;
42
+ }
43
+ function _typeof(obj) {
44
+ "@babel/helpers - typeof";
45
+
46
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
47
+ _typeof = function (obj) {
48
+ return typeof obj;
49
+ };
50
+ } else {
51
+ _typeof = function (obj) {
52
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
53
+ };
54
+ }
55
+ return _typeof(obj);
56
+ }
57
+ function _defineProperty(obj, key, value) {
58
+ if (key in obj) {
59
+ Object.defineProperty(obj, key, {
60
+ value: value,
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true
64
+ });
65
+ } else {
66
+ obj[key] = value;
67
+ }
68
+ return obj;
69
+ }
70
+ function _extends() {
71
+ _extends = Object.assign || function (target) {
72
+ for (var i = 1; i < arguments.length; i++) {
73
+ var source = arguments[i];
74
+ for (var key in source) {
75
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
76
+ target[key] = source[key];
77
+ }
78
+ }
79
+ }
80
+ return target;
81
+ };
82
+ return _extends.apply(this, arguments);
83
+ }
84
+ function _objectWithoutPropertiesLoose(source, excluded) {
85
+ if (source == null) return {};
86
+ var target = {};
87
+ var sourceKeys = Object.keys(source);
88
+ var key, i;
89
+ for (i = 0; i < sourceKeys.length; i++) {
90
+ key = sourceKeys[i];
91
+ if (excluded.indexOf(key) >= 0) continue;
92
+ target[key] = source[key];
93
+ }
94
+ return target;
95
+ }
96
+ function _objectWithoutProperties(source, excluded) {
97
+ if (source == null) return {};
98
+ var target = _objectWithoutPropertiesLoose(source, excluded);
99
+ var key, i;
100
+ if (Object.getOwnPropertySymbols) {
101
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
102
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
103
+ key = sourceSymbolKeys[i];
104
+ if (excluded.indexOf(key) >= 0) continue;
105
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
106
+ target[key] = source[key];
107
+ }
108
+ }
109
+ return target;
110
+ }
111
+
112
+ var version = "1.15.2";
113
+
114
+ function userAgent(pattern) {
115
+ if (typeof window !== 'undefined' && window.navigator) {
116
+ return !! /*@__PURE__*/navigator.userAgent.match(pattern);
117
+ }
118
+ }
119
+ var IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
120
+ var Edge = userAgent(/Edge/i);
121
+ var FireFox = userAgent(/firefox/i);
122
+ var Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
123
+ var IOS = userAgent(/iP(ad|od|hone)/i);
124
+ var ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
125
+
126
+ var captureMode = {
127
+ capture: false,
128
+ passive: false
129
+ };
130
+ function on(el, event, fn) {
131
+ el.addEventListener(event, fn, !IE11OrLess && captureMode);
132
+ }
133
+ function off(el, event, fn) {
134
+ el.removeEventListener(event, fn, !IE11OrLess && captureMode);
135
+ }
136
+ function matches( /**HTMLElement*/el, /**String*/selector) {
137
+ if (!selector) return;
138
+ selector[0] === '>' && (selector = selector.substring(1));
139
+ if (el) {
140
+ try {
141
+ if (el.matches) {
142
+ return el.matches(selector);
143
+ } else if (el.msMatchesSelector) {
144
+ return el.msMatchesSelector(selector);
145
+ } else if (el.webkitMatchesSelector) {
146
+ return el.webkitMatchesSelector(selector);
147
+ }
148
+ } catch (_) {
149
+ return false;
150
+ }
151
+ }
152
+ return false;
153
+ }
154
+ function getParentOrHost(el) {
155
+ return el.host && el !== document && el.host.nodeType ? el.host : el.parentNode;
156
+ }
157
+ function closest( /**HTMLElement*/el, /**String*/selector, /**HTMLElement*/ctx, includeCTX) {
158
+ if (el) {
159
+ ctx = ctx || document;
160
+ do {
161
+ if (selector != null && (selector[0] === '>' ? el.parentNode === ctx && matches(el, selector) : matches(el, selector)) || includeCTX && el === ctx) {
162
+ return el;
163
+ }
164
+ if (el === ctx) break;
165
+ /* jshint boss:true */
166
+ } while (el = getParentOrHost(el));
167
+ }
168
+ return null;
169
+ }
170
+ var R_SPACE = /\s+/g;
171
+ function toggleClass(el, name, state) {
172
+ if (el && name) {
173
+ if (el.classList) {
174
+ el.classList[state ? 'add' : 'remove'](name);
175
+ } else {
176
+ var className = (' ' + el.className + ' ').replace(R_SPACE, ' ').replace(' ' + name + ' ', ' ');
177
+ el.className = (className + (state ? ' ' + name : '')).replace(R_SPACE, ' ');
178
+ }
179
+ }
180
+ }
181
+ function css(el, prop, val) {
182
+ var style = el && el.style;
183
+ if (style) {
184
+ if (val === void 0) {
185
+ if (document.defaultView && document.defaultView.getComputedStyle) {
186
+ val = document.defaultView.getComputedStyle(el, '');
187
+ } else if (el.currentStyle) {
188
+ val = el.currentStyle;
189
+ }
190
+ return prop === void 0 ? val : val[prop];
191
+ } else {
192
+ if (!(prop in style) && prop.indexOf('webkit') === -1) {
193
+ prop = '-webkit-' + prop;
194
+ }
195
+ style[prop] = val + (typeof val === 'string' ? '' : 'px');
196
+ }
197
+ }
198
+ }
199
+ function matrix(el, selfOnly) {
200
+ var appliedTransforms = '';
201
+ if (typeof el === 'string') {
202
+ appliedTransforms = el;
203
+ } else {
204
+ do {
205
+ var transform = css(el, 'transform');
206
+ if (transform && transform !== 'none') {
207
+ appliedTransforms = transform + ' ' + appliedTransforms;
208
+ }
209
+ /* jshint boss:true */
210
+ } while (!selfOnly && (el = el.parentNode));
211
+ }
212
+ var matrixFn = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
213
+ /*jshint -W056 */
214
+ return matrixFn && new matrixFn(appliedTransforms);
215
+ }
216
+ function find(ctx, tagName, iterator) {
217
+ if (ctx) {
218
+ var list = ctx.getElementsByTagName(tagName),
219
+ i = 0,
220
+ n = list.length;
221
+ if (iterator) {
222
+ for (; i < n; i++) {
223
+ iterator(list[i], i);
224
+ }
225
+ }
226
+ return list;
227
+ }
228
+ return [];
229
+ }
230
+ function getWindowScrollingElement() {
231
+ var scrollingElement = document.scrollingElement;
232
+ if (scrollingElement) {
233
+ return scrollingElement;
234
+ } else {
235
+ return document.documentElement;
236
+ }
237
+ }
238
+
239
+ /**
240
+ * Returns the "bounding client rect" of given element
241
+ * @param {HTMLElement} el The element whose boundingClientRect is wanted
242
+ * @param {[Boolean]} relativeToContainingBlock Whether the rect should be relative to the containing block of (including) the container
243
+ * @param {[Boolean]} relativeToNonStaticParent Whether the rect should be relative to the relative parent of (including) the contaienr
244
+ * @param {[Boolean]} undoScale Whether the container's scale() should be undone
245
+ * @param {[HTMLElement]} container The parent the element will be placed in
246
+ * @return {Object} The boundingClientRect of el, with specified adjustments
247
+ */
248
+ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
249
+ if (!el.getBoundingClientRect && el !== window) return;
250
+ var elRect, top, left, bottom, right, height, width;
251
+ if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
252
+ elRect = el.getBoundingClientRect();
253
+ top = elRect.top;
254
+ left = elRect.left;
255
+ bottom = elRect.bottom;
256
+ right = elRect.right;
257
+ height = elRect.height;
258
+ width = elRect.width;
259
+ } else {
260
+ top = 0;
261
+ left = 0;
262
+ bottom = window.innerHeight;
263
+ right = window.innerWidth;
264
+ height = window.innerHeight;
265
+ width = window.innerWidth;
266
+ }
267
+ if ((relativeToContainingBlock || relativeToNonStaticParent) && el !== window) {
268
+ // Adjust for translate()
269
+ container = container || el.parentNode;
270
+
271
+ // solves #1123 (see: https://stackoverflow.com/a/37953806/6088312)
272
+ // Not needed on <= IE11
273
+ if (!IE11OrLess) {
274
+ do {
275
+ if (container && container.getBoundingClientRect && (css(container, 'transform') !== 'none' || relativeToNonStaticParent && css(container, 'position') !== 'static')) {
276
+ var containerRect = container.getBoundingClientRect();
277
+
278
+ // Set relative to edges of padding box of container
279
+ top -= containerRect.top + parseInt(css(container, 'border-top-width'));
280
+ left -= containerRect.left + parseInt(css(container, 'border-left-width'));
281
+ bottom = top + elRect.height;
282
+ right = left + elRect.width;
283
+ break;
284
+ }
285
+ /* jshint boss:true */
286
+ } while (container = container.parentNode);
287
+ }
288
+ }
289
+ if (undoScale && el !== window) {
290
+ // Adjust for scale()
291
+ var elMatrix = matrix(container || el),
292
+ scaleX = elMatrix && elMatrix.a,
293
+ scaleY = elMatrix && elMatrix.d;
294
+ if (elMatrix) {
295
+ top /= scaleY;
296
+ left /= scaleX;
297
+ width /= scaleX;
298
+ height /= scaleY;
299
+ bottom = top + height;
300
+ right = left + width;
301
+ }
302
+ }
303
+ return {
304
+ top: top,
305
+ left: left,
306
+ bottom: bottom,
307
+ right: right,
308
+ width: width,
309
+ height: height
310
+ };
311
+ }
312
+
313
+ /**
314
+ * Checks if a side of an element is scrolled past a side of its parents
315
+ * @param {HTMLElement} el The element who's side being scrolled out of view is in question
316
+ * @param {String} elSide Side of the element in question ('top', 'left', 'right', 'bottom')
317
+ * @param {String} parentSide Side of the parent in question ('top', 'left', 'right', 'bottom')
318
+ * @return {HTMLElement} The parent scroll element that the el's side is scrolled past, or null if there is no such element
319
+ */
320
+ function isScrolledPast(el, elSide, parentSide) {
321
+ var parent = getParentAutoScrollElement(el, true),
322
+ elSideVal = getRect(el)[elSide];
323
+
324
+ /* jshint boss:true */
325
+ while (parent) {
326
+ var parentSideVal = getRect(parent)[parentSide],
327
+ visible = void 0;
328
+ if (parentSide === 'top' || parentSide === 'left') {
329
+ visible = elSideVal >= parentSideVal;
330
+ } else {
331
+ visible = elSideVal <= parentSideVal;
332
+ }
333
+ if (!visible) return parent;
334
+ if (parent === getWindowScrollingElement()) break;
335
+ parent = getParentAutoScrollElement(parent, false);
336
+ }
337
+ return false;
338
+ }
339
+
340
+ /**
341
+ * Gets nth child of el, ignoring hidden children, sortable's elements (does not ignore clone if it's visible)
342
+ * and non-draggable elements
343
+ * @param {HTMLElement} el The parent element
344
+ * @param {Number} childNum The index of the child
345
+ * @param {Object} options Parent Sortable's options
346
+ * @return {HTMLElement} The child at index childNum, or null if not found
347
+ */
348
+ function getChild(el, childNum, options, includeDragEl) {
349
+ var currentChild = 0,
350
+ i = 0,
351
+ children = el.children;
352
+ while (i < children.length) {
353
+ if (children[i].style.display !== 'none' && children[i] !== Sortable.ghost && (includeDragEl || children[i] !== Sortable.dragged) && closest(children[i], options.draggable, el, false)) {
354
+ if (currentChild === childNum) {
355
+ return children[i];
356
+ }
357
+ currentChild++;
358
+ }
359
+ i++;
360
+ }
361
+ return null;
362
+ }
363
+
364
+ /**
365
+ * Gets the last child in the el, ignoring ghostEl or invisible elements (clones)
366
+ * @param {HTMLElement} el Parent element
367
+ * @param {selector} selector Any other elements that should be ignored
368
+ * @return {HTMLElement} The last child, ignoring ghostEl
369
+ */
370
+ function lastChild(el, selector) {
371
+ var last = el.lastElementChild;
372
+ while (last && (last === Sortable.ghost || css(last, 'display') === 'none' || selector && !matches(last, selector))) {
373
+ last = last.previousElementSibling;
374
+ }
375
+ return last || null;
376
+ }
377
+
378
+ /**
379
+ * Returns the index of an element within its parent for a selected set of
380
+ * elements
381
+ * @param {HTMLElement} el
382
+ * @param {selector} selector
383
+ * @return {number}
384
+ */
385
+ function index(el, selector) {
386
+ var index = 0;
387
+ if (!el || !el.parentNode) {
388
+ return -1;
389
+ }
390
+
391
+ /* jshint boss:true */
392
+ while (el = el.previousElementSibling) {
393
+ if (el.nodeName.toUpperCase() !== 'TEMPLATE' && el !== Sortable.clone && (!selector || matches(el, selector))) {
394
+ index++;
395
+ }
396
+ }
397
+ return index;
398
+ }
399
+
400
+ /**
401
+ * Returns the scroll offset of the given element, added with all the scroll offsets of parent elements.
402
+ * The value is returned in real pixels.
403
+ * @param {HTMLElement} el
404
+ * @return {Array} Offsets in the format of [left, top]
405
+ */
406
+ function getRelativeScrollOffset(el) {
407
+ var offsetLeft = 0,
408
+ offsetTop = 0,
409
+ winScroller = getWindowScrollingElement();
410
+ if (el) {
411
+ do {
412
+ var elMatrix = matrix(el),
413
+ scaleX = elMatrix.a,
414
+ scaleY = elMatrix.d;
415
+ offsetLeft += el.scrollLeft * scaleX;
416
+ offsetTop += el.scrollTop * scaleY;
417
+ } while (el !== winScroller && (el = el.parentNode));
418
+ }
419
+ return [offsetLeft, offsetTop];
420
+ }
421
+
422
+ /**
423
+ * Returns the index of the object within the given array
424
+ * @param {Array} arr Array that may or may not hold the object
425
+ * @param {Object} obj An object that has a key-value pair unique to and identical to a key-value pair in the object you want to find
426
+ * @return {Number} The index of the object in the array, or -1
427
+ */
428
+ function indexOfObject(arr, obj) {
429
+ for (var i in arr) {
430
+ if (!arr.hasOwnProperty(i)) continue;
431
+ for (var key in obj) {
432
+ if (obj.hasOwnProperty(key) && obj[key] === arr[i][key]) return Number(i);
433
+ }
434
+ }
435
+ return -1;
436
+ }
437
+ function getParentAutoScrollElement(el, includeSelf) {
438
+ // skip to window
439
+ if (!el || !el.getBoundingClientRect) return getWindowScrollingElement();
440
+ var elem = el;
441
+ var gotSelf = false;
442
+ do {
443
+ // we don't need to get elem css if it isn't even overflowing in the first place (performance)
444
+ if (elem.clientWidth < elem.scrollWidth || elem.clientHeight < elem.scrollHeight) {
445
+ var elemCSS = css(elem);
446
+ if (elem.clientWidth < elem.scrollWidth && (elemCSS.overflowX == 'auto' || elemCSS.overflowX == 'scroll') || elem.clientHeight < elem.scrollHeight && (elemCSS.overflowY == 'auto' || elemCSS.overflowY == 'scroll')) {
447
+ if (!elem.getBoundingClientRect || elem === document.body) return getWindowScrollingElement();
448
+ if (gotSelf || includeSelf) return elem;
449
+ gotSelf = true;
450
+ }
451
+ }
452
+ /* jshint boss:true */
453
+ } while (elem = elem.parentNode);
454
+ return getWindowScrollingElement();
455
+ }
456
+ function extend(dst, src) {
457
+ if (dst && src) {
458
+ for (var key in src) {
459
+ if (src.hasOwnProperty(key)) {
460
+ dst[key] = src[key];
461
+ }
462
+ }
463
+ }
464
+ return dst;
465
+ }
466
+ function isRectEqual(rect1, rect2) {
467
+ return Math.round(rect1.top) === Math.round(rect2.top) && Math.round(rect1.left) === Math.round(rect2.left) && Math.round(rect1.height) === Math.round(rect2.height) && Math.round(rect1.width) === Math.round(rect2.width);
468
+ }
469
+ var _throttleTimeout;
470
+ function throttle(callback, ms) {
471
+ return function () {
472
+ if (!_throttleTimeout) {
473
+ var args = arguments,
474
+ _this = this;
475
+ if (args.length === 1) {
476
+ callback.call(_this, args[0]);
477
+ } else {
478
+ callback.apply(_this, args);
479
+ }
480
+ _throttleTimeout = setTimeout(function () {
481
+ _throttleTimeout = void 0;
482
+ }, ms);
483
+ }
484
+ };
485
+ }
486
+ function cancelThrottle() {
487
+ clearTimeout(_throttleTimeout);
488
+ _throttleTimeout = void 0;
489
+ }
490
+ function scrollBy(el, x, y) {
491
+ el.scrollLeft += x;
492
+ el.scrollTop += y;
493
+ }
494
+ function clone(el) {
495
+ var Polymer = window.Polymer;
496
+ var $ = window.jQuery || window.Zepto;
497
+ if (Polymer && Polymer.dom) {
498
+ return Polymer.dom(el).cloneNode(true);
499
+ } else if ($) {
500
+ return $(el).clone(true)[0];
501
+ } else {
502
+ return el.cloneNode(true);
503
+ }
504
+ }
505
+ function getChildContainingRectFromElement(container, options, ghostEl) {
506
+ var rect = {};
507
+ Array.from(container.children).forEach(function (child) {
508
+ var _rect$left, _rect$top, _rect$right, _rect$bottom;
509
+ if (!closest(child, options.draggable, container, false) || child.animated || child === ghostEl) return;
510
+ var childRect = getRect(child);
511
+ rect.left = Math.min((_rect$left = rect.left) !== null && _rect$left !== void 0 ? _rect$left : Infinity, childRect.left);
512
+ rect.top = Math.min((_rect$top = rect.top) !== null && _rect$top !== void 0 ? _rect$top : Infinity, childRect.top);
513
+ rect.right = Math.max((_rect$right = rect.right) !== null && _rect$right !== void 0 ? _rect$right : -Infinity, childRect.right);
514
+ rect.bottom = Math.max((_rect$bottom = rect.bottom) !== null && _rect$bottom !== void 0 ? _rect$bottom : -Infinity, childRect.bottom);
515
+ });
516
+ rect.width = rect.right - rect.left;
517
+ rect.height = rect.bottom - rect.top;
518
+ rect.x = rect.left;
519
+ rect.y = rect.top;
520
+ return rect;
521
+ }
522
+ var expando = 'Sortable' + new Date().getTime();
523
+
524
+ function AnimationStateManager() {
525
+ var animationStates = [],
526
+ animationCallbackId;
527
+ return {
528
+ captureAnimationState: function captureAnimationState() {
529
+ animationStates = [];
530
+ if (!this.options.animation) return;
531
+ var children = [].slice.call(this.el.children);
532
+ children.forEach(function (child) {
533
+ if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
534
+ animationStates.push({
535
+ target: child,
536
+ rect: getRect(child)
537
+ });
538
+ var fromRect = _objectSpread2({}, animationStates[animationStates.length - 1].rect);
539
+
540
+ // If animating: compensate for current animation
541
+ if (child.thisAnimationDuration) {
542
+ var childMatrix = matrix(child, true);
543
+ if (childMatrix) {
544
+ fromRect.top -= childMatrix.f;
545
+ fromRect.left -= childMatrix.e;
546
+ }
547
+ }
548
+ child.fromRect = fromRect;
549
+ });
550
+ },
551
+ addAnimationState: function addAnimationState(state) {
552
+ animationStates.push(state);
553
+ },
554
+ removeAnimationState: function removeAnimationState(target) {
555
+ animationStates.splice(indexOfObject(animationStates, {
556
+ target: target
557
+ }), 1);
558
+ },
559
+ animateAll: function animateAll(callback) {
560
+ var _this = this;
561
+ if (!this.options.animation) {
562
+ clearTimeout(animationCallbackId);
563
+ if (typeof callback === 'function') callback();
564
+ return;
565
+ }
566
+ var animating = false,
567
+ animationTime = 0;
568
+ animationStates.forEach(function (state) {
569
+ var time = 0,
570
+ target = state.target,
571
+ fromRect = target.fromRect,
572
+ toRect = getRect(target),
573
+ prevFromRect = target.prevFromRect,
574
+ prevToRect = target.prevToRect,
575
+ animatingRect = state.rect,
576
+ targetMatrix = matrix(target, true);
577
+ if (targetMatrix) {
578
+ // Compensate for current animation
579
+ toRect.top -= targetMatrix.f;
580
+ toRect.left -= targetMatrix.e;
581
+ }
582
+ target.toRect = toRect;
583
+ if (target.thisAnimationDuration) {
584
+ // Could also check if animatingRect is between fromRect and toRect
585
+ if (isRectEqual(prevFromRect, toRect) && !isRectEqual(fromRect, toRect) &&
586
+ // Make sure animatingRect is on line between toRect & fromRect
587
+ (animatingRect.top - toRect.top) / (animatingRect.left - toRect.left) === (fromRect.top - toRect.top) / (fromRect.left - toRect.left)) {
588
+ // If returning to same place as started from animation and on same axis
589
+ time = calculateRealTime(animatingRect, prevFromRect, prevToRect, _this.options);
590
+ }
591
+ }
592
+
593
+ // if fromRect != toRect: animate
594
+ if (!isRectEqual(toRect, fromRect)) {
595
+ target.prevFromRect = fromRect;
596
+ target.prevToRect = toRect;
597
+ if (!time) {
598
+ time = _this.options.animation;
599
+ }
600
+ _this.animate(target, animatingRect, toRect, time);
601
+ }
602
+ if (time) {
603
+ animating = true;
604
+ animationTime = Math.max(animationTime, time);
605
+ clearTimeout(target.animationResetTimer);
606
+ target.animationResetTimer = setTimeout(function () {
607
+ target.animationTime = 0;
608
+ target.prevFromRect = null;
609
+ target.fromRect = null;
610
+ target.prevToRect = null;
611
+ target.thisAnimationDuration = null;
612
+ }, time);
613
+ target.thisAnimationDuration = time;
614
+ }
615
+ });
616
+ clearTimeout(animationCallbackId);
617
+ if (!animating) {
618
+ if (typeof callback === 'function') callback();
619
+ } else {
620
+ animationCallbackId = setTimeout(function () {
621
+ if (typeof callback === 'function') callback();
622
+ }, animationTime);
623
+ }
624
+ animationStates = [];
625
+ },
626
+ animate: function animate(target, currentRect, toRect, duration) {
627
+ if (duration) {
628
+ css(target, 'transition', '');
629
+ css(target, 'transform', '');
630
+ var elMatrix = matrix(this.el),
631
+ scaleX = elMatrix && elMatrix.a,
632
+ scaleY = elMatrix && elMatrix.d,
633
+ translateX = (currentRect.left - toRect.left) / (scaleX || 1),
634
+ translateY = (currentRect.top - toRect.top) / (scaleY || 1);
635
+ target.animatingX = !!translateX;
636
+ target.animatingY = !!translateY;
637
+ css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
638
+ this.forRepaintDummy = repaint(target); // repaint
639
+
640
+ css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
641
+ css(target, 'transform', 'translate3d(0,0,0)');
642
+ typeof target.animated === 'number' && clearTimeout(target.animated);
643
+ target.animated = setTimeout(function () {
644
+ css(target, 'transition', '');
645
+ css(target, 'transform', '');
646
+ target.animated = false;
647
+ target.animatingX = false;
648
+ target.animatingY = false;
649
+ }, duration);
650
+ }
651
+ }
652
+ };
653
+ }
654
+ function repaint(target) {
655
+ return target.offsetWidth;
656
+ }
657
+ function calculateRealTime(animatingRect, fromRect, toRect, options) {
658
+ return Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) / Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2)) * options.animation;
659
+ }
660
+
661
+ var plugins = [];
662
+ var defaults = {
663
+ initializeByDefault: true
664
+ };
665
+ var PluginManager = {
666
+ mount: function mount(plugin) {
667
+ // Set default static properties
668
+ for (var option in defaults) {
669
+ if (defaults.hasOwnProperty(option) && !(option in plugin)) {
670
+ plugin[option] = defaults[option];
671
+ }
672
+ }
673
+ plugins.forEach(function (p) {
674
+ if (p.pluginName === plugin.pluginName) {
675
+ throw "Sortable: Cannot mount plugin ".concat(plugin.pluginName, " more than once");
676
+ }
677
+ });
678
+ plugins.push(plugin);
679
+ },
680
+ pluginEvent: function pluginEvent(eventName, sortable, evt) {
681
+ var _this = this;
682
+ this.eventCanceled = false;
683
+ evt.cancel = function () {
684
+ _this.eventCanceled = true;
685
+ };
686
+ var eventNameGlobal = eventName + 'Global';
687
+ plugins.forEach(function (plugin) {
688
+ if (!sortable[plugin.pluginName]) return;
689
+ // Fire global events if it exists in this sortable
690
+ if (sortable[plugin.pluginName][eventNameGlobal]) {
691
+ sortable[plugin.pluginName][eventNameGlobal](_objectSpread2({
692
+ sortable: sortable
693
+ }, evt));
694
+ }
695
+
696
+ // Only fire plugin event if plugin is enabled in this sortable,
697
+ // and plugin has event defined
698
+ if (sortable.options[plugin.pluginName] && sortable[plugin.pluginName][eventName]) {
699
+ sortable[plugin.pluginName][eventName](_objectSpread2({
700
+ sortable: sortable
701
+ }, evt));
702
+ }
703
+ });
704
+ },
705
+ initializePlugins: function initializePlugins(sortable, el, defaults, options) {
706
+ plugins.forEach(function (plugin) {
707
+ var pluginName = plugin.pluginName;
708
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
709
+ var initialized = new plugin(sortable, el, sortable.options);
710
+ initialized.sortable = sortable;
711
+ initialized.options = sortable.options;
712
+ sortable[pluginName] = initialized;
713
+
714
+ // Add default options from plugin
715
+ _extends(defaults, initialized.defaults);
716
+ });
717
+ for (var option in sortable.options) {
718
+ if (!sortable.options.hasOwnProperty(option)) continue;
719
+ var modified = this.modifyOption(sortable, option, sortable.options[option]);
720
+ if (typeof modified !== 'undefined') {
721
+ sortable.options[option] = modified;
722
+ }
723
+ }
724
+ },
725
+ getEventProperties: function getEventProperties(name, sortable) {
726
+ var eventProperties = {};
727
+ plugins.forEach(function (plugin) {
728
+ if (typeof plugin.eventProperties !== 'function') return;
729
+ _extends(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
730
+ });
731
+ return eventProperties;
732
+ },
733
+ modifyOption: function modifyOption(sortable, name, value) {
734
+ var modifiedValue;
735
+ plugins.forEach(function (plugin) {
736
+ // Plugin must exist on the Sortable
737
+ if (!sortable[plugin.pluginName]) return;
738
+
739
+ // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
740
+ if (plugin.optionListeners && typeof plugin.optionListeners[name] === 'function') {
741
+ modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
742
+ }
743
+ });
744
+ return modifiedValue;
745
+ }
746
+ };
747
+
748
+ function dispatchEvent(_ref) {
749
+ var sortable = _ref.sortable,
750
+ rootEl = _ref.rootEl,
751
+ name = _ref.name,
752
+ targetEl = _ref.targetEl,
753
+ cloneEl = _ref.cloneEl,
754
+ toEl = _ref.toEl,
755
+ fromEl = _ref.fromEl,
756
+ oldIndex = _ref.oldIndex,
757
+ newIndex = _ref.newIndex,
758
+ oldDraggableIndex = _ref.oldDraggableIndex,
759
+ newDraggableIndex = _ref.newDraggableIndex,
760
+ originalEvent = _ref.originalEvent,
761
+ putSortable = _ref.putSortable,
762
+ extraEventProperties = _ref.extraEventProperties;
763
+ sortable = sortable || rootEl && rootEl[expando];
764
+ if (!sortable) return;
765
+ var evt,
766
+ options = sortable.options,
767
+ onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
768
+ // Support for new CustomEvent feature
769
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
770
+ evt = new CustomEvent(name, {
771
+ bubbles: true,
772
+ cancelable: true
773
+ });
774
+ } else {
775
+ evt = document.createEvent('Event');
776
+ evt.initEvent(name, true, true);
777
+ }
778
+ evt.to = toEl || rootEl;
779
+ evt.from = fromEl || rootEl;
780
+ evt.item = targetEl || rootEl;
781
+ evt.clone = cloneEl;
782
+ evt.oldIndex = oldIndex;
783
+ evt.newIndex = newIndex;
784
+ evt.oldDraggableIndex = oldDraggableIndex;
785
+ evt.newDraggableIndex = newDraggableIndex;
786
+ evt.originalEvent = originalEvent;
787
+ evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
788
+ var allEventProperties = _objectSpread2(_objectSpread2({}, extraEventProperties), PluginManager.getEventProperties(name, sortable));
789
+ for (var option in allEventProperties) {
790
+ evt[option] = allEventProperties[option];
791
+ }
792
+ if (rootEl) {
793
+ rootEl.dispatchEvent(evt);
794
+ }
795
+ if (options[onName]) {
796
+ options[onName].call(sortable, evt);
797
+ }
798
+ }
799
+
800
+ var _excluded = ["evt"];
801
+ var pluginEvent = function pluginEvent(eventName, sortable) {
802
+ var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
803
+ originalEvent = _ref.evt,
804
+ data = _objectWithoutProperties(_ref, _excluded);
805
+ PluginManager.pluginEvent.bind(Sortable)(eventName, sortable, _objectSpread2({
806
+ dragEl: dragEl,
807
+ parentEl: parentEl,
808
+ ghostEl: ghostEl,
809
+ rootEl: rootEl,
810
+ nextEl: nextEl,
811
+ lastDownEl: lastDownEl,
812
+ cloneEl: cloneEl,
813
+ cloneHidden: cloneHidden,
814
+ dragStarted: moved,
815
+ putSortable: putSortable,
816
+ activeSortable: Sortable.active,
817
+ originalEvent: originalEvent,
818
+ oldIndex: oldIndex,
819
+ oldDraggableIndex: oldDraggableIndex,
820
+ newIndex: newIndex,
821
+ newDraggableIndex: newDraggableIndex,
822
+ hideGhostForTarget: _hideGhostForTarget,
823
+ unhideGhostForTarget: _unhideGhostForTarget,
824
+ cloneNowHidden: function cloneNowHidden() {
825
+ cloneHidden = true;
826
+ },
827
+ cloneNowShown: function cloneNowShown() {
828
+ cloneHidden = false;
829
+ },
830
+ dispatchSortableEvent: function dispatchSortableEvent(name) {
831
+ _dispatchEvent({
832
+ sortable: sortable,
833
+ name: name,
834
+ originalEvent: originalEvent
835
+ });
836
+ }
837
+ }, data));
838
+ };
839
+ function _dispatchEvent(info) {
840
+ dispatchEvent(_objectSpread2({
841
+ putSortable: putSortable,
842
+ cloneEl: cloneEl,
843
+ targetEl: dragEl,
844
+ rootEl: rootEl,
845
+ oldIndex: oldIndex,
846
+ oldDraggableIndex: oldDraggableIndex,
847
+ newIndex: newIndex,
848
+ newDraggableIndex: newDraggableIndex
849
+ }, info));
850
+ }
851
+ var dragEl,
852
+ parentEl,
853
+ ghostEl,
854
+ rootEl,
855
+ nextEl,
856
+ lastDownEl,
857
+ cloneEl,
858
+ cloneHidden,
859
+ oldIndex,
860
+ newIndex,
861
+ oldDraggableIndex,
862
+ newDraggableIndex,
863
+ activeGroup,
864
+ putSortable,
865
+ awaitingDragStarted = false,
866
+ ignoreNextClick = false,
867
+ sortables = [],
868
+ tapEvt,
869
+ touchEvt,
870
+ lastDx,
871
+ lastDy,
872
+ tapDistanceLeft,
873
+ tapDistanceTop,
874
+ moved,
875
+ lastTarget,
876
+ lastDirection,
877
+ pastFirstInvertThresh = false,
878
+ isCircumstantialInvert = false,
879
+ targetMoveDistance,
880
+ // For positioning ghost absolutely
881
+ ghostRelativeParent,
882
+ ghostRelativeParentInitialScroll = [],
883
+ // (left, top)
884
+
885
+ _silent = false,
886
+ savedInputChecked = [];
887
+
888
+ /** @const */
889
+ var documentExists = typeof document !== 'undefined',
890
+ PositionGhostAbsolutely = IOS,
891
+ CSSFloatProperty = Edge || IE11OrLess ? 'cssFloat' : 'float',
892
+ // This will not pass for IE9, because IE9 DnD only works on anchors
893
+ supportDraggable = documentExists && !ChromeForAndroid && !IOS && 'draggable' in document.createElement('div'),
894
+ supportCssPointerEvents = function () {
895
+ if (!documentExists) return;
896
+ // false when <= IE11
897
+ if (IE11OrLess) {
898
+ return false;
899
+ }
900
+ var el = document.createElement('x');
901
+ el.style.cssText = 'pointer-events:auto';
902
+ return el.style.pointerEvents === 'auto';
903
+ }(),
904
+ _detectDirection = function _detectDirection(el, options) {
905
+ var elCSS = css(el),
906
+ elWidth = parseInt(elCSS.width) - parseInt(elCSS.paddingLeft) - parseInt(elCSS.paddingRight) - parseInt(elCSS.borderLeftWidth) - parseInt(elCSS.borderRightWidth),
907
+ child1 = getChild(el, 0, options),
908
+ child2 = getChild(el, 1, options),
909
+ firstChildCSS = child1 && css(child1),
910
+ secondChildCSS = child2 && css(child2),
911
+ firstChildWidth = firstChildCSS && parseInt(firstChildCSS.marginLeft) + parseInt(firstChildCSS.marginRight) + getRect(child1).width,
912
+ secondChildWidth = secondChildCSS && parseInt(secondChildCSS.marginLeft) + parseInt(secondChildCSS.marginRight) + getRect(child2).width;
913
+ if (elCSS.display === 'flex') {
914
+ return elCSS.flexDirection === 'column' || elCSS.flexDirection === 'column-reverse' ? 'vertical' : 'horizontal';
915
+ }
916
+ if (elCSS.display === 'grid') {
917
+ return elCSS.gridTemplateColumns.split(' ').length <= 1 ? 'vertical' : 'horizontal';
918
+ }
919
+ if (child1 && firstChildCSS["float"] && firstChildCSS["float"] !== 'none') {
920
+ var touchingSideChild2 = firstChildCSS["float"] === 'left' ? 'left' : 'right';
921
+ return child2 && (secondChildCSS.clear === 'both' || secondChildCSS.clear === touchingSideChild2) ? 'vertical' : 'horizontal';
922
+ }
923
+ return child1 && (firstChildCSS.display === 'block' || firstChildCSS.display === 'flex' || firstChildCSS.display === 'table' || firstChildCSS.display === 'grid' || firstChildWidth >= elWidth && elCSS[CSSFloatProperty] === 'none' || child2 && elCSS[CSSFloatProperty] === 'none' && firstChildWidth + secondChildWidth > elWidth) ? 'vertical' : 'horizontal';
924
+ },
925
+ _dragElInRowColumn = function _dragElInRowColumn(dragRect, targetRect, vertical) {
926
+ var dragElS1Opp = vertical ? dragRect.left : dragRect.top,
927
+ dragElS2Opp = vertical ? dragRect.right : dragRect.bottom,
928
+ dragElOppLength = vertical ? dragRect.width : dragRect.height,
929
+ targetS1Opp = vertical ? targetRect.left : targetRect.top,
930
+ targetS2Opp = vertical ? targetRect.right : targetRect.bottom,
931
+ targetOppLength = vertical ? targetRect.width : targetRect.height;
932
+ return dragElS1Opp === targetS1Opp || dragElS2Opp === targetS2Opp || dragElS1Opp + dragElOppLength / 2 === targetS1Opp + targetOppLength / 2;
933
+ },
934
+ /**
935
+ * Detects first nearest empty sortable to X and Y position using emptyInsertThreshold.
936
+ * @param {Number} x X position
937
+ * @param {Number} y Y position
938
+ * @return {HTMLElement} Element of the first found nearest Sortable
939
+ */
940
+ _detectNearestEmptySortable = function _detectNearestEmptySortable(x, y) {
941
+ var ret;
942
+ sortables.some(function (sortable) {
943
+ var threshold = sortable[expando].options.emptyInsertThreshold;
944
+ if (!threshold || lastChild(sortable)) return;
945
+ var rect = getRect(sortable),
946
+ insideHorizontally = x >= rect.left - threshold && x <= rect.right + threshold,
947
+ insideVertically = y >= rect.top - threshold && y <= rect.bottom + threshold;
948
+ if (insideHorizontally && insideVertically) {
949
+ return ret = sortable;
950
+ }
951
+ });
952
+ return ret;
953
+ },
954
+ _prepareGroup = function _prepareGroup(options) {
955
+ function toFn(value, pull) {
956
+ return function (to, from, dragEl, evt) {
957
+ var sameGroup = to.options.group.name && from.options.group.name && to.options.group.name === from.options.group.name;
958
+ if (value == null && (pull || sameGroup)) {
959
+ // Default pull value
960
+ // Default pull and put value if same group
961
+ return true;
962
+ } else if (value == null || value === false) {
963
+ return false;
964
+ } else if (pull && value === 'clone') {
965
+ return value;
966
+ } else if (typeof value === 'function') {
967
+ return toFn(value(to, from, dragEl, evt), pull)(to, from, dragEl, evt);
968
+ } else {
969
+ var otherGroup = (pull ? to : from).options.group.name;
970
+ return value === true || typeof value === 'string' && value === otherGroup || value.join && value.indexOf(otherGroup) > -1;
971
+ }
972
+ };
973
+ }
974
+ var group = {};
975
+ var originalGroup = options.group;
976
+ if (!originalGroup || _typeof(originalGroup) != 'object') {
977
+ originalGroup = {
978
+ name: originalGroup
979
+ };
980
+ }
981
+ group.name = originalGroup.name;
982
+ group.checkPull = toFn(originalGroup.pull, true);
983
+ group.checkPut = toFn(originalGroup.put);
984
+ group.revertClone = originalGroup.revertClone;
985
+ options.group = group;
986
+ },
987
+ _hideGhostForTarget = function _hideGhostForTarget() {
988
+ if (!supportCssPointerEvents && ghostEl) {
989
+ css(ghostEl, 'display', 'none');
990
+ }
991
+ },
992
+ _unhideGhostForTarget = function _unhideGhostForTarget() {
993
+ if (!supportCssPointerEvents && ghostEl) {
994
+ css(ghostEl, 'display', '');
995
+ }
996
+ };
997
+
998
+ // #1184 fix - Prevent click event on fallback if dragged but item not changed position
999
+ if (documentExists && !ChromeForAndroid) {
1000
+ document.addEventListener('click', function (evt) {
1001
+ if (ignoreNextClick) {
1002
+ evt.preventDefault();
1003
+ evt.stopPropagation && evt.stopPropagation();
1004
+ evt.stopImmediatePropagation && evt.stopImmediatePropagation();
1005
+ ignoreNextClick = false;
1006
+ return false;
1007
+ }
1008
+ }, true);
1009
+ }
1010
+ var nearestEmptyInsertDetectEvent = function nearestEmptyInsertDetectEvent(evt) {
1011
+ if (dragEl) {
1012
+ evt = evt.touches ? evt.touches[0] : evt;
1013
+ var nearest = _detectNearestEmptySortable(evt.clientX, evt.clientY);
1014
+ if (nearest) {
1015
+ // Create imitation event
1016
+ var event = {};
1017
+ for (var i in evt) {
1018
+ if (evt.hasOwnProperty(i)) {
1019
+ event[i] = evt[i];
1020
+ }
1021
+ }
1022
+ event.target = event.rootEl = nearest;
1023
+ event.preventDefault = void 0;
1024
+ event.stopPropagation = void 0;
1025
+ nearest[expando]._onDragOver(event);
1026
+ }
1027
+ }
1028
+ };
1029
+ var _checkOutsideTargetEl = function _checkOutsideTargetEl(evt) {
1030
+ if (dragEl) {
1031
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1032
+ }
1033
+ };
1034
+
1035
+ /**
1036
+ * @class Sortable
1037
+ * @param {HTMLElement} el
1038
+ * @param {Object} [options]
1039
+ */
1040
+ function Sortable(el, options) {
1041
+ if (!(el && el.nodeType && el.nodeType === 1)) {
1042
+ throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(el));
1043
+ }
1044
+ this.el = el; // root element
1045
+ this.options = options = _extends({}, options);
1046
+
1047
+ // Export instance
1048
+ el[expando] = this;
1049
+ var defaults = {
1050
+ group: null,
1051
+ sort: true,
1052
+ disabled: false,
1053
+ store: null,
1054
+ handle: null,
1055
+ draggable: /^[uo]l$/i.test(el.nodeName) ? '>li' : '>*',
1056
+ swapThreshold: 1,
1057
+ // percentage; 0 <= x <= 1
1058
+ invertSwap: false,
1059
+ // invert always
1060
+ invertedSwapThreshold: null,
1061
+ // will be set to same as swapThreshold if default
1062
+ removeCloneOnHide: true,
1063
+ direction: function direction() {
1064
+ return _detectDirection(el, this.options);
1065
+ },
1066
+ ghostClass: 'sortable-ghost',
1067
+ chosenClass: 'sortable-chosen',
1068
+ dragClass: 'sortable-drag',
1069
+ ignore: 'a, img',
1070
+ filter: null,
1071
+ preventOnFilter: true,
1072
+ animation: 0,
1073
+ easing: null,
1074
+ setData: function setData(dataTransfer, dragEl) {
1075
+ dataTransfer.setData('Text', dragEl.textContent);
1076
+ },
1077
+ dropBubble: false,
1078
+ dragoverBubble: false,
1079
+ dataIdAttr: 'data-id',
1080
+ delay: 0,
1081
+ delayOnTouchOnly: false,
1082
+ touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
1083
+ forceFallback: false,
1084
+ fallbackClass: 'sortable-fallback',
1085
+ fallbackOnBody: false,
1086
+ fallbackTolerance: 0,
1087
+ fallbackOffset: {
1088
+ x: 0,
1089
+ y: 0
1090
+ },
1091
+ supportPointer: Sortable.supportPointer !== false && 'PointerEvent' in window && !Safari,
1092
+ emptyInsertThreshold: 5
1093
+ };
1094
+ PluginManager.initializePlugins(this, el, defaults);
1095
+
1096
+ // Set default options
1097
+ for (var name in defaults) {
1098
+ !(name in options) && (options[name] = defaults[name]);
1099
+ }
1100
+ _prepareGroup(options);
1101
+
1102
+ // Bind all private methods
1103
+ for (var fn in this) {
1104
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
1105
+ this[fn] = this[fn].bind(this);
1106
+ }
1107
+ }
1108
+
1109
+ // Setup drag mode
1110
+ this.nativeDraggable = options.forceFallback ? false : supportDraggable;
1111
+ if (this.nativeDraggable) {
1112
+ // Touch start threshold cannot be greater than the native dragstart threshold
1113
+ this.options.touchStartThreshold = 1;
1114
+ }
1115
+
1116
+ // Bind events
1117
+ if (options.supportPointer) {
1118
+ on(el, 'pointerdown', this._onTapStart);
1119
+ } else {
1120
+ on(el, 'mousedown', this._onTapStart);
1121
+ on(el, 'touchstart', this._onTapStart);
1122
+ }
1123
+ if (this.nativeDraggable) {
1124
+ on(el, 'dragover', this);
1125
+ on(el, 'dragenter', this);
1126
+ }
1127
+ sortables.push(this.el);
1128
+
1129
+ // Restore sorting
1130
+ options.store && options.store.get && this.sort(options.store.get(this) || []);
1131
+
1132
+ // Add animation state manager
1133
+ _extends(this, AnimationStateManager());
1134
+ }
1135
+ Sortable.prototype = /** @lends Sortable.prototype */{
1136
+ constructor: Sortable,
1137
+ _isOutsideThisEl: function _isOutsideThisEl(target) {
1138
+ if (!this.el.contains(target) && target !== this.el) {
1139
+ lastTarget = null;
1140
+ }
1141
+ },
1142
+ _getDirection: function _getDirection(evt, target) {
1143
+ return typeof this.options.direction === 'function' ? this.options.direction.call(this, evt, target, dragEl) : this.options.direction;
1144
+ },
1145
+ _onTapStart: function _onTapStart( /** Event|TouchEvent */evt) {
1146
+ if (!evt.cancelable) return;
1147
+ var _this = this,
1148
+ el = this.el,
1149
+ options = this.options,
1150
+ preventOnFilter = options.preventOnFilter,
1151
+ type = evt.type,
1152
+ touch = evt.touches && evt.touches[0] || evt.pointerType && evt.pointerType === 'touch' && evt,
1153
+ target = (touch || evt).target,
1154
+ originalTarget = evt.target.shadowRoot && (evt.path && evt.path[0] || evt.composedPath && evt.composedPath()[0]) || target,
1155
+ filter = options.filter;
1156
+ _saveInputCheckedState(el);
1157
+
1158
+ // Don't trigger start event when an element is been dragged, otherwise the evt.oldindex always wrong when set option.group.
1159
+ if (dragEl) {
1160
+ return;
1161
+ }
1162
+ if (/mousedown|pointerdown/.test(type) && evt.button !== 0 || options.disabled) {
1163
+ return; // only left button and enabled
1164
+ }
1165
+
1166
+ // cancel dnd if original target is content editable
1167
+ if (originalTarget.isContentEditable) {
1168
+ return;
1169
+ }
1170
+
1171
+ // Safari ignores further event handling after mousedown
1172
+ if (!this.nativeDraggable && Safari && target && target.tagName.toUpperCase() === 'SELECT') {
1173
+ return;
1174
+ }
1175
+ target = closest(target, options.draggable, el, false);
1176
+ if (target && target.animated) {
1177
+ return;
1178
+ }
1179
+ if (lastDownEl === target) {
1180
+ // Ignoring duplicate `down`
1181
+ return;
1182
+ }
1183
+
1184
+ // Get the index of the dragged element within its parent
1185
+ oldIndex = index(target);
1186
+ oldDraggableIndex = index(target, options.draggable);
1187
+
1188
+ // Check filter
1189
+ if (typeof filter === 'function') {
1190
+ if (filter.call(this, evt, target, this)) {
1191
+ _dispatchEvent({
1192
+ sortable: _this,
1193
+ rootEl: originalTarget,
1194
+ name: 'filter',
1195
+ targetEl: target,
1196
+ toEl: el,
1197
+ fromEl: el
1198
+ });
1199
+ pluginEvent('filter', _this, {
1200
+ evt: evt
1201
+ });
1202
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1203
+ return; // cancel dnd
1204
+ }
1205
+ } else if (filter) {
1206
+ filter = filter.split(',').some(function (criteria) {
1207
+ criteria = closest(originalTarget, criteria.trim(), el, false);
1208
+ if (criteria) {
1209
+ _dispatchEvent({
1210
+ sortable: _this,
1211
+ rootEl: criteria,
1212
+ name: 'filter',
1213
+ targetEl: target,
1214
+ fromEl: el,
1215
+ toEl: el
1216
+ });
1217
+ pluginEvent('filter', _this, {
1218
+ evt: evt
1219
+ });
1220
+ return true;
1221
+ }
1222
+ });
1223
+ if (filter) {
1224
+ preventOnFilter && evt.cancelable && evt.preventDefault();
1225
+ return; // cancel dnd
1226
+ }
1227
+ }
1228
+ if (options.handle && !closest(originalTarget, options.handle, el, false)) {
1229
+ return;
1230
+ }
1231
+
1232
+ // Prepare `dragstart`
1233
+ this._prepareDragStart(evt, touch, target);
1234
+ },
1235
+ _prepareDragStart: function _prepareDragStart( /** Event */evt, /** Touch */touch, /** HTMLElement */target) {
1236
+ var _this = this,
1237
+ el = _this.el,
1238
+ options = _this.options,
1239
+ ownerDocument = el.ownerDocument,
1240
+ dragStartFn;
1241
+ if (target && !dragEl && target.parentNode === el) {
1242
+ var dragRect = getRect(target);
1243
+ rootEl = el;
1244
+ dragEl = target;
1245
+ parentEl = dragEl.parentNode;
1246
+ nextEl = dragEl.nextSibling;
1247
+ lastDownEl = target;
1248
+ activeGroup = options.group;
1249
+ Sortable.dragged = dragEl;
1250
+ tapEvt = {
1251
+ target: dragEl,
1252
+ clientX: (touch || evt).clientX,
1253
+ clientY: (touch || evt).clientY
1254
+ };
1255
+ tapDistanceLeft = tapEvt.clientX - dragRect.left;
1256
+ tapDistanceTop = tapEvt.clientY - dragRect.top;
1257
+ this._lastX = (touch || evt).clientX;
1258
+ this._lastY = (touch || evt).clientY;
1259
+ dragEl.style['will-change'] = 'all';
1260
+ dragStartFn = function dragStartFn() {
1261
+ pluginEvent('delayEnded', _this, {
1262
+ evt: evt
1263
+ });
1264
+ if (Sortable.eventCanceled) {
1265
+ _this._onDrop();
1266
+ return;
1267
+ }
1268
+ // Delayed drag has been triggered
1269
+ // we can re-enable the events: touchmove/mousemove
1270
+ _this._disableDelayedDragEvents();
1271
+ if (!FireFox && _this.nativeDraggable) {
1272
+ dragEl.draggable = true;
1273
+ }
1274
+
1275
+ // Bind the events: dragstart/dragend
1276
+ _this._triggerDragStart(evt, touch);
1277
+
1278
+ // Drag start event
1279
+ _dispatchEvent({
1280
+ sortable: _this,
1281
+ name: 'choose',
1282
+ originalEvent: evt
1283
+ });
1284
+
1285
+ // Chosen item
1286
+ toggleClass(dragEl, options.chosenClass, true);
1287
+ };
1288
+
1289
+ // Disable "draggable"
1290
+ options.ignore.split(',').forEach(function (criteria) {
1291
+ find(dragEl, criteria.trim(), _disableDraggable);
1292
+ });
1293
+ on(ownerDocument, 'dragover', nearestEmptyInsertDetectEvent);
1294
+ on(ownerDocument, 'mousemove', nearestEmptyInsertDetectEvent);
1295
+ on(ownerDocument, 'touchmove', nearestEmptyInsertDetectEvent);
1296
+ on(ownerDocument, 'mouseup', _this._onDrop);
1297
+ on(ownerDocument, 'touchend', _this._onDrop);
1298
+ on(ownerDocument, 'touchcancel', _this._onDrop);
1299
+
1300
+ // Make dragEl draggable (must be before delay for FireFox)
1301
+ if (FireFox && this.nativeDraggable) {
1302
+ this.options.touchStartThreshold = 4;
1303
+ dragEl.draggable = true;
1304
+ }
1305
+ pluginEvent('delayStart', this, {
1306
+ evt: evt
1307
+ });
1308
+
1309
+ // Delay is impossible for native DnD in Edge or IE
1310
+ if (options.delay && (!options.delayOnTouchOnly || touch) && (!this.nativeDraggable || !(Edge || IE11OrLess))) {
1311
+ if (Sortable.eventCanceled) {
1312
+ this._onDrop();
1313
+ return;
1314
+ }
1315
+ // If the user moves the pointer or let go the click or touch
1316
+ // before the delay has been reached:
1317
+ // disable the delayed drag
1318
+ on(ownerDocument, 'mouseup', _this._disableDelayedDrag);
1319
+ on(ownerDocument, 'touchend', _this._disableDelayedDrag);
1320
+ on(ownerDocument, 'touchcancel', _this._disableDelayedDrag);
1321
+ on(ownerDocument, 'mousemove', _this._delayedDragTouchMoveHandler);
1322
+ on(ownerDocument, 'touchmove', _this._delayedDragTouchMoveHandler);
1323
+ options.supportPointer && on(ownerDocument, 'pointermove', _this._delayedDragTouchMoveHandler);
1324
+ _this._dragStartTimer = setTimeout(dragStartFn, options.delay);
1325
+ } else {
1326
+ dragStartFn();
1327
+ }
1328
+ }
1329
+ },
1330
+ _delayedDragTouchMoveHandler: function _delayedDragTouchMoveHandler( /** TouchEvent|PointerEvent **/e) {
1331
+ var touch = e.touches ? e.touches[0] : e;
1332
+ if (Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1))) {
1333
+ this._disableDelayedDrag();
1334
+ }
1335
+ },
1336
+ _disableDelayedDrag: function _disableDelayedDrag() {
1337
+ dragEl && _disableDraggable(dragEl);
1338
+ clearTimeout(this._dragStartTimer);
1339
+ this._disableDelayedDragEvents();
1340
+ },
1341
+ _disableDelayedDragEvents: function _disableDelayedDragEvents() {
1342
+ var ownerDocument = this.el.ownerDocument;
1343
+ off(ownerDocument, 'mouseup', this._disableDelayedDrag);
1344
+ off(ownerDocument, 'touchend', this._disableDelayedDrag);
1345
+ off(ownerDocument, 'touchcancel', this._disableDelayedDrag);
1346
+ off(ownerDocument, 'mousemove', this._delayedDragTouchMoveHandler);
1347
+ off(ownerDocument, 'touchmove', this._delayedDragTouchMoveHandler);
1348
+ off(ownerDocument, 'pointermove', this._delayedDragTouchMoveHandler);
1349
+ },
1350
+ _triggerDragStart: function _triggerDragStart( /** Event */evt, /** Touch */touch) {
1351
+ touch = touch || evt.pointerType == 'touch' && evt;
1352
+ if (!this.nativeDraggable || touch) {
1353
+ if (this.options.supportPointer) {
1354
+ on(document, 'pointermove', this._onTouchMove);
1355
+ } else if (touch) {
1356
+ on(document, 'touchmove', this._onTouchMove);
1357
+ } else {
1358
+ on(document, 'mousemove', this._onTouchMove);
1359
+ }
1360
+ } else {
1361
+ on(dragEl, 'dragend', this);
1362
+ on(rootEl, 'dragstart', this._onDragStart);
1363
+ }
1364
+ try {
1365
+ if (document.selection) {
1366
+ // Timeout neccessary for IE9
1367
+ _nextTick(function () {
1368
+ document.selection.empty();
1369
+ });
1370
+ } else {
1371
+ window.getSelection().removeAllRanges();
1372
+ }
1373
+ } catch (err) {}
1374
+ },
1375
+ _dragStarted: function _dragStarted(fallback, evt) {
1376
+ awaitingDragStarted = false;
1377
+ if (rootEl && dragEl) {
1378
+ pluginEvent('dragStarted', this, {
1379
+ evt: evt
1380
+ });
1381
+ if (this.nativeDraggable) {
1382
+ on(document, 'dragover', _checkOutsideTargetEl);
1383
+ }
1384
+ var options = this.options;
1385
+
1386
+ // Apply effect
1387
+ !fallback && toggleClass(dragEl, options.dragClass, false);
1388
+ toggleClass(dragEl, options.ghostClass, true);
1389
+ Sortable.active = this;
1390
+ fallback && this._appendGhost();
1391
+
1392
+ // Drag start event
1393
+ _dispatchEvent({
1394
+ sortable: this,
1395
+ name: 'start',
1396
+ originalEvent: evt
1397
+ });
1398
+ } else {
1399
+ this._nulling();
1400
+ }
1401
+ },
1402
+ _emulateDragOver: function _emulateDragOver() {
1403
+ if (touchEvt) {
1404
+ this._lastX = touchEvt.clientX;
1405
+ this._lastY = touchEvt.clientY;
1406
+ _hideGhostForTarget();
1407
+ var target = document.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1408
+ var parent = target;
1409
+ while (target && target.shadowRoot) {
1410
+ target = target.shadowRoot.elementFromPoint(touchEvt.clientX, touchEvt.clientY);
1411
+ if (target === parent) break;
1412
+ parent = target;
1413
+ }
1414
+ dragEl.parentNode[expando]._isOutsideThisEl(target);
1415
+ if (parent) {
1416
+ do {
1417
+ if (parent[expando]) {
1418
+ var inserted = void 0;
1419
+ inserted = parent[expando]._onDragOver({
1420
+ clientX: touchEvt.clientX,
1421
+ clientY: touchEvt.clientY,
1422
+ target: target,
1423
+ rootEl: parent
1424
+ });
1425
+ if (inserted && !this.options.dragoverBubble) {
1426
+ break;
1427
+ }
1428
+ }
1429
+ target = parent; // store last element
1430
+ }
1431
+ /* jshint boss:true */ while (parent = parent.parentNode);
1432
+ }
1433
+ _unhideGhostForTarget();
1434
+ }
1435
+ },
1436
+ _onTouchMove: function _onTouchMove( /**TouchEvent*/evt) {
1437
+ if (tapEvt) {
1438
+ var options = this.options,
1439
+ fallbackTolerance = options.fallbackTolerance,
1440
+ fallbackOffset = options.fallbackOffset,
1441
+ touch = evt.touches ? evt.touches[0] : evt,
1442
+ ghostMatrix = ghostEl && matrix(ghostEl, true),
1443
+ scaleX = ghostEl && ghostMatrix && ghostMatrix.a,
1444
+ scaleY = ghostEl && ghostMatrix && ghostMatrix.d,
1445
+ relativeScrollOffset = PositionGhostAbsolutely && ghostRelativeParent && getRelativeScrollOffset(ghostRelativeParent),
1446
+ dx = (touch.clientX - tapEvt.clientX + fallbackOffset.x) / (scaleX || 1) + (relativeScrollOffset ? relativeScrollOffset[0] - ghostRelativeParentInitialScroll[0] : 0) / (scaleX || 1),
1447
+ dy = (touch.clientY - tapEvt.clientY + fallbackOffset.y) / (scaleY || 1) + (relativeScrollOffset ? relativeScrollOffset[1] - ghostRelativeParentInitialScroll[1] : 0) / (scaleY || 1);
1448
+
1449
+ // only set the status to dragging, when we are actually dragging
1450
+ if (!Sortable.active && !awaitingDragStarted) {
1451
+ if (fallbackTolerance && Math.max(Math.abs(touch.clientX - this._lastX), Math.abs(touch.clientY - this._lastY)) < fallbackTolerance) {
1452
+ return;
1453
+ }
1454
+ this._onDragStart(evt, true);
1455
+ }
1456
+ if (ghostEl) {
1457
+ if (ghostMatrix) {
1458
+ ghostMatrix.e += dx - (lastDx || 0);
1459
+ ghostMatrix.f += dy - (lastDy || 0);
1460
+ } else {
1461
+ ghostMatrix = {
1462
+ a: 1,
1463
+ b: 0,
1464
+ c: 0,
1465
+ d: 1,
1466
+ e: dx,
1467
+ f: dy
1468
+ };
1469
+ }
1470
+ var cssMatrix = "matrix(".concat(ghostMatrix.a, ",").concat(ghostMatrix.b, ",").concat(ghostMatrix.c, ",").concat(ghostMatrix.d, ",").concat(ghostMatrix.e, ",").concat(ghostMatrix.f, ")");
1471
+ css(ghostEl, 'webkitTransform', cssMatrix);
1472
+ css(ghostEl, 'mozTransform', cssMatrix);
1473
+ css(ghostEl, 'msTransform', cssMatrix);
1474
+ css(ghostEl, 'transform', cssMatrix);
1475
+ lastDx = dx;
1476
+ lastDy = dy;
1477
+ touchEvt = touch;
1478
+ }
1479
+ evt.cancelable && evt.preventDefault();
1480
+ }
1481
+ },
1482
+ _appendGhost: function _appendGhost() {
1483
+ // Bug if using scale(): https://stackoverflow.com/questions/2637058
1484
+ // Not being adjusted for
1485
+ if (!ghostEl) {
1486
+ var container = this.options.fallbackOnBody ? document.body : rootEl,
1487
+ rect = getRect(dragEl, true, PositionGhostAbsolutely, true, container),
1488
+ options = this.options;
1489
+
1490
+ // Position absolutely
1491
+ if (PositionGhostAbsolutely) {
1492
+ // Get relatively positioned parent
1493
+ ghostRelativeParent = container;
1494
+ while (css(ghostRelativeParent, 'position') === 'static' && css(ghostRelativeParent, 'transform') === 'none' && ghostRelativeParent !== document) {
1495
+ ghostRelativeParent = ghostRelativeParent.parentNode;
1496
+ }
1497
+ if (ghostRelativeParent !== document.body && ghostRelativeParent !== document.documentElement) {
1498
+ if (ghostRelativeParent === document) ghostRelativeParent = getWindowScrollingElement();
1499
+ rect.top += ghostRelativeParent.scrollTop;
1500
+ rect.left += ghostRelativeParent.scrollLeft;
1501
+ } else {
1502
+ ghostRelativeParent = getWindowScrollingElement();
1503
+ }
1504
+ ghostRelativeParentInitialScroll = getRelativeScrollOffset(ghostRelativeParent);
1505
+ }
1506
+ ghostEl = dragEl.cloneNode(true);
1507
+ toggleClass(ghostEl, options.ghostClass, false);
1508
+ toggleClass(ghostEl, options.fallbackClass, true);
1509
+ toggleClass(ghostEl, options.dragClass, true);
1510
+ css(ghostEl, 'transition', '');
1511
+ css(ghostEl, 'transform', '');
1512
+ css(ghostEl, 'box-sizing', 'border-box');
1513
+ css(ghostEl, 'margin', 0);
1514
+ css(ghostEl, 'top', rect.top);
1515
+ css(ghostEl, 'left', rect.left);
1516
+ css(ghostEl, 'width', rect.width);
1517
+ css(ghostEl, 'height', rect.height);
1518
+ css(ghostEl, 'opacity', '0.8');
1519
+ css(ghostEl, 'position', PositionGhostAbsolutely ? 'absolute' : 'fixed');
1520
+ css(ghostEl, 'zIndex', '100000');
1521
+ css(ghostEl, 'pointerEvents', 'none');
1522
+ Sortable.ghost = ghostEl;
1523
+ container.appendChild(ghostEl);
1524
+
1525
+ // Set transform-origin
1526
+ css(ghostEl, 'transform-origin', tapDistanceLeft / parseInt(ghostEl.style.width) * 100 + '% ' + tapDistanceTop / parseInt(ghostEl.style.height) * 100 + '%');
1527
+ }
1528
+ },
1529
+ _onDragStart: function _onDragStart( /**Event*/evt, /**boolean*/fallback) {
1530
+ var _this = this;
1531
+ var dataTransfer = evt.dataTransfer;
1532
+ var options = _this.options;
1533
+ pluginEvent('dragStart', this, {
1534
+ evt: evt
1535
+ });
1536
+ if (Sortable.eventCanceled) {
1537
+ this._onDrop();
1538
+ return;
1539
+ }
1540
+ pluginEvent('setupClone', this);
1541
+ if (!Sortable.eventCanceled) {
1542
+ cloneEl = clone(dragEl);
1543
+ cloneEl.removeAttribute("id");
1544
+ cloneEl.draggable = false;
1545
+ cloneEl.style['will-change'] = '';
1546
+ this._hideClone();
1547
+ toggleClass(cloneEl, this.options.chosenClass, false);
1548
+ Sortable.clone = cloneEl;
1549
+ }
1550
+
1551
+ // #1143: IFrame support workaround
1552
+ _this.cloneId = _nextTick(function () {
1553
+ pluginEvent('clone', _this);
1554
+ if (Sortable.eventCanceled) return;
1555
+ if (!_this.options.removeCloneOnHide) {
1556
+ rootEl.insertBefore(cloneEl, dragEl);
1557
+ }
1558
+ _this._hideClone();
1559
+ _dispatchEvent({
1560
+ sortable: _this,
1561
+ name: 'clone'
1562
+ });
1563
+ });
1564
+ !fallback && toggleClass(dragEl, options.dragClass, true);
1565
+
1566
+ // Set proper drop events
1567
+ if (fallback) {
1568
+ ignoreNextClick = true;
1569
+ _this._loopId = setInterval(_this._emulateDragOver, 50);
1570
+ } else {
1571
+ // Undo what was set in _prepareDragStart before drag started
1572
+ off(document, 'mouseup', _this._onDrop);
1573
+ off(document, 'touchend', _this._onDrop);
1574
+ off(document, 'touchcancel', _this._onDrop);
1575
+ if (dataTransfer) {
1576
+ dataTransfer.effectAllowed = 'move';
1577
+ options.setData && options.setData.call(_this, dataTransfer, dragEl);
1578
+ }
1579
+ on(document, 'drop', _this);
1580
+
1581
+ // #1276 fix:
1582
+ css(dragEl, 'transform', 'translateZ(0)');
1583
+ }
1584
+ awaitingDragStarted = true;
1585
+ _this._dragStartId = _nextTick(_this._dragStarted.bind(_this, fallback, evt));
1586
+ on(document, 'selectstart', _this);
1587
+ moved = true;
1588
+ if (Safari) {
1589
+ css(document.body, 'user-select', 'none');
1590
+ }
1591
+ },
1592
+ // Returns true - if no further action is needed (either inserted or another condition)
1593
+ _onDragOver: function _onDragOver( /**Event*/evt) {
1594
+ var el = this.el,
1595
+ target = evt.target,
1596
+ dragRect,
1597
+ targetRect,
1598
+ revert,
1599
+ options = this.options,
1600
+ group = options.group,
1601
+ activeSortable = Sortable.active,
1602
+ isOwner = activeGroup === group,
1603
+ canSort = options.sort,
1604
+ fromSortable = putSortable || activeSortable,
1605
+ vertical,
1606
+ _this = this,
1607
+ completedFired = false;
1608
+ if (_silent) return;
1609
+ function dragOverEvent(name, extra) {
1610
+ pluginEvent(name, _this, _objectSpread2({
1611
+ evt: evt,
1612
+ isOwner: isOwner,
1613
+ axis: vertical ? 'vertical' : 'horizontal',
1614
+ revert: revert,
1615
+ dragRect: dragRect,
1616
+ targetRect: targetRect,
1617
+ canSort: canSort,
1618
+ fromSortable: fromSortable,
1619
+ target: target,
1620
+ completed: completed,
1621
+ onMove: function onMove(target, after) {
1622
+ return _onMove(rootEl, el, dragEl, dragRect, target, getRect(target), evt, after);
1623
+ },
1624
+ changed: changed
1625
+ }, extra));
1626
+ }
1627
+
1628
+ // Capture animation state
1629
+ function capture() {
1630
+ dragOverEvent('dragOverAnimationCapture');
1631
+ _this.captureAnimationState();
1632
+ if (_this !== fromSortable) {
1633
+ fromSortable.captureAnimationState();
1634
+ }
1635
+ }
1636
+
1637
+ // Return invocation when dragEl is inserted (or completed)
1638
+ function completed(insertion) {
1639
+ dragOverEvent('dragOverCompleted', {
1640
+ insertion: insertion
1641
+ });
1642
+ if (insertion) {
1643
+ // Clones must be hidden before folding animation to capture dragRectAbsolute properly
1644
+ if (isOwner) {
1645
+ activeSortable._hideClone();
1646
+ } else {
1647
+ activeSortable._showClone(_this);
1648
+ }
1649
+ if (_this !== fromSortable) {
1650
+ // Set ghost class to new sortable's ghost class
1651
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : activeSortable.options.ghostClass, false);
1652
+ toggleClass(dragEl, options.ghostClass, true);
1653
+ }
1654
+ if (putSortable !== _this && _this !== Sortable.active) {
1655
+ putSortable = _this;
1656
+ } else if (_this === Sortable.active && putSortable) {
1657
+ putSortable = null;
1658
+ }
1659
+
1660
+ // Animation
1661
+ if (fromSortable === _this) {
1662
+ _this._ignoreWhileAnimating = target;
1663
+ }
1664
+ _this.animateAll(function () {
1665
+ dragOverEvent('dragOverAnimationComplete');
1666
+ _this._ignoreWhileAnimating = null;
1667
+ });
1668
+ if (_this !== fromSortable) {
1669
+ fromSortable.animateAll();
1670
+ fromSortable._ignoreWhileAnimating = null;
1671
+ }
1672
+ }
1673
+
1674
+ // Null lastTarget if it is not inside a previously swapped element
1675
+ if (target === dragEl && !dragEl.animated || target === el && !target.animated) {
1676
+ lastTarget = null;
1677
+ }
1678
+
1679
+ // no bubbling and not fallback
1680
+ if (!options.dragoverBubble && !evt.rootEl && target !== document) {
1681
+ dragEl.parentNode[expando]._isOutsideThisEl(evt.target);
1682
+
1683
+ // Do not detect for empty insert if already inserted
1684
+ !insertion && nearestEmptyInsertDetectEvent(evt);
1685
+ }
1686
+ !options.dragoverBubble && evt.stopPropagation && evt.stopPropagation();
1687
+ return completedFired = true;
1688
+ }
1689
+
1690
+ // Call when dragEl has been inserted
1691
+ function changed() {
1692
+ newIndex = index(dragEl);
1693
+ newDraggableIndex = index(dragEl, options.draggable);
1694
+ _dispatchEvent({
1695
+ sortable: _this,
1696
+ name: 'change',
1697
+ toEl: el,
1698
+ newIndex: newIndex,
1699
+ newDraggableIndex: newDraggableIndex,
1700
+ originalEvent: evt
1701
+ });
1702
+ }
1703
+ if (evt.preventDefault !== void 0) {
1704
+ evt.cancelable && evt.preventDefault();
1705
+ }
1706
+ target = closest(target, options.draggable, el, true);
1707
+ dragOverEvent('dragOver');
1708
+ if (Sortable.eventCanceled) return completedFired;
1709
+ if (dragEl.contains(evt.target) || target.animated && target.animatingX && target.animatingY || _this._ignoreWhileAnimating === target) {
1710
+ return completed(false);
1711
+ }
1712
+ ignoreNextClick = false;
1713
+ if (activeSortable && !options.disabled && (isOwner ? canSort || (revert = parentEl !== rootEl) // Reverting item into the original list
1714
+ : putSortable === this || (this.lastPutMode = activeGroup.checkPull(this, activeSortable, dragEl, evt)) && group.checkPut(this, activeSortable, dragEl, evt))) {
1715
+ vertical = this._getDirection(evt, target) === 'vertical';
1716
+ dragRect = getRect(dragEl);
1717
+ dragOverEvent('dragOverValid');
1718
+ if (Sortable.eventCanceled) return completedFired;
1719
+ if (revert) {
1720
+ parentEl = rootEl; // actualization
1721
+ capture();
1722
+ this._hideClone();
1723
+ dragOverEvent('revert');
1724
+ if (!Sortable.eventCanceled) {
1725
+ if (nextEl) {
1726
+ rootEl.insertBefore(dragEl, nextEl);
1727
+ } else {
1728
+ rootEl.appendChild(dragEl);
1729
+ }
1730
+ }
1731
+ return completed(true);
1732
+ }
1733
+ var elLastChild = lastChild(el, options.draggable);
1734
+ if (!elLastChild || _ghostIsLast(evt, vertical, this) && !elLastChild.animated) {
1735
+ // Insert to end of list
1736
+
1737
+ // If already at end of list: Do not insert
1738
+ if (elLastChild === dragEl) {
1739
+ return completed(false);
1740
+ }
1741
+
1742
+ // if there is a last element, it is the target
1743
+ if (elLastChild && el === evt.target) {
1744
+ target = elLastChild;
1745
+ }
1746
+ if (target) {
1747
+ targetRect = getRect(target);
1748
+ }
1749
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, !!target) !== false) {
1750
+ capture();
1751
+ if (elLastChild && elLastChild.nextSibling) {
1752
+ // the last draggable element is not the last node
1753
+ el.insertBefore(dragEl, elLastChild.nextSibling);
1754
+ } else {
1755
+ el.appendChild(dragEl);
1756
+ }
1757
+ parentEl = el; // actualization
1758
+
1759
+ changed();
1760
+ return completed(true);
1761
+ }
1762
+ } else if (elLastChild && _ghostIsFirst(evt, vertical, this)) {
1763
+ // Insert to start of list
1764
+ var firstChild = getChild(el, 0, options, true);
1765
+ if (firstChild === dragEl) {
1766
+ return completed(false);
1767
+ }
1768
+ target = firstChild;
1769
+ targetRect = getRect(target);
1770
+ if (_onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, false) !== false) {
1771
+ capture();
1772
+ el.insertBefore(dragEl, firstChild);
1773
+ parentEl = el; // actualization
1774
+
1775
+ changed();
1776
+ return completed(true);
1777
+ }
1778
+ } else if (target.parentNode === el) {
1779
+ targetRect = getRect(target);
1780
+ var direction = 0,
1781
+ targetBeforeFirstSwap,
1782
+ differentLevel = dragEl.parentNode !== el,
1783
+ differentRowCol = !_dragElInRowColumn(dragEl.animated && dragEl.toRect || dragRect, target.animated && target.toRect || targetRect, vertical),
1784
+ side1 = vertical ? 'top' : 'left',
1785
+ scrolledPastTop = isScrolledPast(target, 'top', 'top') || isScrolledPast(dragEl, 'top', 'top'),
1786
+ scrollBefore = scrolledPastTop ? scrolledPastTop.scrollTop : void 0;
1787
+ if (lastTarget !== target) {
1788
+ targetBeforeFirstSwap = targetRect[side1];
1789
+ pastFirstInvertThresh = false;
1790
+ isCircumstantialInvert = !differentRowCol && options.invertSwap || differentLevel;
1791
+ }
1792
+ direction = _getSwapDirection(evt, target, targetRect, vertical, differentRowCol ? 1 : options.swapThreshold, options.invertedSwapThreshold == null ? options.swapThreshold : options.invertedSwapThreshold, isCircumstantialInvert, lastTarget === target);
1793
+ var sibling;
1794
+ if (direction !== 0) {
1795
+ // Check if target is beside dragEl in respective direction (ignoring hidden elements)
1796
+ var dragIndex = index(dragEl);
1797
+ do {
1798
+ dragIndex -= direction;
1799
+ sibling = parentEl.children[dragIndex];
1800
+ } while (sibling && (css(sibling, 'display') === 'none' || sibling === ghostEl));
1801
+ }
1802
+ // If dragEl is already beside target: Do not insert
1803
+ if (direction === 0 || sibling === target) {
1804
+ return completed(false);
1805
+ }
1806
+ lastTarget = target;
1807
+ lastDirection = direction;
1808
+ var nextSibling = target.nextElementSibling,
1809
+ after = false;
1810
+ after = direction === 1;
1811
+ var moveVector = _onMove(rootEl, el, dragEl, dragRect, target, targetRect, evt, after);
1812
+ if (moveVector !== false) {
1813
+ if (moveVector === 1 || moveVector === -1) {
1814
+ after = moveVector === 1;
1815
+ }
1816
+ _silent = true;
1817
+ setTimeout(_unsilent, 30);
1818
+ capture();
1819
+ if (after && !nextSibling) {
1820
+ el.appendChild(dragEl);
1821
+ } else {
1822
+ target.parentNode.insertBefore(dragEl, after ? nextSibling : target);
1823
+ }
1824
+
1825
+ // Undo chrome's scroll adjustment (has no effect on other browsers)
1826
+ if (scrolledPastTop) {
1827
+ scrollBy(scrolledPastTop, 0, scrollBefore - scrolledPastTop.scrollTop);
1828
+ }
1829
+ parentEl = dragEl.parentNode; // actualization
1830
+
1831
+ // must be done before animation
1832
+ if (targetBeforeFirstSwap !== undefined && !isCircumstantialInvert) {
1833
+ targetMoveDistance = Math.abs(targetBeforeFirstSwap - getRect(target)[side1]);
1834
+ }
1835
+ changed();
1836
+ return completed(true);
1837
+ }
1838
+ }
1839
+ if (el.contains(dragEl)) {
1840
+ return completed(false);
1841
+ }
1842
+ }
1843
+ return false;
1844
+ },
1845
+ _ignoreWhileAnimating: null,
1846
+ _offMoveEvents: function _offMoveEvents() {
1847
+ off(document, 'mousemove', this._onTouchMove);
1848
+ off(document, 'touchmove', this._onTouchMove);
1849
+ off(document, 'pointermove', this._onTouchMove);
1850
+ off(document, 'dragover', nearestEmptyInsertDetectEvent);
1851
+ off(document, 'mousemove', nearestEmptyInsertDetectEvent);
1852
+ off(document, 'touchmove', nearestEmptyInsertDetectEvent);
1853
+ },
1854
+ _offUpEvents: function _offUpEvents() {
1855
+ var ownerDocument = this.el.ownerDocument;
1856
+ off(ownerDocument, 'mouseup', this._onDrop);
1857
+ off(ownerDocument, 'touchend', this._onDrop);
1858
+ off(ownerDocument, 'pointerup', this._onDrop);
1859
+ off(ownerDocument, 'touchcancel', this._onDrop);
1860
+ off(document, 'selectstart', this);
1861
+ },
1862
+ _onDrop: function _onDrop( /**Event*/evt) {
1863
+ var el = this.el,
1864
+ options = this.options;
1865
+
1866
+ // Get the index of the dragged element within its parent
1867
+ newIndex = index(dragEl);
1868
+ newDraggableIndex = index(dragEl, options.draggable);
1869
+ pluginEvent('drop', this, {
1870
+ evt: evt
1871
+ });
1872
+ parentEl = dragEl && dragEl.parentNode;
1873
+
1874
+ // Get again after plugin event
1875
+ newIndex = index(dragEl);
1876
+ newDraggableIndex = index(dragEl, options.draggable);
1877
+ if (Sortable.eventCanceled) {
1878
+ this._nulling();
1879
+ return;
1880
+ }
1881
+ awaitingDragStarted = false;
1882
+ isCircumstantialInvert = false;
1883
+ pastFirstInvertThresh = false;
1884
+ clearInterval(this._loopId);
1885
+ clearTimeout(this._dragStartTimer);
1886
+ _cancelNextTick(this.cloneId);
1887
+ _cancelNextTick(this._dragStartId);
1888
+
1889
+ // Unbind events
1890
+ if (this.nativeDraggable) {
1891
+ off(document, 'drop', this);
1892
+ off(el, 'dragstart', this._onDragStart);
1893
+ }
1894
+ this._offMoveEvents();
1895
+ this._offUpEvents();
1896
+ if (Safari) {
1897
+ css(document.body, 'user-select', '');
1898
+ }
1899
+ css(dragEl, 'transform', '');
1900
+ if (evt) {
1901
+ if (moved) {
1902
+ evt.cancelable && evt.preventDefault();
1903
+ !options.dropBubble && evt.stopPropagation();
1904
+ }
1905
+ ghostEl && ghostEl.parentNode && ghostEl.parentNode.removeChild(ghostEl);
1906
+ if (rootEl === parentEl || putSortable && putSortable.lastPutMode !== 'clone') {
1907
+ // Remove clone(s)
1908
+ cloneEl && cloneEl.parentNode && cloneEl.parentNode.removeChild(cloneEl);
1909
+ }
1910
+ if (dragEl) {
1911
+ if (this.nativeDraggable) {
1912
+ off(dragEl, 'dragend', this);
1913
+ }
1914
+ _disableDraggable(dragEl);
1915
+ dragEl.style['will-change'] = '';
1916
+
1917
+ // Remove classes
1918
+ // ghostClass is added in dragStarted
1919
+ if (moved && !awaitingDragStarted) {
1920
+ toggleClass(dragEl, putSortable ? putSortable.options.ghostClass : this.options.ghostClass, false);
1921
+ }
1922
+ toggleClass(dragEl, this.options.chosenClass, false);
1923
+
1924
+ // Drag stop event
1925
+ _dispatchEvent({
1926
+ sortable: this,
1927
+ name: 'unchoose',
1928
+ toEl: parentEl,
1929
+ newIndex: null,
1930
+ newDraggableIndex: null,
1931
+ originalEvent: evt
1932
+ });
1933
+ if (rootEl !== parentEl) {
1934
+ if (newIndex >= 0) {
1935
+ // Add event
1936
+ _dispatchEvent({
1937
+ rootEl: parentEl,
1938
+ name: 'add',
1939
+ toEl: parentEl,
1940
+ fromEl: rootEl,
1941
+ originalEvent: evt
1942
+ });
1943
+
1944
+ // Remove event
1945
+ _dispatchEvent({
1946
+ sortable: this,
1947
+ name: 'remove',
1948
+ toEl: parentEl,
1949
+ originalEvent: evt
1950
+ });
1951
+
1952
+ // drag from one list and drop into another
1953
+ _dispatchEvent({
1954
+ rootEl: parentEl,
1955
+ name: 'sort',
1956
+ toEl: parentEl,
1957
+ fromEl: rootEl,
1958
+ originalEvent: evt
1959
+ });
1960
+ _dispatchEvent({
1961
+ sortable: this,
1962
+ name: 'sort',
1963
+ toEl: parentEl,
1964
+ originalEvent: evt
1965
+ });
1966
+ }
1967
+ putSortable && putSortable.save();
1968
+ } else {
1969
+ if (newIndex !== oldIndex) {
1970
+ if (newIndex >= 0) {
1971
+ // drag & drop within the same list
1972
+ _dispatchEvent({
1973
+ sortable: this,
1974
+ name: 'update',
1975
+ toEl: parentEl,
1976
+ originalEvent: evt
1977
+ });
1978
+ _dispatchEvent({
1979
+ sortable: this,
1980
+ name: 'sort',
1981
+ toEl: parentEl,
1982
+ originalEvent: evt
1983
+ });
1984
+ }
1985
+ }
1986
+ }
1987
+ if (Sortable.active) {
1988
+ /* jshint eqnull:true */
1989
+ if (newIndex == null || newIndex === -1) {
1990
+ newIndex = oldIndex;
1991
+ newDraggableIndex = oldDraggableIndex;
1992
+ }
1993
+ _dispatchEvent({
1994
+ sortable: this,
1995
+ name: 'end',
1996
+ toEl: parentEl,
1997
+ originalEvent: evt
1998
+ });
1999
+
2000
+ // Save sorting
2001
+ this.save();
2002
+ }
2003
+ }
2004
+ }
2005
+ this._nulling();
2006
+ },
2007
+ _nulling: function _nulling() {
2008
+ pluginEvent('nulling', this);
2009
+ rootEl = dragEl = parentEl = ghostEl = nextEl = cloneEl = lastDownEl = cloneHidden = tapEvt = touchEvt = moved = newIndex = newDraggableIndex = oldIndex = oldDraggableIndex = lastTarget = lastDirection = putSortable = activeGroup = Sortable.dragged = Sortable.ghost = Sortable.clone = Sortable.active = null;
2010
+ savedInputChecked.forEach(function (el) {
2011
+ el.checked = true;
2012
+ });
2013
+ savedInputChecked.length = lastDx = lastDy = 0;
2014
+ },
2015
+ handleEvent: function handleEvent( /**Event*/evt) {
2016
+ switch (evt.type) {
2017
+ case 'drop':
2018
+ case 'dragend':
2019
+ this._onDrop(evt);
2020
+ break;
2021
+ case 'dragenter':
2022
+ case 'dragover':
2023
+ if (dragEl) {
2024
+ this._onDragOver(evt);
2025
+ _globalDragOver(evt);
2026
+ }
2027
+ break;
2028
+ case 'selectstart':
2029
+ evt.preventDefault();
2030
+ break;
2031
+ }
2032
+ },
2033
+ /**
2034
+ * Serializes the item into an array of string.
2035
+ * @returns {String[]}
2036
+ */
2037
+ toArray: function toArray() {
2038
+ var order = [],
2039
+ el,
2040
+ children = this.el.children,
2041
+ i = 0,
2042
+ n = children.length,
2043
+ options = this.options;
2044
+ for (; i < n; i++) {
2045
+ el = children[i];
2046
+ if (closest(el, options.draggable, this.el, false)) {
2047
+ order.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
2048
+ }
2049
+ }
2050
+ return order;
2051
+ },
2052
+ /**
2053
+ * Sorts the elements according to the array.
2054
+ * @param {String[]} order order of the items
2055
+ */
2056
+ sort: function sort(order, useAnimation) {
2057
+ var items = {},
2058
+ rootEl = this.el;
2059
+ this.toArray().forEach(function (id, i) {
2060
+ var el = rootEl.children[i];
2061
+ if (closest(el, this.options.draggable, rootEl, false)) {
2062
+ items[id] = el;
2063
+ }
2064
+ }, this);
2065
+ useAnimation && this.captureAnimationState();
2066
+ order.forEach(function (id) {
2067
+ if (items[id]) {
2068
+ rootEl.removeChild(items[id]);
2069
+ rootEl.appendChild(items[id]);
2070
+ }
2071
+ });
2072
+ useAnimation && this.animateAll();
2073
+ },
2074
+ /**
2075
+ * Save the current sorting
2076
+ */
2077
+ save: function save() {
2078
+ var store = this.options.store;
2079
+ store && store.set && store.set(this);
2080
+ },
2081
+ /**
2082
+ * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
2083
+ * @param {HTMLElement} el
2084
+ * @param {String} [selector] default: `options.draggable`
2085
+ * @returns {HTMLElement|null}
2086
+ */
2087
+ closest: function closest$1(el, selector) {
2088
+ return closest(el, selector || this.options.draggable, this.el, false);
2089
+ },
2090
+ /**
2091
+ * Set/get option
2092
+ * @param {string} name
2093
+ * @param {*} [value]
2094
+ * @returns {*}
2095
+ */
2096
+ option: function option(name, value) {
2097
+ var options = this.options;
2098
+ if (value === void 0) {
2099
+ return options[name];
2100
+ } else {
2101
+ var modifiedValue = PluginManager.modifyOption(this, name, value);
2102
+ if (typeof modifiedValue !== 'undefined') {
2103
+ options[name] = modifiedValue;
2104
+ } else {
2105
+ options[name] = value;
2106
+ }
2107
+ if (name === 'group') {
2108
+ _prepareGroup(options);
2109
+ }
2110
+ }
2111
+ },
2112
+ /**
2113
+ * Destroy
2114
+ */
2115
+ destroy: function destroy() {
2116
+ pluginEvent('destroy', this);
2117
+ var el = this.el;
2118
+ el[expando] = null;
2119
+ off(el, 'mousedown', this._onTapStart);
2120
+ off(el, 'touchstart', this._onTapStart);
2121
+ off(el, 'pointerdown', this._onTapStart);
2122
+ if (this.nativeDraggable) {
2123
+ off(el, 'dragover', this);
2124
+ off(el, 'dragenter', this);
2125
+ }
2126
+ // Remove draggable attributes
2127
+ Array.prototype.forEach.call(el.querySelectorAll('[draggable]'), function (el) {
2128
+ el.removeAttribute('draggable');
2129
+ });
2130
+ this._onDrop();
2131
+ this._disableDelayedDragEvents();
2132
+ sortables.splice(sortables.indexOf(this.el), 1);
2133
+ this.el = el = null;
2134
+ },
2135
+ _hideClone: function _hideClone() {
2136
+ if (!cloneHidden) {
2137
+ pluginEvent('hideClone', this);
2138
+ if (Sortable.eventCanceled) return;
2139
+ css(cloneEl, 'display', 'none');
2140
+ if (this.options.removeCloneOnHide && cloneEl.parentNode) {
2141
+ cloneEl.parentNode.removeChild(cloneEl);
2142
+ }
2143
+ cloneHidden = true;
2144
+ }
2145
+ },
2146
+ _showClone: function _showClone(putSortable) {
2147
+ if (putSortable.lastPutMode !== 'clone') {
2148
+ this._hideClone();
2149
+ return;
2150
+ }
2151
+ if (cloneHidden) {
2152
+ pluginEvent('showClone', this);
2153
+ if (Sortable.eventCanceled) return;
2154
+
2155
+ // show clone at dragEl or original position
2156
+ if (dragEl.parentNode == rootEl && !this.options.group.revertClone) {
2157
+ rootEl.insertBefore(cloneEl, dragEl);
2158
+ } else if (nextEl) {
2159
+ rootEl.insertBefore(cloneEl, nextEl);
2160
+ } else {
2161
+ rootEl.appendChild(cloneEl);
2162
+ }
2163
+ if (this.options.group.revertClone) {
2164
+ this.animate(dragEl, cloneEl);
2165
+ }
2166
+ css(cloneEl, 'display', '');
2167
+ cloneHidden = false;
2168
+ }
2169
+ }
2170
+ };
2171
+ function _globalDragOver( /**Event*/evt) {
2172
+ if (evt.dataTransfer) {
2173
+ evt.dataTransfer.dropEffect = 'move';
2174
+ }
2175
+ evt.cancelable && evt.preventDefault();
2176
+ }
2177
+ function _onMove(fromEl, toEl, dragEl, dragRect, targetEl, targetRect, originalEvent, willInsertAfter) {
2178
+ var evt,
2179
+ sortable = fromEl[expando],
2180
+ onMoveFn = sortable.options.onMove,
2181
+ retVal;
2182
+ // Support for new CustomEvent feature
2183
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
2184
+ evt = new CustomEvent('move', {
2185
+ bubbles: true,
2186
+ cancelable: true
2187
+ });
2188
+ } else {
2189
+ evt = document.createEvent('Event');
2190
+ evt.initEvent('move', true, true);
2191
+ }
2192
+ evt.to = toEl;
2193
+ evt.from = fromEl;
2194
+ evt.dragged = dragEl;
2195
+ evt.draggedRect = dragRect;
2196
+ evt.related = targetEl || toEl;
2197
+ evt.relatedRect = targetRect || getRect(toEl);
2198
+ evt.willInsertAfter = willInsertAfter;
2199
+ evt.originalEvent = originalEvent;
2200
+ fromEl.dispatchEvent(evt);
2201
+ if (onMoveFn) {
2202
+ retVal = onMoveFn.call(sortable, evt, originalEvent);
2203
+ }
2204
+ return retVal;
2205
+ }
2206
+ function _disableDraggable(el) {
2207
+ el.draggable = false;
2208
+ }
2209
+ function _unsilent() {
2210
+ _silent = false;
2211
+ }
2212
+ function _ghostIsFirst(evt, vertical, sortable) {
2213
+ var firstElRect = getRect(getChild(sortable.el, 0, sortable.options, true));
2214
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2215
+ var spacer = 10;
2216
+ return vertical ? evt.clientX < childContainingRect.left - spacer || evt.clientY < firstElRect.top && evt.clientX < firstElRect.right : evt.clientY < childContainingRect.top - spacer || evt.clientY < firstElRect.bottom && evt.clientX < firstElRect.left;
2217
+ }
2218
+ function _ghostIsLast(evt, vertical, sortable) {
2219
+ var lastElRect = getRect(lastChild(sortable.el, sortable.options.draggable));
2220
+ var childContainingRect = getChildContainingRectFromElement(sortable.el, sortable.options, ghostEl);
2221
+ var spacer = 10;
2222
+ return vertical ? evt.clientX > childContainingRect.right + spacer || evt.clientY > lastElRect.bottom && evt.clientX > lastElRect.left : evt.clientY > childContainingRect.bottom + spacer || evt.clientX > lastElRect.right && evt.clientY > lastElRect.top;
2223
+ }
2224
+ function _getSwapDirection(evt, target, targetRect, vertical, swapThreshold, invertedSwapThreshold, invertSwap, isLastTarget) {
2225
+ var mouseOnAxis = vertical ? evt.clientY : evt.clientX,
2226
+ targetLength = vertical ? targetRect.height : targetRect.width,
2227
+ targetS1 = vertical ? targetRect.top : targetRect.left,
2228
+ targetS2 = vertical ? targetRect.bottom : targetRect.right,
2229
+ invert = false;
2230
+ if (!invertSwap) {
2231
+ // Never invert or create dragEl shadow when target movemenet causes mouse to move past the end of regular swapThreshold
2232
+ if (isLastTarget && targetMoveDistance < targetLength * swapThreshold) {
2233
+ // multiplied only by swapThreshold because mouse will already be inside target by (1 - threshold) * targetLength / 2
2234
+ // check if past first invert threshold on side opposite of lastDirection
2235
+ if (!pastFirstInvertThresh && (lastDirection === 1 ? mouseOnAxis > targetS1 + targetLength * invertedSwapThreshold / 2 : mouseOnAxis < targetS2 - targetLength * invertedSwapThreshold / 2)) {
2236
+ // past first invert threshold, do not restrict inverted threshold to dragEl shadow
2237
+ pastFirstInvertThresh = true;
2238
+ }
2239
+ if (!pastFirstInvertThresh) {
2240
+ // dragEl shadow (target move distance shadow)
2241
+ if (lastDirection === 1 ? mouseOnAxis < targetS1 + targetMoveDistance // over dragEl shadow
2242
+ : mouseOnAxis > targetS2 - targetMoveDistance) {
2243
+ return -lastDirection;
2244
+ }
2245
+ } else {
2246
+ invert = true;
2247
+ }
2248
+ } else {
2249
+ // Regular
2250
+ if (mouseOnAxis > targetS1 + targetLength * (1 - swapThreshold) / 2 && mouseOnAxis < targetS2 - targetLength * (1 - swapThreshold) / 2) {
2251
+ return _getInsertDirection(target);
2252
+ }
2253
+ }
2254
+ }
2255
+ invert = invert || invertSwap;
2256
+ if (invert) {
2257
+ // Invert of regular
2258
+ if (mouseOnAxis < targetS1 + targetLength * invertedSwapThreshold / 2 || mouseOnAxis > targetS2 - targetLength * invertedSwapThreshold / 2) {
2259
+ return mouseOnAxis > targetS1 + targetLength / 2 ? 1 : -1;
2260
+ }
2261
+ }
2262
+ return 0;
2263
+ }
2264
+
2265
+ /**
2266
+ * Gets the direction dragEl must be swapped relative to target in order to make it
2267
+ * seem that dragEl has been "inserted" into that element's position
2268
+ * @param {HTMLElement} target The target whose position dragEl is being inserted at
2269
+ * @return {Number} Direction dragEl must be swapped
2270
+ */
2271
+ function _getInsertDirection(target) {
2272
+ if (index(dragEl) < index(target)) {
2273
+ return 1;
2274
+ } else {
2275
+ return -1;
2276
+ }
2277
+ }
2278
+
2279
+ /**
2280
+ * Generate id
2281
+ * @param {HTMLElement} el
2282
+ * @returns {String}
2283
+ * @private
2284
+ */
2285
+ function _generateId(el) {
2286
+ var str = el.tagName + el.className + el.src + el.href + el.textContent,
2287
+ i = str.length,
2288
+ sum = 0;
2289
+ while (i--) {
2290
+ sum += str.charCodeAt(i);
2291
+ }
2292
+ return sum.toString(36);
2293
+ }
2294
+ function _saveInputCheckedState(root) {
2295
+ savedInputChecked.length = 0;
2296
+ var inputs = root.getElementsByTagName('input');
2297
+ var idx = inputs.length;
2298
+ while (idx--) {
2299
+ var el = inputs[idx];
2300
+ el.checked && savedInputChecked.push(el);
2301
+ }
2302
+ }
2303
+ function _nextTick(fn) {
2304
+ return setTimeout(fn, 0);
2305
+ }
2306
+ function _cancelNextTick(id) {
2307
+ return clearTimeout(id);
2308
+ }
2309
+
2310
+ // Fixed #973:
2311
+ if (documentExists) {
2312
+ on(document, 'touchmove', function (evt) {
2313
+ if ((Sortable.active || awaitingDragStarted) && evt.cancelable) {
2314
+ evt.preventDefault();
2315
+ }
2316
+ });
2317
+ }
2318
+
2319
+ // Export utils
2320
+ Sortable.utils = {
2321
+ on: on,
2322
+ off: off,
2323
+ css: css,
2324
+ find: find,
2325
+ is: function is(el, selector) {
2326
+ return !!closest(el, selector, el, false);
2327
+ },
2328
+ extend: extend,
2329
+ throttle: throttle,
2330
+ closest: closest,
2331
+ toggleClass: toggleClass,
2332
+ clone: clone,
2333
+ index: index,
2334
+ nextTick: _nextTick,
2335
+ cancelNextTick: _cancelNextTick,
2336
+ detectDirection: _detectDirection,
2337
+ getChild: getChild
2338
+ };
2339
+
2340
+ /**
2341
+ * Get the Sortable instance of an element
2342
+ * @param {HTMLElement} element The element
2343
+ * @return {Sortable|undefined} The instance of Sortable
2344
+ */
2345
+ Sortable.get = function (element) {
2346
+ return element[expando];
2347
+ };
2348
+
2349
+ /**
2350
+ * Mount a plugin to Sortable
2351
+ * @param {...SortablePlugin|SortablePlugin[]} plugins Plugins being mounted
2352
+ */
2353
+ Sortable.mount = function () {
2354
+ for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {
2355
+ plugins[_key] = arguments[_key];
2356
+ }
2357
+ if (plugins[0].constructor === Array) plugins = plugins[0];
2358
+ plugins.forEach(function (plugin) {
2359
+ if (!plugin.prototype || !plugin.prototype.constructor) {
2360
+ throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(plugin));
2361
+ }
2362
+ if (plugin.utils) Sortable.utils = _objectSpread2(_objectSpread2({}, Sortable.utils), plugin.utils);
2363
+ PluginManager.mount(plugin);
2364
+ });
2365
+ };
2366
+
2367
+ /**
2368
+ * Create sortable instance
2369
+ * @param {HTMLElement} el
2370
+ * @param {Object} [options]
2371
+ */
2372
+ Sortable.create = function (el, options) {
2373
+ return new Sortable(el, options);
2374
+ };
2375
+
2376
+ // Export
2377
+ Sortable.version = version;
2378
+
2379
+ var autoScrolls = [],
2380
+ scrollEl,
2381
+ scrollRootEl,
2382
+ scrolling = false,
2383
+ lastAutoScrollX,
2384
+ lastAutoScrollY,
2385
+ touchEvt$1,
2386
+ pointerElemChangedInterval;
2387
+ function AutoScrollPlugin() {
2388
+ function AutoScroll() {
2389
+ this.defaults = {
2390
+ scroll: true,
2391
+ forceAutoScrollFallback: false,
2392
+ scrollSensitivity: 30,
2393
+ scrollSpeed: 10,
2394
+ bubbleScroll: true
2395
+ };
2396
+
2397
+ // Bind all private methods
2398
+ for (var fn in this) {
2399
+ if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
2400
+ this[fn] = this[fn].bind(this);
2401
+ }
2402
+ }
2403
+ }
2404
+ AutoScroll.prototype = {
2405
+ dragStarted: function dragStarted(_ref) {
2406
+ var originalEvent = _ref.originalEvent;
2407
+ if (this.sortable.nativeDraggable) {
2408
+ on(document, 'dragover', this._handleAutoScroll);
2409
+ } else {
2410
+ if (this.options.supportPointer) {
2411
+ on(document, 'pointermove', this._handleFallbackAutoScroll);
2412
+ } else if (originalEvent.touches) {
2413
+ on(document, 'touchmove', this._handleFallbackAutoScroll);
2414
+ } else {
2415
+ on(document, 'mousemove', this._handleFallbackAutoScroll);
2416
+ }
2417
+ }
2418
+ },
2419
+ dragOverCompleted: function dragOverCompleted(_ref2) {
2420
+ var originalEvent = _ref2.originalEvent;
2421
+ // For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
2422
+ if (!this.options.dragOverBubble && !originalEvent.rootEl) {
2423
+ this._handleAutoScroll(originalEvent);
2424
+ }
2425
+ },
2426
+ drop: function drop() {
2427
+ if (this.sortable.nativeDraggable) {
2428
+ off(document, 'dragover', this._handleAutoScroll);
2429
+ } else {
2430
+ off(document, 'pointermove', this._handleFallbackAutoScroll);
2431
+ off(document, 'touchmove', this._handleFallbackAutoScroll);
2432
+ off(document, 'mousemove', this._handleFallbackAutoScroll);
2433
+ }
2434
+ clearPointerElemChangedInterval();
2435
+ clearAutoScrolls();
2436
+ cancelThrottle();
2437
+ },
2438
+ nulling: function nulling() {
2439
+ touchEvt$1 = scrollRootEl = scrollEl = scrolling = pointerElemChangedInterval = lastAutoScrollX = lastAutoScrollY = null;
2440
+ autoScrolls.length = 0;
2441
+ },
2442
+ _handleFallbackAutoScroll: function _handleFallbackAutoScroll(evt) {
2443
+ this._handleAutoScroll(evt, true);
2444
+ },
2445
+ _handleAutoScroll: function _handleAutoScroll(evt, fallback) {
2446
+ var _this = this;
2447
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2448
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2449
+ elem = document.elementFromPoint(x, y);
2450
+ touchEvt$1 = evt;
2451
+
2452
+ // IE does not seem to have native autoscroll,
2453
+ // Edge's autoscroll seems too conditional,
2454
+ // MACOS Safari does not have autoscroll,
2455
+ // Firefox and Chrome are good
2456
+ if (fallback || this.options.forceAutoScrollFallback || Edge || IE11OrLess || Safari) {
2457
+ autoScroll(evt, this.options, elem, fallback);
2458
+
2459
+ // Listener for pointer element change
2460
+ var ogElemScroller = getParentAutoScrollElement(elem, true);
2461
+ if (scrolling && (!pointerElemChangedInterval || x !== lastAutoScrollX || y !== lastAutoScrollY)) {
2462
+ pointerElemChangedInterval && clearPointerElemChangedInterval();
2463
+ // Detect for pointer elem change, emulating native DnD behaviour
2464
+ pointerElemChangedInterval = setInterval(function () {
2465
+ var newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
2466
+ if (newElem !== ogElemScroller) {
2467
+ ogElemScroller = newElem;
2468
+ clearAutoScrolls();
2469
+ }
2470
+ autoScroll(evt, _this.options, newElem, fallback);
2471
+ }, 10);
2472
+ lastAutoScrollX = x;
2473
+ lastAutoScrollY = y;
2474
+ }
2475
+ } else {
2476
+ // if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
2477
+ if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
2478
+ clearAutoScrolls();
2479
+ return;
2480
+ }
2481
+ autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
2482
+ }
2483
+ }
2484
+ };
2485
+ return _extends(AutoScroll, {
2486
+ pluginName: 'scroll',
2487
+ initializeByDefault: true
2488
+ });
2489
+ }
2490
+ function clearAutoScrolls() {
2491
+ autoScrolls.forEach(function (autoScroll) {
2492
+ clearInterval(autoScroll.pid);
2493
+ });
2494
+ autoScrolls = [];
2495
+ }
2496
+ function clearPointerElemChangedInterval() {
2497
+ clearInterval(pointerElemChangedInterval);
2498
+ }
2499
+ var autoScroll = throttle(function (evt, options, rootEl, isFallback) {
2500
+ // Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
2501
+ if (!options.scroll) return;
2502
+ var x = (evt.touches ? evt.touches[0] : evt).clientX,
2503
+ y = (evt.touches ? evt.touches[0] : evt).clientY,
2504
+ sens = options.scrollSensitivity,
2505
+ speed = options.scrollSpeed,
2506
+ winScroller = getWindowScrollingElement();
2507
+ var scrollThisInstance = false,
2508
+ scrollCustomFn;
2509
+
2510
+ // New scroll root, set scrollEl
2511
+ if (scrollRootEl !== rootEl) {
2512
+ scrollRootEl = rootEl;
2513
+ clearAutoScrolls();
2514
+ scrollEl = options.scroll;
2515
+ scrollCustomFn = options.scrollFn;
2516
+ if (scrollEl === true) {
2517
+ scrollEl = getParentAutoScrollElement(rootEl, true);
2518
+ }
2519
+ }
2520
+ var layersOut = 0;
2521
+ var currentParent = scrollEl;
2522
+ do {
2523
+ var el = currentParent,
2524
+ rect = getRect(el),
2525
+ top = rect.top,
2526
+ bottom = rect.bottom,
2527
+ left = rect.left,
2528
+ right = rect.right,
2529
+ width = rect.width,
2530
+ height = rect.height,
2531
+ canScrollX = void 0,
2532
+ canScrollY = void 0,
2533
+ scrollWidth = el.scrollWidth,
2534
+ scrollHeight = el.scrollHeight,
2535
+ elCSS = css(el),
2536
+ scrollPosX = el.scrollLeft,
2537
+ scrollPosY = el.scrollTop;
2538
+ if (el === winScroller) {
2539
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
2540
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
2541
+ } else {
2542
+ canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
2543
+ canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
2544
+ }
2545
+ var vx = canScrollX && (Math.abs(right - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
2546
+ var vy = canScrollY && (Math.abs(bottom - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
2547
+ if (!autoScrolls[layersOut]) {
2548
+ for (var i = 0; i <= layersOut; i++) {
2549
+ if (!autoScrolls[i]) {
2550
+ autoScrolls[i] = {};
2551
+ }
2552
+ }
2553
+ }
2554
+ if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
2555
+ autoScrolls[layersOut].el = el;
2556
+ autoScrolls[layersOut].vx = vx;
2557
+ autoScrolls[layersOut].vy = vy;
2558
+ clearInterval(autoScrolls[layersOut].pid);
2559
+ if (vx != 0 || vy != 0) {
2560
+ scrollThisInstance = true;
2561
+ /* jshint loopfunc:true */
2562
+ autoScrolls[layersOut].pid = setInterval(function () {
2563
+ // emulate drag over during autoscroll (fallback), emulating native DnD behaviour
2564
+ if (isFallback && this.layer === 0) {
2565
+ Sortable.active._onTouchMove(touchEvt$1); // To move ghost if it is positioned absolutely
2566
+ }
2567
+ var scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
2568
+ var scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
2569
+ if (typeof scrollCustomFn === 'function') {
2570
+ if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt$1, autoScrolls[this.layer].el) !== 'continue') {
2571
+ return;
2572
+ }
2573
+ }
2574
+ scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
2575
+ }.bind({
2576
+ layer: layersOut
2577
+ }), 24);
2578
+ }
2579
+ }
2580
+ layersOut++;
2581
+ } while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
2582
+ scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
2583
+ }, 30);
2584
+
2585
+ var drop = function drop(_ref) {
2586
+ var originalEvent = _ref.originalEvent,
2587
+ putSortable = _ref.putSortable,
2588
+ dragEl = _ref.dragEl,
2589
+ activeSortable = _ref.activeSortable,
2590
+ dispatchSortableEvent = _ref.dispatchSortableEvent,
2591
+ hideGhostForTarget = _ref.hideGhostForTarget,
2592
+ unhideGhostForTarget = _ref.unhideGhostForTarget;
2593
+ if (!originalEvent) return;
2594
+ var toSortable = putSortable || activeSortable;
2595
+ hideGhostForTarget();
2596
+ var touch = originalEvent.changedTouches && originalEvent.changedTouches.length ? originalEvent.changedTouches[0] : originalEvent;
2597
+ var target = document.elementFromPoint(touch.clientX, touch.clientY);
2598
+ unhideGhostForTarget();
2599
+ if (toSortable && !toSortable.el.contains(target)) {
2600
+ dispatchSortableEvent('spill');
2601
+ this.onSpill({
2602
+ dragEl: dragEl,
2603
+ putSortable: putSortable
2604
+ });
2605
+ }
2606
+ };
2607
+ function Revert() {}
2608
+ Revert.prototype = {
2609
+ startIndex: null,
2610
+ dragStart: function dragStart(_ref2) {
2611
+ var oldDraggableIndex = _ref2.oldDraggableIndex;
2612
+ this.startIndex = oldDraggableIndex;
2613
+ },
2614
+ onSpill: function onSpill(_ref3) {
2615
+ var dragEl = _ref3.dragEl,
2616
+ putSortable = _ref3.putSortable;
2617
+ this.sortable.captureAnimationState();
2618
+ if (putSortable) {
2619
+ putSortable.captureAnimationState();
2620
+ }
2621
+ var nextSibling = getChild(this.sortable.el, this.startIndex, this.options);
2622
+ if (nextSibling) {
2623
+ this.sortable.el.insertBefore(dragEl, nextSibling);
2624
+ } else {
2625
+ this.sortable.el.appendChild(dragEl);
2626
+ }
2627
+ this.sortable.animateAll();
2628
+ if (putSortable) {
2629
+ putSortable.animateAll();
2630
+ }
2631
+ },
2632
+ drop: drop
2633
+ };
2634
+ _extends(Revert, {
2635
+ pluginName: 'revertOnSpill'
2636
+ });
2637
+ function Remove() {}
2638
+ Remove.prototype = {
2639
+ onSpill: function onSpill(_ref4) {
2640
+ var dragEl = _ref4.dragEl,
2641
+ putSortable = _ref4.putSortable;
2642
+ var parentSortable = putSortable || this.sortable;
2643
+ parentSortable.captureAnimationState();
2644
+ dragEl.parentNode && dragEl.parentNode.removeChild(dragEl);
2645
+ parentSortable.animateAll();
2646
+ },
2647
+ drop: drop
2648
+ };
2649
+ _extends(Remove, {
2650
+ pluginName: 'removeOnSpill'
2651
+ });
2652
+
2653
+ Sortable.mount(new AutoScrollPlugin());
2654
+ Sortable.mount(Remove, Revert);
2655
+
2656
+ const pdsSortableCss = ".pds-sortable.sc-pds-sortable-h{--border-radius:var(--pine-border-radius-050);--border-default:var(--pine-border-width-thin) solid var(--pine-color-grey-300);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.pds-sortable.pds-sortable--bordered.sc-pds-sortable-h{border:var(--border-default);border-radius:var(--border-radius)}";
2657
+ const PdsSortableStyle0 = pdsSortableCss;
2658
+
2659
+ const PdsSortable = class {
2660
+ constructor(hostRef) {
2661
+ index$1.registerInstance(this, hostRef);
2662
+ this.pdsSortableItemMoved = index$1.createEvent(this, "pdsSortableItemMoved", 7);
2663
+ this.border = false;
2664
+ this.componentId = undefined;
2665
+ this.dividers = false;
2666
+ this.handleType = 'row';
2667
+ }
2668
+ classNames() {
2669
+ const classNames = ['pds-sortable'];
2670
+ if (this.border) {
2671
+ classNames.push('pds-sortable--bordered');
2672
+ }
2673
+ if (this.dividers) {
2674
+ classNames.push('pds-sortable--divided');
2675
+ }
2676
+ if (this.handleType !== undefined) {
2677
+ classNames.push(`pds-sortable--handle-type-${this.handleType}`);
2678
+ }
2679
+ return classNames.join(' ');
2680
+ }
2681
+ componentDidLoad() {
2682
+ let sortableOptions = {
2683
+ animation: 150,
2684
+ ghostClass: 'pds-sortable-item--ghost',
2685
+ dragClass: 'pds-sortable-item--drag',
2686
+ onEnd: (evt) => {
2687
+ this.pdsSortableItemMoved.emit(evt);
2688
+ },
2689
+ };
2690
+ if (this.handleType === 'handle') {
2691
+ sortableOptions = Object.assign(Object.assign({}, sortableOptions), { handle: '.pds-sortable-item__handle' });
2692
+ }
2693
+ Sortable.create(this.el, sortableOptions);
2694
+ }
2695
+ render() {
2696
+ return (index$1.h(index$1.Host, { key: '030286aa0de920f4b5ce4470f3d1b5ab14be2792', class: this.classNames(), id: this.componentId }, index$1.h("slot", { key: 'c38822d7c82273c2fbc28d09c919e4c179ebb49d' })));
2697
+ }
2698
+ get el() { return index$1.getElement(this); }
2699
+ };
2700
+ PdsSortable.style = PdsSortableStyle0;
2701
+
2702
+ exports.pds_sortable = PdsSortable;
2703
+
2704
+ //# sourceMappingURL=pds-sortable.cjs.entry.js.map