@vonage/vivid 3.0.0-next.7 → 3.0.0-next.71

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 (478) hide show
  1. package/README.md +137 -4
  2. package/accordion/index.js +59 -0
  3. package/accordion-item/index.js +131 -0
  4. package/action-group/index.js +47 -0
  5. package/avatar/index.js +51 -0
  6. package/badge/index.js +58 -0
  7. package/banner/index.js +149 -0
  8. package/breadcrumb/index.js +103 -0
  9. package/breadcrumb-item/index.js +62 -0
  10. package/button/index.js +130 -0
  11. package/calendar/index.js +1563 -0
  12. package/calendar-event/index.js +115 -0
  13. package/card/index.js +132 -0
  14. package/checkbox/index.js +184 -0
  15. package/dialog/index.js +281 -0
  16. package/divider/index.js +86 -0
  17. package/elevation/index.js +3 -0
  18. package/fab/index.js +105 -0
  19. package/focus/index.js +18 -0
  20. package/header/index.js +66 -0
  21. package/icon/index.js +38 -0
  22. package/{src/index.ts → index.d.ts} +2 -2
  23. package/index.js +63 -0
  24. package/layout/index.js +51 -0
  25. package/lib/accordion/accordion.d.ts +9 -0
  26. package/lib/accordion/accordion.template.d.ts +4 -0
  27. package/lib/accordion/index.d.ts +2 -0
  28. package/lib/accordion-item/accordion-item.d.ts +13 -0
  29. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  30. package/lib/accordion-item/index.d.ts +4 -0
  31. package/lib/action-group/action-group.d.ts +10 -0
  32. package/lib/action-group/action-group.template.d.ts +4 -0
  33. package/lib/action-group/index.d.ts +2 -0
  34. package/lib/avatar/avatar.d.ts +14 -0
  35. package/lib/avatar/avatar.template.d.ts +4 -0
  36. package/lib/avatar/index.d.ts +3 -0
  37. package/lib/badge/badge.d.ts +17 -0
  38. package/lib/badge/badge.template.d.ts +4 -0
  39. package/lib/badge/index.d.ts +3 -0
  40. package/lib/banner/banner.d.ts +20 -0
  41. package/lib/banner/banner.template.d.ts +4 -0
  42. package/lib/banner/index.d.ts +3 -0
  43. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  44. package/lib/breadcrumb/breadcrumb.template.d.ts +4 -0
  45. package/lib/breadcrumb/index.d.ts +2 -0
  46. package/lib/breadcrumb-item/breadcrumb-item.d.ts +5 -0
  47. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +4 -0
  48. package/lib/breadcrumb-item/index.d.ts +4 -0
  49. package/lib/button/button.d.ts +18 -0
  50. package/lib/button/button.template.d.ts +4 -0
  51. package/lib/button/index.d.ts +4 -0
  52. package/lib/calendar/calendar.d.ts +13 -0
  53. package/lib/calendar/calendar.template.d.ts +4 -0
  54. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  55. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  56. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  57. package/lib/calendar/index.d.ts +2 -0
  58. package/lib/calendar-event/calendar-event.d.ts +14 -0
  59. package/lib/calendar-event/calendar-event.template.d.ts +4 -0
  60. package/lib/calendar-event/index.d.ts +2 -0
  61. package/lib/card/card.d.ts +10 -0
  62. package/lib/card/card.template.d.ts +4 -0
  63. package/lib/card/index.d.ts +4 -0
  64. package/lib/checkbox/checkbox.d.ts +5 -0
  65. package/lib/checkbox/checkbox.template.d.ts +4 -0
  66. package/lib/checkbox/index.d.ts +4 -0
  67. package/lib/components.d.ts +32 -0
  68. package/lib/dialog/dialog.d.ts +20 -0
  69. package/lib/dialog/dialog.template.d.ts +4 -0
  70. package/lib/dialog/index.d.ts +5 -0
  71. package/lib/divider/divider.d.ts +3 -0
  72. package/lib/divider/divider.template.d.ts +4 -0
  73. package/lib/divider/index.d.ts +2 -0
  74. package/lib/elevation/elevation.d.ts +5 -0
  75. package/lib/elevation/elevation.template.d.ts +4 -0
  76. package/lib/elevation/index.d.ts +2 -0
  77. package/lib/enums.d.ts +51 -0
  78. package/lib/fab/fab.d.ts +13 -0
  79. package/lib/fab/fab.template.d.ts +4 -0
  80. package/lib/fab/index.d.ts +4 -0
  81. package/lib/focus/focus.d.ts +3 -0
  82. package/lib/focus/focus.template.d.ts +4 -0
  83. package/lib/focus/index.d.ts +2 -0
  84. package/lib/header/header.d.ts +5 -0
  85. package/lib/header/header.template.d.ts +4 -0
  86. package/lib/header/index.d.ts +3 -0
  87. package/lib/icon/icon.d.ts +12 -0
  88. package/lib/icon/icon.placeholder.d.ts +1 -0
  89. package/lib/icon/icon.template.d.ts +4 -0
  90. package/lib/icon/index.d.ts +2 -0
  91. package/lib/layout/index.d.ts +2 -0
  92. package/lib/layout/layout.d.ts +16 -0
  93. package/lib/layout/layout.template.d.ts +4 -0
  94. package/lib/menu/index.d.ts +12 -0
  95. package/lib/menu/menu.d.ts +10 -0
  96. package/lib/menu/menu.template.d.ts +3 -0
  97. package/lib/menu-item/index.d.ts +3 -0
  98. package/lib/menu-item/menu-item.d.ts +7 -0
  99. package/lib/menu-item/menu-item.template.d.ts +5 -0
  100. package/lib/nav/index.d.ts +2 -0
  101. package/lib/nav/nav.d.ts +3 -0
  102. package/lib/nav/nav.template.d.ts +4 -0
  103. package/lib/nav-disclosure/index.d.ts +4 -0
  104. package/lib/nav-disclosure/nav-disclosure.d.ts +10 -0
  105. package/lib/nav-disclosure/nav-disclosure.template.d.ts +4 -0
  106. package/lib/nav-item/index.d.ts +4 -0
  107. package/lib/nav-item/nav-item.d.ts +6 -0
  108. package/lib/nav-item/nav-item.template.d.ts +4 -0
  109. package/lib/note/index.d.ts +2 -0
  110. package/lib/note/note.d.ts +10 -0
  111. package/lib/note/note.template.d.ts +5 -0
  112. package/lib/popup/index.d.ts +4 -0
  113. package/lib/popup/popup.d.ts +18 -0
  114. package/lib/popup/popup.template.d.ts +4 -0
  115. package/lib/progress/index.d.ts +2 -0
  116. package/lib/progress/progress.d.ts +9 -0
  117. package/lib/progress/progress.template.d.ts +5 -0
  118. package/lib/progress-ring/index.d.ts +2 -0
  119. package/lib/progress-ring/progress-ring.d.ts +7 -0
  120. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  121. package/lib/side-drawer/index.d.ts +2 -0
  122. package/lib/side-drawer/side-drawer.d.ts +9 -0
  123. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  124. package/lib/text-anchor/index.d.ts +2 -0
  125. package/lib/text-anchor/text-anchor.d.ts +7 -0
  126. package/lib/text-anchor/text-anchor.template.d.ts +4 -0
  127. package/lib/text-area/index.d.ts +3 -0
  128. package/lib/text-area/text-area.d.ts +9 -0
  129. package/lib/text-area/text-area.template.d.ts +4 -0
  130. package/lib/text-field/index.d.ts +4 -0
  131. package/lib/text-field/text-field.d.ts +16 -0
  132. package/lib/text-field/text-field.template.d.ts +5 -0
  133. package/lib/tooltip/index.d.ts +3 -0
  134. package/lib/tooltip/tooltip.d.ts +8 -0
  135. package/lib/tooltip/tooltip.template.d.ts +4 -0
  136. package/menu/index.js +380 -0
  137. package/menu-item/index.js +19 -0
  138. package/nav/index.js +17 -0
  139. package/nav-disclosure/index.js +88 -0
  140. package/nav-item/index.js +45 -0
  141. package/note/index.js +66 -0
  142. package/package.json +56 -5
  143. package/popup/index.js +26 -0
  144. package/progress/index.js +105 -0
  145. package/progress-ring/index.js +80 -0
  146. package/shared/_has.js +58 -0
  147. package/shared/affix.js +29 -0
  148. package/shared/anchor.js +86 -0
  149. package/shared/apply-mixins.js +22 -0
  150. package/shared/aria-global.js +72 -0
  151. package/shared/base-progress.js +70 -0
  152. package/shared/breadcrumb-item.js +25 -0
  153. package/shared/button.js +200 -0
  154. package/shared/calendar-event.js +26 -0
  155. package/shared/class-names.js +15 -0
  156. package/shared/design-system/index.d.ts +3 -0
  157. package/shared/dialog-polyfill.esm.js +858 -0
  158. package/shared/enums.js +79 -0
  159. package/shared/es.object.assign.js +69 -0
  160. package/shared/export.js +995 -0
  161. package/shared/focus.js +5 -0
  162. package/shared/focus2.js +11 -0
  163. package/shared/form-associated.js +466 -0
  164. package/shared/form-elements.js +299 -0
  165. package/shared/icon.js +1406 -0
  166. package/shared/index.js +5014 -0
  167. package/shared/index2.js +35 -0
  168. package/shared/index3.js +2117 -0
  169. package/shared/index4.js +371 -0
  170. package/shared/iterators.js +61 -0
  171. package/shared/key-codes.js +90 -0
  172. package/shared/object-keys.js +13 -0
  173. package/shared/patterns/affix.d.ts +9 -0
  174. package/shared/patterns/focus.d.ts +3 -0
  175. package/shared/patterns/form-elements.d.ts +22 -0
  176. package/shared/patterns/index.d.ts +2 -0
  177. package/shared/ref.js +41 -0
  178. package/shared/slotted.js +119 -0
  179. package/shared/start-end.js +50 -0
  180. package/shared/text-anchor.js +12 -0
  181. package/shared/text-anchor.template.js +57 -0
  182. package/shared/to-string.js +51 -0
  183. package/shared/web.dom-collections.iterator.js +474 -0
  184. package/shared/when.js +15 -0
  185. package/side-drawer/index.js +102 -0
  186. package/styles/core/all.css +75 -0
  187. package/styles/core/theme.css +11 -0
  188. package/styles/core/typography.css +69 -0
  189. package/styles/fonts/SpeziaCompleteVariableItalicWeb.woff2 +0 -0
  190. package/styles/fonts/SpeziaCompleteVariableUprightWeb.woff2 +0 -0
  191. package/styles/fonts/SpeziaMonoCompleteVariableWeb.woff2 +0 -0
  192. package/styles/fonts/spezia.css +20 -0
  193. package/styles/tokens/theme-dark.css +210 -0
  194. package/styles/tokens/theme-light.css +210 -0
  195. package/text-anchor/index.js +27 -0
  196. package/text-area/index.js +304 -0
  197. package/text-field/index.js +152 -0
  198. package/tooltip/index.js +71 -0
  199. package/.babelrc +0 -3
  200. package/.eslintrc.json +0 -70
  201. package/.stylelintrc.json +0 -8
  202. package/CHANGELOG.json +0 -343
  203. package/CHANGELOG.md +0 -45
  204. package/jest.config.cjs +0 -20
  205. package/playwright.config.dev.ts +0 -21
  206. package/playwright.config.ts +0 -34
  207. package/project.json +0 -122
  208. package/rollup.config.prod.ts +0 -50
  209. package/setupJestTests.js +0 -17
  210. package/src/lib/accordion/README.md +0 -55
  211. package/src/lib/accordion/accordion.scss +0 -10
  212. package/src/lib/accordion/accordion.spec.ts +0 -91
  213. package/src/lib/accordion/accordion.template.ts +0 -23
  214. package/src/lib/accordion/accordion.ts +0 -49
  215. package/src/lib/accordion/index.ts +0 -14
  216. package/src/lib/accordion/ui.test.ts +0 -37
  217. package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Chrome-Stable-darwin.png +0 -0
  218. package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Chrome-Stable-linux.png +0 -0
  219. package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Firefox-darwin.png +0 -0
  220. package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Firefox-linux.png +0 -0
  221. package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Safari-darwin.png +0 -0
  222. package/src/lib/accordion/ui.test.ts-snapshots/snapshots-accordion-Desktop-Safari-linux.png +0 -0
  223. package/src/lib/accordion-item/README.md +0 -113
  224. package/src/lib/accordion-item/accordion-item.scss +0 -91
  225. package/src/lib/accordion-item/accordion-item.spec.ts +0 -103
  226. package/src/lib/accordion-item/accordion-item.template.ts +0 -62
  227. package/src/lib/accordion-item/accordion-item.ts +0 -67
  228. package/src/lib/accordion-item/index.ts +0 -14
  229. package/src/lib/accordion-item/partials/variables.scss +0 -1
  230. package/src/lib/accordion-item/ui.test.ts +0 -37
  231. package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Chrome-Stable-darwin.png +0 -0
  232. package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Chrome-Stable-linux.png +0 -0
  233. package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Firefox-darwin.png +0 -0
  234. package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Firefox-linux.png +0 -0
  235. package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Safari-darwin.png +0 -0
  236. package/src/lib/accordion-item/ui.test.ts-snapshots/snapshots-accordion-item-Desktop-Safari-linux.png +0 -0
  237. package/src/lib/badge/README.md +0 -112
  238. package/src/lib/badge/badge.scss +0 -64
  239. package/src/lib/badge/badge.spec.ts +0 -114
  240. package/src/lib/badge/badge.template.ts +0 -36
  241. package/src/lib/badge/badge.ts +0 -97
  242. package/src/lib/badge/index.ts +0 -23
  243. package/src/lib/badge/ui.test.ts +0 -28
  244. package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Chrome-Stable-darwin.png +0 -0
  245. package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Chrome-Stable-linux.png +0 -0
  246. package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Firefox-darwin.png +0 -0
  247. package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Firefox-linux.png +0 -0
  248. package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Safari-darwin.png +0 -0
  249. package/src/lib/badge/ui.test.ts-snapshots/snapshots-badge-Desktop-Safari-linux.png +0 -0
  250. package/src/lib/banner/README.md +0 -117
  251. package/src/lib/banner/banner.scss +0 -71
  252. package/src/lib/banner/banner.spec.ts +0 -355
  253. package/src/lib/banner/banner.template.ts +0 -61
  254. package/src/lib/banner/banner.ts +0 -77
  255. package/src/lib/banner/index.ts +0 -14
  256. package/src/lib/banner/ui.test.ts +0 -64
  257. package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Chrome-Stable-darwin.png +0 -0
  258. package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Chrome-Stable-linux.png +0 -0
  259. package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Firefox-darwin.png +0 -0
  260. package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Firefox-linux.png +0 -0
  261. package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Safari-darwin.png +0 -0
  262. package/src/lib/banner/ui.test.ts-snapshots/snapshots-banner-Desktop-Safari-linux.png +0 -0
  263. package/src/lib/breadcrumb/README.md +0 -25
  264. package/src/lib/breadcrumb/breadcrumb.scss +0 -3
  265. package/src/lib/breadcrumb/breadcrumb.spec.ts +0 -78
  266. package/src/lib/breadcrumb/breadcrumb.ts +0 -10
  267. package/src/lib/breadcrumb/index.ts +0 -13
  268. package/src/lib/breadcrumb/ui.test.ts +0 -36
  269. package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Chrome-Stable-darwin.png +0 -0
  270. package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Chrome-Stable-linux.png +0 -0
  271. package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Firefox-darwin.png +0 -0
  272. package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Firefox-linux.png +0 -0
  273. package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Safari-darwin.png +0 -0
  274. package/src/lib/breadcrumb/ui.test.ts-snapshots/snapshots-breadcrumb-Desktop-Safari-linux.png +0 -0
  275. package/src/lib/breadcrumb-item/README.md +0 -40
  276. package/src/lib/breadcrumb-item/breadcrumb-item.scss +0 -28
  277. package/src/lib/breadcrumb-item/breadcrumb-item.spec.ts +0 -192
  278. package/src/lib/breadcrumb-item/breadcrumb-item.template.ts +0 -37
  279. package/src/lib/breadcrumb-item/breadcrumb-item.ts +0 -15
  280. package/src/lib/breadcrumb-item/index.ts +0 -16
  281. package/src/lib/breadcrumb-item/ui.test.ts +0 -38
  282. package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Chrome-Stable-darwin.png +0 -0
  283. package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Chrome-Stable-linux.png +0 -0
  284. package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Firefox-darwin.png +0 -0
  285. package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Firefox-linux.png +0 -0
  286. package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Safari-darwin.png +0 -0
  287. package/src/lib/breadcrumb-item/ui.test.ts-snapshots/snapshots-breadcrumb-item-Desktop-Safari-linux.png +0 -0
  288. package/src/lib/button/README.md +0 -120
  289. package/src/lib/button/button.scss +0 -142
  290. package/src/lib/button/button.spec.ts +0 -131
  291. package/src/lib/button/button.template.ts +0 -89
  292. package/src/lib/button/button.ts +0 -95
  293. package/src/lib/button/index.ts +0 -25
  294. package/src/lib/button/partials/variables.scss +0 -2
  295. package/src/lib/button/ui.test.ts +0 -32
  296. package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Chrome-Stable-darwin.png +0 -0
  297. package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Chrome-Stable-linux.png +0 -0
  298. package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Firefox-darwin.png +0 -0
  299. package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Firefox-linux.png +0 -0
  300. package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Safari-darwin.png +0 -0
  301. package/src/lib/button/ui.test.ts-snapshots/snapshots-button-Desktop-Safari-linux.png +0 -0
  302. package/src/lib/calendar/README.md +0 -70
  303. package/src/lib/calendar/calendar.scss +0 -176
  304. package/src/lib/calendar/calendar.spec.ts +0 -341
  305. package/src/lib/calendar/calendar.template.ts +0 -93
  306. package/src/lib/calendar/calendar.ts +0 -139
  307. package/src/lib/calendar/helpers/calendar.date-functions.ts +0 -31
  308. package/src/lib/calendar/helpers/calendar.event-context.ts +0 -72
  309. package/src/lib/calendar/helpers/calendar.keyboard-interactions.ts +0 -65
  310. package/src/lib/calendar/index.ts +0 -16
  311. package/src/lib/calendar/partials/_variables.scss +0 -15
  312. package/src/lib/calendar/ui.test.ts +0 -32
  313. package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Chrome-Stable-darwin.png +0 -0
  314. package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Chrome-Stable-linux.png +0 -0
  315. package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Firefox-darwin.png +0 -0
  316. package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Firefox-linux.png +0 -0
  317. package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Safari-darwin.png +0 -0
  318. package/src/lib/calendar/ui.test.ts-snapshots/snapshots-calendar-Desktop-Safari-linux.png +0 -0
  319. package/src/lib/components.spec.ts +0 -7
  320. package/src/lib/components.ts +0 -16
  321. package/src/lib/elevation/README.md +0 -99
  322. package/src/lib/elevation/elevation.scss +0 -15
  323. package/src/lib/elevation/elevation.spec.ts +0 -55
  324. package/src/lib/elevation/elevation.template.ts +0 -26
  325. package/src/lib/elevation/elevation.ts +0 -17
  326. package/src/lib/elevation/index.ts +0 -17
  327. package/src/lib/elevation/partials/_elevation.mixin.scss +0 -4
  328. package/src/lib/elevation/ui.test.ts +0 -32
  329. package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Chrome-Stable-darwin.png +0 -0
  330. package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Chrome-Stable-linux.png +0 -0
  331. package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Firefox-darwin.png +0 -0
  332. package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Firefox-linux.png +0 -0
  333. package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Safari-darwin.png +0 -0
  334. package/src/lib/elevation/ui.test.ts-snapshots/snapshots-elevation-Desktop-Safari-linux.png +0 -0
  335. package/src/lib/enums.ts +0 -55
  336. package/src/lib/focus/README.md +0 -1
  337. package/src/lib/focus/focus.scss +0 -17
  338. package/src/lib/focus/focus.template.ts +0 -16
  339. package/src/lib/focus/focus.ts +0 -10
  340. package/src/lib/focus/index.ts +0 -21
  341. package/src/lib/focus/partials/variables.scss +0 -2
  342. package/src/lib/icon/README.md +0 -70
  343. package/src/lib/icon/__snapshots__/icon.spec.ts.snap +0 -16
  344. package/src/lib/icon/icon.placeholder.ts +0 -12
  345. package/src/lib/icon/icon.scss +0 -52
  346. package/src/lib/icon/icon.spec.ts +0 -106
  347. package/src/lib/icon/icon.template.ts +0 -23
  348. package/src/lib/icon/icon.ts +0 -93
  349. package/src/lib/icon/index.ts +0 -14
  350. package/src/lib/layout/README.md +0 -154
  351. package/src/lib/layout/index.ts +0 -18
  352. package/src/lib/layout/layout.scss +0 -40
  353. package/src/lib/layout/layout.spec.ts +0 -73
  354. package/src/lib/layout/layout.template.ts +0 -29
  355. package/src/lib/layout/layout.ts +0 -46
  356. package/src/lib/layout/partials/_functions.scss +0 -15
  357. package/src/lib/layout/partials/_mixins.scss +0 -5
  358. package/src/lib/layout/partials/_variables.scss +0 -23
  359. package/src/lib/layout/ui.test.ts +0 -32
  360. package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Chrome-Stable-darwin.png +0 -0
  361. package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Chrome-Stable-linux.png +0 -0
  362. package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Firefox-darwin.png +0 -0
  363. package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Firefox-linux.png +0 -0
  364. package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Safari-darwin.png +0 -0
  365. package/src/lib/layout/ui.test.ts-snapshots/snapshots-layout-Desktop-Safari-linux.png +0 -0
  366. package/src/lib/popup/README.md +0 -261
  367. package/src/lib/popup/index.ts +0 -21
  368. package/src/lib/popup/popup.scss +0 -43
  369. package/src/lib/popup/popup.spec.ts +0 -265
  370. package/src/lib/popup/popup.template.ts +0 -41
  371. package/src/lib/popup/popup.ts +0 -158
  372. package/src/lib/popup/ui.test.ts +0 -111
  373. package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Chrome-Stable-darwin.png +0 -0
  374. package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Chrome-Stable-linux.png +0 -0
  375. package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Firefox-darwin.png +0 -0
  376. package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Firefox-linux.png +0 -0
  377. package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Safari-darwin.png +0 -0
  378. package/src/lib/popup/ui.test.ts-snapshots/snapshots-popup-Desktop-Safari-linux.png +0 -0
  379. package/src/lib/progress/README.md +0 -107
  380. package/src/lib/progress/index.ts +0 -14
  381. package/src/lib/progress/progress.scss +0 -133
  382. package/src/lib/progress/progress.spec.ts +0 -173
  383. package/src/lib/progress/progress.template.ts +0 -62
  384. package/src/lib/progress/progress.ts +0 -25
  385. package/src/lib/progress/ui.test.ts +0 -70
  386. package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Chrome-Stable-darwin.png +0 -0
  387. package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Chrome-Stable-linux.png +0 -0
  388. package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Firefox-darwin.png +0 -0
  389. package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Firefox-linux.png +0 -0
  390. package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Safari-darwin.png +0 -0
  391. package/src/lib/progress/ui.test.ts-snapshots/snapshots-progress-Desktop-Safari-linux.png +0 -0
  392. package/src/lib/progress-ring/README.md +0 -90
  393. package/src/lib/progress-ring/index.ts +0 -15
  394. package/src/lib/progress-ring/progress-ring.scss +0 -75
  395. package/src/lib/progress-ring/progress-ring.spec.ts +0 -139
  396. package/src/lib/progress-ring/progress-ring.template.ts +0 -82
  397. package/src/lib/progress-ring/progress-ring.ts +0 -18
  398. package/src/lib/progress-ring/ui.test.ts +0 -35
  399. package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Chrome-Stable-darwin.png +0 -0
  400. package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Chrome-Stable-linux.png +0 -0
  401. package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Firefox-darwin.png +0 -0
  402. package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Firefox-linux.png +0 -0
  403. package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Safari-darwin.png +0 -0
  404. package/src/lib/progress-ring/ui.test.ts-snapshots/snapshots-progress-ring-Desktop-Safari-linux.png +0 -0
  405. package/src/lib/side-drawer/README.md +0 -304
  406. package/src/lib/side-drawer/index.ts +0 -16
  407. package/src/lib/side-drawer/partials/variables.scss +0 -6
  408. package/src/lib/side-drawer/side-drawer.scss +0 -109
  409. package/src/lib/side-drawer/side-drawer.spec.ts +0 -118
  410. package/src/lib/side-drawer/side-drawer.template.ts +0 -51
  411. package/src/lib/side-drawer/side-drawer.ts +0 -58
  412. package/src/lib/side-drawer/ui.test.ts +0 -102
  413. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Chrome-Stable-darwin.png +0 -0
  414. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Chrome-Stable-linux.png +0 -0
  415. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Firefox-darwin.png +0 -0
  416. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Firefox-linux.png +0 -0
  417. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Safari-darwin.png +0 -0
  418. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-Desktop-Safari-linux.png +0 -0
  419. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Chrome-Stable-darwin.png +0 -0
  420. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Chrome-Stable-linux.png +0 -0
  421. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Firefox-darwin.png +0 -0
  422. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Firefox-linux.png +0 -0
  423. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Safari-darwin.png +0 -0
  424. package/src/lib/side-drawer/ui.test.ts-snapshots/snapshots-side-drawer-modal-Desktop-Safari-linux.png +0 -0
  425. package/src/lib/sidenav-item/README.md +0 -41
  426. package/src/lib/sidenav-item/index.ts +0 -20
  427. package/src/lib/sidenav-item/sidenav-item.scss +0 -51
  428. package/src/lib/sidenav-item/sidenav-item.spec.ts +0 -64
  429. package/src/lib/sidenav-item/sidenav-item.template.ts +0 -25
  430. package/src/lib/sidenav-item/sidenav-item.ts +0 -15
  431. package/src/lib/sidenav-item/ui.test.ts +0 -32
  432. package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Chrome-Stable-darwin.png +0 -0
  433. package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Chrome-Stable-linux.png +0 -0
  434. package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Firefox-darwin.png +0 -0
  435. package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Firefox-linux.png +0 -0
  436. package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Safari-darwin.png +0 -0
  437. package/src/lib/sidenav-item/ui.test.ts-snapshots/snapshots-sidenav-item-Desktop-Safari-linux.png +0 -0
  438. package/src/lib/text/README.md +0 -119
  439. package/src/lib/text/index.ts +0 -14
  440. package/src/lib/text/text.scss +0 -92
  441. package/src/lib/text/text.spec.ts +0 -54
  442. package/src/lib/text/text.template.ts +0 -28
  443. package/src/lib/text/text.ts +0 -55
  444. package/src/lib/text/ui.test.ts +0 -39
  445. package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Chrome-Stable-darwin.png +0 -0
  446. package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Chrome-Stable-linux.png +0 -0
  447. package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Firefox-darwin.png +0 -0
  448. package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Firefox-linux.png +0 -0
  449. package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Safari-darwin.png +0 -0
  450. package/src/lib/text/ui.test.ts-snapshots/snapshots-text-Desktop-Safari-linux.png +0 -0
  451. package/src/lib/text-anchor/README.md +0 -5
  452. package/src/lib/text-anchor/index.ts +0 -12
  453. package/src/lib/text-anchor/text-anchor.spec.ts +0 -153
  454. package/src/lib/text-anchor/text-anchor.template.ts +0 -66
  455. package/src/lib/text-anchor/text-anchor.ts +0 -22
  456. package/src/lib/tooltip/README.md +0 -132
  457. package/src/lib/tooltip/index.ts +0 -16
  458. package/src/lib/tooltip/partials/variables.scss +0 -1
  459. package/src/lib/tooltip/tooltip.scss +0 -18
  460. package/src/lib/tooltip/tooltip.spec.ts +0 -70
  461. package/src/lib/tooltip/tooltip.template.ts +0 -30
  462. package/src/lib/tooltip/tooltip.ts +0 -44
  463. package/src/lib/tooltip/ui.test.ts +0 -53
  464. package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Chrome-Stable-darwin.png +0 -0
  465. package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Chrome-Stable-linux.png +0 -0
  466. package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Firefox-darwin.png +0 -0
  467. package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Firefox-linux.png +0 -0
  468. package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Safari-darwin.png +0 -0
  469. package/src/lib/tooltip/ui.test.ts-snapshots/snapshots-tooltip-Desktop-Safari-linux.png +0 -0
  470. package/src/shared/design-system/index.ts +0 -12
  471. package/src/shared/patterns/affix.ts +0 -56
  472. package/src/shared/patterns/index.ts +0 -1
  473. package/src/types/extract-gfm.d.ts +0 -5
  474. package/src/types/style.d.ts +0 -4
  475. package/src/visual-tests/visual-tests-utils.ts +0 -76
  476. package/tsconfig.json +0 -36
  477. package/tsconfig.lib.json +0 -11
  478. package/tsconfig.spec.json +0 -16
@@ -0,0 +1,1563 @@
1
+ import { e as emptyArray, O as Observable, S as SubscriberSet, D as DOM, H as HTMLDirective, g as HTMLView, F as FoundationElement, c as __classPrivateFieldGet, _ as __decorate, a as attr, b as __metadata, h as html, d as designSystem } from '../shared/index.js';
2
+ import '../shared/web.dom-collections.iterator.js';
3
+ import { C as CalendarEvent } from '../shared/calendar-event.js';
4
+ import '../shared/es.object.assign.js';
5
+ import { b as _has, _ as _curry1, a as _curry2 } from '../shared/_has.js';
6
+ import '../shared/export.js';
7
+ import '../shared/object-keys.js';
8
+ import '../shared/iterators.js';
9
+
10
+ /** @internal */
11
+ function newSplice(index, removed, addedCount) {
12
+ return {
13
+ index: index,
14
+ removed: removed,
15
+ addedCount: addedCount,
16
+ };
17
+ }
18
+ const EDIT_LEAVE = 0;
19
+ const EDIT_UPDATE = 1;
20
+ const EDIT_ADD = 2;
21
+ const EDIT_DELETE = 3;
22
+ // Note: This function is *based* on the computation of the Levenshtein
23
+ // "edit" distance. The one change is that "updates" are treated as two
24
+ // edits - not one. With Array splices, an update is really a delete
25
+ // followed by an add. By retaining this, we optimize for "keeping" the
26
+ // maximum array items in the original array. For example:
27
+ //
28
+ // 'xxxx123' -> '123yyyy'
29
+ //
30
+ // With 1-edit updates, the shortest path would be just to update all seven
31
+ // characters. With 2-edit updates, we delete 4, leave 3, and add 4. This
32
+ // leaves the substring '123' intact.
33
+ function calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd) {
34
+ // "Deletion" columns
35
+ const rowCount = oldEnd - oldStart + 1;
36
+ const columnCount = currentEnd - currentStart + 1;
37
+ const distances = new Array(rowCount);
38
+ let north;
39
+ let west;
40
+ // "Addition" rows. Initialize null column.
41
+ for (let i = 0; i < rowCount; ++i) {
42
+ distances[i] = new Array(columnCount);
43
+ distances[i][0] = i;
44
+ }
45
+ // Initialize null row
46
+ for (let j = 0; j < columnCount; ++j) {
47
+ distances[0][j] = j;
48
+ }
49
+ for (let i = 1; i < rowCount; ++i) {
50
+ for (let j = 1; j < columnCount; ++j) {
51
+ if (current[currentStart + j - 1] === old[oldStart + i - 1]) {
52
+ distances[i][j] = distances[i - 1][j - 1];
53
+ }
54
+ else {
55
+ north = distances[i - 1][j] + 1;
56
+ west = distances[i][j - 1] + 1;
57
+ distances[i][j] = north < west ? north : west;
58
+ }
59
+ }
60
+ }
61
+ return distances;
62
+ }
63
+ // This starts at the final weight, and walks "backward" by finding
64
+ // the minimum previous weight recursively until the origin of the weight
65
+ // matrix.
66
+ function spliceOperationsFromEditDistances(distances) {
67
+ let i = distances.length - 1;
68
+ let j = distances[0].length - 1;
69
+ let current = distances[i][j];
70
+ const edits = [];
71
+ while (i > 0 || j > 0) {
72
+ if (i === 0) {
73
+ edits.push(EDIT_ADD);
74
+ j--;
75
+ continue;
76
+ }
77
+ if (j === 0) {
78
+ edits.push(EDIT_DELETE);
79
+ i--;
80
+ continue;
81
+ }
82
+ const northWest = distances[i - 1][j - 1];
83
+ const west = distances[i - 1][j];
84
+ const north = distances[i][j - 1];
85
+ let min;
86
+ if (west < north) {
87
+ min = west < northWest ? west : northWest;
88
+ }
89
+ else {
90
+ min = north < northWest ? north : northWest;
91
+ }
92
+ if (min === northWest) {
93
+ if (northWest === current) {
94
+ edits.push(EDIT_LEAVE);
95
+ }
96
+ else {
97
+ edits.push(EDIT_UPDATE);
98
+ current = northWest;
99
+ }
100
+ i--;
101
+ j--;
102
+ }
103
+ else if (min === west) {
104
+ edits.push(EDIT_DELETE);
105
+ i--;
106
+ current = west;
107
+ }
108
+ else {
109
+ edits.push(EDIT_ADD);
110
+ j--;
111
+ current = north;
112
+ }
113
+ }
114
+ edits.reverse();
115
+ return edits;
116
+ }
117
+ function sharedPrefix(current, old, searchLength) {
118
+ for (let i = 0; i < searchLength; ++i) {
119
+ if (current[i] !== old[i]) {
120
+ return i;
121
+ }
122
+ }
123
+ return searchLength;
124
+ }
125
+ function sharedSuffix(current, old, searchLength) {
126
+ let index1 = current.length;
127
+ let index2 = old.length;
128
+ let count = 0;
129
+ while (count < searchLength && current[--index1] === old[--index2]) {
130
+ count++;
131
+ }
132
+ return count;
133
+ }
134
+ function intersect(start1, end1, start2, end2) {
135
+ // Disjoint
136
+ if (end1 < start2 || end2 < start1) {
137
+ return -1;
138
+ }
139
+ // Adjacent
140
+ if (end1 === start2 || end2 === start1) {
141
+ return 0;
142
+ }
143
+ // Non-zero intersect, span1 first
144
+ if (start1 < start2) {
145
+ if (end1 < end2) {
146
+ return end1 - start2; // Overlap
147
+ }
148
+ return end2 - start2; // Contained
149
+ }
150
+ // Non-zero intersect, span2 first
151
+ if (end2 < end1) {
152
+ return end2 - start1; // Overlap
153
+ }
154
+ return end1 - start1; // Contained
155
+ }
156
+ /**
157
+ * Splice Projection functions:
158
+ *
159
+ * A splice map is a representation of how a previous array of items
160
+ * was transformed into a new array of items. Conceptually it is a list of
161
+ * tuples of
162
+ *
163
+ * <index, removed, addedCount>
164
+ *
165
+ * which are kept in ascending index order of. The tuple represents that at
166
+ * the |index|, |removed| sequence of items were removed, and counting forward
167
+ * from |index|, |addedCount| items were added.
168
+ */
169
+ /**
170
+ * @internal
171
+ * @remarks
172
+ * Lacking individual splice mutation information, the minimal set of
173
+ * splices can be synthesized given the previous state and final state of an
174
+ * array. The basic approach is to calculate the edit distance matrix and
175
+ * choose the shortest path through it.
176
+ *
177
+ * Complexity: O(l * p)
178
+ * l: The length of the current array
179
+ * p: The length of the old array
180
+ */
181
+ function calcSplices(current, currentStart, currentEnd, old, oldStart, oldEnd) {
182
+ let prefixCount = 0;
183
+ let suffixCount = 0;
184
+ const minLength = Math.min(currentEnd - currentStart, oldEnd - oldStart);
185
+ if (currentStart === 0 && oldStart === 0) {
186
+ prefixCount = sharedPrefix(current, old, minLength);
187
+ }
188
+ if (currentEnd === current.length && oldEnd === old.length) {
189
+ suffixCount = sharedSuffix(current, old, minLength - prefixCount);
190
+ }
191
+ currentStart += prefixCount;
192
+ oldStart += prefixCount;
193
+ currentEnd -= suffixCount;
194
+ oldEnd -= suffixCount;
195
+ if (currentEnd - currentStart === 0 && oldEnd - oldStart === 0) {
196
+ return emptyArray;
197
+ }
198
+ if (currentStart === currentEnd) {
199
+ const splice = newSplice(currentStart, [], 0);
200
+ while (oldStart < oldEnd) {
201
+ splice.removed.push(old[oldStart++]);
202
+ }
203
+ return [splice];
204
+ }
205
+ else if (oldStart === oldEnd) {
206
+ return [newSplice(currentStart, [], currentEnd - currentStart)];
207
+ }
208
+ const ops = spliceOperationsFromEditDistances(calcEditDistances(current, currentStart, currentEnd, old, oldStart, oldEnd));
209
+ const splices = [];
210
+ let splice = void 0;
211
+ let index = currentStart;
212
+ let oldIndex = oldStart;
213
+ for (let i = 0; i < ops.length; ++i) {
214
+ switch (ops[i]) {
215
+ case EDIT_LEAVE:
216
+ if (splice !== void 0) {
217
+ splices.push(splice);
218
+ splice = void 0;
219
+ }
220
+ index++;
221
+ oldIndex++;
222
+ break;
223
+ case EDIT_UPDATE:
224
+ if (splice === void 0) {
225
+ splice = newSplice(index, [], 0);
226
+ }
227
+ splice.addedCount++;
228
+ index++;
229
+ splice.removed.push(old[oldIndex]);
230
+ oldIndex++;
231
+ break;
232
+ case EDIT_ADD:
233
+ if (splice === void 0) {
234
+ splice = newSplice(index, [], 0);
235
+ }
236
+ splice.addedCount++;
237
+ index++;
238
+ break;
239
+ case EDIT_DELETE:
240
+ if (splice === void 0) {
241
+ splice = newSplice(index, [], 0);
242
+ }
243
+ splice.removed.push(old[oldIndex]);
244
+ oldIndex++;
245
+ break;
246
+ // no default
247
+ }
248
+ }
249
+ if (splice !== void 0) {
250
+ splices.push(splice);
251
+ }
252
+ return splices;
253
+ }
254
+ const $push = Array.prototype.push;
255
+ function mergeSplice(splices, index, removed, addedCount) {
256
+ const splice = newSplice(index, removed, addedCount);
257
+ let inserted = false;
258
+ let insertionOffset = 0;
259
+ for (let i = 0; i < splices.length; i++) {
260
+ const current = splices[i];
261
+ current.index += insertionOffset;
262
+ if (inserted) {
263
+ continue;
264
+ }
265
+ const intersectCount = intersect(splice.index, splice.index + splice.removed.length, current.index, current.index + current.addedCount);
266
+ if (intersectCount >= 0) {
267
+ // Merge the two splices
268
+ splices.splice(i, 1);
269
+ i--;
270
+ insertionOffset -= current.addedCount - current.removed.length;
271
+ splice.addedCount += current.addedCount - intersectCount;
272
+ const deleteCount = splice.removed.length + current.removed.length - intersectCount;
273
+ if (!splice.addedCount && !deleteCount) {
274
+ // merged splice is a noop. discard.
275
+ inserted = true;
276
+ }
277
+ else {
278
+ let currentRemoved = current.removed;
279
+ if (splice.index < current.index) {
280
+ // some prefix of splice.removed is prepended to current.removed.
281
+ const prepend = splice.removed.slice(0, current.index - splice.index);
282
+ $push.apply(prepend, currentRemoved);
283
+ currentRemoved = prepend;
284
+ }
285
+ if (splice.index + splice.removed.length >
286
+ current.index + current.addedCount) {
287
+ // some suffix of splice.removed is appended to current.removed.
288
+ const append = splice.removed.slice(current.index + current.addedCount - splice.index);
289
+ $push.apply(currentRemoved, append);
290
+ }
291
+ splice.removed = currentRemoved;
292
+ if (current.index < splice.index) {
293
+ splice.index = current.index;
294
+ }
295
+ }
296
+ }
297
+ else if (splice.index < current.index) {
298
+ // Insert splice here.
299
+ inserted = true;
300
+ splices.splice(i, 0, splice);
301
+ i++;
302
+ const offset = splice.addedCount - splice.removed.length;
303
+ current.index += offset;
304
+ insertionOffset += offset;
305
+ }
306
+ }
307
+ if (!inserted) {
308
+ splices.push(splice);
309
+ }
310
+ }
311
+ function createInitialSplices(changeRecords) {
312
+ const splices = [];
313
+ for (let i = 0, ii = changeRecords.length; i < ii; i++) {
314
+ const record = changeRecords[i];
315
+ mergeSplice(splices, record.index, record.removed, record.addedCount);
316
+ }
317
+ return splices;
318
+ }
319
+ /** @internal */
320
+ function projectArraySplices(array, changeRecords) {
321
+ let splices = [];
322
+ const initialSplices = createInitialSplices(changeRecords);
323
+ for (let i = 0, ii = initialSplices.length; i < ii; ++i) {
324
+ const splice = initialSplices[i];
325
+ if (splice.addedCount === 1 && splice.removed.length === 1) {
326
+ if (splice.removed[0] !== array[splice.index]) {
327
+ splices.push(splice);
328
+ }
329
+ continue;
330
+ }
331
+ splices = splices.concat(calcSplices(array, splice.index, splice.index + splice.addedCount, splice.removed, 0, splice.removed.length));
332
+ }
333
+ return splices;
334
+ }
335
+
336
+ let arrayObservationEnabled = false;
337
+ function adjustIndex(changeRecord, array) {
338
+ let index = changeRecord.index;
339
+ const arrayLength = array.length;
340
+ if (index > arrayLength) {
341
+ index = arrayLength - changeRecord.addedCount;
342
+ }
343
+ else if (index < 0) {
344
+ index =
345
+ arrayLength + changeRecord.removed.length + index - changeRecord.addedCount;
346
+ }
347
+ if (index < 0) {
348
+ index = 0;
349
+ }
350
+ changeRecord.index = index;
351
+ return changeRecord;
352
+ }
353
+ class ArrayObserver extends SubscriberSet {
354
+ constructor(source) {
355
+ super(source);
356
+ this.oldCollection = void 0;
357
+ this.splices = void 0;
358
+ this.needsQueue = true;
359
+ this.call = this.flush;
360
+ Reflect.defineProperty(source, "$fastController", {
361
+ value: this,
362
+ enumerable: false,
363
+ });
364
+ }
365
+ subscribe(subscriber) {
366
+ this.flush();
367
+ super.subscribe(subscriber);
368
+ }
369
+ addSplice(splice) {
370
+ if (this.splices === void 0) {
371
+ this.splices = [splice];
372
+ }
373
+ else {
374
+ this.splices.push(splice);
375
+ }
376
+ if (this.needsQueue) {
377
+ this.needsQueue = false;
378
+ DOM.queueUpdate(this);
379
+ }
380
+ }
381
+ reset(oldCollection) {
382
+ this.oldCollection = oldCollection;
383
+ if (this.needsQueue) {
384
+ this.needsQueue = false;
385
+ DOM.queueUpdate(this);
386
+ }
387
+ }
388
+ flush() {
389
+ const splices = this.splices;
390
+ const oldCollection = this.oldCollection;
391
+ if (splices === void 0 && oldCollection === void 0) {
392
+ return;
393
+ }
394
+ this.needsQueue = true;
395
+ this.splices = void 0;
396
+ this.oldCollection = void 0;
397
+ const finalSplices = oldCollection === void 0
398
+ ? projectArraySplices(this.source, splices)
399
+ : calcSplices(this.source, 0, this.source.length, oldCollection, 0, oldCollection.length);
400
+ this.notify(finalSplices);
401
+ }
402
+ }
403
+ /* eslint-disable prefer-rest-params */
404
+ /* eslint-disable @typescript-eslint/explicit-function-return-type */
405
+ /**
406
+ * Enables the array observation mechanism.
407
+ * @remarks
408
+ * Array observation is enabled automatically when using the
409
+ * {@link RepeatDirective}, so calling this API manually is
410
+ * not typically necessary.
411
+ * @public
412
+ */
413
+ function enableArrayObservation() {
414
+ if (arrayObservationEnabled) {
415
+ return;
416
+ }
417
+ arrayObservationEnabled = true;
418
+ Observable.setArrayObserverFactory((collection) => {
419
+ return new ArrayObserver(collection);
420
+ });
421
+ const proto = Array.prototype;
422
+ // Don't patch Array if it has already been patched
423
+ // by another copy of fast-element.
424
+ if (proto.$fastPatch) {
425
+ return;
426
+ }
427
+ Reflect.defineProperty(proto, "$fastPatch", {
428
+ value: 1,
429
+ enumerable: false,
430
+ });
431
+ const pop = proto.pop;
432
+ const push = proto.push;
433
+ const reverse = proto.reverse;
434
+ const shift = proto.shift;
435
+ const sort = proto.sort;
436
+ const splice = proto.splice;
437
+ const unshift = proto.unshift;
438
+ proto.pop = function () {
439
+ const notEmpty = this.length > 0;
440
+ const methodCallResult = pop.apply(this, arguments);
441
+ const o = this.$fastController;
442
+ if (o !== void 0 && notEmpty) {
443
+ o.addSplice(newSplice(this.length, [methodCallResult], 0));
444
+ }
445
+ return methodCallResult;
446
+ };
447
+ proto.push = function () {
448
+ const methodCallResult = push.apply(this, arguments);
449
+ const o = this.$fastController;
450
+ if (o !== void 0) {
451
+ o.addSplice(adjustIndex(newSplice(this.length - arguments.length, [], arguments.length), this));
452
+ }
453
+ return methodCallResult;
454
+ };
455
+ proto.reverse = function () {
456
+ let oldArray;
457
+ const o = this.$fastController;
458
+ if (o !== void 0) {
459
+ o.flush();
460
+ oldArray = this.slice();
461
+ }
462
+ const methodCallResult = reverse.apply(this, arguments);
463
+ if (o !== void 0) {
464
+ o.reset(oldArray);
465
+ }
466
+ return methodCallResult;
467
+ };
468
+ proto.shift = function () {
469
+ const notEmpty = this.length > 0;
470
+ const methodCallResult = shift.apply(this, arguments);
471
+ const o = this.$fastController;
472
+ if (o !== void 0 && notEmpty) {
473
+ o.addSplice(newSplice(0, [methodCallResult], 0));
474
+ }
475
+ return methodCallResult;
476
+ };
477
+ proto.sort = function () {
478
+ let oldArray;
479
+ const o = this.$fastController;
480
+ if (o !== void 0) {
481
+ o.flush();
482
+ oldArray = this.slice();
483
+ }
484
+ const methodCallResult = sort.apply(this, arguments);
485
+ if (o !== void 0) {
486
+ o.reset(oldArray);
487
+ }
488
+ return methodCallResult;
489
+ };
490
+ proto.splice = function () {
491
+ const methodCallResult = splice.apply(this, arguments);
492
+ const o = this.$fastController;
493
+ if (o !== void 0) {
494
+ o.addSplice(adjustIndex(newSplice(+arguments[0], methodCallResult, arguments.length > 2 ? arguments.length - 2 : 0), this));
495
+ }
496
+ return methodCallResult;
497
+ };
498
+ proto.unshift = function () {
499
+ const methodCallResult = unshift.apply(this, arguments);
500
+ const o = this.$fastController;
501
+ if (o !== void 0) {
502
+ o.addSplice(adjustIndex(newSplice(0, [], arguments.length), this));
503
+ }
504
+ return methodCallResult;
505
+ };
506
+ }
507
+ /* eslint-enable prefer-rest-params */
508
+ /* eslint-enable @typescript-eslint/explicit-function-return-type */
509
+
510
+ const defaultRepeatOptions = Object.freeze({
511
+ positioning: false,
512
+ recycle: true,
513
+ });
514
+ function bindWithoutPositioning(view, items, index, context) {
515
+ view.bind(items[index], context);
516
+ }
517
+ function bindWithPositioning(view, items, index, context) {
518
+ const childContext = Object.create(context);
519
+ childContext.index = index;
520
+ childContext.length = items.length;
521
+ view.bind(items[index], childContext);
522
+ }
523
+ /**
524
+ * A behavior that renders a template for each item in an array.
525
+ * @public
526
+ */
527
+ class RepeatBehavior {
528
+ /**
529
+ * Creates an instance of RepeatBehavior.
530
+ * @param location - The location in the DOM to render the repeat.
531
+ * @param itemsBinding - The array to render.
532
+ * @param isItemsBindingVolatile - Indicates whether the items binding has volatile dependencies.
533
+ * @param templateBinding - The template to render for each item.
534
+ * @param isTemplateBindingVolatile - Indicates whether the template binding has volatile dependencies.
535
+ * @param options - Options used to turn on special repeat features.
536
+ */
537
+ constructor(location, itemsBinding, isItemsBindingVolatile, templateBinding, isTemplateBindingVolatile, options) {
538
+ this.location = location;
539
+ this.itemsBinding = itemsBinding;
540
+ this.templateBinding = templateBinding;
541
+ this.options = options;
542
+ this.source = null;
543
+ this.views = [];
544
+ this.items = null;
545
+ this.itemsObserver = null;
546
+ this.originalContext = void 0;
547
+ this.childContext = void 0;
548
+ this.bindView = bindWithoutPositioning;
549
+ this.itemsBindingObserver = Observable.binding(itemsBinding, this, isItemsBindingVolatile);
550
+ this.templateBindingObserver = Observable.binding(templateBinding, this, isTemplateBindingVolatile);
551
+ if (options.positioning) {
552
+ this.bindView = bindWithPositioning;
553
+ }
554
+ }
555
+ /**
556
+ * Bind this behavior to the source.
557
+ * @param source - The source to bind to.
558
+ * @param context - The execution context that the binding is operating within.
559
+ */
560
+ bind(source, context) {
561
+ this.source = source;
562
+ this.originalContext = context;
563
+ this.childContext = Object.create(context);
564
+ this.childContext.parent = source;
565
+ this.childContext.parentContext = this.originalContext;
566
+ this.items = this.itemsBindingObserver.observe(source, this.originalContext);
567
+ this.template = this.templateBindingObserver.observe(source, this.originalContext);
568
+ this.observeItems(true);
569
+ this.refreshAllViews();
570
+ }
571
+ /**
572
+ * Unbinds this behavior from the source.
573
+ * @param source - The source to unbind from.
574
+ */
575
+ unbind() {
576
+ this.source = null;
577
+ this.items = null;
578
+ if (this.itemsObserver !== null) {
579
+ this.itemsObserver.unsubscribe(this);
580
+ }
581
+ this.unbindAllViews();
582
+ this.itemsBindingObserver.disconnect();
583
+ this.templateBindingObserver.disconnect();
584
+ }
585
+ /** @internal */
586
+ handleChange(source, args) {
587
+ if (source === this.itemsBinding) {
588
+ this.items = this.itemsBindingObserver.observe(this.source, this.originalContext);
589
+ this.observeItems();
590
+ this.refreshAllViews();
591
+ }
592
+ else if (source === this.templateBinding) {
593
+ this.template = this.templateBindingObserver.observe(this.source, this.originalContext);
594
+ this.refreshAllViews(true);
595
+ }
596
+ else {
597
+ this.updateViews(args);
598
+ }
599
+ }
600
+ observeItems(force = false) {
601
+ if (!this.items) {
602
+ this.items = emptyArray;
603
+ return;
604
+ }
605
+ const oldObserver = this.itemsObserver;
606
+ const newObserver = (this.itemsObserver = Observable.getNotifier(this.items));
607
+ const hasNewObserver = oldObserver !== newObserver;
608
+ if (hasNewObserver && oldObserver !== null) {
609
+ oldObserver.unsubscribe(this);
610
+ }
611
+ if (hasNewObserver || force) {
612
+ newObserver.subscribe(this);
613
+ }
614
+ }
615
+ updateViews(splices) {
616
+ const childContext = this.childContext;
617
+ const views = this.views;
618
+ const bindView = this.bindView;
619
+ const items = this.items;
620
+ const template = this.template;
621
+ const recycle = this.options.recycle;
622
+ const leftoverViews = [];
623
+ let leftoverIndex = 0;
624
+ let availableViews = 0;
625
+ for (let i = 0, ii = splices.length; i < ii; ++i) {
626
+ const splice = splices[i];
627
+ const removed = splice.removed;
628
+ let removeIndex = 0;
629
+ let addIndex = splice.index;
630
+ const end = addIndex + splice.addedCount;
631
+ const removedViews = views.splice(splice.index, removed.length);
632
+ availableViews = leftoverViews.length + removedViews.length;
633
+ for (; addIndex < end; ++addIndex) {
634
+ const neighbor = views[addIndex];
635
+ const location = neighbor ? neighbor.firstChild : this.location;
636
+ let view;
637
+ if (recycle && availableViews > 0) {
638
+ if (removeIndex <= availableViews && removedViews.length > 0) {
639
+ view = removedViews[removeIndex];
640
+ removeIndex++;
641
+ }
642
+ else {
643
+ view = leftoverViews[leftoverIndex];
644
+ leftoverIndex++;
645
+ }
646
+ availableViews--;
647
+ }
648
+ else {
649
+ view = template.create();
650
+ }
651
+ views.splice(addIndex, 0, view);
652
+ bindView(view, items, addIndex, childContext);
653
+ view.insertBefore(location);
654
+ }
655
+ if (removedViews[removeIndex]) {
656
+ leftoverViews.push(...removedViews.slice(removeIndex));
657
+ }
658
+ }
659
+ for (let i = leftoverIndex, ii = leftoverViews.length; i < ii; ++i) {
660
+ leftoverViews[i].dispose();
661
+ }
662
+ if (this.options.positioning) {
663
+ for (let i = 0, ii = views.length; i < ii; ++i) {
664
+ const currentContext = views[i].context;
665
+ currentContext.length = ii;
666
+ currentContext.index = i;
667
+ }
668
+ }
669
+ }
670
+ refreshAllViews(templateChanged = false) {
671
+ const items = this.items;
672
+ const childContext = this.childContext;
673
+ const template = this.template;
674
+ const location = this.location;
675
+ const bindView = this.bindView;
676
+ let itemsLength = items.length;
677
+ let views = this.views;
678
+ let viewsLength = views.length;
679
+ if (itemsLength === 0 || templateChanged || !this.options.recycle) {
680
+ // all views need to be removed
681
+ HTMLView.disposeContiguousBatch(views);
682
+ viewsLength = 0;
683
+ }
684
+ if (viewsLength === 0) {
685
+ // all views need to be created
686
+ this.views = views = new Array(itemsLength);
687
+ for (let i = 0; i < itemsLength; ++i) {
688
+ const view = template.create();
689
+ bindView(view, items, i, childContext);
690
+ views[i] = view;
691
+ view.insertBefore(location);
692
+ }
693
+ }
694
+ else {
695
+ // attempt to reuse existing views with new data
696
+ let i = 0;
697
+ for (; i < itemsLength; ++i) {
698
+ if (i < viewsLength) {
699
+ const view = views[i];
700
+ bindView(view, items, i, childContext);
701
+ }
702
+ else {
703
+ const view = template.create();
704
+ bindView(view, items, i, childContext);
705
+ views.push(view);
706
+ view.insertBefore(location);
707
+ }
708
+ }
709
+ const removed = views.splice(i, viewsLength - i);
710
+ for (i = 0, itemsLength = removed.length; i < itemsLength; ++i) {
711
+ removed[i].dispose();
712
+ }
713
+ }
714
+ }
715
+ unbindAllViews() {
716
+ const views = this.views;
717
+ for (let i = 0, ii = views.length; i < ii; ++i) {
718
+ views[i].unbind();
719
+ }
720
+ }
721
+ }
722
+ /**
723
+ * A directive that configures list rendering.
724
+ * @public
725
+ */
726
+ class RepeatDirective extends HTMLDirective {
727
+ /**
728
+ * Creates an instance of RepeatDirective.
729
+ * @param itemsBinding - The binding that provides the array to render.
730
+ * @param templateBinding - The template binding used to obtain a template to render for each item in the array.
731
+ * @param options - Options used to turn on special repeat features.
732
+ */
733
+ constructor(itemsBinding, templateBinding, options) {
734
+ super();
735
+ this.itemsBinding = itemsBinding;
736
+ this.templateBinding = templateBinding;
737
+ this.options = options;
738
+ /**
739
+ * Creates a placeholder string based on the directive's index within the template.
740
+ * @param index - The index of the directive within the template.
741
+ */
742
+ this.createPlaceholder = DOM.createBlockPlaceholder;
743
+ enableArrayObservation();
744
+ this.isItemsBindingVolatile = Observable.isVolatileBinding(itemsBinding);
745
+ this.isTemplateBindingVolatile = Observable.isVolatileBinding(templateBinding);
746
+ }
747
+ /**
748
+ * Creates a behavior for the provided target node.
749
+ * @param target - The node instance to create the behavior for.
750
+ */
751
+ createBehavior(target) {
752
+ return new RepeatBehavior(target, this.itemsBinding, this.isItemsBindingVolatile, this.templateBinding, this.isTemplateBindingVolatile, this.options);
753
+ }
754
+ }
755
+ /**
756
+ * A directive that enables list rendering.
757
+ * @param itemsBinding - The array to render.
758
+ * @param templateOrTemplateBinding - The template or a template binding used obtain a template
759
+ * to render for each item in the array.
760
+ * @param options - Options used to turn on special repeat features.
761
+ * @public
762
+ */
763
+ function repeat(itemsBinding, templateOrTemplateBinding, options = defaultRepeatOptions) {
764
+ const templateBinding = typeof templateOrTemplateBinding === "function"
765
+ ? templateOrTemplateBinding
766
+ : () => templateOrTemplateBinding;
767
+ return new RepeatDirective(itemsBinding, templateBinding, Object.assign(Object.assign({}, defaultRepeatOptions), options));
768
+ }
769
+
770
+ /**
771
+ * Tests whether or not an object is an array.
772
+ *
773
+ * @private
774
+ * @param {*} val The object to test.
775
+ * @return {Boolean} `true` if `val` is an array, `false` otherwise.
776
+ * @example
777
+ *
778
+ * _isArray([]); //=> true
779
+ * _isArray(null); //=> false
780
+ * _isArray({}); //=> false
781
+ */
782
+ var _isArray = Array.isArray || function _isArray(val) {
783
+ return val != null && val.length >= 0 && Object.prototype.toString.call(val) === '[object Array]';
784
+ };
785
+
786
+ function _isString(x) {
787
+ return Object.prototype.toString.call(x) === '[object String]';
788
+ }
789
+
790
+ var toString = Object.prototype.toString;
791
+
792
+ var _isArguments =
793
+ /*#__PURE__*/
794
+ function () {
795
+ return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
796
+ return toString.call(x) === '[object Arguments]';
797
+ } : function _isArguments(x) {
798
+ return _has('callee', x);
799
+ };
800
+ }();
801
+
802
+ var _isArguments$1 = _isArguments;
803
+
804
+ var hasEnumBug = !
805
+ /*#__PURE__*/
806
+ {
807
+ toString: null
808
+ }.propertyIsEnumerable('toString');
809
+ var nonEnumerableProps = ['constructor', 'valueOf', 'isPrototypeOf', 'toString', 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; // Safari bug
810
+
811
+ var hasArgsEnumBug =
812
+ /*#__PURE__*/
813
+ function () {
814
+
815
+ return arguments.propertyIsEnumerable('length');
816
+ }();
817
+
818
+ var contains = function contains(list, item) {
819
+ var idx = 0;
820
+
821
+ while (idx < list.length) {
822
+ if (list[idx] === item) {
823
+ return true;
824
+ }
825
+
826
+ idx += 1;
827
+ }
828
+
829
+ return false;
830
+ };
831
+ /**
832
+ * Returns a list containing the names of all the enumerable own properties of
833
+ * the supplied object.
834
+ * Note that the order of the output array is not guaranteed to be consistent
835
+ * across different JS platforms.
836
+ *
837
+ * @func
838
+ * @memberOf R
839
+ * @since v0.1.0
840
+ * @category Object
841
+ * @sig {k: v} -> [k]
842
+ * @param {Object} obj The object to extract properties from
843
+ * @return {Array} An array of the object's own properties.
844
+ * @see R.keysIn, R.values
845
+ * @example
846
+ *
847
+ * R.keys({a: 1, b: 2, c: 3}); //=> ['a', 'b', 'c']
848
+ */
849
+
850
+
851
+ var keys = typeof Object.keys === 'function' && !hasArgsEnumBug ?
852
+ /*#__PURE__*/
853
+ _curry1(function keys(obj) {
854
+ return Object(obj) !== obj ? [] : Object.keys(obj);
855
+ }) :
856
+ /*#__PURE__*/
857
+ _curry1(function keys(obj) {
858
+ if (Object(obj) !== obj) {
859
+ return [];
860
+ }
861
+
862
+ var prop, nIdx;
863
+ var ks = [];
864
+
865
+ var checkArgsLength = hasArgsEnumBug && _isArguments$1(obj);
866
+
867
+ for (prop in obj) {
868
+ if (_has(prop, obj) && (!checkArgsLength || prop !== 'length')) {
869
+ ks[ks.length] = prop;
870
+ }
871
+ }
872
+
873
+ if (hasEnumBug) {
874
+ nIdx = nonEnumerableProps.length - 1;
875
+
876
+ while (nIdx >= 0) {
877
+ prop = nonEnumerableProps[nIdx];
878
+
879
+ if (_has(prop, obj) && !contains(ks, prop)) {
880
+ ks[ks.length] = prop;
881
+ }
882
+
883
+ nIdx -= 1;
884
+ }
885
+ }
886
+
887
+ return ks;
888
+ });
889
+ var keys$1 = keys;
890
+
891
+ /**
892
+ * Gives a single-word string description of the (native) type of a value,
893
+ * returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
894
+ * attempt to distinguish user Object types any further, reporting them all as
895
+ * 'Object'.
896
+ *
897
+ * @func
898
+ * @memberOf R
899
+ * @since v0.8.0
900
+ * @category Type
901
+ * @sig (* -> {*}) -> String
902
+ * @param {*} val The value to test
903
+ * @return {String}
904
+ * @example
905
+ *
906
+ * R.type({}); //=> "Object"
907
+ * R.type(1); //=> "Number"
908
+ * R.type(false); //=> "Boolean"
909
+ * R.type('s'); //=> "String"
910
+ * R.type(null); //=> "Null"
911
+ * R.type([]); //=> "Array"
912
+ * R.type(/[A-z]/); //=> "RegExp"
913
+ * R.type(() => {}); //=> "Function"
914
+ * R.type(undefined); //=> "Undefined"
915
+ */
916
+
917
+ var type =
918
+ /*#__PURE__*/
919
+ _curry1(function type(val) {
920
+ return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
921
+ });
922
+
923
+ var type$1 = type;
924
+
925
+ /**
926
+ * A function that returns the `!` of its argument. It will return `true` when
927
+ * passed false-y value, and `false` when passed a truth-y one.
928
+ *
929
+ * @func
930
+ * @memberOf R
931
+ * @since v0.1.0
932
+ * @category Logic
933
+ * @sig * -> Boolean
934
+ * @param {*} a any value
935
+ * @return {Boolean} the logical inverse of passed argument.
936
+ * @see R.complement
937
+ * @example
938
+ *
939
+ * R.not(true); //=> false
940
+ * R.not(false); //=> true
941
+ * R.not(0); //=> true
942
+ * R.not(1); //=> false
943
+ */
944
+
945
+ var not =
946
+ /*#__PURE__*/
947
+ _curry1(function not(a) {
948
+ return !a;
949
+ });
950
+
951
+ var not$1 = not;
952
+
953
+ function _arrayFromIterator(iter) {
954
+ var list = [];
955
+ var next;
956
+
957
+ while (!(next = iter.next()).done) {
958
+ list.push(next.value);
959
+ }
960
+
961
+ return list;
962
+ }
963
+
964
+ function _includesWith(pred, x, list) {
965
+ var idx = 0;
966
+ var len = list.length;
967
+
968
+ while (idx < len) {
969
+ if (pred(x, list[idx])) {
970
+ return true;
971
+ }
972
+
973
+ idx += 1;
974
+ }
975
+
976
+ return false;
977
+ }
978
+
979
+ function _functionName(f) {
980
+ // String(x => x) evaluates to "x => x", so the pattern may not match.
981
+ var match = String(f).match(/^function (\w*)/);
982
+ return match == null ? '' : match[1];
983
+ }
984
+
985
+ // Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
986
+ function _objectIs(a, b) {
987
+ // SameValue algorithm
988
+ if (a === b) {
989
+ // Steps 1-5, 7-10
990
+ // Steps 6.b-6.e: +0 != -0
991
+ return a !== 0 || 1 / a === 1 / b;
992
+ } else {
993
+ // Step 6.a: NaN == NaN
994
+ return a !== a && b !== b;
995
+ }
996
+ }
997
+
998
+ var _objectIs$1 = typeof Object.is === 'function' ? Object.is : _objectIs;
999
+
1000
+ /**
1001
+ * private _uniqContentEquals function.
1002
+ * That function is checking equality of 2 iterator contents with 2 assumptions
1003
+ * - iterators lengths are the same
1004
+ * - iterators values are unique
1005
+ *
1006
+ * false-positive result will be returned for comparision of, e.g.
1007
+ * - [1,2,3] and [1,2,3,4]
1008
+ * - [1,1,1] and [1,2,3]
1009
+ * */
1010
+
1011
+ function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
1012
+ var a = _arrayFromIterator(aIterator);
1013
+
1014
+ var b = _arrayFromIterator(bIterator);
1015
+
1016
+ function eq(_a, _b) {
1017
+ return _equals(_a, _b, stackA.slice(), stackB.slice());
1018
+ } // if *a* array contains any element that is not included in *b*
1019
+
1020
+
1021
+ return !_includesWith(function (b, aItem) {
1022
+ return !_includesWith(eq, aItem, b);
1023
+ }, b, a);
1024
+ }
1025
+
1026
+ function _equals(a, b, stackA, stackB) {
1027
+ if (_objectIs$1(a, b)) {
1028
+ return true;
1029
+ }
1030
+
1031
+ var typeA = type$1(a);
1032
+
1033
+ if (typeA !== type$1(b)) {
1034
+ return false;
1035
+ }
1036
+
1037
+ if (a == null || b == null) {
1038
+ return false;
1039
+ }
1040
+
1041
+ if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {
1042
+ return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);
1043
+ }
1044
+
1045
+ if (typeof a.equals === 'function' || typeof b.equals === 'function') {
1046
+ return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);
1047
+ }
1048
+
1049
+ switch (typeA) {
1050
+ case 'Arguments':
1051
+ case 'Array':
1052
+ case 'Object':
1053
+ if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {
1054
+ return a === b;
1055
+ }
1056
+
1057
+ break;
1058
+
1059
+ case 'Boolean':
1060
+ case 'Number':
1061
+ case 'String':
1062
+ if (!(typeof a === typeof b && _objectIs$1(a.valueOf(), b.valueOf()))) {
1063
+ return false;
1064
+ }
1065
+
1066
+ break;
1067
+
1068
+ case 'Date':
1069
+ if (!_objectIs$1(a.valueOf(), b.valueOf())) {
1070
+ return false;
1071
+ }
1072
+
1073
+ break;
1074
+
1075
+ case 'Error':
1076
+ return a.name === b.name && a.message === b.message;
1077
+
1078
+ case 'RegExp':
1079
+ if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {
1080
+ return false;
1081
+ }
1082
+
1083
+ break;
1084
+ }
1085
+
1086
+ var idx = stackA.length - 1;
1087
+
1088
+ while (idx >= 0) {
1089
+ if (stackA[idx] === a) {
1090
+ return stackB[idx] === b;
1091
+ }
1092
+
1093
+ idx -= 1;
1094
+ }
1095
+
1096
+ switch (typeA) {
1097
+ case 'Map':
1098
+ if (a.size !== b.size) {
1099
+ return false;
1100
+ }
1101
+
1102
+ return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
1103
+
1104
+ case 'Set':
1105
+ if (a.size !== b.size) {
1106
+ return false;
1107
+ }
1108
+
1109
+ return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));
1110
+
1111
+ case 'Arguments':
1112
+ case 'Array':
1113
+ case 'Object':
1114
+ case 'Boolean':
1115
+ case 'Number':
1116
+ case 'String':
1117
+ case 'Date':
1118
+ case 'Error':
1119
+ case 'RegExp':
1120
+ case 'Int8Array':
1121
+ case 'Uint8Array':
1122
+ case 'Uint8ClampedArray':
1123
+ case 'Int16Array':
1124
+ case 'Uint16Array':
1125
+ case 'Int32Array':
1126
+ case 'Uint32Array':
1127
+ case 'Float32Array':
1128
+ case 'Float64Array':
1129
+ case 'ArrayBuffer':
1130
+ break;
1131
+
1132
+ default:
1133
+ // Values of other types are only equal if identical.
1134
+ return false;
1135
+ }
1136
+
1137
+ var keysA = keys$1(a);
1138
+
1139
+ if (keysA.length !== keys$1(b).length) {
1140
+ return false;
1141
+ }
1142
+
1143
+ var extendedStackA = stackA.concat([a]);
1144
+ var extendedStackB = stackB.concat([b]);
1145
+ idx = keysA.length - 1;
1146
+
1147
+ while (idx >= 0) {
1148
+ var key = keysA[idx];
1149
+
1150
+ if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {
1151
+ return false;
1152
+ }
1153
+
1154
+ idx -= 1;
1155
+ }
1156
+
1157
+ return true;
1158
+ }
1159
+
1160
+ /**
1161
+ * Returns `true` if its arguments are equivalent, `false` otherwise. Handles
1162
+ * cyclical data structures.
1163
+ *
1164
+ * Dispatches symmetrically to the `equals` methods of both arguments, if
1165
+ * present.
1166
+ *
1167
+ * @func
1168
+ * @memberOf R
1169
+ * @since v0.15.0
1170
+ * @category Relation
1171
+ * @sig a -> b -> Boolean
1172
+ * @param {*} a
1173
+ * @param {*} b
1174
+ * @return {Boolean}
1175
+ * @example
1176
+ *
1177
+ * R.equals(1, 1); //=> true
1178
+ * R.equals(1, '1'); //=> false
1179
+ * R.equals([1, 2, 3], [1, 2, 3]); //=> true
1180
+ *
1181
+ * const a = {}; a.v = a;
1182
+ * const b = {}; b.v = b;
1183
+ * R.equals(a, b); //=> true
1184
+ */
1185
+
1186
+ var equals =
1187
+ /*#__PURE__*/
1188
+ _curry2(function equals(a, b) {
1189
+ return _equals(a, b, [], []);
1190
+ });
1191
+
1192
+ var equals$1 = equals;
1193
+
1194
+ function _isObject(x) {
1195
+ return Object.prototype.toString.call(x) === '[object Object]';
1196
+ }
1197
+
1198
+ /**
1199
+ * Returns the empty value of its argument's type. Ramda defines the empty
1200
+ * value of Array (`[]`), Object (`{}`), String (`''`), and Arguments. Other
1201
+ * types are supported if they define `<Type>.empty`,
1202
+ * `<Type>.prototype.empty` or implement the
1203
+ * [FantasyLand Monoid spec](https://github.com/fantasyland/fantasy-land#monoid).
1204
+ *
1205
+ * Dispatches to the `empty` method of the first argument, if present.
1206
+ *
1207
+ * @func
1208
+ * @memberOf R
1209
+ * @since v0.3.0
1210
+ * @category Function
1211
+ * @sig a -> a
1212
+ * @param {*} x
1213
+ * @return {*}
1214
+ * @example
1215
+ *
1216
+ * R.empty(Just(42)); //=> Nothing()
1217
+ * R.empty([1, 2, 3]); //=> []
1218
+ * R.empty('unicorns'); //=> ''
1219
+ * R.empty({x: 1, y: 2}); //=> {}
1220
+ */
1221
+
1222
+ var empty =
1223
+ /*#__PURE__*/
1224
+ _curry1(function empty(x) {
1225
+ return x != null && typeof x['fantasy-land/empty'] === 'function' ? x['fantasy-land/empty']() : x != null && x.constructor != null && typeof x.constructor['fantasy-land/empty'] === 'function' ? x.constructor['fantasy-land/empty']() : x != null && typeof x.empty === 'function' ? x.empty() : x != null && x.constructor != null && typeof x.constructor.empty === 'function' ? x.constructor.empty() : _isArray(x) ? [] : _isString(x) ? '' : _isObject(x) ? {} : _isArguments$1(x) ? function () {
1226
+ return arguments;
1227
+ }() : void 0 // else
1228
+ ;
1229
+ });
1230
+
1231
+ var empty$1 = empty;
1232
+
1233
+ /**
1234
+ * Returns `true` if the given value is its type's empty value; `false`
1235
+ * otherwise.
1236
+ *
1237
+ * @func
1238
+ * @memberOf R
1239
+ * @since v0.1.0
1240
+ * @category Logic
1241
+ * @sig a -> Boolean
1242
+ * @param {*} x
1243
+ * @return {Boolean}
1244
+ * @see R.empty
1245
+ * @example
1246
+ *
1247
+ * R.isEmpty([1, 2, 3]); //=> false
1248
+ * R.isEmpty([]); //=> true
1249
+ * R.isEmpty(''); //=> true
1250
+ * R.isEmpty(null); //=> false
1251
+ * R.isEmpty({}); //=> true
1252
+ * R.isEmpty({length: 0}); //=> false
1253
+ */
1254
+
1255
+ var isEmpty =
1256
+ /*#__PURE__*/
1257
+ _curry1(function isEmpty(x) {
1258
+ return x != null && equals$1(x, empty$1(x));
1259
+ });
1260
+
1261
+ var isEmpty$1 = isEmpty;
1262
+
1263
+ var css_248z = "/**\n * Do not edit directly\n * Generated on Thu, 06 Oct 2022 14:03:46 GMT\n */\nol {\n padding: 0;\n margin: 0;\n list-style: none;\n}\n\n[role=grid i] {\n position: relative;\n z-index: 0;\n display: grid;\n margin: auto;\n grid-template-areas: \". column-headers\" \"row-headers calendar\";\n grid-template-columns: min-content auto;\n inline-size: max(100%, 500px);\n min-inline-size: 880px;\n}\n\n.row-headers {\n display: grid;\n grid-area: row-headers;\n grid-template-rows: repeat(24, 1fr);\n margin-inline-end: 2px;\n}\n.row-headers > [role=rowheader i] {\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n}\n.row-headers > [role=rowheader i] > time {\n font: var(--vvd-font-base-condensed);\n font-size: small;\n line-height: 1;\n text-transform: uppercase;\n white-space: nowrap;\n}\n\n.calendar-row {\n display: contents;\n}\n\n.calendar-grid-presentation {\n display: grid;\n overflow: hidden;\n background-color: var(--vvd-color-surface-2dp);\n border-radius: 6px;\n counter-reset: listing;\n filter: var(--vvd-shadow-surface-2dp);\n gap: 1px;\n grid-area: calendar;\n grid-auto-flow: column;\n grid-template: repeat(24, 1fr)/repeat(7, 1fr);\n}\n\n.hours {\n display: contents;\n}\n.hours > [role=listitem i] {\n position: relative;\n grid-column: 1/8;\n grid-row: var(--row);\n min-block-size: 48px;\n pointer-events: none;\n}\n.hours > [role=listitem i]:not(:first-child)::after {\n position: absolute;\n border-block-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n inline-size: 100%;\n margin-block-start: -1px;\n}\n.hours > [role=listitem i]:nth-child(24n+1) {\n --row: 1;\n}\n.hours > [role=listitem i]:nth-child(24n+2) {\n --row: 2;\n}\n.hours > [role=listitem i]:nth-child(24n+3) {\n --row: 3;\n}\n.hours > [role=listitem i]:nth-child(24n+4) {\n --row: 4;\n}\n.hours > [role=listitem i]:nth-child(24n+5) {\n --row: 5;\n}\n.hours > [role=listitem i]:nth-child(24n+6) {\n --row: 6;\n}\n.hours > [role=listitem i]:nth-child(24n+7) {\n --row: 7;\n}\n.hours > [role=listitem i]:nth-child(24n+8) {\n --row: 8;\n}\n.hours > [role=listitem i]:nth-child(24n+9) {\n --row: 9;\n}\n.hours > [role=listitem i]:nth-child(24n+10) {\n --row: 10;\n}\n.hours > [role=listitem i]:nth-child(24n+11) {\n --row: 11;\n}\n.hours > [role=listitem i]:nth-child(24n+12) {\n --row: 12;\n}\n.hours > [role=listitem i]:nth-child(24n+13) {\n --row: 13;\n}\n.hours > [role=listitem i]:nth-child(24n+14) {\n --row: 14;\n}\n.hours > [role=listitem i]:nth-child(24n+15) {\n --row: 15;\n}\n.hours > [role=listitem i]:nth-child(24n+16) {\n --row: 16;\n}\n.hours > [role=listitem i]:nth-child(24n+17) {\n --row: 17;\n}\n.hours > [role=listitem i]:nth-child(24n+18) {\n --row: 18;\n}\n.hours > [role=listitem i]:nth-child(24n+19) {\n --row: 19;\n}\n.hours > [role=listitem i]:nth-child(24n+20) {\n --row: 20;\n}\n.hours > [role=listitem i]:nth-child(24n+21) {\n --row: 21;\n}\n.hours > [role=listitem i]:nth-child(24n+22) {\n --row: 22;\n}\n.hours > [role=listitem i]:nth-child(24n+23) {\n --row: 23;\n}\n.hours > [role=listitem i]:nth-child(24n+24) {\n --row: 24;\n}\n\n[role=gridcell i] {\n display: grid;\n gap: 1px;\n grid-auto-flow: column;\n}\n\n[role=gridcell i],\n[role=columnheader i],\n[role=columnheader i] [role=button i] {\n position: relative;\n}\n[role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n position: absolute;\n z-index: -1;\n background-color: var(--vvd-color-information-400);\n content: \"\";\n}\n@supports (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n inset: 0;\n }\n}\n@supports not (inset: 0) {\n [role=gridcell i]::before,\n[role=columnheader i]::before,\n[role=columnheader i] [role=button i]::before {\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n }\n}\n[role=gridcell i]:focus,\n[role=columnheader i]:focus,\n[role=columnheader i] [role=button i]:focus {\n outline: none;\n}\n[role=gridcell i]:not(:focus-visible)::before,\n[role=columnheader i]:not(:focus-visible)::before,\n[role=columnheader i] [role=button i]:not(:focus-visible)::before {\n display: none;\n}\n\n.columns {\n display: contents;\n}\n.columns > [role=gridcell i] {\n position: relative;\n grid-column: var(--column);\n grid-row: 1/25;\n}\n.columns > [role=gridcell i]:nth-child(1) {\n --column: 1;\n}\n.columns > [role=gridcell i]:nth-child(2) {\n --column: 2;\n}\n.columns > [role=gridcell i]:nth-child(3) {\n --column: 3;\n}\n.columns > [role=gridcell i]:nth-child(4) {\n --column: 4;\n}\n.columns > [role=gridcell i]:nth-child(5) {\n --column: 5;\n}\n.columns > [role=gridcell i]:nth-child(6) {\n --column: 6;\n}\n.columns > [role=gridcell i]:nth-child(7) {\n --column: 7;\n}\n.columns > [role=gridcell i]:not(:first-child)::after {\n position: absolute;\n block-size: 100%;\n border-inline-end: var(--vvd-color-neutral-100) 1px solid;\n content: \"\";\n margin-inline-start: -1px;\n}\n\n.column-headers {\n display: grid;\n grid-area: column-headers;\n grid-template-columns: repeat(7, 1fr);\n}\n.column-headers [role=columnheader i] h2 {\n display: grid;\n align-items: baseline;\n margin: 0;\n font: var(--vvd-font-heading4);\n grid-template-columns: 1fr auto 1fr;\n}\n.column-headers [role=columnheader i] h2 > em {\n font: inherit;\n inline-size: min-content;\n}\n@supports (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n inset-inline-start: 0;\n }\n}\n@supports not (inset: 0) {\n .column-headers [role=columnheader i] h2 > em {\n left: 0;\n }\n}\n.column-headers [role=columnheader i] h2 > small {\n font: var(--vvd-font-base-condensed);\n text-transform: uppercase;\n}";
1264
+
1265
+ const ARROW_UP = 'ArrowUp';
1266
+ const ARROW_RIGHT = 'ArrowRight';
1267
+ const ARROW_DOWN = 'ArrowDown';
1268
+ const ARROW_LEFT = 'ArrowLeft';
1269
+ function isCellOrHeader(el) {
1270
+ return el instanceof HTMLElement && (el.matches('[role="gridcell"i]') || el.matches('[role="columnheader"i]'));
1271
+ }
1272
+
1273
+ const getCellOrHeader = f => f.matches('[role="columnheader"i]') ? '[role="gridcell"i]' : '[role="columnheader"i]';
1274
+
1275
+ function getNextFocusableGridElement(key, activeElement) {
1276
+ if (activeElement.parentNode instanceof HTMLElement) {
1277
+ switch (key) {
1278
+ case ARROW_RIGHT:
1279
+ return activeElement.nextElementSibling || activeElement.parentNode.firstElementChild;
1280
+
1281
+ case ARROW_LEFT:
1282
+ return activeElement.previousElementSibling || activeElement.parentNode.lastElementChild;
1283
+
1284
+ case ARROW_UP:
1285
+ case ARROW_DOWN:
1286
+ {
1287
+ const {
1288
+ children
1289
+ } = activeElement.parentNode;
1290
+ const i = Array.from(children).indexOf(activeElement);
1291
+ return this.shadowRoot.querySelector(`${getCellOrHeader(activeElement)}:nth-child(${i + 1})`);
1292
+ }
1293
+ }
1294
+ }
1295
+ }
1296
+ function getHeaderDescendantGridCell(key, activeElement) {
1297
+ if (key !== ARROW_DOWN) {
1298
+ return;
1299
+ }
1300
+
1301
+ const header = activeElement.closest('[role="columnheader"i]');
1302
+ const columnHeaders = this.shadowRoot.querySelectorAll('[role="columnheader"i]');
1303
+ const i = Array.from(columnHeaders).indexOf(header);
1304
+ return this.shadowRoot.querySelector(`[role="gridcell"i]:nth-child(${i + 1})`);
1305
+ }
1306
+
1307
+ function getDay(el) {
1308
+ const cellOrHeader = el.closest('[role="gridcell"i], [role="columnheader"i]');
1309
+
1310
+ if (cellOrHeader) {
1311
+ const {
1312
+ parentElement
1313
+ } = cellOrHeader;
1314
+
1315
+ if (parentElement) {
1316
+ return parentElement.children && Array.from(parentElement.children).indexOf(cellOrHeader);
1317
+ }
1318
+ }
1319
+ }
1320
+
1321
+ function getHour(e, el, hours) {
1322
+ const rowHeaderOrCell = el.closest('[role="rowheader"], [role="gridcell"i]');
1323
+
1324
+ if (rowHeaderOrCell) {
1325
+ const DOMRect = rowHeaderOrCell.getBoundingClientRect();
1326
+ const offsetY = e.clientY - DOMRect.y;
1327
+ const hourHeight = DOMRect.height / hours;
1328
+ const hour = offsetY / hourHeight;
1329
+ return Math.round((hour + Number.EPSILON) * 100) / 100;
1330
+ }
1331
+ }
1332
+
1333
+ const getEventContext = function getEventContext(e) {
1334
+ if (!(e instanceof KeyboardEvent || e instanceof MouseEvent)) {
1335
+ throw new Error('Invalid event. Event must be instance of KeyboardEvent or MouseEvent');
1336
+ }
1337
+
1338
+ const [el] = e.composedPath();
1339
+
1340
+ if (!(el && el instanceof HTMLElement && this.shadowRoot.contains(el))) {
1341
+ throw new Error('Invalid event. Event must contain a target object which is a direct descendant of calendar');
1342
+ }
1343
+
1344
+ const day = getDay(el);
1345
+ let hour;
1346
+
1347
+ if (e instanceof MouseEvent) {
1348
+ hour = getHour(e, el, this._hours);
1349
+ }
1350
+
1351
+ const context = Object.assign(Object.assign({}, day != undefined && {
1352
+ day
1353
+ }), hour != undefined && {
1354
+ hour
1355
+ });
1356
+ return not$1(isEmpty$1(context)) ? context : null;
1357
+ };
1358
+
1359
+ var _Calendar_instances, _Calendar_activeCalendarEvent_get;
1360
+ class Calendar extends FoundationElement {
1361
+ constructor() {
1362
+ super(...arguments);
1363
+
1364
+ _Calendar_instances.add(this);
1365
+
1366
+ this.hour12 = false;
1367
+ this._hours = 24;
1368
+ this._days = 7;
1369
+ this.hoursAsDatetime = Array.from({
1370
+ length: this._hours - 1
1371
+ }).fill(new Date(new Date().setHours(0, 0, 0))).map((d, i) => new Date(d.setHours(++i)));
1372
+
1373
+ this._generateDaysArr = dateArr => {
1374
+ if (dateArr.length == this._days) {
1375
+ return dateArr;
1376
+ }
1377
+
1378
+ const lastDate = new Date(dateArr[dateArr.length - 1]);
1379
+ lastDate.setDate(lastDate.getDate() + 1);
1380
+ return this._generateDaysArr([...dateArr, lastDate]);
1381
+ };
1382
+
1383
+ this.getEventContext = getEventContext;
1384
+ }
1385
+
1386
+ getCalendarEventContainingCell(calendarEvent) {
1387
+ const slotName = calendarEvent.getAttribute('slot');
1388
+ const gridCell = this.shadowRoot.querySelector(`slot[name="${slotName}"i]`);
1389
+ return gridCell.parentElement;
1390
+ }
1391
+
1392
+ arrowKeysInteractions(key) {
1393
+ const {
1394
+ activeElement
1395
+ } = this.shadowRoot;
1396
+ let focusNext;
1397
+
1398
+ if (isCellOrHeader(activeElement)) {
1399
+ focusNext = getNextFocusableGridElement.call(this, key, activeElement);
1400
+ } else if (__classPrivateFieldGet(this, _Calendar_instances, "a", _Calendar_activeCalendarEvent_get)) {
1401
+ focusNext = this.getCalendarEventContainingCell(__classPrivateFieldGet(this, _Calendar_instances, "a", _Calendar_activeCalendarEvent_get));
1402
+ } else if (activeElement === null || activeElement === void 0 ? void 0 : activeElement.matches('em[role="button"i]')) {
1403
+ focusNext = getHeaderDescendantGridCell.call(this, key, activeElement);
1404
+ } else {
1405
+ focusNext = this.shadowRoot.querySelector('[role="columnheader"i]');
1406
+ }
1407
+
1408
+ this.activateElement(focusNext);
1409
+ }
1410
+
1411
+ activateElement(el) {
1412
+ const onBlur = ({
1413
+ target
1414
+ }) => target.setAttribute('tabindex', '-1');
1415
+
1416
+ el === null || el === void 0 ? void 0 : el.addEventListener('blur', onBlur, {
1417
+ once: true
1418
+ });
1419
+ el === null || el === void 0 ? void 0 : el.setAttribute('tabindex', '0');
1420
+ el === null || el === void 0 ? void 0 : el.focus();
1421
+ }
1422
+
1423
+ onKeydown({
1424
+ key
1425
+ }) {
1426
+ const isArrow = [ARROW_UP, ARROW_RIGHT, ARROW_DOWN, ARROW_LEFT].some(predefinedKey => predefinedKey == key);
1427
+
1428
+ if (isArrow) {
1429
+ this.arrowKeysInteractions(key);
1430
+ }
1431
+
1432
+ return !isArrow;
1433
+ }
1434
+
1435
+ }
1436
+ _Calendar_instances = new WeakSet(), _Calendar_activeCalendarEvent_get = function _Calendar_activeCalendarEvent_get() {
1437
+ const {
1438
+ activeElement
1439
+ } = document;
1440
+ return activeElement instanceof CalendarEvent ? activeElement : null;
1441
+ };
1442
+
1443
+ __decorate([attr, __metadata("design:type", Object)], Calendar.prototype, "datetime", void 0);
1444
+
1445
+ __decorate([attr({
1446
+ attribute: 'start-day'
1447
+ }), __metadata("design:type", String)], Calendar.prototype, "startDay", void 0);
1448
+
1449
+ __decorate([attr, __metadata("design:type", Object)], Calendar.prototype, "locales", void 0);
1450
+
1451
+ __decorate([attr({
1452
+ mode: 'boolean'
1453
+ }), __metadata("design:type", Object)], Calendar.prototype, "hour12", void 0);
1454
+
1455
+ function getValidDateString(date) {
1456
+ const twoDigit = num => `0${num}`.slice(-2);
1457
+
1458
+ return `${date.getFullYear()}-${twoDigit(date.getMonth() + 1)}-${twoDigit(date.getDate())}`;
1459
+ }
1460
+ const weekdaysMap = new Map([['sunday', 0], ['monday', 1]]);
1461
+ function getFirstDateOfTheWeek(date = new Date(), startDay) {
1462
+ date = new Date(date);
1463
+ let num = weekdaysMap.get(startDay);
1464
+ num !== null && num !== void 0 ? num : num = 1;
1465
+ const day = date.getDate() - (date.getDay() + 7 - num) % 7;
1466
+ return new Date(date.setDate(day));
1467
+ }
1468
+
1469
+ let _2 = t => t,
1470
+ _t,
1471
+ _t2,
1472
+ _t3,
1473
+ _t4,
1474
+ _t5,
1475
+ _t6,
1476
+ _t7;
1477
+
1478
+ const HoursTemplate = () => {
1479
+ return html(_t || (_t = _2`
1480
+ <div class="row-headers" role="presentation">
1481
+ ${0}
1482
+ </div>`), repeat(x => x.hoursAsDatetime, html(_t2 || (_t2 = _2`<span role="rowheader">
1483
+ <time datetime="${0}">
1484
+ ${0}
1485
+ </time>
1486
+ </span>`), (x, c) => new Intl.DateTimeFormat(c.parent.locales, {
1487
+ hour: 'numeric',
1488
+ minute: 'numeric',
1489
+ hour12: false
1490
+ }).format(x), (x, c) => new Intl.DateTimeFormat(c.parent.locales, {
1491
+ hour: 'numeric',
1492
+ hour12: c.parent.hour12
1493
+ }).format(x))));
1494
+ };
1495
+
1496
+ const DaysTemplate = () => {
1497
+ return html(_t3 || (_t3 = _2`
1498
+ <div class="column-headers" role="row">
1499
+ ${0}
1500
+ </div>`), repeat(x => x._generateDaysArr([getFirstDateOfTheWeek(x.datetime, x.startDay)]), html(_t4 || (_t4 = _2`
1501
+ <div role="columnheader" tabindex="-1">
1502
+ <time datetime=${0}>
1503
+ <h2>
1504
+ <!-- TODO add to column aria-labelledby or describedby to count
1505
+ events and related day e.g. "3 events, Sunday, March 8" -->
1506
+ <em tabindex="0" role="button" aria-label=${0}>
1507
+ ${0}
1508
+ </em>
1509
+ <small aria-hidden="true">
1510
+ ${0}
1511
+ </small>
1512
+ </h2>
1513
+ </time>
1514
+ </div>`), x => getValidDateString(x), (x, c) => new Intl.DateTimeFormat(c.parent.locales, {
1515
+ weekday: 'long',
1516
+ month: 'long',
1517
+ day: 'numeric'
1518
+ }).format(x), (x, c) => new Intl.DateTimeFormat(c.parent.locales, {
1519
+ day: '2-digit'
1520
+ }).format(x), (x, c) => new Intl.DateTimeFormat(c.parent.locales, {
1521
+ weekday: 'short'
1522
+ }).format(x))));
1523
+ };
1524
+
1525
+ const ColumnTemplate = html(_t5 || (_t5 = _2`
1526
+ <div role="gridcell" tabindex="-1">
1527
+ <slot name="day-${0}"></slot>
1528
+ </div>
1529
+ `), (_, c) => c.index);
1530
+ const CalendarTemplate = () => html(_t6 || (_t6 = _2`
1531
+ <div role="grid" @keydown=${0}>
1532
+ ${0}
1533
+ <div role="row" class="calendar-row">
1534
+ ${0}
1535
+ <div class="calendar-grid-presentation" role="presentation">
1536
+ <div class="hours" role="list">
1537
+ ${0}
1538
+ </div>
1539
+ <div class="columns" role="presentation">
1540
+ ${0}
1541
+ </div>
1542
+ <slot></slot>
1543
+ </div>
1544
+ </div>
1545
+ </div>
1546
+ `), (x, c) => x.onKeydown(c.event), DaysTemplate, HoursTemplate, repeat(x => Array.from({
1547
+ length: x.hoursAsDatetime.length + 1
1548
+ }), html(_t7 || (_t7 = _2`
1549
+ <div role="listitem"></div>`))), repeat(x => Array.from(Array(x._days)), ColumnTemplate, {
1550
+ positioning: true
1551
+ }));
1552
+
1553
+ const vividCalendar = Calendar.compose({
1554
+ baseName: 'calendar',
1555
+ template: CalendarTemplate,
1556
+ styles: css_248z,
1557
+ shadowOptions: {
1558
+ delegatesFocus: true
1559
+ }
1560
+ });
1561
+ designSystem.register(vividCalendar());
1562
+
1563
+ export { vividCalendar };