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