@sparkle-learning/core 0.0.32 → 0.0.35

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 (611) hide show
  1. package/dist/cjs/PrivateRoute-4abc9d29.js +35 -0
  2. package/dist/cjs/{active-router-eedb3bfe.js → active-router-f9e18bd8.js} +1 -1
  3. package/dist/cjs/{animation-6132e37f.js → animation-ee586546.js} +83 -78
  4. package/dist/cjs/{app-globals-9869bf67.js → app-globals-33c9f31b.js} +1 -1
  5. package/dist/cjs/{PrivateRoute-043bb7d3.js → auth.service-4b584cd7.js} +4 -33
  6. package/dist/cjs/{auth.store-ff3fda09.js → auth.store-1e630a7d.js} +48 -725
  7. package/dist/cjs/compass-svg.cjs.entry.js +1 -1
  8. package/dist/cjs/context-consumer.cjs.entry.js +1 -1
  9. package/dist/cjs/course-select.cjs.entry.js +1 -1
  10. package/dist/cjs/{cubic-bezier-293f4663.js → cubic-bezier-53d26d05.js} +10 -11
  11. package/dist/cjs/dom-utils-b8befdd5.js +63 -0
  12. package/dist/cjs/{facilitator.service-faac5c0c.js → facilitator.service-9e990274.js} +8 -7
  13. package/dist/cjs/{feed.service-66405969.js → feed.service-b4f09441.js} +8 -7
  14. package/dist/cjs/{focus-visible-ad3828a7.js → focus-visible-b0b07ba6.js} +19 -6
  15. package/dist/cjs/{framework-delegate-2470a246.js → framework-delegate-59a98abd.js} +11 -13
  16. package/dist/cjs/{gesture-controller-07c31f70.js → gesture-controller-0eb5579e.js} +1 -1
  17. package/dist/cjs/{haptic-91e86eb7.js → haptic-780f33c4.js} +3 -2
  18. package/dist/cjs/{hardware-back-button-f7b5d99e.js → hardware-back-button-92d97ff8.js} +8 -8
  19. package/dist/cjs/header-mobile-collapse_2.cjs.entry.js +112 -0
  20. package/dist/cjs/{helpers-7e28976c.js → helpers-c2496722.js} +81 -14
  21. package/dist/cjs/httpService-7211d93b.js +685 -0
  22. package/dist/cjs/{icons-80d477f6.js → icons-c61db785.js} +1 -1
  23. package/dist/cjs/{index-43642662.js → index-12082cba.js} +21 -18
  24. package/dist/cjs/{index-459a5fa9.js → index-15ea05f5.js} +19 -28
  25. package/dist/cjs/{index-bae2a754.js → index-51e8292e.js} +18 -11
  26. package/dist/cjs/index-70e63f5b.js +3071 -0
  27. package/dist/cjs/{index-b12edb26.js → index-787d4498.js} +17 -25
  28. package/dist/cjs/{tap-click-1caf1780.js → index-8b5629a6.js} +30 -20
  29. package/dist/cjs/{index-8540d72e.js → index-975586fd.js} +7 -1
  30. package/dist/cjs/index-9c7b27e4.js +140 -0
  31. package/dist/cjs/{index-185f9c5a.js → index-af080b50.js} +9 -8
  32. package/dist/cjs/index-e56e09b8.js +38 -0
  33. package/dist/cjs/index.cjs.js +13 -11
  34. package/dist/cjs/{index.es-ef3efdfb.js → index.es-38cbcdbe.js} +2 -7
  35. package/dist/cjs/injectHistory-7206bbb9.js +9 -0
  36. package/dist/cjs/{input-shims-6c442c9f.js → input-shims-eff63b88.js} +21 -24
  37. package/dist/cjs/ion-accordion-group.cjs.entry.js +17 -9
  38. package/dist/cjs/ion-accordion.cjs.entry.js +19 -23
  39. package/dist/cjs/ion-action-sheet_4.cjs.entry.js +216 -212
  40. package/dist/cjs/ion-app.cjs.entry.js +8 -8
  41. package/dist/cjs/ion-avatar_16.cjs.entry.js +1907 -0
  42. package/dist/cjs/ion-back-button.cjs.entry.js +11 -11
  43. package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
  44. package/dist/cjs/ion-badge.cjs.entry.js +3 -3
  45. package/dist/cjs/ion-breadcrumb.cjs.entry.js +13 -21
  46. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +12 -14
  47. package/dist/cjs/ion-buttons_3.cjs.entry.js +13 -13
  48. package/dist/cjs/ion-card-header.cjs.entry.js +4 -4
  49. package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
  50. package/dist/cjs/ion-checkbox_4.cjs.entry.js +360 -0
  51. package/dist/cjs/ion-chip.cjs.entry.js +3 -3
  52. package/dist/cjs/ion-col_3.cjs.entry.js +159 -0
  53. package/dist/cjs/ion-content_2.cjs.entry.js +59 -52
  54. package/dist/cjs/ion-datetime-button.cjs.entry.js +312 -0
  55. package/dist/cjs/ion-datetime.cjs.entry.js +752 -1245
  56. package/dist/cjs/ion-fab-button.cjs.entry.js +25 -9
  57. package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
  58. package/dist/cjs/ion-fab.cjs.entry.js +15 -13
  59. package/dist/cjs/ion-footer.cjs.entry.js +16 -14
  60. package/dist/cjs/ion-img.cjs.entry.js +4 -4
  61. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
  62. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -15
  63. package/dist/cjs/ion-item-divider.cjs.entry.js +4 -4
  64. package/dist/cjs/ion-item-group.cjs.entry.js +3 -3
  65. package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
  66. package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
  67. package/dist/cjs/ion-item-sliding.cjs.entry.js +41 -46
  68. package/dist/cjs/ion-loading.cjs.entry.js +23 -35
  69. package/dist/cjs/ion-menu-button.cjs.entry.js +13 -13
  70. package/dist/cjs/ion-menu-toggle.cjs.entry.js +7 -7
  71. package/dist/cjs/ion-menu.cjs.entry.js +47 -40
  72. package/dist/cjs/ion-modal.cjs.entry.js +935 -282
  73. package/dist/cjs/ion-nav-link.cjs.entry.js +2 -2
  74. package/dist/cjs/ion-nav.cjs.entry.js +45 -35
  75. package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +151 -43
  76. package/dist/cjs/ion-picker-column.cjs.entry.js +23 -25
  77. package/dist/cjs/ion-picker.cjs.entry.js +15 -17
  78. package/dist/cjs/ion-progress-bar.cjs.entry.js +6 -8
  79. package/dist/cjs/ion-range.cjs.entry.js +515 -0
  80. package/dist/cjs/ion-refresher-content.cjs.entry.js +6 -12
  81. package/dist/cjs/ion-refresher.cjs.entry.js +68 -50
  82. package/dist/cjs/ion-reorder-group.cjs.entry.js +15 -16
  83. package/dist/cjs/ion-reorder.cjs.entry.js +3 -3
  84. package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
  85. package/dist/cjs/ion-route.cjs.entry.js +1 -1
  86. package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
  87. package/dist/cjs/ion-router-outlet.cjs.entry.js +22 -20
  88. package/dist/cjs/ion-router.cjs.entry.js +32 -31
  89. package/dist/cjs/ion-searchbar.cjs.entry.js +14 -16
  90. package/dist/cjs/ion-segment-button.cjs.entry.js +8 -8
  91. package/dist/cjs/ion-segment.cjs.entry.js +24 -26
  92. package/dist/cjs/ion-select_2.cjs.entry.js +59 -56
  93. package/dist/cjs/ion-skeleton-text.cjs.entry.js +4 -4
  94. package/dist/cjs/ion-slide.cjs.entry.js +3 -3
  95. package/dist/cjs/ion-slides.cjs.entry.js +23 -23
  96. package/dist/cjs/ion-split-pane.cjs.entry.js +10 -11
  97. package/dist/cjs/ion-tab-bar.cjs.entry.js +5 -5
  98. package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
  99. package/dist/cjs/ion-tab.cjs.entry.js +4 -4
  100. package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
  101. package/dist/cjs/ion-text.cjs.entry.js +24 -0
  102. package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
  103. package/dist/cjs/ion-toast.cjs.entry.js +23 -43
  104. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +29 -28
  105. package/dist/cjs/{ionic-global-878073d1.js → ionic-global-2cde9d3a.js} +27 -31
  106. package/dist/cjs/{ios.transition-c3bfb096.js → ios.transition-da235483.js} +71 -51
  107. package/dist/cjs/{keyboard-dfd76ac3.js → keyboard-91096619.js} +3 -3
  108. package/dist/cjs/loader.cjs.js +5 -5
  109. package/dist/cjs/match-path-84c9f7ca.js +511 -0
  110. package/dist/cjs/{md.transition-7eb9a1a7.js → md.transition-be429e07.js} +9 -16
  111. package/dist/cjs/{menu-toggle-util-cb549c2c.js → menu-toggle-util-7a01448c.js} +2 -2
  112. package/dist/cjs/{overlays-0a748609.js → overlays-32df265a.js} +29 -29
  113. package/dist/cjs/parse-d0071120.js +1237 -0
  114. package/dist/cjs/{purify-d0ad2883.js → purify-fb9c107e.js} +1 -1
  115. package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
  116. package/dist/cjs/sparkle-card_3.cjs.entry.js +91 -0
  117. package/dist/cjs/sparkle-character-intro.cjs.entry.js +1 -1
  118. package/dist/cjs/sparkle-code.cjs.entry.js +2 -2
  119. package/dist/cjs/sparkle-compass-post.cjs.entry.js +1 -1
  120. package/dist/cjs/sparkle-compass.cjs.entry.js +1 -1
  121. package/dist/cjs/sparkle-core.cjs.js +5 -5
  122. package/dist/cjs/sparkle-course-root.cjs.entry.js +146 -0
  123. package/dist/cjs/sparkle-dropdown.cjs.entry.js +61 -0
  124. package/dist/cjs/sparkle-emoji.cjs.entry.js +1 -1
  125. package/dist/cjs/{header-mobile-collapse_61.cjs.entry.js → sparkle-export-lessons_6.cjs.entry.js} +8865 -17663
  126. package/dist/cjs/sparkle-facilitator-header_19.cjs.entry.js +2130 -0
  127. package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +8 -7
  128. package/dist/cjs/sparkle-feedback.cjs.entry.js +9 -7
  129. package/dist/cjs/sparkle-goal-form.cjs.entry.js +8 -7
  130. package/dist/cjs/sparkle-goal-progress.cjs.entry.js +19 -0
  131. package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +1 -1
  132. package/dist/cjs/sparkle-gww-graph.cjs.entry.js +1 -1
  133. package/dist/cjs/sparkle-gww-item.cjs.entry.js +74 -0
  134. package/dist/cjs/sparkle-intro.cjs.entry.js +26 -0
  135. package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +1 -1
  136. package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +2 -2
  137. package/dist/cjs/sparkle-menu-toggle_3.cjs.entry.js +236 -0
  138. package/dist/cjs/sparkle-modal-image.cjs.entry.js +1 -1
  139. package/dist/cjs/sparkle-notfound-page.cjs.entry.js +1 -1
  140. package/dist/cjs/sparkle-overlay.cjs.entry.js +1 -1
  141. package/dist/cjs/sparkle-poll.cjs.entry.js +1 -1
  142. package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
  143. package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +1 -1
  144. package/dist/cjs/sparkle-quiz.cjs.entry.js +1 -1
  145. package/dist/cjs/sparkle-select.cjs.entry.js +1 -1
  146. package/dist/cjs/sparkle-sidebar.cjs.entry.js +1 -1
  147. package/dist/cjs/sparkle-tab.cjs.entry.js +1 -1
  148. package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +1 -1
  149. package/dist/cjs/sparkle-tabs.cjs.entry.js +1 -1
  150. package/dist/cjs/sparkle-validation-error.cjs.entry.js +21 -0
  151. package/dist/cjs/sparkle-youtube.cjs.entry.js +1 -1
  152. package/dist/cjs/{spinner-configs-6f6b7ef0.js → spinner-configs-0ac05f2d.js} +43 -43
  153. package/dist/cjs/{status-tap-8697433c.js → status-tap-033befa2.js} +7 -5
  154. package/dist/cjs/stencil-async-content.cjs.entry.js +1 -1
  155. package/dist/cjs/stencil-route-link.cjs.entry.js +77 -0
  156. package/dist/cjs/stencil-route-title.cjs.entry.js +2 -2
  157. package/dist/cjs/stencil-router-prompt.cjs.entry.js +2 -2
  158. package/dist/cjs/stencil-router-redirect.cjs.entry.js +32 -0
  159. package/dist/cjs/student.service-d48f1c99.js +61 -0
  160. package/dist/cjs/{swipe-back-7e08b5e0.js → swipe-back-4a826f9b.js} +5 -5
  161. package/dist/cjs/{theme-4252ac15.js → theme-b0b295c1.js} +6 -5
  162. package/dist/cjs/user.store-8a049c4e.js +21 -0
  163. package/dist/collection/collection-manifest.json +3 -1
  164. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +16 -0
  165. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +197 -3
  166. package/dist/collection/components/sparkle-intro/sparkle-intro.css +15 -0
  167. package/dist/collection/components/sparkle-intro/sparkle-intro.js +35 -0
  168. package/dist/esm/PrivateRoute-530ef873.js +33 -0
  169. package/dist/esm/{active-router-909088d6.js → active-router-9843e205.js} +1 -1
  170. package/dist/esm/{animation-b306f6c2.js → animation-d98d3e81.js} +83 -78
  171. package/dist/esm/{app-globals-5c736ae5.js → app-globals-08edc964.js} +1 -1
  172. package/dist/esm/{PrivateRoute-b9937c45.js → auth.service-79389d86.js} +4 -32
  173. package/dist/esm/{auth.store-3ed2389e.js → auth.store-b812b34b.js} +45 -725
  174. package/dist/esm/compass-svg.entry.js +1 -1
  175. package/dist/esm/context-consumer.entry.js +1 -1
  176. package/dist/esm/course-select.entry.js +1 -1
  177. package/dist/esm/{cubic-bezier-a7ad9c8e.js → cubic-bezier-4c0db14f.js} +10 -11
  178. package/dist/esm/dom-utils-8e73e88b.js +55 -0
  179. package/dist/esm/{facilitator.service-ec0a9739.js → facilitator.service-7babc526.js} +2 -1
  180. package/dist/esm/{feed.service-33b83cb7.js → feed.service-80fbe79d.js} +3 -2
  181. package/dist/esm/{focus-visible-40cda868.js → focus-visible-4e9a0764.js} +19 -6
  182. package/dist/esm/{framework-delegate-3bc58c27.js → framework-delegate-9b329182.js} +11 -13
  183. package/dist/esm/{gesture-controller-686622ba.js → gesture-controller-7be18351.js} +1 -1
  184. package/dist/esm/{haptic-99c9e346.js → haptic-3a76a65c.js} +4 -3
  185. package/dist/esm/{hardware-back-button-b6ccf74a.js → hardware-back-button-fa04d6e9.js} +8 -8
  186. package/dist/esm/header-mobile-collapse_2.entry.js +107 -0
  187. package/dist/esm/{helpers-39367fe1.js → helpers-94a5855b.js} +81 -15
  188. package/dist/esm/httpService-b2b7a1ad.js +683 -0
  189. package/dist/esm/{icons-61dec176.js → icons-16f1a80b.js} +2 -2
  190. package/dist/esm/{index-a12c14bd.js → index-21661af2.js} +22 -19
  191. package/dist/esm/{tap-click-13f1fb0d.js → index-230a26c9.js} +30 -20
  192. package/dist/esm/{index-c26d8655.js → index-478745be.js} +17 -25
  193. package/dist/esm/{index-dc61f152.js → index-4ec6b9c2.js} +5 -2
  194. package/dist/esm/{index-9594837e.js → index-95307148.js} +19 -28
  195. package/dist/esm/{index-5568e3fa.js → index-9db08224.js} +19 -12
  196. package/dist/esm/index-ab1c6a9f.js +3067 -0
  197. package/dist/esm/{index-435af8e6.js → index-be6112f8.js} +9 -8
  198. package/dist/esm/index-c23a1826.js +128 -0
  199. package/dist/esm/index-dad75b83.js +34 -0
  200. package/dist/esm/{index.es-97dd8174.js → index.es-1c3b1ef3.js} +2 -7
  201. package/dist/esm/index.js +9 -7
  202. package/dist/esm/injectHistory-4bfff188.js +7 -0
  203. package/dist/esm/{input-shims-cc98ea92.js → input-shims-ce5c01df.js} +21 -24
  204. package/dist/esm/ion-accordion-group.entry.js +17 -9
  205. package/dist/esm/ion-accordion.entry.js +19 -23
  206. package/dist/esm/ion-action-sheet_4.entry.js +216 -212
  207. package/dist/esm/ion-app.entry.js +8 -8
  208. package/dist/esm/ion-avatar_16.entry.js +1888 -0
  209. package/dist/esm/ion-back-button.entry.js +11 -11
  210. package/dist/esm/ion-backdrop.entry.js +4 -4
  211. package/dist/esm/ion-badge.entry.js +3 -3
  212. package/dist/esm/ion-breadcrumb.entry.js +13 -21
  213. package/dist/esm/ion-breadcrumbs.entry.js +12 -14
  214. package/dist/esm/ion-buttons_3.entry.js +13 -13
  215. package/dist/esm/ion-card-header.entry.js +4 -4
  216. package/dist/esm/ion-card-subtitle.entry.js +4 -4
  217. package/dist/esm/ion-checkbox_4.entry.js +353 -0
  218. package/dist/esm/ion-chip.entry.js +3 -3
  219. package/dist/esm/ion-col_3.entry.js +153 -0
  220. package/dist/esm/ion-content_2.entry.js +59 -52
  221. package/dist/esm/ion-datetime-button.entry.js +308 -0
  222. package/dist/esm/ion-datetime.entry.js +723 -1216
  223. package/dist/esm/ion-fab-button.entry.js +25 -9
  224. package/dist/esm/ion-fab-list.entry.js +4 -4
  225. package/dist/esm/ion-fab.entry.js +15 -13
  226. package/dist/esm/ion-footer.entry.js +16 -14
  227. package/dist/esm/ion-img.entry.js +4 -4
  228. package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
  229. package/dist/esm/ion-infinite-scroll.entry.js +13 -15
  230. package/dist/esm/ion-item-divider.entry.js +4 -4
  231. package/dist/esm/ion-item-group.entry.js +3 -3
  232. package/dist/esm/ion-item-option.entry.js +8 -8
  233. package/dist/esm/ion-item-options.entry.js +5 -5
  234. package/dist/esm/ion-item-sliding.entry.js +41 -46
  235. package/dist/esm/ion-loading.entry.js +23 -35
  236. package/dist/esm/ion-menu-button.entry.js +13 -13
  237. package/dist/esm/ion-menu-toggle.entry.js +7 -7
  238. package/dist/esm/ion-menu.entry.js +47 -40
  239. package/dist/esm/ion-modal.entry.js +921 -268
  240. package/dist/esm/ion-nav-link.entry.js +2 -2
  241. package/dist/esm/ion-nav.entry.js +45 -35
  242. package/dist/esm/ion-picker-column-internal_2.entry.js +151 -43
  243. package/dist/esm/ion-picker-column.entry.js +23 -25
  244. package/dist/esm/ion-picker.entry.js +15 -17
  245. package/dist/esm/ion-progress-bar.entry.js +6 -8
  246. package/dist/esm/ion-range.entry.js +511 -0
  247. package/dist/esm/ion-refresher-content.entry.js +6 -12
  248. package/dist/esm/ion-refresher.entry.js +68 -50
  249. package/dist/esm/ion-reorder-group.entry.js +15 -16
  250. package/dist/esm/ion-reorder.entry.js +3 -3
  251. package/dist/esm/ion-route-redirect.entry.js +1 -1
  252. package/dist/esm/ion-route.entry.js +1 -1
  253. package/dist/esm/ion-router-link.entry.js +5 -5
  254. package/dist/esm/ion-router-outlet.entry.js +22 -20
  255. package/dist/esm/ion-router.entry.js +32 -31
  256. package/dist/esm/ion-searchbar.entry.js +14 -16
  257. package/dist/esm/ion-segment-button.entry.js +8 -8
  258. package/dist/esm/ion-segment.entry.js +24 -26
  259. package/dist/esm/ion-select_2.entry.js +59 -56
  260. package/dist/esm/ion-skeleton-text.entry.js +4 -4
  261. package/dist/esm/ion-slide.entry.js +3 -3
  262. package/dist/esm/ion-slides.entry.js +23 -23
  263. package/dist/esm/ion-split-pane.entry.js +10 -11
  264. package/dist/esm/ion-tab-bar.entry.js +5 -5
  265. package/dist/esm/ion-tab-button.entry.js +6 -6
  266. package/dist/esm/ion-tab.entry.js +4 -4
  267. package/dist/esm/ion-tabs.entry.js +4 -5
  268. package/dist/esm/ion-text.entry.js +20 -0
  269. package/dist/esm/ion-thumbnail.entry.js +2 -2
  270. package/dist/esm/ion-toast.entry.js +23 -43
  271. package/dist/esm/ion-virtual-scroll.entry.js +29 -28
  272. package/dist/esm/{ionic-global-0939c477.js → ionic-global-293e882b.js} +27 -31
  273. package/dist/esm/{ios.transition-b4ca8a33.js → ios.transition-7cd34deb.js} +71 -51
  274. package/dist/esm/{keyboard-2503e874.js → keyboard-7e8329b3.js} +3 -3
  275. package/dist/esm/loader.js +5 -5
  276. package/dist/esm/match-path-36fdf5c7.js +499 -0
  277. package/dist/esm/{md.transition-ca5e0322.js → md.transition-2589a5b1.js} +9 -16
  278. package/dist/esm/{menu-toggle-util-7fa22c2f.js → menu-toggle-util-f92ba2f0.js} +2 -2
  279. package/dist/esm/{overlays-34cfa9e0.js → overlays-dfa730c8.js} +30 -30
  280. package/dist/esm/parse-1ae3a9bb.js +1196 -0
  281. package/dist/esm/polyfills/css-shim.js +1 -1
  282. package/dist/esm/{purify-ffce2b4c.js → purify-79af871f.js} +1 -1
  283. package/dist/esm/sparkle-animation-player.entry.js +2 -2
  284. package/dist/esm/sparkle-card_3.entry.js +85 -0
  285. package/dist/esm/sparkle-character-intro.entry.js +1 -1
  286. package/dist/esm/sparkle-code.entry.js +2 -2
  287. package/dist/esm/sparkle-compass-post.entry.js +1 -1
  288. package/dist/esm/sparkle-compass.entry.js +1 -1
  289. package/dist/esm/sparkle-core.js +5 -5
  290. package/dist/esm/sparkle-course-root.entry.js +142 -0
  291. package/dist/esm/sparkle-dropdown.entry.js +57 -0
  292. package/dist/esm/sparkle-emoji.entry.js +1 -1
  293. package/dist/esm/{header-mobile-collapse_61.entry.js → sparkle-export-lessons_6.entry.js} +8860 -17603
  294. package/dist/esm/sparkle-facilitator-header_19.entry.js +2108 -0
  295. package/dist/esm/sparkle-facilitator-notes-form.entry.js +8 -7
  296. package/dist/esm/sparkle-feedback.entry.js +9 -7
  297. package/dist/esm/sparkle-goal-form.entry.js +9 -8
  298. package/dist/esm/sparkle-goal-progress.entry.js +15 -0
  299. package/dist/esm/sparkle-gww-comment-list.entry.js +1 -1
  300. package/dist/esm/sparkle-gww-graph.entry.js +1 -1
  301. package/dist/esm/sparkle-gww-item.entry.js +70 -0
  302. package/dist/esm/sparkle-intro.entry.js +22 -0
  303. package/dist/esm/sparkle-lower-content-nav.entry.js +1 -1
  304. package/dist/esm/sparkle-menu-collapsible.entry.js +2 -2
  305. package/dist/esm/sparkle-menu-toggle_3.entry.js +230 -0
  306. package/dist/esm/sparkle-modal-image.entry.js +1 -1
  307. package/dist/esm/sparkle-notfound-page.entry.js +1 -1
  308. package/dist/esm/sparkle-overlay.entry.js +1 -1
  309. package/dist/esm/sparkle-poll.entry.js +1 -1
  310. package/dist/esm/sparkle-quiz-container.entry.js +1 -1
  311. package/dist/esm/sparkle-quiz-feedback_5.entry.js +1 -1
  312. package/dist/esm/sparkle-quiz.entry.js +1 -1
  313. package/dist/esm/sparkle-select.entry.js +1 -1
  314. package/dist/esm/sparkle-sidebar.entry.js +1 -1
  315. package/dist/esm/sparkle-tab.entry.js +1 -1
  316. package/dist/esm/sparkle-table-of-contents.entry.js +1 -1
  317. package/dist/esm/sparkle-tabs.entry.js +1 -1
  318. package/dist/esm/sparkle-validation-error.entry.js +17 -0
  319. package/dist/esm/sparkle-youtube.entry.js +1 -1
  320. package/dist/esm/{spinner-configs-f609a655.js → spinner-configs-a37e628a.js} +43 -43
  321. package/dist/esm/{status-tap-6351a0cb.js → status-tap-79b6199d.js} +7 -5
  322. package/dist/esm/stencil-async-content.entry.js +1 -1
  323. package/dist/esm/stencil-route-link.entry.js +73 -0
  324. package/dist/esm/stencil-route-title.entry.js +2 -2
  325. package/dist/esm/stencil-router-prompt.entry.js +2 -2
  326. package/dist/esm/stencil-router-redirect.entry.js +28 -0
  327. package/dist/esm/{student.service-29b688ba.js → student.service-0caed0f4.js} +3 -18
  328. package/dist/esm/{swipe-back-34251834.js → swipe-back-ad7a0361.js} +5 -5
  329. package/dist/esm/{theme-c336c9d9.js → theme-7ef00c83.js} +6 -5
  330. package/dist/esm/user.store-8477642a.js +19 -0
  331. package/dist/esm/{util-6ef753e9.js → util-a831d09d.js} +1 -1
  332. package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +8 -1
  333. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +46 -22
  334. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +43 -19
  335. package/dist/node_modules/@ionic/core/dist/collection/components/datetime-button/datetime-button.css +60 -0
  336. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +2 -1
  337. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +2 -2
  338. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +6 -6
  339. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +6 -6
  340. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +3 -3
  341. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +1 -6
  342. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +1 -6
  343. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +1 -5
  344. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +1 -5
  345. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +31 -3
  346. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +29 -1
  347. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +24 -1
  348. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +24 -1
  349. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +4 -0
  350. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +4 -0
  351. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +2 -2
  352. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +2 -2
  353. package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +8 -8
  354. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +34 -17
  355. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +34 -17
  356. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +50 -1
  357. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +27 -0
  358. package/dist/sparkle-core/index.esm.js +1 -1
  359. package/dist/sparkle-core/p-0127a61a.entry.js +1 -0
  360. package/dist/sparkle-core/p-01743e3e.js +4 -0
  361. package/dist/sparkle-core/p-06af1bc8.entry.js +1 -0
  362. package/dist/sparkle-core/{p-703ca87c.js → p-076f0239.js} +0 -0
  363. package/dist/sparkle-core/p-0798d46a.entry.js +1 -0
  364. package/dist/sparkle-core/p-085eb951.entry.js +4 -0
  365. package/dist/sparkle-core/{p-39e5a90f.entry.js → p-0b92326d.entry.js} +1 -1
  366. package/dist/sparkle-core/{p-5ff6416d.entry.js → p-0c603495.entry.js} +2 -2
  367. package/dist/sparkle-core/{p-6bbabb80.entry.js → p-0d7cceaa.entry.js} +1 -1
  368. package/dist/sparkle-core/p-0d813026.entry.js +1 -0
  369. package/dist/sparkle-core/{p-69e7783d.js → p-0e4de1d0.js} +0 -0
  370. package/dist/sparkle-core/p-11ed6b7f.entry.js +1 -0
  371. package/dist/sparkle-core/p-122427b7.entry.js +1 -0
  372. package/dist/sparkle-core/p-12c4f45c.entry.js +1 -0
  373. package/dist/sparkle-core/p-136b93d5.entry.js +4 -0
  374. package/dist/sparkle-core/{p-e225581a.js → p-1394cbb8.js} +2 -2
  375. package/dist/sparkle-core/{p-c48bbc7c.entry.js → p-14340143.entry.js} +1 -1
  376. package/dist/sparkle-core/p-14a06a91.entry.js +1 -0
  377. package/dist/sparkle-core/{p-a9ee3f6d.entry.js → p-16b7974e.entry.js} +1 -1
  378. package/dist/sparkle-core/p-16c81890.entry.js +1 -0
  379. package/dist/sparkle-core/{p-5c9aa1f9.entry.js → p-1701723e.entry.js} +1 -1
  380. package/dist/sparkle-core/p-1728ead7.js +1 -0
  381. package/dist/sparkle-core/p-17aef6f9.js +1 -0
  382. package/dist/sparkle-core/p-180857a2.entry.js +1 -0
  383. package/dist/sparkle-core/p-1acc7870.entry.js +1 -0
  384. package/dist/sparkle-core/{p-513794b0.js → p-1c2aee9c.js} +1 -1
  385. package/dist/sparkle-core/p-1cd4c3cc.entry.js +1 -0
  386. package/dist/sparkle-core/p-21d9833d.js +1 -0
  387. package/dist/sparkle-core/p-23d713e2.js +1 -0
  388. package/dist/sparkle-core/p-25c13612.entry.js +1 -0
  389. package/dist/sparkle-core/p-2699868a.entry.js +1 -0
  390. package/dist/sparkle-core/p-27075abe.js +4 -0
  391. package/dist/sparkle-core/{p-713590fc.js → p-280e938d.js} +1 -1
  392. package/dist/sparkle-core/p-2bd4c60e.js +1 -0
  393. package/dist/sparkle-core/p-2c89a6c2.entry.js +1 -0
  394. package/dist/sparkle-core/p-308517b3.js +4 -0
  395. package/dist/sparkle-core/p-3227afcb.entry.js +1 -0
  396. package/dist/sparkle-core/{p-173d5461.entry.js → p-34d93a39.entry.js} +1 -1
  397. package/dist/sparkle-core/p-34ebfc8a.entry.js +1 -0
  398. package/dist/sparkle-core/p-351b82a8.entry.js +1 -0
  399. package/dist/sparkle-core/p-363a2d6d.js +4 -0
  400. package/dist/sparkle-core/p-36c48760.entry.js +1 -0
  401. package/dist/sparkle-core/p-3810777d.js +4 -0
  402. package/dist/sparkle-core/p-384911d7.entry.js +1 -0
  403. package/dist/sparkle-core/p-3b618eda.entry.js +1 -0
  404. package/dist/sparkle-core/p-3c752205.entry.js +1 -0
  405. package/dist/sparkle-core/{p-50aac721.entry.js → p-3d2c0e24.entry.js} +2 -2
  406. package/dist/sparkle-core/{p-350adbaa.entry.js → p-3eb56165.entry.js} +1 -1
  407. package/dist/sparkle-core/{p-ed0e9d29.entry.js → p-3ef53ebf.entry.js} +1 -1
  408. package/dist/sparkle-core/{p-fbd7eeca.entry.js → p-3fd92216.entry.js} +1 -1
  409. package/dist/sparkle-core/{p-1df05176.js → p-4338e1e3.js} +2 -2
  410. package/dist/sparkle-core/p-442eadcf.entry.js +1 -0
  411. package/dist/sparkle-core/{p-5f45d206.entry.js → p-4af496a8.entry.js} +1 -1
  412. package/dist/sparkle-core/{p-935e7cfc.js → p-4bd4dab2.js} +1 -1
  413. package/dist/sparkle-core/{p-18e62133.entry.js → p-4c9e010d.entry.js} +1 -1
  414. package/dist/sparkle-core/p-4d0dfbc9.js +1 -0
  415. package/dist/sparkle-core/{p-8c6b6038.js → p-4d4077ea.js} +0 -0
  416. package/dist/sparkle-core/p-4e0502b8.entry.js +4 -0
  417. package/dist/sparkle-core/p-506f3c5f.js +4 -0
  418. package/dist/sparkle-core/p-524a6174.entry.js +1 -0
  419. package/dist/sparkle-core/p-53aac9d7.entry.js +1 -0
  420. package/dist/sparkle-core/{p-0580419b.entry.js → p-56700a40.entry.js} +1 -1
  421. package/dist/sparkle-core/p-5722be24.entry.js +1 -0
  422. package/dist/sparkle-core/p-58389020.entry.js +348 -0
  423. package/dist/sparkle-core/{p-11cf398a.entry.js → p-58f74119.entry.js} +1 -1
  424. package/dist/sparkle-core/p-5979f253.entry.js +1 -0
  425. package/dist/sparkle-core/p-5a3de051.entry.js +4 -0
  426. package/dist/sparkle-core/p-5a850731.entry.js +1 -0
  427. package/dist/sparkle-core/{p-950effe7.entry.js → p-5dcf33fb.entry.js} +1 -1
  428. package/dist/sparkle-core/p-5e8fa1ac.entry.js +1 -0
  429. package/dist/sparkle-core/p-5ef50959.js +1 -0
  430. package/dist/sparkle-core/p-615b8f64.entry.js +1 -0
  431. package/dist/sparkle-core/{p-90389886.entry.js → p-63d8a5b7.entry.js} +1 -1
  432. package/dist/sparkle-core/p-6a337ad1.entry.js +1 -0
  433. package/dist/sparkle-core/p-6a5ace01.js +2 -0
  434. package/dist/sparkle-core/{p-d7baf31e.entry.js → p-6ae9c743.entry.js} +1 -1
  435. package/dist/sparkle-core/p-76206f80.entry.js +1 -0
  436. package/dist/sparkle-core/{p-99b43ee1.entry.js → p-767c9db8.entry.js} +1 -1
  437. package/dist/sparkle-core/p-76a6e202.entry.js +1 -0
  438. package/dist/sparkle-core/{p-ee0d7f19.entry.js → p-785f1879.entry.js} +1 -1
  439. package/dist/sparkle-core/p-788735b9.entry.js +1 -0
  440. package/dist/sparkle-core/{p-057f6a23.entry.js → p-7b21bd70.entry.js} +1 -1
  441. package/dist/sparkle-core/p-7b3d1457.js +1 -0
  442. package/dist/sparkle-core/p-7d8427eb.js +4 -0
  443. package/dist/sparkle-core/{p-5264da79.js → p-7e7ce516.js} +0 -0
  444. package/dist/sparkle-core/{p-838fa86d.entry.js → p-8cbe019a.entry.js} +5 -5
  445. package/dist/sparkle-core/{p-9c1772c3.js → p-8d630960.js} +1 -1
  446. package/dist/sparkle-core/{p-7052c43a.entry.js → p-8e42e634.entry.js} +1 -1
  447. package/dist/sparkle-core/p-8e56f9ee.entry.js +1 -0
  448. package/dist/sparkle-core/p-8ed0cefb.entry.js +1 -0
  449. package/dist/sparkle-core/{p-d4c07aca.js → p-924b2917.js} +0 -0
  450. package/dist/sparkle-core/p-9484e34b.entry.js +1 -0
  451. package/dist/sparkle-core/p-966817ec.js +1 -0
  452. package/dist/sparkle-core/p-969e98e5.entry.js +1 -0
  453. package/dist/sparkle-core/p-98f3925b.js +4 -0
  454. package/dist/sparkle-core/{p-a1cab0f3.js → p-99231c00.js} +2 -2
  455. package/dist/sparkle-core/p-9a383065.entry.js +7 -0
  456. package/dist/sparkle-core/p-9b4979b5.entry.js +4 -0
  457. package/dist/sparkle-core/{p-c69b0a7a.entry.js → p-9cd95e7e.entry.js} +1 -1
  458. package/dist/sparkle-core/p-9dc42d70.entry.js +1 -0
  459. package/dist/sparkle-core/p-9eea81f2.js +1 -0
  460. package/dist/sparkle-core/{p-797c23ed.entry.js → p-9ef14088.entry.js} +1 -1
  461. package/dist/sparkle-core/p-a05871e6.js +1 -0
  462. package/dist/sparkle-core/p-a111c567.entry.js +1 -0
  463. package/dist/sparkle-core/{p-1af044f7.js → p-a19b42f0.js} +1 -1
  464. package/dist/sparkle-core/p-a208ab2d.js +4 -0
  465. package/dist/sparkle-core/p-a2f7c751.entry.js +1 -0
  466. package/dist/sparkle-core/p-a458b415.entry.js +1 -0
  467. package/dist/sparkle-core/p-a6c1a55a.entry.js +5 -0
  468. package/dist/sparkle-core/{p-145e40f5.entry.js → p-ab3a8f5e.entry.js} +1 -1
  469. package/dist/sparkle-core/p-ac0e4d8c.entry.js +1 -0
  470. package/dist/sparkle-core/p-add30d46.js +4 -0
  471. package/dist/sparkle-core/{p-5b40aae5.entry.js → p-b00d0a47.entry.js} +1 -1
  472. package/dist/sparkle-core/p-b2827978.entry.js +1 -0
  473. package/dist/sparkle-core/p-b8ba8164.entry.js +1 -0
  474. package/dist/sparkle-core/{p-6823e6c1.entry.js → p-ba775d8e.entry.js} +1 -1
  475. package/dist/sparkle-core/{p-37c00e39.entry.js → p-bae8cd7d.entry.js} +1 -1
  476. package/dist/sparkle-core/p-bb3e3482.entry.js +1 -0
  477. package/dist/sparkle-core/p-bb575dba.entry.js +1 -0
  478. package/dist/sparkle-core/p-bd2c8e30.entry.js +10 -0
  479. package/dist/sparkle-core/p-c48352cf.js +4 -0
  480. package/dist/sparkle-core/{p-667accac.entry.js → p-c5eb4404.entry.js} +1 -1
  481. package/dist/sparkle-core/p-c8ad5a5b.entry.js +4 -0
  482. package/dist/sparkle-core/p-c9f474d0.js +4 -0
  483. package/dist/sparkle-core/p-ca0edc9b.entry.js +1 -0
  484. package/dist/sparkle-core/{p-680663a2.entry.js → p-cb04b18a.entry.js} +1 -1
  485. package/dist/sparkle-core/{p-b3909012.entry.js → p-d0d0e5e5.entry.js} +1 -1
  486. package/dist/sparkle-core/{p-7d61177b.entry.js → p-d220a642.entry.js} +1 -1
  487. package/dist/sparkle-core/p-d38a2511.entry.js +1 -0
  488. package/dist/sparkle-core/{p-b07a2cf2.entry.js → p-d5b8302f.entry.js} +1 -1
  489. package/dist/sparkle-core/p-d5ba8e80.entry.js +1 -0
  490. package/dist/sparkle-core/{p-3a202a38.entry.js → p-d6637b48.entry.js} +1 -1
  491. package/dist/sparkle-core/p-d6788642.entry.js +1 -0
  492. package/dist/sparkle-core/p-d6a3a639.entry.js +1 -0
  493. package/dist/sparkle-core/p-d86f8633.entry.js +1 -0
  494. package/dist/sparkle-core/{p-9cfdeb18.entry.js → p-defeaa5c.entry.js} +1 -1
  495. package/dist/sparkle-core/p-df5cfa7f.entry.js +1 -0
  496. package/dist/sparkle-core/p-df5efe0d.entry.js +1 -0
  497. package/dist/sparkle-core/p-dff8325e.js +4 -0
  498. package/dist/sparkle-core/p-e09de7ac.js +1 -0
  499. package/dist/sparkle-core/{p-016a7aaf.entry.js → p-e1743d82.entry.js} +1 -1
  500. package/dist/sparkle-core/p-e28a106d.entry.js +1 -0
  501. package/dist/sparkle-core/p-e566c0b3.entry.js +1 -0
  502. package/dist/sparkle-core/{p-bca0e465.entry.js → p-e6d39f6e.entry.js} +1 -1
  503. package/dist/sparkle-core/p-e9431eeb.js +7 -0
  504. package/dist/sparkle-core/p-ea4a9f0d.entry.js +1 -0
  505. package/dist/sparkle-core/p-ea7d7a3b.js +1 -0
  506. package/dist/sparkle-core/p-eaa8bbee.js +4 -0
  507. package/dist/sparkle-core/p-ed3dfd89.js +4 -0
  508. package/dist/sparkle-core/{p-3defe550.entry.js → p-efe37368.entry.js} +1 -1
  509. package/dist/sparkle-core/p-f187d129.entry.js +1 -0
  510. package/dist/sparkle-core/{p-a9ccb0df.js → p-f3cba72a.js} +0 -0
  511. package/dist/sparkle-core/{p-052caa63.js → p-f5e7bfa5.js} +1 -1
  512. package/dist/sparkle-core/{p-ecd39170.entry.js → p-f63a13d8.entry.js} +1 -1
  513. package/dist/sparkle-core/{p-1726da2f.entry.js → p-fdb9a613.entry.js} +1 -1
  514. package/dist/sparkle-core/p-fde96f7c.js +4 -0
  515. package/dist/sparkle-core/{p-aa87c7f0.entry.js → p-fe214d79.entry.js} +1 -1
  516. package/dist/sparkle-core/p-fe3a7bca.js +1 -0
  517. package/dist/sparkle-core/{p-aa9ebc39.entry.js → p-fea20ec2.entry.js} +1 -1
  518. package/dist/sparkle-core/p-ff26d891.entry.js +1 -0
  519. package/dist/sparkle-core/sparkle-core.css +1 -1
  520. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  521. package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +16 -0
  522. package/dist/types/components/sparkle-intro/sparkle-intro.d.ts +7 -0
  523. package/dist/types/components.d.ts +73 -11
  524. package/package.json +3 -3
  525. package/dist/cjs/ion-card-title.cjs.entry.js +0 -30
  526. package/dist/cjs/ion-textarea.cjs.entry.js +0 -247
  527. package/dist/cjs/ion-toggle.cjs.entry.js +0 -160
  528. package/dist/cjs/sparkle-feed-post.cjs.entry.js +0 -19
  529. package/dist/cjs/student.service-744c3155.js +0 -77
  530. package/dist/esm/ion-card-title.entry.js +0 -26
  531. package/dist/esm/ion-textarea.entry.js +0 -243
  532. package/dist/esm/ion-toggle.entry.js +0 -156
  533. package/dist/esm/sparkle-feed-post.entry.js +0 -15
  534. package/dist/sparkle-core/p-0187adef.entry.js +0 -1
  535. package/dist/sparkle-core/p-03189863.js +0 -1
  536. package/dist/sparkle-core/p-03ec54a8.entry.js +0 -1
  537. package/dist/sparkle-core/p-04583c51.entry.js +0 -1
  538. package/dist/sparkle-core/p-063cd168.js +0 -4
  539. package/dist/sparkle-core/p-081968cc.entry.js +0 -1
  540. package/dist/sparkle-core/p-0934f5dd.entry.js +0 -1
  541. package/dist/sparkle-core/p-0f899097.entry.js +0 -352
  542. package/dist/sparkle-core/p-1339830f.entry.js +0 -1
  543. package/dist/sparkle-core/p-1b78dea1.entry.js +0 -1
  544. package/dist/sparkle-core/p-1cef8572.js +0 -4
  545. package/dist/sparkle-core/p-21bf4ca0.entry.js +0 -1
  546. package/dist/sparkle-core/p-21db4e8e.entry.js +0 -1
  547. package/dist/sparkle-core/p-23a9f7d1.entry.js +0 -1
  548. package/dist/sparkle-core/p-289a35ed.entry.js +0 -1
  549. package/dist/sparkle-core/p-2ee6a5f9.entry.js +0 -1
  550. package/dist/sparkle-core/p-35a7bd6c.entry.js +0 -1
  551. package/dist/sparkle-core/p-389500fd.js +0 -4
  552. package/dist/sparkle-core/p-45e6db62.entry.js +0 -1
  553. package/dist/sparkle-core/p-48f9b960.entry.js +0 -1
  554. package/dist/sparkle-core/p-4dc3ef96.entry.js +0 -1
  555. package/dist/sparkle-core/p-547b70c6.entry.js +0 -1
  556. package/dist/sparkle-core/p-5598650a.entry.js +0 -1
  557. package/dist/sparkle-core/p-55ae49e1.js +0 -4
  558. package/dist/sparkle-core/p-58e98f89.entry.js +0 -1
  559. package/dist/sparkle-core/p-59f7bf6e.entry.js +0 -1
  560. package/dist/sparkle-core/p-5a3d0e6b.js +0 -4
  561. package/dist/sparkle-core/p-5d2e54ee.entry.js +0 -1
  562. package/dist/sparkle-core/p-62a6c96f.entry.js +0 -1
  563. package/dist/sparkle-core/p-64e72f8f.js +0 -4
  564. package/dist/sparkle-core/p-660e0742.js +0 -1
  565. package/dist/sparkle-core/p-6bf07a28.js +0 -1
  566. package/dist/sparkle-core/p-6c6145cd.js +0 -4
  567. package/dist/sparkle-core/p-6c90bde6.entry.js +0 -5
  568. package/dist/sparkle-core/p-6e88764b.entry.js +0 -4
  569. package/dist/sparkle-core/p-6ee40949.js +0 -1
  570. package/dist/sparkle-core/p-6fbe3ca3.entry.js +0 -1
  571. package/dist/sparkle-core/p-6fd4985d.js +0 -4
  572. package/dist/sparkle-core/p-70b2452c.js +0 -4
  573. package/dist/sparkle-core/p-7493ee15.entry.js +0 -1
  574. package/dist/sparkle-core/p-75572037.js +0 -1
  575. package/dist/sparkle-core/p-768bcc9e.entry.js +0 -1
  576. package/dist/sparkle-core/p-7e61973d.entry.js +0 -7
  577. package/dist/sparkle-core/p-855ca600.js +0 -1
  578. package/dist/sparkle-core/p-857f3696.entry.js +0 -1
  579. package/dist/sparkle-core/p-8fe2e51f.entry.js +0 -4
  580. package/dist/sparkle-core/p-932bfb69.entry.js +0 -1
  581. package/dist/sparkle-core/p-941eaa3a.entry.js +0 -1
  582. package/dist/sparkle-core/p-95004267.entry.js +0 -1
  583. package/dist/sparkle-core/p-996361f9.entry.js +0 -1
  584. package/dist/sparkle-core/p-9a17f2ad.js +0 -4
  585. package/dist/sparkle-core/p-9babd345.js +0 -1
  586. package/dist/sparkle-core/p-a080e768.entry.js +0 -1
  587. package/dist/sparkle-core/p-a7cc0052.entry.js +0 -4
  588. package/dist/sparkle-core/p-ae1f145d.entry.js +0 -1
  589. package/dist/sparkle-core/p-b3e6427d.js +0 -7
  590. package/dist/sparkle-core/p-b49ca0ea.entry.js +0 -1
  591. package/dist/sparkle-core/p-b81e20fe.entry.js +0 -4
  592. package/dist/sparkle-core/p-c1279cc9.entry.js +0 -1
  593. package/dist/sparkle-core/p-c1376096.entry.js +0 -1
  594. package/dist/sparkle-core/p-c3986a52.entry.js +0 -1
  595. package/dist/sparkle-core/p-c3d3d5c4.entry.js +0 -1
  596. package/dist/sparkle-core/p-c5b9bdd6.entry.js +0 -1
  597. package/dist/sparkle-core/p-cbbeed67.entry.js +0 -1
  598. package/dist/sparkle-core/p-d4a435f8.entry.js +0 -1
  599. package/dist/sparkle-core/p-d5b05ece.entry.js +0 -5
  600. package/dist/sparkle-core/p-d8d3524a.js +0 -1
  601. package/dist/sparkle-core/p-e0fced48.entry.js +0 -1
  602. package/dist/sparkle-core/p-e1cba44b.entry.js +0 -4
  603. package/dist/sparkle-core/p-e3fdd0a8.entry.js +0 -1
  604. package/dist/sparkle-core/p-e6b66cef.entry.js +0 -1
  605. package/dist/sparkle-core/p-e72d4450.js +0 -4
  606. package/dist/sparkle-core/p-eb70a23c.entry.js +0 -1
  607. package/dist/sparkle-core/p-f4001fdf.js +0 -4
  608. package/dist/sparkle-core/p-f9b73032.entry.js +0 -1
  609. package/dist/sparkle-core/p-faa912d7.entry.js +0 -1
  610. package/dist/sparkle-core/p-fc933591.entry.js +0 -1
  611. package/dist/sparkle-core/p-fef04ab5.js +0 -4
@@ -0,0 +1,2108 @@
1
+ import { r as registerInstance, h, i as getElement, H as Host, e as createEvent, F as Fragment, c as getAssetPath, k as getContext } from './index-9db08224.js';
2
+ import { m as menuController } from './index-95307148.js';
3
+ import { S as SignalRService, t as templates, s as signalRStore } from './index-ab1c6a9f.js';
4
+ import { T as TocStore, A as AuthStore, c as createStore } from './auth.store-b812b34b.js';
5
+ import { F as FacilitatorService, f as facilitatorStore } from './facilitator.service-7babc526.js';
6
+ import { H as HttpService } from './httpService-b2b7a1ad.js';
7
+ import { m as modalController, h as alertController } from './overlays-dfa730c8.js';
8
+ import { A as AppDataService, g as goalStore, F as FeedService, f as feedStore } from './feed.service-80fbe79d.js';
9
+ import { E as EnvironmentConfigService } from './environment-config.service-2b5d692b.js';
10
+ import { A as AssetsService } from './assets.service-66e848b8.js';
11
+ import { b as MyHealthTemplate, S as SparkleGlobal$1, c as MyHealthTemplateJSON, d as MyMoodTemplate, e as MyMoodTemplateJSON } from './util-a831d09d.js';
12
+ import { A as AuthService, s as setupConfig } from './auth.service-79389d86.js';
13
+ import { u as userStore } from './user.store-8477642a.js';
14
+ import { S as StudentService } from './student.service-0caed0f4.js';
15
+ import { i as injectHistory } from './injectHistory-4bfff188.js';
16
+ import { m as matchPath, a as matchesAreEqual, s as stripTrailingSlash, b as addLeadingSlash, c as createLocation, d as createKey, h as hasBasename, e as stripBasename, f as createPath, g as stripLeadingSlash, l as locationsAreEqual } from './match-path-36fdf5c7.js';
17
+ import { A as ActiveRouter } from './active-router-9843e205.js';
18
+ import { s as storageAvailable, a as supportsHistory, b as supportsPopStateOnHashChange, g as getConfirmation, i as isExtraneousPopstateEvent, c as supportsGoWithoutReloadUsingHash } from './dom-utils-8e73e88b.js';
19
+ import './hardware-back-button-fa04d6e9.js';
20
+ import './helpers-94a5855b.js';
21
+ import './ionic-global-293e882b.js';
22
+ import './animation-d98d3e81.js';
23
+ import './localstorage.service-4bf408c8.js';
24
+
25
+ const facilitatorHeaderCss = "sparkle-facilitator-header{background-color:var(--background);box-shadow:0px 1px 3px rgba(2, 8, 20, 0.06), 0px 1px 2px rgba(2, 8, 20, 0.04);color:var(--text-color--light);display:block;font-size:14px;font-weight:500;line-height:1;position:fixed;top:0;left:0;transform:translateY(0);transition:transform 200ms ease;user-select:none;width:100%;white-space:nowrap;z-index:2}@media (min-width: 768px){.Layout:not(.is-menu-toggled) sparkle-facilitator-header.hidden{transform:translateY(-100%)}}@media (max-width: 768px){.Layout.is-menu-toggled sparkle-facilitator-header.hidden{transform:translateY(-100%)}}sparkle-facilitator-header header{align-items:center;display:flex;height:var(--header-height);padding:0 1.4rem 0 0.8rem}sparkle-facilitator-header a{color:inherit;font-weight:500;padding:10px 0}sparkle-facilitator-header ion-icon{font-size:16px;color:#B2BECD}sparkle-facilitator-header .link-active{color:var(--ion-color-sparkle)}@media (hover: hover){sparkle-facilitator-header a:not(.link-active):hover{color:var(--text-color)}}sparkle-facilitator-header sparkle-menu-toggle{flex:none;margin-right:0.75em}sparkle-facilitator-header .HeaderLogo{color:var(--text-color--dark);font-family:var(--heading-font-family);height:25px;margin-right:2em;display:flex;justify-content:center;align-items:center;font-size:1.5em}sparkle-facilitator-header .SectionNav stencil-route{display:flex}sparkle-facilitator-header .SectionNav .Dropdown{align-self:center;color:var(--text-color);margin-right:0.75em}sparkle-facilitator-header .SectionNav .Dropdown-button{border:solid 1px #DEE3EA;border-radius:6px;color:var(--text-color--dark);padding:10px;transition:border-color 100ms ease}sparkle-facilitator-header .SectionNav .Dropdown.is-open .Dropdown-button{border-color:var(--line-rule-color)}sparkle-facilitator-header .SectionNav .Dropdown-panel{min-width:180px}sparkle-facilitator-header .SectionNav .Dropdown-panel a{display:flex;justify-content:space-between}sparkle-facilitator-header .SectionNav .Dropdown-panel svg{height:1em;width:1em}sparkle-facilitator-header .SectionNav .Dropdown-panel .Nav-link{margin-left:0;margin-right:0}sparkle-facilitator-header .SectionNav-tabs>*{align-items:center;display:inline-flex;height:var(--header-height);margin-right:1em;padding:0px 1em;position:relative}sparkle-facilitator-header .SectionNav-tabs .link-active:after{background-color:currentColor;bottom:0;content:\"\";display:block;height:2px;left:0;position:absolute;width:100%}sparkle-facilitator-header .UtilNav{align-items:center;display:flex;font-size:12px;margin-left:auto}sparkle-facilitator-header .UtilNav>*{margin-left:1em}sparkle-facilitator-header .UtilNav .Dropdown.is-open{color:var(--text-color)}sparkle-facilitator-header .UtilNav .Dropdown-button{padding:10px 0}@media (hover: hover){sparkle-facilitator-header .UtilNav .Dropdown-button:hover{color:var(--text-color)}}sparkle-facilitator-header .UtilNav .Dropdown-panel{font-size:14px}sparkle-facilitator-header .girls-inc-logo{display:block;max-width:40px;max-height:40px;width:auto;height:auto}";
26
+
27
+ const SparkleFacilitatorHeader = class {
28
+ constructor(hostRef) {
29
+ registerInstance(this, hostRef);
30
+ this.courseName = '';
31
+ this.hidden = false;
32
+ this.frameRequested = false;
33
+ this.prevScroll = 0;
34
+ }
35
+ handleScroll() {
36
+ if (!this.frameRequested) {
37
+ requestAnimationFrame(() => {
38
+ const { scrollY } = window;
39
+ this.hidden = scrollY > 60 && scrollY > this.prevScroll;
40
+ this.prevScroll = scrollY;
41
+ this.frameRequested = false;
42
+ });
43
+ this.frameRequested = true;
44
+ }
45
+ }
46
+ componentWillLoad() {
47
+ }
48
+ hostData() {
49
+ return {
50
+ class: { hidden: this.hidden },
51
+ };
52
+ }
53
+ openEnd() {
54
+ menuController.enable(true, 'students');
55
+ menuController.open('students');
56
+ }
57
+ async openOnlineStudentsSidebar() {
58
+ document.getElementById("#onlineStudents");
59
+ }
60
+ __stencil_render() {
61
+ return (h("header", null, h("a", { href: "/home" }, h("div", { class: "HeaderLogo" }, this.courseName)), h("header-mobile-collapse", null, h("div", { class: "SectionNav-tabs" }), h("nav", { class: "UtilNav" }, h("sparkle-button", { href: "/login", round: true }, "Login"), h("sparkle-button", { href: "/signup", primary: true, round: true }, "Get Started"), h("slot", { name: "logo" })))));
62
+ }
63
+ get el() { return getElement(this); }
64
+ render() { return h(Host, this.hostData(), this.__stencil_render()); }
65
+ };
66
+ SparkleFacilitatorHeader.style = facilitatorHeaderCss;
67
+
68
+ class StoreService {
69
+ constructor() { }
70
+ static getInstance() {
71
+ if (!StoreService.instance) {
72
+ StoreService.instance = new StoreService();
73
+ }
74
+ return StoreService.instance;
75
+ }
76
+ async UpdateTocPageInfo(pageInfo) {
77
+ TocStore.state.pageInfo = pageInfo;
78
+ }
79
+ }
80
+
81
+ const facilitatorPageCss = ".Error{align-items:center;background-color:var(--offset-background);color:var(--text-color--light);display:flex;flex-direction:column;justify-content:center;line-height:1;white-space:nowrap}.Error.full-screen{padding-bottom:3rem}.Error>*{margin:10px}.Error h1,.Error div{color:inherit;font-size:3rem}.Error div{text-shadow:3px 3px 3px rgba(0,0,0,0.1)}.Error p{font-size:18px}sparkle-facilitator-page{display:grid;font-size:16px;grid-template-columns:1fr;line-height:2;margin-top:var(--header-height);overflow-x:hidden;transform:var(--page-transform, none);transition:transform 200ms cubic-bezier(0.2, 1, 0.2, 1);--page-padding:2rem;padding:20px}@media (min-width: 1234px){sparkle-facilitator-page{grid-template-columns:1fr}}@media (min-width: 1800px){sparkle-facilitator-page{grid-template-columns:1fr}}sparkle-facilitator-page>main.column-1{position:relative;grid-column:1;margin-bottom:3rem;padding:var(--page-padding, 2rem 1rem);position:relative}sparkle-facilitator-page>main.column-2{position:relative;grid-column:1;margin-bottom:3rem;padding:var(--page-padding, 2rem 1rem);position:relative}sparkle-facilitator-page sparkle-pagination{grid-column:1 / -1;border:none;--page-padding:0rem 1rem}sparkle-facilitator-page .full-screen{grid-column:1 / -1;height:calc(100vh - var(--header-height));margin-bottom:0;overflow:hidden;padding:0}sparkle-facilitator-page sparkle-page-footer{margin-top:0rem}sparkle-facilitator-page .page-heading-encapsulation{text-transform:uppercase;background:transparent;color:#2d4665;border:1px solid #dee3ea;border-radius:14px;height:24px;padding:2px 8px;font-weight:600;font-size:10px;line-height:14px;display:inline-flex;align-items:center;align-self:center;justify-self:flex-end;letter-spacing:0.08em;float:right}sparkle-facilitator-page .page-heading-encapsulation:hover{border-color:#92a1b3}sparkle-facilitator-page h1{display:flex;justify-content:space-between;margin-top:2rem;margin-bottom:1rem}sparkle-facilitator-page h2 a[href^='#'],sparkle-facilitator-page h3 a[href^='#'],sparkle-facilitator-page h4 a[href^='#'],sparkle-facilitator-page h5 a[href^='#'],sparkle-facilitator-page h6 a[href^='#']{color:inherit;position:relative}sparkle-facilitator-page h2 a[href^='#']:before,sparkle-facilitator-page h3 a[href^='#']:before,sparkle-facilitator-page h4 a[href^='#']:before,sparkle-facilitator-page h5 a[href^='#']:before,sparkle-facilitator-page h6 a[href^='#']:before{content:'#';opacity:0;padding-right:5px;position:absolute;right:100%;transition:opacity 100ms ease}sparkle-facilitator-page h2 a[href^='#']:hover:before,sparkle-facilitator-page h3 a[href^='#']:hover:before,sparkle-facilitator-page h4 a[href^='#']:hover:before,sparkle-facilitator-page h5 a[href^='#']:hover:before,sparkle-facilitator-page h6 a[href^='#']:hover:before{opacity:1}sparkle-facilitator-page h2 code,sparkle-facilitator-page h3 code,sparkle-facilitator-page h4 code,sparkle-facilitator-page h5 code,sparkle-facilitator-page h6 code{background:none;font-size:inherit}sparkle-facilitator-page aside{float:right;margin-left:20px;margin-bottom:20px}@media (min-width: 1234px){sparkle-facilitator-page main.no-demo .page-meta{position:fixed;right:0;top:100px;width:240px;transition:0.2s transform ease}sparkle-header.hidden~stencil-route sparkle-facilitator-page main.no-demo .page-meta{transform:translateY(-60px)}}sparkle-facilitator-page main.has-demo .page-meta internal-ad{display:none}sparkle-facilitator-page .tab-content{padding:20px}";
82
+
83
+ const FacilitatorPage = class {
84
+ constructor(hostRef) {
85
+ registerInstance(this, hostRef);
86
+ this.pageDidLoad = createEvent(this, "pageDidLoad", 7);
87
+ this.isLesson = false;
88
+ this.notesPage = { title: null, path: null, body: null, pageInfo: null };
89
+ this.lessonNotesPage = { title: null, path: null, body: null, pageInfo: null };
90
+ this.page = { title: null, path: null, body: null, pageInfo: null };
91
+ this.onlineStudents = [];
92
+ this.activetab = "FACILITATOR_NOTES";
93
+ this.validateFetch = (response) => {
94
+ if (!response.ok) {
95
+ throw response;
96
+ }
97
+ return response.json();
98
+ };
99
+ this.handleNotesPage = (page) => {
100
+ this.badFetch = null;
101
+ this.notesPage = page;
102
+ this.pageDidLoad.emit({ pageInfo: this.notesPage.pageInfo });
103
+ };
104
+ this.handleLessonNotesPage = (page) => {
105
+ this.badFetchLessonNotes = null;
106
+ this.lessonNotesPage = page;
107
+ };
108
+ this.handleNewPage = (page) => {
109
+ this.page = page;
110
+ this.page = Object.assign(Object.assign({}, this.page), { nextUrl: "/presentation/teacher" + this.page.nextUrl, previousUrl: "/presentation/teacher" + this.page.previousUrl });
111
+ StoreService.getInstance().UpdateTocPageInfo(this.page.pageInfo);
112
+ };
113
+ this.handleBadFetch = (error) => {
114
+ this.badFetch = error;
115
+ this.notesPage = {
116
+ title: error.statusText,
117
+ body: null,
118
+ path: null,
119
+ pageInfo: null
120
+ };
121
+ };
122
+ this.handleLessonNotesBadFetch = (error) => {
123
+ this.badFetchLessonNotes = error;
124
+ this.lessonNotesPage = {
125
+ title: error.statusText,
126
+ body: null,
127
+ path: null,
128
+ pageInfo: null
129
+ };
130
+ };
131
+ }
132
+ async componentWillLoad() {
133
+ await this.fetchClasses();
134
+ return this.fetchNotesPage(this.notesPath) && this.fetchPage(this.path);
135
+ }
136
+ componentDidLoad() {
137
+ this.isLesson = TocStore.state.pageInfo.pageId > 0;
138
+ if (!this.isLesson) {
139
+ this.activetab = "ONLINE_STUDENTS";
140
+ }
141
+ }
142
+ async fetchClasses() {
143
+ await FacilitatorService.getInstance().fetchClasses();
144
+ }
145
+ fetchNotesPage(path, oldPath) {
146
+ if (path === null || path === oldPath) {
147
+ return;
148
+ }
149
+ path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
150
+ let lessonPath = this.getLessonPath(path);
151
+ console.log(lessonPath);
152
+ return fetch(path).then(this.validateFetch).then(this.handleNotesPage).catch(this.handleBadFetch) &&
153
+ fetch(lessonPath).then(this.validateFetch).then(this.handleLessonNotesPage).catch(this.handleLessonNotesBadFetch);
154
+ }
155
+ getLessonPath(path) {
156
+ let splittedPath = path.split("/");
157
+ splittedPath.pop();
158
+ return splittedPath.join("/") + "/lesson-notes.json";
159
+ }
160
+ fetchPage(path, oldPath) {
161
+ if (path === null || path === oldPath) {
162
+ return;
163
+ }
164
+ if (SignalRService.getInstance().connection.connectionState == "Connected") {
165
+ SignalRService.getInstance().callSignalR("NavigateFacilitatorPresentationCourseTo", { url: this.path.replace(".json", "") });
166
+ }
167
+ path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
168
+ return fetch(path).then(this.validateFetch).then(this.handleNewPage).catch(this.handleBadFetch);
169
+ }
170
+ disconnectedCallback() {
171
+ StoreService.getInstance().UpdateTocPageInfo(null);
172
+ }
173
+ setDocumentMeta(page) {
174
+ const { title, meta = {} } = page;
175
+ const metaEls = {
176
+ title: document.head.querySelectorAll('.meta-title'),
177
+ description: document.head.querySelectorAll('.meta-description'),
178
+ url: document.head.querySelectorAll('.meta-url, link[rel="canonical"]'),
179
+ image: document.head.querySelectorAll('.meta-image'),
180
+ };
181
+ const updateMeta = (els, update) => {
182
+ els.forEach((el) => {
183
+ ['href', 'content'].forEach(attr => {
184
+ if (el.hasAttribute(attr)) {
185
+ el.setAttribute(attr, update(el.getAttribute(attr)));
186
+ }
187
+ });
188
+ });
189
+ };
190
+ // Title
191
+ const getTitle = () => {
192
+ const suffix = /^\/docs\/pages.*$/.test(this.notesPath) ? 'Sparkle' : 'Sparkle';
193
+ // Favor meta title, else go with auto-title. fallback to generic title
194
+ return meta.title || title ? `${title} - ${suffix}` : suffix;
195
+ };
196
+ document.title = getTitle();
197
+ updateMeta(metaEls.title, getTitle);
198
+ // Canonical URL
199
+ updateMeta(metaEls.url, (oldVal) => {
200
+ const uri = '/docs/';
201
+ const path = location.pathname.split(uri)[1];
202
+ return oldVal.split(uri)[0] + uri + path;
203
+ });
204
+ // Description
205
+ updateMeta(metaEls.description, () => meta.description || 'Sparkle is the free open-source platform for creating learning content on web, mobile and desktop.');
206
+ // Sharing Image
207
+ updateMeta(metaEls.image, () => meta.image || 'https://girlsinclearning.com//images/logo-primary.png');
208
+ }
209
+ hostData() {
210
+ return {
211
+ class: {
212
+ [this.notesPage.pageClass]: typeof this.notesPage.pageClass === 'string',
213
+ },
214
+ };
215
+ }
216
+ renderNavigation() {
217
+ return (h("div", { class: "p-2 d-md-flex justify-content-md-center" }, h("div", { class: "btn-group btn-group-sm", role: "group", "aria-label": "Basic outlined example" }, h("button", { type: "button", class: "btn btn-outline-primary" }, "Prev"), h("input", { type: "text", class: "form-control", placeholder: "Input group example", "aria-label": "Input group example", "aria-describedby": "btnGroupAddon", value: this.path.replace("index", ""), readOnly: true }), h("button", { type: "button", class: "btn btn-outline-primary" }, "Next"))));
218
+ }
219
+ renderTabs() {
220
+ return (h("main", { class: 'no-demo' }, h("ul", { class: "nav nav-tabs" }, this.isLesson &&
221
+ h(Fragment, null, h("li", { class: "nav-item" }, h("a", { class: `nav-link ${this.activetab == "FACILITATOR_NOTES" ? 'active' : ''}`, href: "javascript:void(0)", onClick: () => this.activetab = "FACILITATOR_NOTES" }, "Facilitator Notes")), h("li", { class: "nav-item" }, h("a", { class: `nav-link ${this.activetab == "NOTES" ? 'active' : ''}`, href: "javascript:void(0)", onClick: () => this.activetab = "NOTES" }, "Notes")), h("li", { class: "nav-item" }, h("a", { class: `nav-link ${this.activetab == "LESSON_NOTES" ? 'active' : ''}`, href: "javascript:void(0)", onClick: () => this.activetab = "LESSON_NOTES" }, "Lesson Notes"))), h("li", { class: "nav-item" }, h("a", { class: `nav-link ${this.activetab == "ONLINE_STUDENTS" ? 'active' : ''}`, href: "javascript:void(0)", onClick: () => this.activetab = "ONLINE_STUDENTS" }, "Online Students")), h("li", { class: "nav-item" }, h("a", { class: `nav-link ${this.activetab == "DASHBOARD" ? 'active' : ''}`, href: "javascript:void(0)", onClick: () => this.activetab = "DASHBOARD" }, "Dashboard")), h("li", { class: "nav-item" }, h("a", { class: `nav-link ${this.activetab == "EXPORT" ? 'active' : ''}`, href: "javascript:void(0)", onClick: () => this.activetab = "EXPORT" }, "Export"))), h("div", { class: "tab-content" }, this.activetab == "FACILITATOR_NOTES" && this.renderFacilitatorNotes(), this.activetab == "NOTES" && h("sparkle-facilitator-notes", null), this.activetab == "LESSON_NOTES" && this.renderLessonNotes(), this.activetab == "ONLINE_STUDENTS" && h("sparkle-online-students", { path: this.path }), this.activetab == "DASHBOARD" && h("sparkle-facilitator-dashboard", null), this.activetab == "EXPORT" && h("sparkle-export-lessons", null))));
222
+ }
223
+ renderLessonNotes() {
224
+ const { lessonNotesPage } = this;
225
+ const Template = templates[lessonNotesPage.template] || templates.default;
226
+ if (this.badFetchLessonNotes) {
227
+ return templates.error(this.badFetch);
228
+ }
229
+ return h(Template, { page: lessonNotesPage });
230
+ }
231
+ renderFacilitatorNotes() {
232
+ const { notesPage } = this;
233
+ const Template = templates[notesPage.template] || templates.default;
234
+ if (this.badFetch) {
235
+ return templates.error(this.badFetch);
236
+ }
237
+ return h(Template, { page: notesPage });
238
+ }
239
+ __stencil_render() {
240
+ console.log(facilitatorStore.state.classes);
241
+ const { page } = this;
242
+ const content = this.renderTabs();
243
+ return h("div", { class: "container" }, h("div", { class: "d-flex justify-content-between align-items-center" }, h("sparkle-page-footer", { page: page }), h("div", null, h("select", { class: "form-select", "aria-label": "Default select example" }, facilitatorStore.state.classes.map(item => h("option", null, item.ClassName))))), content);
244
+ }
245
+ static get watchers() { return {
246
+ "notesPath": ["fetchNotesPage"],
247
+ "path": ["fetchPage"],
248
+ "page": ["setDocumentMeta"]
249
+ }; }
250
+ render() { return h(Host, this.hostData(), this.__stencil_render()); }
251
+ };
252
+ FacilitatorPage.style = facilitatorPageCss;
253
+
254
+ class AccountService {
255
+ constructor() { }
256
+ static getInstance() {
257
+ if (!AccountService.instance) {
258
+ AccountService.instance = new AccountService();
259
+ }
260
+ return AccountService.instance;
261
+ }
262
+ async register(registerInput) {
263
+ const headers = {
264
+ 'Content-Type': 'application/json',
265
+ };
266
+ AuthStore.state.loading = true;
267
+ let result;
268
+ try {
269
+ result = await HttpService.http.post('api/Account/Register', registerInput, {
270
+ headers: headers
271
+ });
272
+ if (result.Succeeded) {
273
+ AuthStore.state.loading = false;
274
+ }
275
+ }
276
+ catch (e) {
277
+ AuthStore.state.loading = false;
278
+ return e;
279
+ }
280
+ return result;
281
+ }
282
+ async forgotPassword(forgotPasswordInput) {
283
+ AuthStore.state.loading = true;
284
+ let result;
285
+ try {
286
+ result = await HttpService.http.post('api/Account/Forgot-Password', forgotPasswordInput);
287
+ if (result.Succeeded) {
288
+ AuthStore.state.loading = false;
289
+ }
290
+ }
291
+ catch (e) {
292
+ AuthStore.state.loading = false;
293
+ return e;
294
+ }
295
+ return result;
296
+ }
297
+ async resetPassword(resetPasswordInput) {
298
+ AuthStore.state.loading = true;
299
+ let result;
300
+ try {
301
+ result = await HttpService.http.post('api/Account/reset-password', resetPasswordInput);
302
+ if (result.Succeeded) {
303
+ AuthStore.state.loading = false;
304
+ }
305
+ }
306
+ catch (e) {
307
+ AuthStore.state.loading = false;
308
+ return e;
309
+ }
310
+ return result;
311
+ }
312
+ }
313
+
314
+ const sparkleForgotPasswordCss = "sparkle-forgot-password .list{margin-bottom:0}";
315
+
316
+ const SparkleForgotPassword = class {
317
+ constructor(hostRef) {
318
+ registerInstance(this, hostRef);
319
+ this.formControls = {
320
+ email: {
321
+ isValid: false,
322
+ value: '',
323
+ validate: value => {
324
+ if (value) {
325
+ return true;
326
+ }
327
+ else {
328
+ return false;
329
+ }
330
+ },
331
+ },
332
+ };
333
+ this.submitted = false;
334
+ }
335
+ changeFormValue(controlName, value) {
336
+ this.formControls = Object.assign(Object.assign({}, this.formControls), { [controlName]: Object.assign(Object.assign({}, this.formControls[controlName]), { value: value, isValid: this.formControls[controlName].validate(value) }) });
337
+ }
338
+ async handleSubmit(e) {
339
+ e.preventDefault();
340
+ this.submitted = true;
341
+ let isFormValid = true;
342
+ //Run all validation functions
343
+ for (let controlName in this.formControls) {
344
+ let control = this.formControls[controlName];
345
+ control.validate(control.value);
346
+ if (!control.isValid) {
347
+ isFormValid = false;
348
+ }
349
+ }
350
+ if (isFormValid) {
351
+ let result = await AccountService.getInstance().forgotPassword({
352
+ Email: this.formControls.email.value,
353
+ ClientURL: window.location.origin + "/reset-password"
354
+ });
355
+ if (result.Succeeded) {
356
+ this.history.replace('/login', {});
357
+ }
358
+ else if (result.Failed) {
359
+ if (result.Errors.length > 0) {
360
+ this.validationErrors = result.Errors;
361
+ }
362
+ }
363
+ }
364
+ }
365
+ render() {
366
+ return [
367
+ h("div", null, h("div", { class: "login-logo" }, h("img", { src: getAssetPath("/assets/img/G3-Girls.jpg"), alt: "Girls Inc" })), h("sparkle-validation-error", { errors: this.validationErrors }), h("form", { novalidate: "true", onSubmit: (e) => this.handleSubmit(e) }, h("ion-list", { "no-lines": true }, h("ion-item", { lines: "none" }, "Enter your email address and we will send you a link to reset your password."), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Email"), h("ion-input", { name: "email", type: "text", value: this.formControls.email.value, onInput: (ev) => this.changeFormValue("email", ev.target.value), spellcheck: false, autocapitalize: "off" })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.email.isValid || this.submitted === false, class: "ion-padding-left" }, "Email is required")), h("br", null), h("div", { class: "ion-padding" }, h("ion-button", { type: "submit", expand: "block", disabled: AuthStore.state.loading }, AuthStore.state.loading && h("ion-spinner", { name: "dots" }), " SEND PASSWORD RESET EMAIL")))))
368
+ ];
369
+ }
370
+ };
371
+ SparkleForgotPassword.style = sparkleForgotPasswordCss;
372
+
373
+ const sparkleGoalsCss = ":host{display:block}sparkle-dropdown a{color:var(--text-color);padding:1em;cursor:pointer}";
374
+
375
+ const SparkleGoals = class {
376
+ constructor(hostRef) {
377
+ registerInstance(this, hostRef);
378
+ }
379
+ async componentDidLoad() {
380
+ await AppDataService.getInstance().getAllGoals();
381
+ }
382
+ async presentAddGoalModal(appData) {
383
+ const modal = await modalController.create({
384
+ component: "sparkle-goal-form",
385
+ cssClass: "auto-height",
386
+ componentProps: { appData }
387
+ });
388
+ await modal.present();
389
+ }
390
+ render() {
391
+ return (h(Host, null, h("h2", null, "MY GOALS"), h("ion-item", { lines: "none" }, h("ion-button", { size: "default", color: "primary", slot: "end", onClick: () => this.presentAddGoalModal(null) }, h("ion-icon", { name: "add-outline" }), "Add")), h("div", { class: "ion-padding" }, h("sparkle-cards", null, goalStore.state.goals.map((goal) => h("div", { style: { "position": "relative" } }, h("sparkle-goal-item", { goal: goal.AppData, onEditGoal: () => this.presentAddGoalModal(goal) })))), !goalStore.state.goalsLoading && goalStore.state.goals.length == 0
392
+ && h("div", { class: "text-center" }, "No Goals"), goalStore.state.goalsLoading &&
393
+ h("div", { class: "text-center" }, h("ion-spinner", { name: "dots" })))));
394
+ }
395
+ };
396
+ SparkleGoals.style = sparkleGoalsCss;
397
+
398
+ const sparkleGwwCss = ":host{display:block}";
399
+
400
+ const SparkleGww = class {
401
+ constructor(hostRef) {
402
+ registerInstance(this, hostRef);
403
+ this.commentPosted = createEvent(this, "commentPosted", 7);
404
+ this.postComment = async (model) => {
405
+ const result = await FeedService.getInstance().createPostComment(model);
406
+ if (result.Succeeded) {
407
+ this.commentPosted.emit();
408
+ }
409
+ };
410
+ }
411
+ async componentDidLoad() {
412
+ await FeedService.getInstance().getAllPosts();
413
+ }
414
+ render() {
415
+ console.log(feedStore.state.postIdLoading, "Loading");
416
+ return (h(Host, null, feedStore.state.posts.map((item) => h("sparkle-gww-item", { key: item.Id, post: item, onPostComment: this.postComment, loading: feedStore.state.postIdLoading == item.Id }))));
417
+ }
418
+ };
419
+ SparkleGww.style = sparkleGwwCss;
420
+
421
+ const storage = window.localStorage;
422
+ function set(key, value) {
423
+ return new Promise((resolve, reject) => {
424
+ try {
425
+ storage && storage.setItem(key, JSON.stringify(value));
426
+ resolve();
427
+ }
428
+ catch (err) {
429
+ reject(`Couldnt store object ${err}`);
430
+ }
431
+ });
432
+ }
433
+ function get(key) {
434
+ try {
435
+ if (storage) {
436
+ const item = storage.getItem(key);
437
+ return JSON.parse(item);
438
+ }
439
+ }
440
+ catch (err) {
441
+ return null;
442
+ }
443
+ }
444
+
445
+ class SparkleGlobal {
446
+ }
447
+ SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE = "SPARKLE_CLASSROOM_MODE";
448
+
449
+ const headerCss = "sparkle-header{background-color:var(--background);box-shadow:0px 1px 3px rgba(2, 8, 20, 0.06), 0px 1px 2px rgba(2, 8, 20, 0.04);color:var(--text-color--light);display:block;font-size:14px;font-weight:500;line-height:1;position:fixed;top:0;left:0;transform:translateY(0);transition:transform 200ms ease;user-select:none;width:100%;white-space:nowrap;z-index:2}@media (min-width: 768px){.Layout:not(.is-menu-toggled) sparkle-header.hidden{transform:translateY(-100%)}}@media (max-width: 768px){.Layout.is-menu-toggled sparkle-header.hidden{transform:translateY(-100%)}}sparkle-header header{align-items:center;display:flex;height:var(--header-height);padding:0 1.4rem 0 0.8rem}sparkle-header a{color:inherit;font-weight:500;padding:10px 0}sparkle-header ion-icon{font-size:16px;color:#b2becd}sparkle-header .link-active{color:var(--ion-color-sparkle)}@media (hover: hover){sparkle-header a:not(.link-active):hover{color:var(--text-color)}}sparkle-header sparkle-menu-toggle{flex:none;margin-right:0.75em}sparkle-header .HeaderLogo{color:var(--text-color--dark);font-family:var(--heading-font-family);height:25px;margin-right:2em;display:flex;justify-content:center;align-items:center;font-size:1.5em}sparkle-header .SectionNav stencil-route{display:flex}sparkle-header .SectionNav .Dropdown{align-self:center;color:var(--text-color);margin-right:0.75em}sparkle-header .SectionNav .Dropdown-button{border:solid 1px #dee3ea;border-radius:6px;color:var(--text-color--dark);padding:10px;transition:border-color 100ms ease}sparkle-header .SectionNav .Dropdown.is-open .Dropdown-button{border-color:var(--line-rule-color)}sparkle-header .SectionNav .Dropdown-panel{min-width:180px}sparkle-header .SectionNav .Dropdown-panel a{display:flex;justify-content:space-between}sparkle-header .SectionNav .Dropdown-panel svg{height:1em;width:1em}sparkle-header .SectionNav .Dropdown-panel .Nav-link{margin-left:0;margin-right:0}sparkle-header .SectionNav-tabs>*{align-items:center;display:inline-flex;height:var(--header-height);margin-right:1em;padding:0px 1em;position:relative}sparkle-header .SectionNav-tabs .link-active:after{background-color:currentColor;bottom:0;content:'';display:block;height:2px;left:0;position:absolute;width:100%}sparkle-header .UtilNav{align-items:center;display:flex;font-size:12px;margin-left:auto}sparkle-header .UtilNav>*{margin-left:1em}sparkle-header .UtilNav .Dropdown.is-open{color:var(--text-color)}sparkle-header .UtilNav .Dropdown-button{padding:10px 0}@media (hover: hover){sparkle-header .UtilNav .Dropdown-button:hover{color:var(--text-color)}}sparkle-header .UtilNav .Dropdown-panel{font-size:14px}sparkle-header .class-room-toggle-container{display:flex;justify-content:start;align-items:center;padding-left:20px}sparkle-header .class-room-mode-toggle-title{padding-right:5px}sparkle-header .class-room-mode-toggle{align-items:center;display:flex;justify-content:center;width:90px;height:28px;background:var(--ion-color-sparkle-step-50);border-radius:18px}sparkle-header .class-room-mode-toggle button{background-color:transparent;border:none;border-radius:16px;color:#5b708b;cursor:pointer;font-family:var(--font-family);font-size:11px;letter-spacing:-0.02em;width:calc(50% - 2px);line-height:21px;padding-top:2px;transition:200ms background-color ease, 200ms color ease}sparkle-header .class-room-mode-toggle button:focus,sparkle-header .class-room-mode-toggle button:active{outline:none}sparkle-header .class-room-mode-toggle button.is-selected{background-color:var(--ion-color-sparkle);color:var(--ion-color-sparkle-contrast);font-weight:600;box-shadow:0px 2px 3px #a7b5c7}sparkle-header .girls-inc-logo{display:block;max-width:40px;max-height:40px;width:auto;height:auto}sparkle-header sparkle-dropdown.profile-dropdown .Dropdown-icon{height:30px;width:30px}sparkle-header sparkle-dropdown.profile-dropdown .Dropdown-arrow{height:30px}";
450
+
451
+ const SparkleHeader = class {
452
+ constructor(hostRef) {
453
+ registerInstance(this, hostRef);
454
+ this.classRoomModeChanged = createEvent(this, "classRoomModeChanged", 7);
455
+ this.hideClassRoomToggle = false;
456
+ this.courseName = '';
457
+ this.imageUrl = '';
458
+ this.classRoomMode = true;
459
+ this.hidden = false;
460
+ this.frameRequested = false;
461
+ this.prevScroll = 0;
462
+ }
463
+ handleScroll() {
464
+ if (!this.frameRequested) {
465
+ requestAnimationFrame(() => {
466
+ const { scrollY } = window;
467
+ this.hidden = scrollY > 60 && scrollY > this.prevScroll;
468
+ this.prevScroll = scrollY;
469
+ this.frameRequested = false;
470
+ });
471
+ this.frameRequested = true;
472
+ }
473
+ }
474
+ componentDidLoad() {
475
+ var _a;
476
+ this.classRoomMode = (_a = get(SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE)) !== null && _a !== void 0 ? _a : false;
477
+ }
478
+ hostData() {
479
+ return {
480
+ class: { hidden: this.hidden },
481
+ };
482
+ }
483
+ toggleClassRoomMode() {
484
+ this.classRoomMode = !this.classRoomMode;
485
+ set(SparkleGlobal.LOCALSTORAGE_CLASSROOM_MODE, this.classRoomMode);
486
+ this.classRoomModeChanged.emit(this.classRoomMode);
487
+ }
488
+ renderModeToggle() {
489
+ return (h("div", { class: "class-room-toggle-container" }, h("div", { class: "class-room-mode-toggle-title" }, "Classroom"), h("div", { class: "class-room-mode-toggle" }, h("button", { class: this.classRoomMode == true ? 'is-selected' : null, title: "Toggle classroom mode", onClick: () => this.toggleClassRoomMode() }, "On"), h("button", { class: this.classRoomMode == false ? 'is-selected' : null, title: "Toggle classroom mode", onClick: () => this.toggleClassRoomMode() }, "Off"))));
490
+ }
491
+ __stencil_render() {
492
+ return (h("header", null, h("sparkle-menu-toggle", { onClick: this.toggleClickFn }), h("a", { href: "/home" }, h("div", { class: "HeaderLogo" }, this.courseName)), h("header-mobile-collapse", null, h("div", { class: "SectionNav-tabs" }, h("stencil-route-link", { url: "/home" }, "Home")), h("nav", { class: "UtilNav" }, !this.authUser ? ([
493
+ h("sparkle-button", { href: "/login", round: true }, "Login"),
494
+ h("sparkle-button", { href: "/signup", primary: true, round: true }, "Get Started"),
495
+ ]) : (h("sparkle-dropdown", { image: this.imageUrl, align: "center", label: "Account", class: "label-sm-only profile-dropdown" }, h("section", null, h("stencil-route-link", { url: "/profile" }, "My Profile"), h("stencil-route-link", { url: "/enrollment" }, "My Enrollment"), h("a", { onClick: this.signoutClickFn }, "Sign Out")))), !this.hideClassRoomToggle && this.renderModeToggle(), h("slot", { name: "logo" })))));
496
+ }
497
+ render() { return h(Host, this.hostData(), this.__stencil_render()); }
498
+ };
499
+ SparkleHeader.style = headerCss;
500
+
501
+ const { state, reset } = createStore({
502
+ mediaUploading: false,
503
+ });
504
+ const mediaStore = { state, reset };
505
+
506
+ class MediaService {
507
+ constructor() { }
508
+ static getInstance() {
509
+ if (!MediaService.instance) {
510
+ MediaService.instance = new MediaService();
511
+ }
512
+ return MediaService.instance;
513
+ }
514
+ async uploadImage(files) {
515
+ let formData = new FormData();
516
+ for (let i = 0; i < files.length; i++) {
517
+ formData.append("uploads[]", files[i], files[i].name);
518
+ }
519
+ mediaStore.state.mediaUploading = true;
520
+ let result;
521
+ try {
522
+ result = await HttpService.http.post(`api/v1/MediaItems/Upload`, formData);
523
+ if (result) {
524
+ mediaStore.state.mediaUploading = false;
525
+ }
526
+ }
527
+ catch (e) {
528
+ mediaStore.state.mediaUploading = false;
529
+ }
530
+ return result;
531
+ }
532
+ }
533
+
534
+ const sparkleHealthCss = ":host{display:block}.health-image{display:block;max-width:300px;max-height:200px;width:auto;height:auto}";
535
+
536
+ const SparkleHealth = class {
537
+ constructor(hostRef) {
538
+ registerInstance(this, hostRef);
539
+ this.uploadedImageUrl = "";
540
+ this.heartRate = 0;
541
+ this.public = true;
542
+ this.submitted = false;
543
+ }
544
+ async postFeed() {
545
+ const sparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
546
+ const tocData = await AssetsService.getInstance().loadJsonFile(sparkleConfig.tocPath);
547
+ var model = {
548
+ PostText: MyHealthTemplate(this.heartRate),
549
+ ExternalResourceUrl: this.uploadedImageUrl,
550
+ IsPublic: this.public,
551
+ MiniAppId: SparkleGlobal$1.MY_HEALTH_APP_ID,
552
+ CourseId: tocData.id,
553
+ PostTextJSON: MyHealthTemplateJSON(this.heartRate)
554
+ };
555
+ const result = await FeedService.getInstance().createPost(model);
556
+ if (result.Succeeded) {
557
+ this.history.replace('/home');
558
+ }
559
+ }
560
+ async uploadImage(event) {
561
+ this.submitted = true;
562
+ console.log(event.target.files);
563
+ if (event.target.files && event.target.files[0]) {
564
+ const result = await MediaService.getInstance().uploadImage(event.target.files);
565
+ if (result.Succeeded && result.Data && result.Data.length > 0) {
566
+ this.uploadedImageUrl = result.Data[0].FullImageUrl;
567
+ console.log(this.uploadedImageUrl);
568
+ }
569
+ }
570
+ }
571
+ selectFile() {
572
+ this.el.querySelector("#fileInput").click();
573
+ }
574
+ render() {
575
+ return (h(Host, null, h("div", null, h("h3", null, "MY HEALTH"), h("p", null, "This mini-app will help girls develop and instil good physical health habits"), h("ion-list", null, h("ion-list-header", null, "Select Heart Rate"), h("ion-item", { lines: "none" }, h("ion-range", { min: 0, max: 150, step: 1, snaps: true, pin: true, onIonChange: (ev) => this.heartRate = +ev.detail.value }, h("ion-icon", { size: "small", slot: "start", name: "pulse" }), h("ion-icon", { name: "pulse", size: "small" }), h("div", { slot: "end" }, h("strong", null, this.heartRate)))), this.uploadedImageUrl && h("ion-item", { lines: "none" }, h("img", { class: "health-image", src: this.uploadedImageUrl })), h("ion-item", { lines: "none" }, h("input", { type: "file", id: "fileInput", onChange: (ev) => this.uploadImage(ev), style: { display: "none" }, accept: "image/*" }), h("div", null, h("ion-button", { onClick: () => this.selectFile(), disabled: mediaStore.state.mediaUploading }, mediaStore.state.mediaUploading && h("ion-spinner", { name: "dots" }), "Upload Image"))), h("ion-item", { lines: "none" }, h("ion-label", null, "Share to Community Wall"), h("ion-checkbox", { slot: "start", onChange: (ev) => this.public = ev.detail.checked, checked: true })), h("ion-item", { lines: "none" }, h("ion-button", { slot: "end", color: "primary", size: "default", onClick: () => this.postFeed(), disabled: mediaStore.state.mediaUploading || feedStore.state.createPostLoading }, feedStore.state.createPostLoading && h("ion-spinner", { name: "dots" }), " POST"))))));
576
+ }
577
+ get el() { return getElement(this); }
578
+ };
579
+ SparkleHealth.style = sparkleHealthCss;
580
+
581
+ const sparkleLoginCss = "sparkle-login .list{margin-bottom:0}";
582
+
583
+ const PageLogin = class {
584
+ constructor(hostRef) {
585
+ registerInstance(this, hostRef);
586
+ this.userDidLogIn = createEvent(this, "userDidLogIn", 7);
587
+ this.username = {
588
+ valid: false,
589
+ value: ''
590
+ };
591
+ this.password = {
592
+ valid: false,
593
+ value: ''
594
+ };
595
+ this.rememberMe = {
596
+ valid: true,
597
+ value: false
598
+ };
599
+ this.submitted = false;
600
+ }
601
+ handleUsername(ev) {
602
+ this.validateUsername();
603
+ this.username = Object.assign(Object.assign({}, this.username), { value: ev.target.value });
604
+ }
605
+ handlePassword(ev) {
606
+ this.validatePassword();
607
+ this.password.value = ev.target.value;
608
+ this.password = Object.assign(Object.assign({}, this.password), { value: ev.target.value });
609
+ }
610
+ handleRememberMe(ev) {
611
+ this.rememberMe = Object.assign(Object.assign({}, this.password), { value: ev.target.checked });
612
+ console.log(this.rememberMe.value);
613
+ }
614
+ validateUsername() {
615
+ if (this.username.value && this.username.value.length > 0) {
616
+ this.username = Object.assign(Object.assign({}, this.username), { valid: true });
617
+ return;
618
+ }
619
+ this.username = Object.assign(Object.assign({}, this.username), { valid: false });
620
+ }
621
+ validatePassword() {
622
+ if (this.password.value && this.password.value.length > 0) {
623
+ this.password.valid = true;
624
+ this.password = Object.assign(Object.assign({}, this.password), { valid: true });
625
+ return;
626
+ }
627
+ this.password = Object.assign(Object.assign({}, this.password), { valid: false });
628
+ }
629
+ async componentWillLoad() {
630
+ this.destroyListener = AuthStore.onChange('authUser', async (authUser) => {
631
+ this.notsignin = !authUser;
632
+ });
633
+ this.notsignin = !AuthStore.state.authUser;
634
+ }
635
+ disconnectedCallback() {
636
+ if (this.destroyListener) {
637
+ this.destroyListener();
638
+ }
639
+ }
640
+ async onLogin(e) {
641
+ e.preventDefault();
642
+ // const navCtrl: HTMLIonRouterElement = await (this.nav as any).componentOnReady();
643
+ this.validatePassword();
644
+ this.validateUsername();
645
+ this.submitted = true;
646
+ if (this.password.valid && this.username.valid) {
647
+ //await UserData.login(this.username.value);
648
+ await AuthService.getInstance().authenticate({
649
+ Email: this.username.value,
650
+ Password: this.password.value,
651
+ RememberClient: this.rememberMe.value
652
+ });
653
+ sessionStorage.setItem('rememberMe', this.rememberMe.value == true ? '1' : '0');
654
+ this.userDidLogIn.emit({ loginStatus: true });
655
+ }
656
+ }
657
+ async onSignup(e) {
658
+ e.preventDefault();
659
+ //const navCtrl: HTMLIonRouterElement = await (this.nav as any).componentOnReady();
660
+ //navCtrl.push('/signup');
661
+ }
662
+ renderLogin() {
663
+ return [
664
+ h("div", null, h("div", { class: "login-logo" }, h("img", { src: getAssetPath("/assets/img/G3-Girls.jpg"), alt: "Girls Inc" })), h("form", { novalidate: "true", onSubmit: (e) => this.onLogin(e) }, h("ion-list", { "no-lines": true }, h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Username"), h("ion-input", { name: "username", type: "text", value: this.username.value, onInput: (ev) => this.handleUsername(ev), spellcheck: false, autocapitalize: "off", required: true })), h("ion-text", { color: "danger" }, h("p", { hidden: this.username.valid || this.submitted === false, class: "ion-padding-left" }, "Username is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Password"), h("ion-input", { name: "password", type: "password", value: this.password.value, onInput: (ev) => this.handlePassword(ev), required: true })), h("ion-text", { color: "danger" }, h("p", { hidden: this.password.valid || this.submitted === false, class: "ion-padding-left" }, "Password is required")), h("ion-item", { lines: "none" }, h("ion-label", null, "Remember Me"), h("ion-checkbox", { slot: "start", checked: this.rememberMe.value, onIonChange: (e) => this.handleRememberMe(e) })), h("ion-item", { lines: "none" }, h("stencil-route-link", { slot: "end", url: "/forgot-password", exact: true }, "Forgot Password?"))), h("ion-row", null, h("ion-col", null, h("ion-button", { type: "submit", expand: "block", disabled: AuthStore.state.loading }, AuthStore.state.loading && h("ion-spinner", { name: "dots" }), " Log In"))), h("ion-item", { lines: "none" }, h("span", null, " Not registered yet? ", h("stencil-route-link", { url: "/signup", exact: true }, "Sign Up")))))
665
+ ];
666
+ }
667
+ render() {
668
+ if (!this.notsignin) {
669
+ return h("stencil-router-redirect", { url: "home" });
670
+ }
671
+ return this.renderLogin();
672
+ }
673
+ };
674
+ PageLogin.style = sparkleLoginCss;
675
+
676
+ const menuCss = "sparkle-menu{background-color:var(--background);border-right:solid 1px var(--line-rule-color);display:flex;flex-direction:column;height:100vh;left:0;position:fixed;top:0;transition:transform 200ms cubic-bezier(0.2, 1, 0.2, 1);transform:var(--menu-transform, none);width:var(--menu-width);z-index:1}sparkle-menu>header{align-items:center;border-bottom:solid 1px var(--line-rule-color);display:flex;flex:none;height:var(--header-height);padding:0 1.4rem 0 0.8rem;user-select:none}sparkle-menu sparkle-menu-toggle{margin-right:0.75em}sparkle-menu .MenuLogo{color:var(--text-color--dark);font-family:var(--heading-font-family);height:25px}sparkle-menu>.Menu{overflow-y:auto;-webkit-overflow-scrolling:touch}sparkle-menu nav{padding:2rem 1.5rem}.MenuControls{border-bottom:solid 1px var(--line-rule-color);box-shadow:0 5px 10px -10px rgba(0, 0, 0, 0.1);font-size:13px;padding:1em}.CourseSelect,.CourseSelect .Dropdown,.CourseSelect .Dropdown-button{width:100%}.CourseSelect-course{align-items:center;display:flex}.CourseSelect-icon{height:14px;width:14px;margin-right:0.5em}.CourseSelect .Select-option{padding-left:0.75em}";
677
+
678
+ const SparkleMenu = class {
679
+ constructor(hostRef) {
680
+ registerInstance(this, hostRef);
681
+ this.config = {
682
+ showRomanNumber: false,
683
+ showModuleIndex: true,
684
+ showSessionIndex: true
685
+ };
686
+ }
687
+ render() {
688
+ return [
689
+ h("header", null, h("sparkle-menu-toggle", { onClick: this.toggleClickFn }), h("stencil-route-link", { url: "/docs/" }, h("div", { class: "MenuLogo" }, this.toc.name))),
690
+ // <section class="MenuControls">
691
+ // <course-select />
692
+ // </section>,
693
+ h("stencil-route-switch", { scrollTopOffset: 0, class: "Menu" }, h("sparkle-nav", { toc: this.toc, config: this.config })),
694
+ ];
695
+ }
696
+ };
697
+ SparkleMenu.style = menuCss;
698
+
699
+ const sparkleMoodCss = ":host{display:block}.show{display:block}.hide{display:none}";
700
+
701
+ const SparkleMood = class {
702
+ constructor(hostRef) {
703
+ registerInstance(this, hostRef);
704
+ this.feelingItems = ["Anger", "Fear", "Disgust", "Happiness", "Sadness", "Suprise", "Neutral", "Anxiety", "Love", "Depression", "Contempt", "Pride", "Shame", "Envy"];
705
+ this.intensityItems = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10'];
706
+ this.locationItems = ["anger.jpg", "fear.jpg", "disgust.jpg", "happiness.jpg", "sadness.jpg", "neutral.jpg", "anxiety.jpg", "love.jpg", "depression.jpg", "contempt.jpg", "pride.jpg", "shame.jpg", "envy.jpg"];
707
+ this.feeling = this.feelingItems[0];
708
+ this.intensity = this.intensityItems[0];
709
+ this.location = this.locationItems[0];
710
+ this.public = true;
711
+ this.submitted = false;
712
+ this.currentStep = "FEELING";
713
+ }
714
+ back() {
715
+ if (this.currentStep == "LOCATION") {
716
+ this.currentStep = "INTENSITY";
717
+ }
718
+ else if (this.currentStep == "INTENSITY") {
719
+ this.currentStep = "FEELING";
720
+ }
721
+ }
722
+ async next() {
723
+ if (this.currentStep == "FEELING") {
724
+ this.currentStep = "INTENSITY";
725
+ }
726
+ else if (this.currentStep == "INTENSITY") {
727
+ this.currentStep = "LOCATION";
728
+ }
729
+ else if (this.currentStep == "LOCATION") {
730
+ const sparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
731
+ const tocData = await AssetsService.getInstance().loadJsonFile(sparkleConfig.tocPath);
732
+ var model = {
733
+ CourseId: tocData.id,
734
+ PostText: MyMoodTemplate(this.feeling, this.intensity, getAssetPath(`../assets/img/mood/` + this.location)),
735
+ PostTextJSON: MyMoodTemplateJSON(this.feeling, this.intensity, getAssetPath(`../assets/img/mood/` + this.location)),
736
+ ExternalResourceUrl: "",
737
+ IsPublic: this.public,
738
+ MiniAppId: SparkleGlobal$1.MY_MOOD_APP_ID,
739
+ };
740
+ const result = await FeedService.getInstance().createPost(model);
741
+ if (result.Succeeded) {
742
+ this.history.replace('/home');
743
+ }
744
+ }
745
+ }
746
+ render() {
747
+ const buttonLabel = this.currentStep == "LOCATION" ? "SUBMIT" : "NEXT";
748
+ return (h(Host, null, h("div", { class: `${this.currentStep == "FEELING" ? '' : 'hide'}` }, h("ion-list", null, h("ion-radio-group", { name: "feeling", value: this.feeling, onIonChange: (ev) => this.feeling = ev.detail.value }, h("ion-list-header", null, h("ion-label", null, "FEELING")), this.feelingItems.map((item) => h("ion-item", null, h("ion-label", null, item), h("ion-radio", { slot: "start", value: item })))))), h("div", { class: `${this.currentStep == "INTENSITY" ? '' : 'hide'}` }, h("ion-list", null, h("ion-radio-group", { name: "intesity", value: this.intensity, onIonChange: (ev) => this.intensity = ev.detail.value }, h("ion-list-header", null, h("ion-label", null, "INTENSITY")), this.intensityItems.map((item) => h("ion-item", null, h("ion-label", null, item), h("ion-radio", { slot: "start", value: item })))))), h("div", { class: `${this.currentStep == "LOCATION" ? '' : 'hide'}` }, h("ion-list", null, h("ion-radio-group", { name: "location", value: this.location, onIonChange: (ev) => this.location = ev.detail.value }, h("ion-list-header", null, h("ion-label", null, h("h3", null, "LOCATION"))), this.locationItems.map((item) => h("ion-item", null, h("ion-label", null, h("img", { src: getAssetPath(`../assets/img/mood/` + item) })), h("ion-radio", { slot: "start", value: item })))), h("ion-item", { lines: "none" }, h("ion-label", null, "Share to Community Wall"), h("ion-checkbox", { slot: "start", onChange: (ev) => this.public = ev.detail.checked, checked: true })))), h("ion-item", { lines: "none" }, this.currentStep != "FEELING" && h("ion-button", { size: "default", slot: "start", onClick: () => this.back() }, "BACK"), h("ion-button", { slot: "end", color: "primary", size: "default", onClick: () => this.next(), disabled: feedStore.state.createPostLoading }, feedStore.state.createPostLoading && h("ion-spinner", { name: "dots" }), buttonLabel))));
749
+ }
750
+ };
751
+ SparkleMood.style = sparkleMoodCss;
752
+
753
+ const pageCss = ".Error{align-items:center;background-color:var(--offset-background);color:var(--text-color--light);display:flex;flex-direction:column;justify-content:center;line-height:1;white-space:nowrap}.Error.full-screen{padding-bottom:3rem}.Error>*{margin:10px}.Error h1,.Error div{color:inherit;font-size:3rem}.Error div{text-shadow:3px 3px 3px rgba(0,0,0,0.1)}.Error p{font-size:18px}sparkle-page{display:grid;font-size:16px;grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr;line-height:2;margin-left:var(--page-margin-left);margin-top:var(--header-height);overflow-x:hidden;transform:var(--page-transform, none);transition:transform 200ms cubic-bezier(0.2, 1, 0.2, 1)}@media (min-width: 1234px){sparkle-page{grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 3fr}}@media (min-width: 1800px){sparkle-page{grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr 240px}}sparkle-page>main{position:relative;grid-column:2;margin-bottom:3rem;padding:var(--page-padding, 2rem 1rem);position:relative}sparkle-page sparkle-pagination{grid-column:1 / -1}sparkle-page .full-screen{grid-column:1 / -1;height:calc(100vh - var(--header-height));margin-bottom:0;overflow:hidden;padding:0}sparkle-page .page-heading-encapsulation{text-transform:uppercase;background:transparent;color:#2d4665;border:1px solid #dee3ea;border-radius:14px;height:24px;padding:2px 8px;font-weight:600;font-size:10px;line-height:14px;display:inline-flex;align-items:center;align-self:center;justify-self:flex-end;letter-spacing:0.08em;float:right}sparkle-page .page-heading-encapsulation:hover{border-color:#92a1b3}sparkle-page h1{display:flex;justify-content:space-between;margin-top:2rem;margin-bottom:1rem}sparkle-page h2 a[href^='#'],sparkle-page h3 a[href^='#'],sparkle-page h4 a[href^='#'],sparkle-page h5 a[href^='#'],sparkle-page h6 a[href^='#']{color:inherit;position:relative}sparkle-page h2 a[href^='#']:before,sparkle-page h3 a[href^='#']:before,sparkle-page h4 a[href^='#']:before,sparkle-page h5 a[href^='#']:before,sparkle-page h6 a[href^='#']:before{content:'#';opacity:0;padding-right:5px;position:absolute;right:100%;transition:opacity 100ms ease}sparkle-page h2 a[href^='#']:hover:before,sparkle-page h3 a[href^='#']:hover:before,sparkle-page h4 a[href^='#']:hover:before,sparkle-page h5 a[href^='#']:hover:before,sparkle-page h6 a[href^='#']:hover:before{opacity:1}sparkle-page h2 code,sparkle-page h3 code,sparkle-page h4 code,sparkle-page h5 code,sparkle-page h6 code{background:none;font-size:inherit}sparkle-page aside{float:right;margin-left:20px;margin-bottom:20px}@media (min-width: 1234px){sparkle-page main.no-demo .page-meta{position:fixed;right:0;top:100px;width:240px;transition:0.2s transform ease}sparkle-header.hidden~stencil-route sparkle-page main.no-demo .page-meta{transform:translateY(-60px)}}sparkle-page main.has-demo .page-meta internal-ad{display:none}sparkle-page .controls{display:flex;justify-content:flex-end}";
754
+
755
+ const SparklePage = class {
756
+ constructor(hostRef) {
757
+ registerInstance(this, hostRef);
758
+ this.pageDidLoad = createEvent(this, "pageDidLoad", 7);
759
+ this.presentation = false;
760
+ this.page = { title: null, path: null, body: null, pageInfo: null };
761
+ this.isLesson = false;
762
+ this.handleFacilitatorNavigationChange = (url) => {
763
+ this.history.replace(url, {});
764
+ };
765
+ this.validateFetch = (response) => {
766
+ if (!response.ok) {
767
+ throw response;
768
+ }
769
+ return response.json();
770
+ };
771
+ this.handleNewPage = (page) => {
772
+ this.badFetch = null;
773
+ this.page = page;
774
+ if (this.presentation) {
775
+ this.page = Object.assign(Object.assign({}, this.page), { previousUrl: "/presentation" + this.page.previousUrl, nextUrl: "/presentation" + this.page.nextUrl });
776
+ }
777
+ StoreService.getInstance().UpdateTocPageInfo(this.page.pageInfo);
778
+ this.isLesson = this.page.pageInfo.pageId > 0;
779
+ this.pageDidLoad.emit({ pageInfo: this.page.pageInfo });
780
+ };
781
+ this.handleBadFetch = (error) => {
782
+ this.badFetch = error;
783
+ this.page = {
784
+ title: error.statusText,
785
+ body: null,
786
+ path: null,
787
+ pageInfo: null
788
+ };
789
+ };
790
+ }
791
+ componentWillLoad() {
792
+ if (this.path) {
793
+ return this.fetchPage(this.path);
794
+ }
795
+ }
796
+ componentDidLoad() {
797
+ if (this.presentation) {
798
+ signalRStore.onChange("connected", (connected) => {
799
+ if (connected) {
800
+ SignalRService.getInstance().connection.on("NavigateFacilitatorPresentationCourseTo", this.handleFacilitatorNavigationChange);
801
+ }
802
+ });
803
+ }
804
+ }
805
+ fetchPage(path, oldPath) {
806
+ if (SignalRService.getInstance().connection.connectionState == "Connected") {
807
+ SignalRService.getInstance().callSignalR("OnStudentNavigate", { url: window.location.href });
808
+ if (this.presentation) {
809
+ console.log('register listener');
810
+ SignalRService.getInstance().connection.on("NavigateFacilitatorPresentationCourseTo", this.handleFacilitatorNavigationChange);
811
+ }
812
+ }
813
+ if (path === null || path === oldPath) {
814
+ return;
815
+ }
816
+ path = /^\/docs\/pages\/[a-z]{2}\.json$/.test(path) ? path.replace('.json', '/index.json') : path;
817
+ return fetch(path).then(this.validateFetch).then(this.handleNewPage).catch(this.handleBadFetch);
818
+ }
819
+ disconnectedCallback() {
820
+ StoreService.getInstance().UpdateTocPageInfo(null);
821
+ }
822
+ // @Watch('page')
823
+ // setScrollPosition() {
824
+ // const hash = this.history.location.hash;
825
+ // if (this.isServer || (hash !== undefined && hash !== '')) {
826
+ // return;
827
+ // }
828
+ // requestAnimationFrame(() => {
829
+ // const { location } = this.history;
830
+ // const { scrollPosition = [0, 0] } = location;
831
+ // const [x, y] = scrollPosition;
832
+ // document.documentElement.scrollTo(x, y);
833
+ // });
834
+ // }
835
+ setDocumentMeta(page) {
836
+ const { title, meta = {} } = page;
837
+ const metaEls = {
838
+ title: document.head.querySelectorAll('.meta-title'),
839
+ description: document.head.querySelectorAll('.meta-description'),
840
+ url: document.head.querySelectorAll('.meta-url, link[rel="canonical"]'),
841
+ image: document.head.querySelectorAll('.meta-image'),
842
+ };
843
+ const updateMeta = (els, update) => {
844
+ els.forEach((el) => {
845
+ ['href', 'content'].forEach(attr => {
846
+ if (el.hasAttribute(attr)) {
847
+ el.setAttribute(attr, update(el.getAttribute(attr)));
848
+ }
849
+ });
850
+ });
851
+ };
852
+ // Title
853
+ const getTitle = () => {
854
+ const suffix = /^\/docs\/pages\/appflow.*$/.test(this.path) ? 'Sparkle' : 'Sparkle';
855
+ // Favor meta title, else go with auto-title. fallback to generic title
856
+ return meta.title || title ? `${title} - ${suffix}` : suffix;
857
+ };
858
+ document.title = getTitle();
859
+ updateMeta(metaEls.title, getTitle);
860
+ // Canonical URL
861
+ updateMeta(metaEls.url, (oldVal) => {
862
+ const uri = '/docs/';
863
+ const path = location.pathname.split(uri)[1];
864
+ return oldVal.split(uri)[0] + uri + path;
865
+ });
866
+ // Description
867
+ updateMeta(metaEls.description, () => meta.description || 'Sparkle is the free open-source platform for creating learning content on web, mobile and desktop.');
868
+ // Sharing Image
869
+ updateMeta(metaEls.image, () => meta.image || 'https://girlsinclearning.com//images/logo-primary.png');
870
+ }
871
+ hostData() {
872
+ return {
873
+ class: {
874
+ [this.page.pageClass]: typeof this.page.pageClass === 'string',
875
+ },
876
+ };
877
+ }
878
+ async presentFeedbackModal() {
879
+ const modal = await modalController.create({
880
+ component: 'sparkle-feedback',
881
+ cssClass: 'sparkle-modal sparkle-feedback-modal'
882
+ });
883
+ await modal.present();
884
+ }
885
+ async openProjectorPage() {
886
+ if (userStore.state.user.FacilitatorClassList.length > 1) {
887
+ await this.presentAlertClasses();
888
+ }
889
+ else {
890
+ this.openWindows();
891
+ }
892
+ }
893
+ async presentAlertClasses() {
894
+ var inputs = [];
895
+ // var defaultCourseClassId = this.jwtService.getDefaultCourseClassId();
896
+ var classes = userStore.state.user.FacilitatorClassList;
897
+ classes.forEach((item, index) => inputs.push({
898
+ name: 'radio' + index,
899
+ type: 'radio',
900
+ label: item.CourseName,
901
+ value: item.CourseClassId,
902
+ //checked: defaultCourseClassId > 0 ? item.CourseClassId == defaultCourseClassId : index == 0
903
+ }));
904
+ const alert = await alertController.create({
905
+ header: 'Classes',
906
+ inputs: inputs,
907
+ buttons: [
908
+ {
909
+ text: 'Cancel',
910
+ role: 'cancel',
911
+ cssClass: 'secondary',
912
+ handler: () => {
913
+ }
914
+ }, {
915
+ text: 'Ok',
916
+ handler: (data) => {
917
+ }
918
+ }
919
+ ]
920
+ });
921
+ await alert.present();
922
+ }
923
+ openWindows() {
924
+ //this.jwtService.updateDefaultCourseClassId(data);
925
+ window.open(window.location.origin + "/presentation" + this.path.replace(".json", ""), "_blank");
926
+ setTimeout(() => {
927
+ window.open(window.location.origin + "/presentation" + '/teacher' + this.path.replace(".json", ""), "_blank");
928
+ }, 500);
929
+ }
930
+ renderControls() {
931
+ if (AuthStore.state.isAuthenticated) {
932
+ return (h("div", { class: "controls" }, h("ion-button", { onClick: () => this.presentFeedbackModal() }, h("ion-icon", { name: "chatbox-outline" })), this.isLesson && userStore.state.user && userStore.state.user.Roles.indexOf('Facilitator') > -1 && h("ion-button", { onClick: () => this.openProjectorPage() }, h("ion-icon", { name: "desktop-outline" }))));
933
+ }
934
+ return "";
935
+ }
936
+ __stencil_render() {
937
+ if (this.path) {
938
+ const { page } = this;
939
+ if (this.badFetch) {
940
+ return templates.error(this.badFetch);
941
+ }
942
+ const Template = templates[page.template] || templates.default;
943
+ const content = [
944
+ h("main", { class: 'no-demo' }, this.renderControls(), h(Template, { page: page }))
945
+ ];
946
+ return content;
947
+ }
948
+ else {
949
+ return h("main", { class: 'no-demo' }, h("slot", null));
950
+ }
951
+ }
952
+ static get watchers() { return {
953
+ "path": ["fetchPage"],
954
+ "page": ["setDocumentMeta"]
955
+ }; }
956
+ render() { return h(Host, this.hostData(), this.__stencil_render()); }
957
+ };
958
+ SparklePage.style = pageCss;
959
+
960
+ const sparkleResetPasswordCss = ":host{display:block}";
961
+
962
+ const SparkleResetPassword = class {
963
+ constructor(hostRef) {
964
+ registerInstance(this, hostRef);
965
+ this.formControls = {
966
+ password: {
967
+ isValid: false,
968
+ value: '',
969
+ validate: value => {
970
+ if (value) {
971
+ return true;
972
+ }
973
+ else {
974
+ return false;
975
+ }
976
+ },
977
+ },
978
+ confirmPassword: {
979
+ isValid: false,
980
+ value: '',
981
+ validate: value => {
982
+ if (value) {
983
+ return true;
984
+ }
985
+ else {
986
+ return false;
987
+ }
988
+ },
989
+ },
990
+ };
991
+ this.submitted = false;
992
+ }
993
+ componentDidLoad() {
994
+ console.log(this.history.location.query.code);
995
+ console.log(this.history.location.query.email);
996
+ }
997
+ changeFormValue(controlName, value) {
998
+ this.formControls = Object.assign(Object.assign({}, this.formControls), { [controlName]: Object.assign(Object.assign({}, this.formControls[controlName]), { value: value, isValid: this.formControls[controlName].validate(value) }) });
999
+ }
1000
+ async handleSubmit(e) {
1001
+ e.preventDefault();
1002
+ this.submitted = true;
1003
+ let isFormValid = true;
1004
+ //Run all validation functions
1005
+ for (let controlName in this.formControls) {
1006
+ let control = this.formControls[controlName];
1007
+ control.validate(control.value);
1008
+ if (!control.isValid) {
1009
+ isFormValid = false;
1010
+ }
1011
+ }
1012
+ if (isFormValid) {
1013
+ let result = await AccountService.getInstance().resetPassword({
1014
+ Email: this.history.location.query.email,
1015
+ Token: this.history.location.query.code,
1016
+ Password: this.formControls.password.value,
1017
+ ConfirmPassword: this.formControls.confirmPassword.value,
1018
+ });
1019
+ if (result.Succeeded) {
1020
+ this.history.replace('/login', {});
1021
+ }
1022
+ else if (result.Failed) {
1023
+ if (result.Errors.length > 0) {
1024
+ this.validationErrors = result.Errors;
1025
+ }
1026
+ }
1027
+ }
1028
+ }
1029
+ render() {
1030
+ return (h(Host, null, h("div", { class: "login-logo" }, h("img", { src: getAssetPath("/assets/img/G3-Girls.jpg"), alt: "Girls Inc" })), h("sparkle-validation-error", { errors: this.validationErrors }), h("form", { novalidate: "true", onSubmit: (e) => this.handleSubmit(e) }, h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Password"), h("ion-input", { name: "password", type: "password", value: this.formControls.password.value, onInput: (ev) => this.changeFormValue("password", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.password.isValid || this.submitted === false, class: "ion-padding-start" }, "Password is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Confirm Password"), h("ion-input", { name: "confirmPassword", type: "password", value: this.formControls.confirmPassword.value, onInput: (ev) => this.changeFormValue("confirmPassword", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.confirmPassword.isValid || this.submitted === false, class: "ion-padding-start" }, "Confirm Password is required")), h("br", null), h("div", { class: "ion-padding" }, h("ion-button", { type: "submit", expand: "block", disabled: AuthStore.state.loading }, AuthStore.state.loading && h("ion-spinner", { name: "dots" }), " Reset Password")))));
1031
+ }
1032
+ };
1033
+ SparkleResetPassword.style = sparkleResetPasswordCss;
1034
+
1035
+ const sparkleRootCss = ":root{--page-padding:2rem 0}sparkle-root{overflow-y:auto}.Layout{display:flex;overflow-x:hidden}.Layout>stencil-route,.Layout>stencil-route-switch{width:100%}.Layout.is-menu-toggled{--menu-transform:translateX(calc(-1 * var(--menu-width)));--page-margin-left:0}@media (max-width: 768px){.Layout{--menu-transform:translateX(calc(-1 * var(--menu-width)));--page-padding:1.5rem;--page-margin-left:0}.Layout.is-menu-toggled{--menu-transform:none;--page-transform:translateX(var(--menu-width))}.Layout.is-menu-toggled sparkle-page>*{opacity:0.2;pointer-events:none}body.scroll-lock{overflow-y:hidden}}#messagesList{display:grid;font-size:12px;font-weight:bold;grid-template-columns:1fr minmax(0, var(--page-width, 720px)) 1fr;line-height:2;margin-left:var(--page-margin-left);margin-top:var(--header-height);overflow-x:hidden;transform:var(--page-transform, none);margin-top:56px;padding:4px;background:#e50739;color:#fff}";
1036
+
1037
+ const SparkleRoot = class {
1038
+ constructor(hostRef) {
1039
+ registerInstance(this, hostRef);
1040
+ this.history = null;
1041
+ this.handleStudentNavigationChange = (url) => {
1042
+ this.history.replace(url, {});
1043
+ };
1044
+ }
1045
+ async componentWillLoad() {
1046
+ setupConfig({
1047
+ sparkle: Object.assign(Object.assign({}, this.config), { prod: true })
1048
+ });
1049
+ //return Promise.reject();
1050
+ await HttpService.getInstance();
1051
+ await HttpService.init();
1052
+ var sparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
1053
+ if (sparkleConfig && sparkleConfig.auth && sparkleConfig.auth.getToken()) {
1054
+ AuthStore.state.isAuthenticated = true;
1055
+ }
1056
+ AuthStore.onChange("isAuthenticated", async (isAuthenticated) => {
1057
+ if (isAuthenticated) {
1058
+ console.log('authenticated');
1059
+ await StudentService.getInstance().fetchUserConfiguration();
1060
+ }
1061
+ });
1062
+ if (AuthStore.state.isAuthenticated) {
1063
+ return await StudentService.getInstance().fetchUserConfiguration();
1064
+ }
1065
+ //SignalRAspNetCoreHelper.initSignalR();
1066
+ }
1067
+ componentDidLoad() {
1068
+ SignalRService.getInstance().connection.on("NavigateStudentTo", this.handleStudentNavigationChange);
1069
+ AuthStore.onChange("isAuthenticated", async (isAuthenticated) => {
1070
+ if (isAuthenticated) {
1071
+ SignalRService.getInstance().start();
1072
+ }
1073
+ });
1074
+ if (AuthStore.state.isAuthenticated) {
1075
+ SignalRService.getInstance().start();
1076
+ }
1077
+ }
1078
+ render() {
1079
+ return (h(Host, null, h("slot", null)));
1080
+ }
1081
+ };
1082
+ injectHistory(SparkleRoot);
1083
+ SparkleRoot.style = sparkleRootCss;
1084
+
1085
+ const sparkleSignupCss = "sparkle-signup .list{margin-bottom:0}";
1086
+
1087
+ const SparkleSignup = class {
1088
+ constructor(hostRef) {
1089
+ registerInstance(this, hostRef);
1090
+ this.formControls = {
1091
+ firstName: {
1092
+ isValid: false,
1093
+ value: '',
1094
+ validate: value => {
1095
+ if (value) {
1096
+ return true;
1097
+ }
1098
+ else {
1099
+ return false;
1100
+ }
1101
+ },
1102
+ },
1103
+ lastName: {
1104
+ isValid: false,
1105
+ value: '',
1106
+ validate: value => {
1107
+ if (value) {
1108
+ return true;
1109
+ }
1110
+ else {
1111
+ return false;
1112
+ }
1113
+ },
1114
+ },
1115
+ userName: {
1116
+ isValid: false,
1117
+ value: '',
1118
+ validate: value => {
1119
+ if (value) {
1120
+ return true;
1121
+ }
1122
+ else {
1123
+ return false;
1124
+ }
1125
+ },
1126
+ },
1127
+ email: {
1128
+ isValid: false,
1129
+ value: '',
1130
+ validate: value => {
1131
+ if (value) {
1132
+ return true;
1133
+ }
1134
+ else {
1135
+ return false;
1136
+ }
1137
+ },
1138
+ },
1139
+ password: {
1140
+ isValid: false,
1141
+ value: '',
1142
+ validate: value => {
1143
+ if (value) {
1144
+ return true;
1145
+ }
1146
+ else {
1147
+ return false;
1148
+ }
1149
+ },
1150
+ },
1151
+ confirmPassword: {
1152
+ isValid: false,
1153
+ value: '',
1154
+ validate: value => {
1155
+ if (value) {
1156
+ return true;
1157
+ }
1158
+ else {
1159
+ return false;
1160
+ }
1161
+ },
1162
+ },
1163
+ };
1164
+ this.submitted = false;
1165
+ }
1166
+ changeFormValue(controlName, value) {
1167
+ this.formControls = Object.assign(Object.assign({}, this.formControls), { [controlName]: Object.assign(Object.assign({}, this.formControls[controlName]), { value: value, isValid: this.formControls[controlName].validate(value) }) });
1168
+ }
1169
+ async handleSubmit(e) {
1170
+ e.preventDefault();
1171
+ this.submitted = true;
1172
+ let isFormValid = true;
1173
+ //Run all validation functions
1174
+ for (let controlName in this.formControls) {
1175
+ let control = this.formControls[controlName];
1176
+ control.validate(control.value);
1177
+ if (!control.isValid) {
1178
+ isFormValid = false;
1179
+ }
1180
+ }
1181
+ if (isFormValid) {
1182
+ let result = await AccountService.getInstance().register({
1183
+ Email: this.formControls.email.value,
1184
+ UserName: this.formControls.userName.value,
1185
+ FirstName: this.formControls.firstName.value,
1186
+ LastName: this.formControls.lastName.value,
1187
+ Password: this.formControls.password.value,
1188
+ ConfirmPassword: this.formControls.confirmPassword.value,
1189
+ });
1190
+ if (result.Succeeded) {
1191
+ this.history.replace('/login', {});
1192
+ }
1193
+ else if (result.Failed) {
1194
+ if (result.Errors.length > 0) {
1195
+ this.validationErrors = result.Errors;
1196
+ }
1197
+ }
1198
+ }
1199
+ }
1200
+ render() {
1201
+ return [
1202
+ h("div", null, h("div", { class: "signup-logo" }, h("img", { src: getAssetPath("/assets/img/G3-Girls.jpg"), alt: "Girls Inc" })), h("sparkle-validation-error", { errors: this.validationErrors }), h("form", { onSubmit: e => this.handleSubmit(e), novalidate: true }, h("ion-list", { "no-lines": true }, h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "First Name"), h("ion-input", { name: "firstName", type: "text", value: this.formControls.firstName.value, onInput: (ev) => this.changeFormValue("firstName", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.firstName.isValid || this.submitted === false, class: "ion-padding-start" }, "First Name is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Last Name"), h("ion-input", { name: "lastName", type: "text", value: this.formControls.lastName.value, onInput: (ev) => this.changeFormValue("lastName", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.lastName.isValid || this.submitted === false, class: "ion-padding-start" }, "Last Name is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Username"), h("ion-input", { name: "userName", type: "text", value: this.formControls.userName.value, onInput: (ev) => this.changeFormValue("userName", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.userName.isValid || this.submitted === false, class: "ion-padding-start" }, "Username is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Email"), h("ion-input", { name: "email", type: "text", value: this.formControls.email.value, onInput: (ev) => this.changeFormValue("email", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.email.isValid || this.submitted === false, class: "ion-padding-start" }, "Email is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Password"), h("ion-input", { name: "password", type: "password", value: this.formControls.password.value, onInput: (ev) => this.changeFormValue("password", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.password.isValid || this.submitted === false, class: "ion-padding-start" }, "Password is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Confirm Password"), h("ion-input", { name: "confirmPassword", type: "password", value: this.formControls.confirmPassword.value, onInput: (ev) => this.changeFormValue("confirmPassword", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.formControls.confirmPassword.isValid || this.submitted === false, class: "ion-padding-start" }, "Confirm Password is required"))), h("div", { class: "ion-padding" }, h("ion-button", { type: "submit", expand: "block", disabled: AuthStore.state.loading }, AuthStore.state.loading && h("ion-spinner", { name: "dots" }), "Register")), h("ion-item", { lines: "none" }, "Already have an account? \u00A0", h("stencil-route-link", { url: "/login", exact: true }, "Log In"))))
1203
+ ];
1204
+ }
1205
+ };
1206
+ SparkleSignup.style = sparkleSignupCss;
1207
+
1208
+ const sparkleUnauthorizedCss = ":host{display:block}.unauthorized{display:block;padding-left:var(--page-margin-left);padding-top:var(--header-height)}.content{text-align:center;padding-top:40px}";
1209
+
1210
+ const SparkleUnauthorized = class {
1211
+ constructor(hostRef) {
1212
+ registerInstance(this, hostRef);
1213
+ }
1214
+ render() {
1215
+ return (h(Host, { class: {
1216
+ 'unauthorized': true,
1217
+ } }, h("div", { class: "content" }, h("h1", null, "401"), h("p", null, "Unauthorized"))));
1218
+ }
1219
+ };
1220
+ SparkleUnauthorized.style = sparkleUnauthorizedCss;
1221
+
1222
+ const sparkleUserEnrollmentCss = ":host{display:block}";
1223
+
1224
+ const SparkleUserEnrollment = class {
1225
+ constructor(hostRef) {
1226
+ registerInstance(this, hostRef);
1227
+ this.enrollmentFormControls = {
1228
+ ShortCode: {
1229
+ isValid: false,
1230
+ value: '',
1231
+ validate: (value) => {
1232
+ if (value) {
1233
+ return true;
1234
+ }
1235
+ else {
1236
+ return false;
1237
+ }
1238
+ },
1239
+ },
1240
+ };
1241
+ this.enrollmentFormSubmitted = false;
1242
+ }
1243
+ changeEnrollmentFormValue(controlName, value) {
1244
+ this.enrollmentFormControls = Object.assign(Object.assign({}, this.enrollmentFormControls), { [controlName]: Object.assign(Object.assign({}, this.enrollmentFormControls[controlName]), { value: value, isValid: this.enrollmentFormControls[controlName].validate(value) }) });
1245
+ }
1246
+ async handleEnrollmentFormSubmit(e) {
1247
+ e.preventDefault();
1248
+ this.enrollmentFormSubmitted = true;
1249
+ let isFormValid = true;
1250
+ //Run all validation functions
1251
+ for (let controlName in this.enrollmentFormControls) {
1252
+ let control = this.enrollmentFormControls[controlName];
1253
+ control.validate(control.value);
1254
+ if (!control.isValid) {
1255
+ isFormValid = false;
1256
+ }
1257
+ }
1258
+ if (isFormValid) {
1259
+ let result = await StudentService.getInstance().enrollClass({
1260
+ ShortCode: this.enrollmentFormControls.ShortCode.value,
1261
+ });
1262
+ console.log(result);
1263
+ }
1264
+ }
1265
+ async leaveClass(enrollmentId) {
1266
+ let result = await StudentService.getInstance().leaveClass({
1267
+ Id: enrollmentId,
1268
+ });
1269
+ console.log(result);
1270
+ }
1271
+ renderEnrollmentList() {
1272
+ if (userStore.state.enrollmentList.length > 0) {
1273
+ return (userStore.state.enrollmentList.map((item) => h("ion-item", null, h("ion-label", null, item.Name), h("ion-button", { onClick: () => this.leaveClass(item.Id) }, h("ion-icon", { name: "trash" })))));
1274
+ }
1275
+ else {
1276
+ return (h("ion-item", { lines: "none" }, h("ion-text", { class: "ion-text-center" }, "No data found")));
1277
+ }
1278
+ }
1279
+ render() {
1280
+ return (h(Host, null, h("form", { onSubmit: e => this.handleEnrollmentFormSubmit(e), novalidate: true }, h("ion-list", { "no-lines": true }, h("ion-list-header", null, "Enrollment"), h("ion-grid", null, h("ion-row", { class: "ion-align-items-center" }, h("ion-col", { size: "9" }, h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Short Code"), h("ion-input", { name: "ShortCode", type: "text", value: this.enrollmentFormControls.ShortCode.value, onInput: (ev) => this.changeEnrollmentFormValue("ShortCode", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.enrollmentFormControls.ShortCode.isValid || this.enrollmentFormSubmitted === false, class: "ion-padding-start" }, "Short Code is required"))), h("ion-col", { size: "3" }, h("div", null, h("ion-button", { slot: "end", type: "submit", expand: "block" }, "Enroll"))))))), h("ion-list", null, h("ion-list-header", null, "Enroll List"), this.renderEnrollmentList())));
1281
+ }
1282
+ };
1283
+ SparkleUserEnrollment.style = sparkleUserEnrollmentCss;
1284
+
1285
+ const sparkleUserProfileCss = ":host{display:block}ion-card{box-shadow:0px 2px 2px rgba(0, 0, 0, 0.2);overflow:visible;margin:16px 0 24px;position:relative;padding-top:60px}ion-card .img-wrapper{background-color:#f5f5f5;border-radius:10px;position:absolute;left:50%;top:-30px;transform:translateX(-50%)}ion-card .img-wrapper img{border-radius:10px;width:80px;height:80px}ion-card .img-wrapper ion-button{--border-width:1px;--border-color:var(--ion-color-sparkle);--border-style:solid;--padding-start:0;--padding-end:0;--padding-bottom:0;--padding-top:0;--border-radius:50%;height:26px;width:26px;position:absolute;right:-10px;bottom:-10px}ion-card .img-wrapper ion-button ion-icon{width:14px;height:14px}ion-card .img-wrapper img.loading{opacity:0.1}.image-upload-loading{position:absolute;top:40%;left:35%}";
1286
+
1287
+ const SparkleUserProfile = class {
1288
+ constructor(hostRef) {
1289
+ registerInstance(this, hostRef);
1290
+ this.profileFormControls = {
1291
+ ProfileImage: {
1292
+ isValid: true,
1293
+ value: '',
1294
+ validate: (_) => {
1295
+ return true;
1296
+ },
1297
+ },
1298
+ FirstName: {
1299
+ isValid: false,
1300
+ value: '',
1301
+ validate: (value) => {
1302
+ if (value) {
1303
+ return true;
1304
+ }
1305
+ else {
1306
+ return false;
1307
+ }
1308
+ },
1309
+ },
1310
+ LastName: {
1311
+ isValid: false,
1312
+ value: '',
1313
+ validate: (value) => {
1314
+ if (value) {
1315
+ return true;
1316
+ }
1317
+ else {
1318
+ return false;
1319
+ }
1320
+ },
1321
+ },
1322
+ ProfileText: {
1323
+ isValid: true,
1324
+ value: '',
1325
+ validate: (value) => {
1326
+ if (value) {
1327
+ return true;
1328
+ }
1329
+ else {
1330
+ return false;
1331
+ }
1332
+ }
1333
+ }
1334
+ };
1335
+ this.profileFormSubmitted = false;
1336
+ }
1337
+ componentWillLoad() {
1338
+ if (userStore.state.user) {
1339
+ const user = userStore.state.user;
1340
+ this.changeFormValue("FirstName", user.FirstName);
1341
+ this.changeFormValue("LastName", user.LastName);
1342
+ this.changeFormValue("ProfileText", user.ProfileText);
1343
+ this.changeFormValue("ProfileImage", user.ProfileImage);
1344
+ }
1345
+ }
1346
+ changeFormValue(controlName, value) {
1347
+ this.profileFormControls = Object.assign(Object.assign({}, this.profileFormControls), { [controlName]: Object.assign(Object.assign({}, this.profileFormControls[controlName]), { value: value, isValid: this.profileFormControls[controlName].validate(value) }) });
1348
+ }
1349
+ async handleProfileFormSubmit(e) {
1350
+ e.preventDefault();
1351
+ await this.updateUser();
1352
+ }
1353
+ async updateUser() {
1354
+ this.profileFormSubmitted = true;
1355
+ let isFormValid = true;
1356
+ for (let controlName in this.profileFormControls) {
1357
+ let control = this.profileFormControls[controlName];
1358
+ control.validate(control.value);
1359
+ if (!control.isValid) {
1360
+ isFormValid = false;
1361
+ }
1362
+ }
1363
+ if (isFormValid) {
1364
+ await StudentService.getInstance().updateProfile({
1365
+ FirstName: this.profileFormControls.FirstName.value,
1366
+ LastName: this.profileFormControls.LastName.value,
1367
+ ProfileImage: this.profileFormControls.ProfileImage.value,
1368
+ ProfileText: this.profileFormControls.ProfileText.value
1369
+ });
1370
+ }
1371
+ }
1372
+ async uploadProfileImage(event) {
1373
+ if (event.target.files && event.target.files[0]) {
1374
+ const result = await MediaService.getInstance().uploadImage(event.target.files);
1375
+ if (result.Succeeded && result.Data && result.Data.length > 0) {
1376
+ this.changeFormValue("ProfileImage", result.Data[0].FullImageUrl);
1377
+ await this.updateUser();
1378
+ }
1379
+ }
1380
+ }
1381
+ selectFile() {
1382
+ this.el.querySelector("#fileInput").click();
1383
+ }
1384
+ render() {
1385
+ return (h(Host, null, h("ion-card", { color: "sparkle" }, h("div", { class: "img-wrapper" }, h("img", { class: mediaStore.state.mediaUploading ? "loading" : '', src: this.profileFormControls.ProfileImage.value || getAssetPath(`../assets/svg/profile.svg`) }), h("input", { type: "file", id: "fileInput", onChange: (ev) => this.uploadProfileImage(ev), style: { display: "none" }, accept: "image/*" }), h("ion-button", { color: "sparkle", onClick: () => this.selectFile(), disabled: mediaStore.state.mediaUploading }, h("ion-icon", { slot: "icon-only", name: "camera-outline" })), mediaStore.state.mediaUploading && h("ion-spinner", { class: "image-upload-loading", name: "dots" })), h("ion-card-content", { class: "ion-text-center" }, h("h2", null, this.profileFormControls.FirstName.value, " ", this.profileFormControls.LastName.value), h("h3", null, this.profileFormControls.ProfileText.value))), h("form", { onSubmit: e => this.handleProfileFormSubmit(e), novalidate: true }, h("ion-list", { "no-lines": true }, h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "First Name"), h("ion-input", { name: "firstName", type: "text", value: this.profileFormControls.FirstName.value, onInput: (ev) => this.changeFormValue("FirstName", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.profileFormControls.FirstName.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "First Name is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Last Name"), h("ion-input", { name: "lastName", type: "text", value: this.profileFormControls.LastName.value, onInput: (ev) => this.changeFormValue("LastName", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.profileFormControls.LastName.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "Last Name is required")), h("ion-item", null, h("ion-label", { position: "stacked", color: "primary" }, "Profile Bio"), h("ion-input", { name: "lastName", type: "text", value: this.profileFormControls.ProfileText.value, onInput: (ev) => this.changeFormValue("ProfileText", ev.target.value) })), h("ion-text", { color: "danger" }, h("p", { hidden: this.profileFormControls.ProfileText.isValid || this.profileFormSubmitted === false, class: "ion-padding-start" }, "Profile Bio is required"))), h("div", { class: "ion-padding" }, h("ion-button", { type: "submit", expand: "block", disabled: userStore.state.updateLoading }, userStore.state.updateLoading && h("ion-spinner", { name: "dots" }), " Update")))));
1386
+ }
1387
+ get el() { return getElement(this); }
1388
+ };
1389
+ SparkleUserProfile.style = sparkleUserProfileCss;
1390
+
1391
+ const routeCss = "stencil-route.inactive{display:none}";
1392
+
1393
+ const Route = class {
1394
+ constructor(hostRef) {
1395
+ registerInstance(this, hostRef);
1396
+ this.group = null;
1397
+ this.match = null;
1398
+ this.componentProps = {};
1399
+ this.exact = false;
1400
+ this.scrollOnNextRender = false;
1401
+ this.previousMatch = null;
1402
+ }
1403
+ // Identify if the current route is a match.
1404
+ computeMatch(newLocation) {
1405
+ const isGrouped = this.group != null || (this.el.parentElement != null && this.el.parentElement.tagName.toLowerCase() === 'stencil-route-switch');
1406
+ if (!newLocation || isGrouped) {
1407
+ return;
1408
+ }
1409
+ this.previousMatch = this.match;
1410
+ return this.match = matchPath(newLocation.pathname, {
1411
+ path: this.url,
1412
+ exact: this.exact,
1413
+ strict: true
1414
+ });
1415
+ }
1416
+ async loadCompleted() {
1417
+ let routeViewOptions = {};
1418
+ if (this.history && this.history.location.hash) {
1419
+ routeViewOptions = {
1420
+ scrollToId: this.history.location.hash.substr(1)
1421
+ };
1422
+ }
1423
+ else if (this.scrollTopOffset) {
1424
+ routeViewOptions = {
1425
+ scrollTopOffset: this.scrollTopOffset
1426
+ };
1427
+ }
1428
+ // After all children have completed then tell switch
1429
+ // the provided callback will get executed after this route is in view
1430
+ if (typeof this.componentUpdated === 'function') {
1431
+ this.componentUpdated(routeViewOptions);
1432
+ // If this is an independent route and it matches then routes have updated.
1433
+ // If the only change to location is a hash change then do not scroll.
1434
+ }
1435
+ else if (this.match && !matchesAreEqual(this.match, this.previousMatch) && this.routeViewsUpdated) {
1436
+ this.routeViewsUpdated(routeViewOptions);
1437
+ }
1438
+ }
1439
+ async componentDidUpdate() {
1440
+ await this.loadCompleted();
1441
+ }
1442
+ async componentDidLoad() {
1443
+ await this.loadCompleted();
1444
+ }
1445
+ render() {
1446
+ // If there is no activeRouter then do not render
1447
+ // Check if this route is in the matching URL (for example, a parent route)
1448
+ if (!this.match || !this.history) {
1449
+ return null;
1450
+ }
1451
+ // component props defined in route
1452
+ // the history api
1453
+ // current match data including params
1454
+ const childProps = Object.assign({}, this.componentProps, { history: this.history, match: this.match });
1455
+ // If there is a routerRender defined then use
1456
+ // that and pass the component and component props with it.
1457
+ if (this.routeRender) {
1458
+ return this.routeRender(Object.assign({}, childProps, { component: this.component }));
1459
+ }
1460
+ if (this.component) {
1461
+ const ChildComponent = this.component;
1462
+ return (h(ChildComponent, Object.assign({}, childProps)));
1463
+ }
1464
+ }
1465
+ get el() { return getElement(this); }
1466
+ static get watchers() { return {
1467
+ "location": ["computeMatch"]
1468
+ }; }
1469
+ };
1470
+ ActiveRouter.injectProps(Route, [
1471
+ 'location',
1472
+ 'history',
1473
+ 'historyType',
1474
+ 'routeViewsUpdated'
1475
+ ]);
1476
+ Route.style = routeCss;
1477
+
1478
+ const warning = (value, ...args) => {
1479
+ if (!value) {
1480
+ console.warn(...args);
1481
+ }
1482
+ };
1483
+
1484
+ // Adapted from the https://github.com/ReactTraining/history and converted to TypeScript
1485
+ const createTransitionManager = () => {
1486
+ let prompt;
1487
+ let listeners = [];
1488
+ const setPrompt = (nextPrompt) => {
1489
+ warning(prompt == null, 'A history supports only one prompt at a time');
1490
+ prompt = nextPrompt;
1491
+ return () => {
1492
+ if (prompt === nextPrompt) {
1493
+ prompt = null;
1494
+ }
1495
+ };
1496
+ };
1497
+ const confirmTransitionTo = (location, action, getUserConfirmation, callback) => {
1498
+ // TODO: If another transition starts while we're still confirming
1499
+ // the previous one, we may end up in a weird state. Figure out the
1500
+ // best way to handle this.
1501
+ if (prompt != null) {
1502
+ const result = typeof prompt === 'function' ? prompt(location, action) : prompt;
1503
+ if (typeof result === 'string') {
1504
+ if (typeof getUserConfirmation === 'function') {
1505
+ getUserConfirmation(result, callback);
1506
+ }
1507
+ else {
1508
+ warning(false, 'A history needs a getUserConfirmation function in order to use a prompt message');
1509
+ callback(true);
1510
+ }
1511
+ }
1512
+ else {
1513
+ // Return false from a transition hook to cancel the transition.
1514
+ callback(result !== false);
1515
+ }
1516
+ }
1517
+ else {
1518
+ callback(true);
1519
+ }
1520
+ };
1521
+ const appendListener = (fn) => {
1522
+ let isActive = true;
1523
+ const listener = (...args) => {
1524
+ if (isActive) {
1525
+ fn(...args);
1526
+ }
1527
+ };
1528
+ listeners.push(listener);
1529
+ return () => {
1530
+ isActive = false;
1531
+ listeners = listeners.filter(item => item !== listener);
1532
+ };
1533
+ };
1534
+ const notifyListeners = (...args) => {
1535
+ listeners.forEach(listener => listener(...args));
1536
+ };
1537
+ return {
1538
+ setPrompt,
1539
+ confirmTransitionTo,
1540
+ appendListener,
1541
+ notifyListeners
1542
+ };
1543
+ };
1544
+
1545
+ const createScrollHistory = (win, applicationScrollKey = 'scrollPositions') => {
1546
+ let scrollPositions = new Map();
1547
+ const set = (key, value) => {
1548
+ scrollPositions.set(key, value);
1549
+ if (storageAvailable(win, 'sessionStorage')) {
1550
+ const arrayData = [];
1551
+ scrollPositions.forEach((value, key) => {
1552
+ arrayData.push([key, value]);
1553
+ });
1554
+ win.sessionStorage.setItem('scrollPositions', JSON.stringify(arrayData));
1555
+ }
1556
+ };
1557
+ const get = (key) => {
1558
+ return scrollPositions.get(key);
1559
+ };
1560
+ const has = (key) => {
1561
+ return scrollPositions.has(key);
1562
+ };
1563
+ const capture = (key) => {
1564
+ set(key, [win.scrollX, win.scrollY]);
1565
+ };
1566
+ if (storageAvailable(win, 'sessionStorage')) {
1567
+ const scrollData = win.sessionStorage.getItem(applicationScrollKey);
1568
+ scrollPositions = scrollData ?
1569
+ new Map(JSON.parse(scrollData)) :
1570
+ scrollPositions;
1571
+ }
1572
+ if ('scrollRestoration' in win.history) {
1573
+ history.scrollRestoration = 'manual';
1574
+ }
1575
+ return {
1576
+ set,
1577
+ get,
1578
+ has,
1579
+ capture
1580
+ };
1581
+ };
1582
+
1583
+ // Adapted from the https://github.com/ReactTraining/history and converted to TypeScript
1584
+ const PopStateEvent = 'popstate';
1585
+ const HashChangeEvent$1 = 'hashchange';
1586
+ /**
1587
+ * Creates a history object that uses the HTML5 history API including
1588
+ * pushState, replaceState, and the popstate event.
1589
+ */
1590
+ const createBrowserHistory = (win, props = {}) => {
1591
+ let forceNextPop = false;
1592
+ const globalHistory = win.history;
1593
+ const globalLocation = win.location;
1594
+ const globalNavigator = win.navigator;
1595
+ const canUseHistory = supportsHistory(win);
1596
+ const needsHashChangeListener = !supportsPopStateOnHashChange(globalNavigator);
1597
+ const scrollHistory = createScrollHistory(win);
1598
+ const forceRefresh = (props.forceRefresh != null) ? props.forceRefresh : false;
1599
+ const getUserConfirmation = (props.getUserConfirmation != null) ? props.getUserConfirmation : getConfirmation;
1600
+ const keyLength = (props.keyLength != null) ? props.keyLength : 6;
1601
+ const basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
1602
+ const getHistoryState = () => {
1603
+ try {
1604
+ return win.history.state || {};
1605
+ }
1606
+ catch (e) {
1607
+ // IE 11 sometimes throws when accessing window.history.state
1608
+ // See https://github.com/ReactTraining/history/pull/289
1609
+ return {};
1610
+ }
1611
+ };
1612
+ const getDOMLocation = (historyState) => {
1613
+ historyState = historyState || {};
1614
+ const { key, state } = historyState;
1615
+ const { pathname, search, hash } = globalLocation;
1616
+ let path = pathname + search + hash;
1617
+ warning((!basename || hasBasename(path, basename)), 'You are attempting to use a basename on a page whose URL path does not begin ' +
1618
+ 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
1619
+ if (basename) {
1620
+ path = stripBasename(path, basename);
1621
+ }
1622
+ return createLocation(path, state, key || createKey(keyLength));
1623
+ };
1624
+ const transitionManager = createTransitionManager();
1625
+ const setState = (nextState) => {
1626
+ // Capture location for the view before changing history.
1627
+ scrollHistory.capture(history.location.key);
1628
+ Object.assign(history, nextState);
1629
+ // Set scroll position based on its previous storage value
1630
+ history.location.scrollPosition = scrollHistory.get(history.location.key);
1631
+ history.length = globalHistory.length;
1632
+ transitionManager.notifyListeners(history.location, history.action);
1633
+ };
1634
+ const handlePopState = (event) => {
1635
+ // Ignore extraneous popstate events in WebKit.
1636
+ if (!isExtraneousPopstateEvent(globalNavigator, event)) {
1637
+ handlePop(getDOMLocation(event.state));
1638
+ }
1639
+ };
1640
+ const handleHashChange = () => {
1641
+ handlePop(getDOMLocation(getHistoryState()));
1642
+ };
1643
+ const handlePop = (location) => {
1644
+ if (forceNextPop) {
1645
+ forceNextPop = false;
1646
+ setState();
1647
+ }
1648
+ else {
1649
+ const action = 'POP';
1650
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, (ok) => {
1651
+ if (ok) {
1652
+ setState({ action, location });
1653
+ }
1654
+ else {
1655
+ revertPop(location);
1656
+ }
1657
+ });
1658
+ }
1659
+ };
1660
+ const revertPop = (fromLocation) => {
1661
+ const toLocation = history.location;
1662
+ // TODO: We could probably make this more reliable by
1663
+ // keeping a list of keys we've seen in sessionStorage.
1664
+ // Instead, we just default to 0 for keys we don't know.
1665
+ let toIndex = allKeys.indexOf(toLocation.key);
1666
+ let fromIndex = allKeys.indexOf(fromLocation.key);
1667
+ if (toIndex === -1) {
1668
+ toIndex = 0;
1669
+ }
1670
+ if (fromIndex === -1) {
1671
+ fromIndex = 0;
1672
+ }
1673
+ const delta = toIndex - fromIndex;
1674
+ if (delta) {
1675
+ forceNextPop = true;
1676
+ go(delta);
1677
+ }
1678
+ };
1679
+ const initialLocation = getDOMLocation(getHistoryState());
1680
+ let allKeys = [initialLocation.key];
1681
+ let listenerCount = 0;
1682
+ let isBlocked = false;
1683
+ // Public interface
1684
+ const createHref = (location) => {
1685
+ return basename + createPath(location);
1686
+ };
1687
+ const push = (path, state) => {
1688
+ warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to push when the 1st ' +
1689
+ 'argument is a location-like object that already has state; it is ignored');
1690
+ const action = 'PUSH';
1691
+ const location = createLocation(path, state, createKey(keyLength), history.location);
1692
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, (ok) => {
1693
+ if (!ok) {
1694
+ return;
1695
+ }
1696
+ const href = createHref(location);
1697
+ const { key, state } = location;
1698
+ if (canUseHistory) {
1699
+ globalHistory.pushState({ key, state }, '', href);
1700
+ if (forceRefresh) {
1701
+ globalLocation.href = href;
1702
+ }
1703
+ else {
1704
+ const prevIndex = allKeys.indexOf(history.location.key);
1705
+ const nextKeys = allKeys.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
1706
+ nextKeys.push(location.key);
1707
+ allKeys = nextKeys;
1708
+ setState({ action, location });
1709
+ }
1710
+ }
1711
+ else {
1712
+ warning(state === undefined, 'Browser history cannot push state in browsers that do not support HTML5 history');
1713
+ globalLocation.href = href;
1714
+ }
1715
+ });
1716
+ };
1717
+ const replace = (path, state) => {
1718
+ warning(!(typeof path === 'object' && path.state !== undefined && state !== undefined), 'You should avoid providing a 2nd state argument to replace when the 1st ' +
1719
+ 'argument is a location-like object that already has state; it is ignored');
1720
+ const action = 'REPLACE';
1721
+ const location = createLocation(path, state, createKey(keyLength), history.location);
1722
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, (ok) => {
1723
+ if (!ok) {
1724
+ return;
1725
+ }
1726
+ const href = createHref(location);
1727
+ const { key, state } = location;
1728
+ if (canUseHistory) {
1729
+ globalHistory.replaceState({ key, state }, '', href);
1730
+ if (forceRefresh) {
1731
+ globalLocation.replace(href);
1732
+ }
1733
+ else {
1734
+ const prevIndex = allKeys.indexOf(history.location.key);
1735
+ if (prevIndex !== -1) {
1736
+ allKeys[prevIndex] = location.key;
1737
+ }
1738
+ setState({ action, location });
1739
+ }
1740
+ }
1741
+ else {
1742
+ warning(state === undefined, 'Browser history cannot replace state in browsers that do not support HTML5 history');
1743
+ globalLocation.replace(href);
1744
+ }
1745
+ });
1746
+ };
1747
+ const go = (n) => {
1748
+ globalHistory.go(n);
1749
+ };
1750
+ const goBack = () => go(-1);
1751
+ const goForward = () => go(1);
1752
+ const checkDOMListeners = (delta) => {
1753
+ listenerCount += delta;
1754
+ if (listenerCount === 1) {
1755
+ win.addEventListener(PopStateEvent, handlePopState);
1756
+ if (needsHashChangeListener) {
1757
+ win.addEventListener(HashChangeEvent$1, handleHashChange);
1758
+ }
1759
+ }
1760
+ else if (listenerCount === 0) {
1761
+ win.removeEventListener(PopStateEvent, handlePopState);
1762
+ if (needsHashChangeListener) {
1763
+ win.removeEventListener(HashChangeEvent$1, handleHashChange);
1764
+ }
1765
+ }
1766
+ };
1767
+ const block = (prompt = '') => {
1768
+ const unblock = transitionManager.setPrompt(prompt);
1769
+ if (!isBlocked) {
1770
+ checkDOMListeners(1);
1771
+ isBlocked = true;
1772
+ }
1773
+ return () => {
1774
+ if (isBlocked) {
1775
+ isBlocked = false;
1776
+ checkDOMListeners(-1);
1777
+ }
1778
+ return unblock();
1779
+ };
1780
+ };
1781
+ const listen = (listener) => {
1782
+ const unlisten = transitionManager.appendListener(listener);
1783
+ checkDOMListeners(1);
1784
+ return () => {
1785
+ checkDOMListeners(-1);
1786
+ unlisten();
1787
+ };
1788
+ };
1789
+ const history = {
1790
+ length: globalHistory.length,
1791
+ action: 'POP',
1792
+ location: initialLocation,
1793
+ createHref,
1794
+ push,
1795
+ replace,
1796
+ go,
1797
+ goBack,
1798
+ goForward,
1799
+ block,
1800
+ listen,
1801
+ win: win
1802
+ };
1803
+ return history;
1804
+ };
1805
+
1806
+ // Adapted from the https://github.com/ReactTraining/history and converted to TypeScript
1807
+ const HashChangeEvent = 'hashchange';
1808
+ const HashPathCoders = {
1809
+ hashbang: {
1810
+ encodePath: (path) => path.charAt(0) === '!' ? path : '!/' + stripLeadingSlash(path),
1811
+ decodePath: (path) => path.charAt(0) === '!' ? path.substr(1) : path
1812
+ },
1813
+ noslash: {
1814
+ encodePath: stripLeadingSlash,
1815
+ decodePath: addLeadingSlash
1816
+ },
1817
+ slash: {
1818
+ encodePath: addLeadingSlash,
1819
+ decodePath: addLeadingSlash
1820
+ }
1821
+ };
1822
+ const createHashHistory = (win, props = {}) => {
1823
+ let forceNextPop = false;
1824
+ let ignorePath = null;
1825
+ let listenerCount = 0;
1826
+ let isBlocked = false;
1827
+ const globalLocation = win.location;
1828
+ const globalHistory = win.history;
1829
+ const canGoWithoutReload = supportsGoWithoutReloadUsingHash(win.navigator);
1830
+ const keyLength = (props.keyLength != null) ? props.keyLength : 6;
1831
+ const { getUserConfirmation = getConfirmation, hashType = 'slash' } = props;
1832
+ const basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : '';
1833
+ const { encodePath, decodePath } = HashPathCoders[hashType];
1834
+ const getHashPath = () => {
1835
+ // We can't use window.location.hash here because it's not
1836
+ // consistent across browsers - Firefox will pre-decode it!
1837
+ const href = globalLocation.href;
1838
+ const hashIndex = href.indexOf('#');
1839
+ return hashIndex === -1 ? '' : href.substring(hashIndex + 1);
1840
+ };
1841
+ const pushHashPath = (path) => (globalLocation.hash = path);
1842
+ const replaceHashPath = (path) => {
1843
+ const hashIndex = globalLocation.href.indexOf('#');
1844
+ globalLocation.replace(globalLocation.href.slice(0, hashIndex >= 0 ? hashIndex : 0) + '#' + path);
1845
+ };
1846
+ const getDOMLocation = () => {
1847
+ let path = decodePath(getHashPath());
1848
+ warning((!basename || hasBasename(path, basename)), 'You are attempting to use a basename on a page whose URL path does not begin ' +
1849
+ 'with the basename. Expected path "' + path + '" to begin with "' + basename + '".');
1850
+ if (basename) {
1851
+ path = stripBasename(path, basename);
1852
+ }
1853
+ return createLocation(path, undefined, createKey(keyLength));
1854
+ };
1855
+ const transitionManager = createTransitionManager();
1856
+ const setState = (nextState) => {
1857
+ Object.assign(history, nextState);
1858
+ history.length = globalHistory.length;
1859
+ transitionManager.notifyListeners(history.location, history.action);
1860
+ };
1861
+ const handleHashChange = () => {
1862
+ const path = getHashPath();
1863
+ const encodedPath = encodePath(path);
1864
+ if (path !== encodedPath) {
1865
+ // Ensure we always have a properly-encoded hash.
1866
+ replaceHashPath(encodedPath);
1867
+ }
1868
+ else {
1869
+ const location = getDOMLocation();
1870
+ const prevLocation = history.location;
1871
+ if (!forceNextPop && locationsAreEqual(prevLocation, location)) {
1872
+ return; // A hashchange doesn't always == location change.
1873
+ }
1874
+ if (ignorePath === createPath(location)) {
1875
+ return; // Ignore this change; we already setState in push/replace.
1876
+ }
1877
+ ignorePath = null;
1878
+ handlePop(location);
1879
+ }
1880
+ };
1881
+ const handlePop = (location) => {
1882
+ if (forceNextPop) {
1883
+ forceNextPop = false;
1884
+ setState();
1885
+ }
1886
+ else {
1887
+ const action = 'POP';
1888
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, (ok) => {
1889
+ if (ok) {
1890
+ setState({ action, location });
1891
+ }
1892
+ else {
1893
+ revertPop(location);
1894
+ }
1895
+ });
1896
+ }
1897
+ };
1898
+ const revertPop = (fromLocation) => {
1899
+ const toLocation = history.location;
1900
+ // TODO: We could probably make this more reliable by
1901
+ // keeping a list of paths we've seen in sessionStorage.
1902
+ // Instead, we just default to 0 for paths we don't know.
1903
+ let toIndex = allPaths.lastIndexOf(createPath(toLocation));
1904
+ let fromIndex = allPaths.lastIndexOf(createPath(fromLocation));
1905
+ if (toIndex === -1) {
1906
+ toIndex = 0;
1907
+ }
1908
+ if (fromIndex === -1) {
1909
+ fromIndex = 0;
1910
+ }
1911
+ const delta = toIndex - fromIndex;
1912
+ if (delta) {
1913
+ forceNextPop = true;
1914
+ go(delta);
1915
+ }
1916
+ };
1917
+ // Ensure the hash is encoded properly before doing anything else.
1918
+ const path = getHashPath();
1919
+ const encodedPath = encodePath(path);
1920
+ if (path !== encodedPath) {
1921
+ replaceHashPath(encodedPath);
1922
+ }
1923
+ const initialLocation = getDOMLocation();
1924
+ let allPaths = [createPath(initialLocation)];
1925
+ // Public interface
1926
+ const createHref = (location) => ('#' + encodePath(basename + createPath(location)));
1927
+ const push = (path, state) => {
1928
+ warning(state === undefined, 'Hash history cannot push state; it is ignored');
1929
+ const action = 'PUSH';
1930
+ const location = createLocation(path, undefined, createKey(keyLength), history.location);
1931
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, (ok) => {
1932
+ if (!ok) {
1933
+ return;
1934
+ }
1935
+ const path = createPath(location);
1936
+ const encodedPath = encodePath(basename + path);
1937
+ const hashChanged = getHashPath() !== encodedPath;
1938
+ if (hashChanged) {
1939
+ // We cannot tell if a hashchange was caused by a PUSH, so we'd
1940
+ // rather setState here and ignore the hashchange. The caveat here
1941
+ // is that other hash histories in the page will consider it a POP.
1942
+ ignorePath = path;
1943
+ pushHashPath(encodedPath);
1944
+ const prevIndex = allPaths.lastIndexOf(createPath(history.location));
1945
+ const nextPaths = allPaths.slice(0, prevIndex === -1 ? 0 : prevIndex + 1);
1946
+ nextPaths.push(path);
1947
+ allPaths = nextPaths;
1948
+ setState({ action, location });
1949
+ }
1950
+ else {
1951
+ warning(false, 'Hash history cannot PUSH the same path; a new entry will not be added to the history stack');
1952
+ setState();
1953
+ }
1954
+ });
1955
+ };
1956
+ const replace = (path, state) => {
1957
+ warning(state === undefined, 'Hash history cannot replace state; it is ignored');
1958
+ const action = 'REPLACE';
1959
+ const location = createLocation(path, undefined, createKey(keyLength), history.location);
1960
+ transitionManager.confirmTransitionTo(location, action, getUserConfirmation, (ok) => {
1961
+ if (!ok) {
1962
+ return;
1963
+ }
1964
+ const path = createPath(location);
1965
+ const encodedPath = encodePath(basename + path);
1966
+ const hashChanged = getHashPath() !== encodedPath;
1967
+ if (hashChanged) {
1968
+ // We cannot tell if a hashchange was caused by a REPLACE, so we'd
1969
+ // rather setState here and ignore the hashchange. The caveat here
1970
+ // is that other hash histories in the page will consider it a POP.
1971
+ ignorePath = path;
1972
+ replaceHashPath(encodedPath);
1973
+ }
1974
+ const prevIndex = allPaths.indexOf(createPath(history.location));
1975
+ if (prevIndex !== -1) {
1976
+ allPaths[prevIndex] = path;
1977
+ }
1978
+ setState({ action, location });
1979
+ });
1980
+ };
1981
+ const go = (n) => {
1982
+ warning(canGoWithoutReload, 'Hash history go(n) causes a full page reload in this browser');
1983
+ globalHistory.go(n);
1984
+ };
1985
+ const goBack = () => go(-1);
1986
+ const goForward = () => go(1);
1987
+ const checkDOMListeners = (win, delta) => {
1988
+ listenerCount += delta;
1989
+ if (listenerCount === 1) {
1990
+ win.addEventListener(HashChangeEvent, handleHashChange);
1991
+ }
1992
+ else if (listenerCount === 0) {
1993
+ win.removeEventListener(HashChangeEvent, handleHashChange);
1994
+ }
1995
+ };
1996
+ const block = (prompt = '') => {
1997
+ const unblock = transitionManager.setPrompt(prompt);
1998
+ if (!isBlocked) {
1999
+ checkDOMListeners(win, 1);
2000
+ isBlocked = true;
2001
+ }
2002
+ return () => {
2003
+ if (isBlocked) {
2004
+ isBlocked = false;
2005
+ checkDOMListeners(win, -1);
2006
+ }
2007
+ return unblock();
2008
+ };
2009
+ };
2010
+ const listen = (listener) => {
2011
+ const unlisten = transitionManager.appendListener(listener);
2012
+ checkDOMListeners(win, 1);
2013
+ return () => {
2014
+ checkDOMListeners(win, -1);
2015
+ unlisten();
2016
+ };
2017
+ };
2018
+ const history = {
2019
+ length: globalHistory.length,
2020
+ action: 'POP',
2021
+ location: initialLocation,
2022
+ createHref,
2023
+ push,
2024
+ replace,
2025
+ go,
2026
+ goBack,
2027
+ goForward,
2028
+ block,
2029
+ listen,
2030
+ win: win
2031
+ };
2032
+ return history;
2033
+ };
2034
+
2035
+ const getLocation = (location, root) => {
2036
+ // Remove the root URL if found at beginning of string
2037
+ const pathname = location.pathname.indexOf(root) == 0 ?
2038
+ '/' + location.pathname.slice(root.length) :
2039
+ location.pathname;
2040
+ return Object.assign({}, location, { pathname });
2041
+ };
2042
+ const HISTORIES = {
2043
+ 'browser': createBrowserHistory,
2044
+ 'hash': createHashHistory
2045
+ };
2046
+ const Router = class {
2047
+ constructor(hostRef) {
2048
+ registerInstance(this, hostRef);
2049
+ this.root = '/';
2050
+ this.historyType = 'browser';
2051
+ // A suffix to append to the page title whenever
2052
+ // it's updated through RouteTitle
2053
+ this.titleSuffix = '';
2054
+ this.routeViewsUpdated = (options = {}) => {
2055
+ if (this.history && options.scrollToId && this.historyType === 'browser') {
2056
+ const elm = this.history.win.document.getElementById(options.scrollToId);
2057
+ if (elm) {
2058
+ return elm.scrollIntoView();
2059
+ }
2060
+ }
2061
+ this.scrollTo(options.scrollTopOffset || this.scrollTopOffset);
2062
+ };
2063
+ this.isServer = getContext(this, "isServer");
2064
+ this.queue = getContext(this, "queue");
2065
+ }
2066
+ componentWillLoad() {
2067
+ this.history = HISTORIES[this.historyType](this.el.ownerDocument.defaultView);
2068
+ this.history.listen((location) => {
2069
+ location = getLocation(location, this.root);
2070
+ this.location = location;
2071
+ });
2072
+ this.location = getLocation(this.history.location, this.root);
2073
+ }
2074
+ scrollTo(scrollToLocation) {
2075
+ const history = this.history;
2076
+ if (scrollToLocation == null || this.isServer || !history) {
2077
+ return;
2078
+ }
2079
+ if (history.action === 'POP' && Array.isArray(history.location.scrollPosition)) {
2080
+ return this.queue.write(() => {
2081
+ if (history && history.location && Array.isArray(history.location.scrollPosition)) {
2082
+ history.win.scrollTo(history.location.scrollPosition[0], history.location.scrollPosition[1]);
2083
+ }
2084
+ });
2085
+ }
2086
+ // okay, the frame has passed. Go ahead and render now
2087
+ return this.queue.write(() => {
2088
+ history.win.scrollTo(0, scrollToLocation);
2089
+ });
2090
+ }
2091
+ render() {
2092
+ if (!this.location || !this.history) {
2093
+ return;
2094
+ }
2095
+ const state = {
2096
+ historyType: this.historyType,
2097
+ location: this.location,
2098
+ titleSuffix: this.titleSuffix,
2099
+ root: this.root,
2100
+ history: this.history,
2101
+ routeViewsUpdated: this.routeViewsUpdated
2102
+ };
2103
+ return (h(ActiveRouter.Provider, { state: state }, h("slot", null)));
2104
+ }
2105
+ get el() { return getElement(this); }
2106
+ };
2107
+
2108
+ export { SparkleFacilitatorHeader as sparkle_facilitator_header, FacilitatorPage as sparkle_facilitator_page, SparkleForgotPassword as sparkle_forgot_password, SparkleGoals as sparkle_goals, SparkleGww as sparkle_gww, SparkleHeader as sparkle_header, SparkleHealth as sparkle_health, PageLogin as sparkle_login, SparkleMenu as sparkle_menu, SparkleMood as sparkle_mood, SparklePage as sparkle_page, SparkleResetPassword as sparkle_reset_password, SparkleRoot as sparkle_root, SparkleSignup as sparkle_signup, SparkleUnauthorized as sparkle_unauthorized, SparkleUserEnrollment as sparkle_user_enrollment, SparkleUserProfile as sparkle_user_profile, Route as stencil_route, Router as stencil_router };