@sparkle-learning/core 0.0.55 → 0.0.57

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 (1097) hide show
  1. package/dist/sparkle-core/PrivateRoute-a12e7ee5.js +37 -0
  2. package/dist/sparkle-core/account.service-e711795d.js +63 -0
  3. package/dist/sparkle-core/active-router-af86c9b4.js +73 -0
  4. package/dist/sparkle-core/animation-676a644d.js +984 -0
  5. package/dist/sparkle-core/app-globals-9ffa9ec3.js +10 -0
  6. package/dist/sparkle-core/appdata.service-703dff70.js +69 -0
  7. package/dist/sparkle-core/assets/user.png +0 -0
  8. package/dist/sparkle-core/assets.service-6508aae6.js +71 -0
  9. package/dist/sparkle-core/assignment.service-e42e9368.js +17 -0
  10. package/dist/sparkle-core/button-active-d68c5eb7.js +67 -0
  11. package/dist/sparkle-core/compass-svg.entry.js +128 -0
  12. package/dist/sparkle-core/context-consumer.entry.js +25 -0
  13. package/dist/sparkle-core/course-select.entry.js +26 -0
  14. package/dist/sparkle-core/css-shim-04165e59.js +4 -0
  15. package/dist/sparkle-core/dom-26e7cb2c.js +73 -0
  16. package/dist/sparkle-core/dom-utils-8e73e88b.js +55 -0
  17. package/dist/sparkle-core/facilitator.service-00a88935.js +79 -0
  18. package/dist/sparkle-core/facilitator.store-01be0386.js +18 -0
  19. package/dist/sparkle-core/feed.service-d495f3e1.js +53 -0
  20. package/dist/sparkle-core/framework-delegate-d3fa493f.js +107 -0
  21. package/dist/sparkle-core/haptic-a9e94599.js +124 -0
  22. package/dist/sparkle-core/header-mobile-collapse.entry.js +86 -0
  23. package/dist/sparkle-core/helpers-f11f0674.js +406 -0
  24. package/dist/sparkle-core/icons-758d1417.js +41 -0
  25. package/dist/sparkle-core/index-05b398c2.js +34 -0
  26. package/dist/sparkle-core/index-0af0deac.js +312 -0
  27. package/dist/sparkle-core/index-0df264ee.js +4518 -0
  28. package/dist/sparkle-core/index-183cda39.js +223 -0
  29. package/dist/sparkle-core/index-18a69883.js +1336 -0
  30. package/dist/sparkle-core/index-1d7a6fa0.js +269 -0
  31. package/dist/sparkle-core/index-1dec9544.js +3064 -0
  32. package/dist/sparkle-core/index-81dab78f.js +85 -0
  33. package/dist/sparkle-core/index-9b5bcea1.js +22 -0
  34. package/dist/sparkle-core/index-bb469fe3.js +128 -0
  35. package/dist/sparkle-core/index-d2990a48.js +184 -0
  36. package/dist/sparkle-core/index-dd414b33.js +653 -0
  37. package/dist/sparkle-core/index-faeec85a.js +8 -0
  38. package/dist/sparkle-core/index.es-1f6eedc5.js +11066 -0
  39. package/dist/sparkle-core/index.esm.js +19 -1
  40. package/dist/sparkle-core/input-shims-0b2f5522.js +418 -0
  41. package/dist/sparkle-core/ion-accordion-group.entry.js +201 -0
  42. package/dist/sparkle-core/ion-accordion.entry.js +332 -0
  43. package/dist/sparkle-core/ion-action-sheet.entry.js +263 -0
  44. package/dist/sparkle-core/ion-alert.entry.js +448 -0
  45. package/dist/sparkle-core/ion-app.entry.js +75 -0
  46. package/dist/sparkle-core/ion-avatar.entry.js +21 -0
  47. package/dist/sparkle-core/ion-back-button.entry.js +90 -0
  48. package/dist/sparkle-core/ion-backdrop.entry.js +63 -0
  49. package/dist/sparkle-core/ion-badge.entry.js +25 -0
  50. package/dist/sparkle-core/ion-breadcrumb.entry.js +91 -0
  51. package/dist/sparkle-core/ion-breadcrumbs.entry.js +129 -0
  52. package/dist/sparkle-core/ion-button.entry.js +125 -0
  53. package/dist/sparkle-core/ion-buttons.entry.js +38 -0
  54. package/dist/sparkle-core/ion-card-content.entry.js +26 -0
  55. package/dist/sparkle-core/ion-card-header.entry.js +33 -0
  56. package/dist/sparkle-core/ion-card-subtitle.entry.js +26 -0
  57. package/dist/sparkle-core/ion-card-title.entry.js +26 -0
  58. package/dist/sparkle-core/ion-card.entry.js +64 -0
  59. package/dist/sparkle-core/ion-checkbox.entry.js +109 -0
  60. package/dist/sparkle-core/ion-chip.entry.js +36 -0
  61. package/dist/sparkle-core/ion-col.entry.js +121 -0
  62. package/dist/sparkle-core/ion-content.entry.js +319 -0
  63. package/dist/sparkle-core/ion-datetime-button.entry.js +308 -0
  64. package/dist/sparkle-core/ion-datetime.entry.js +1619 -0
  65. package/dist/sparkle-core/ion-fab-button.entry.js +104 -0
  66. package/dist/sparkle-core/ion-fab-list.entry.js +41 -0
  67. package/dist/sparkle-core/ion-fab.entry.js +72 -0
  68. package/dist/sparkle-core/ion-footer.entry.js +116 -0
  69. package/dist/sparkle-core/ion-grid.entry.js +24 -0
  70. package/dist/sparkle-core/ion-header.entry.js +341 -0
  71. package/dist/sparkle-core/ion-icon.entry.js +200 -0
  72. package/dist/sparkle-core/ion-img.entry.js +97 -0
  73. package/dist/sparkle-core/ion-infinite-scroll-content.entry.js +33 -0
  74. package/dist/sparkle-core/ion-infinite-scroll.entry.js +202 -0
  75. package/dist/sparkle-core/ion-input.entry.js +293 -0
  76. package/dist/sparkle-core/ion-item-divider.entry.js +36 -0
  77. package/dist/sparkle-core/ion-item-group.entry.js +27 -0
  78. package/dist/sparkle-core/ion-item-option.entry.js +56 -0
  79. package/dist/sparkle-core/ion-item-options.entry.js +43 -0
  80. package/dist/sparkle-core/ion-item-sliding.entry.js +394 -0
  81. package/dist/sparkle-core/ion-item.entry.js +267 -0
  82. package/dist/sparkle-core/ion-label.entry.js +77 -0
  83. package/dist/sparkle-core/ion-list-header.entry.js +27 -0
  84. package/dist/sparkle-core/ion-list.entry.js +48 -0
  85. package/dist/sparkle-core/ion-loading.entry.js +211 -0
  86. package/dist/sparkle-core/ion-menu-button.entry.js +72 -0
  87. package/dist/sparkle-core/ion-menu-toggle.entry.js +43 -0
  88. package/dist/sparkle-core/ion-menu.entry.js +575 -0
  89. package/dist/sparkle-core/ion-modal.entry.js +1706 -0
  90. package/dist/sparkle-core/ion-nav-link.entry.js +43 -0
  91. package/dist/sparkle-core/ion-nav.entry.js +872 -0
  92. package/dist/sparkle-core/ion-note.entry.js +25 -0
  93. package/dist/sparkle-core/ion-picker-column-internal.entry.js +363 -0
  94. package/dist/sparkle-core/ion-picker-column.entry.js +327 -0
  95. package/dist/sparkle-core/ion-picker-internal.entry.js +454 -0
  96. package/dist/sparkle-core/ion-picker.entry.js +217 -0
  97. package/dist/sparkle-core/ion-popover.entry.js +1362 -0
  98. package/dist/sparkle-core/ion-progress-bar.entry.js +70 -0
  99. package/dist/sparkle-core/ion-radio-group.entry.js +121 -0
  100. package/dist/sparkle-core/ion-radio.entry.js +111 -0
  101. package/dist/sparkle-core/ion-range.entry.js +511 -0
  102. package/dist/sparkle-core/ion-refresher-content.entry.js +31 -0
  103. package/dist/sparkle-core/ion-refresher.entry.js +798 -0
  104. package/dist/sparkle-core/ion-reorder-group.entry.js +277 -0
  105. package/dist/sparkle-core/ion-reorder.entry.js +34 -0
  106. package/dist/sparkle-core/ion-ripple-effect.entry.js +89 -0
  107. package/dist/sparkle-core/ion-route-redirect.entry.js +20 -0
  108. package/dist/sparkle-core/ion-route.entry.js +45 -0
  109. package/dist/sparkle-core/ion-router-link.entry.js +34 -0
  110. package/dist/sparkle-core/ion-router-outlet.entry.js +196 -0
  111. package/dist/sparkle-core/ion-router.entry.js +827 -0
  112. package/dist/sparkle-core/ion-row.entry.js +16 -0
  113. package/dist/sparkle-core/ion-searchbar.entry.js +366 -0
  114. package/dist/sparkle-core/ion-segment-button.entry.js +98 -0
  115. package/dist/sparkle-core/ion-segment.entry.js +415 -0
  116. package/dist/sparkle-core/ion-select-option.entry.js +23 -0
  117. package/dist/sparkle-core/ion-select-popover.entry.js +96 -0
  118. package/dist/sparkle-core/ion-select.entry.js +510 -0
  119. package/dist/sparkle-core/ion-skeleton-text.entry.js +29 -0
  120. package/dist/sparkle-core/ion-slide.entry.js +21 -0
  121. package/dist/sparkle-core/ion-slides.entry.js +387 -0
  122. package/dist/sparkle-core/ion-spinner.entry.js +60 -0
  123. package/dist/sparkle-core/ion-split-pane.entry.js +156 -0
  124. package/dist/sparkle-core/ion-tab-bar.entry.js +71 -0
  125. package/dist/sparkle-core/ion-tab-button.entry.js +99 -0
  126. package/dist/sparkle-core/ion-tab.entry.js +63 -0
  127. package/dist/sparkle-core/ion-tabs.entry.js +150 -0
  128. package/dist/sparkle-core/ion-text.entry.js +20 -0
  129. package/dist/sparkle-core/ion-textarea.entry.js +244 -0
  130. package/dist/sparkle-core/ion-thumbnail.entry.js +16 -0
  131. package/dist/sparkle-core/ion-title.entry.js +48 -0
  132. package/dist/sparkle-core/ion-toast.entry.js +268 -0
  133. package/dist/sparkle-core/ion-toggle.entry.js +173 -0
  134. package/dist/sparkle-core/ion-toolbar.entry.js +70 -0
  135. package/dist/sparkle-core/ion-virtual-scroll.entry.js +551 -0
  136. package/dist/sparkle-core/ionic-global-127576f6.js +226 -0
  137. package/dist/sparkle-core/ios.transition-02531dda.js +479 -0
  138. package/dist/sparkle-core/location-utils-fea12957.js +229 -0
  139. package/dist/sparkle-core/match-path-760e1797.js +343 -0
  140. package/dist/sparkle-core/md.transition-f8765467.js +55 -0
  141. package/dist/sparkle-core/media.service-2609406e.js +36 -0
  142. package/dist/sparkle-core/menu-toggle-util-6cc13cbd.js +12 -0
  143. package/dist/sparkle-core/overlays-fd3cfa13.js +493 -0
  144. package/dist/sparkle-core/parse-60474840.js +1196 -0
  145. package/dist/sparkle-core/purify-d9093094.js +1469 -0
  146. package/dist/sparkle-core/quiz.model-1cff62e4.js +5 -0
  147. package/dist/sparkle-core/shadow-css-1257b266.js +387 -0
  148. package/dist/sparkle-core/signalR.service-2b7645c1.js +2983 -0
  149. package/dist/sparkle-core/sparkle-animation-player.entry.js +513 -0
  150. package/dist/sparkle-core/sparkle-assignment.entry.js +114 -0
  151. package/dist/sparkle-core/sparkle-button.entry.js +24 -0
  152. package/dist/sparkle-core/sparkle-card.entry.js +61 -0
  153. package/dist/sparkle-core/sparkle-cards.entry.js +15 -0
  154. package/dist/sparkle-core/sparkle-character-intro.entry.js +22 -0
  155. package/dist/sparkle-core/sparkle-code.entry.js +39 -0
  156. package/dist/sparkle-core/sparkle-compass-post.entry.js +129 -0
  157. package/dist/sparkle-core/sparkle-compass.entry.js +122 -0
  158. package/dist/sparkle-core/sparkle-core.css +2660 -1
  159. package/dist/sparkle-core/sparkle-core.esm.js +130 -1
  160. package/dist/sparkle-core/sparkle-course-root.entry.js +155 -0
  161. package/dist/sparkle-core/sparkle-discussion-questions.entry.js +122 -0
  162. package/dist/sparkle-core/sparkle-discussion-results.entry.js +189 -0
  163. package/dist/sparkle-core/sparkle-discussion.entry.js +52 -0
  164. package/dist/sparkle-core/sparkle-dropdown.entry.js +57 -0
  165. package/dist/sparkle-core/sparkle-emoji.entry.js +77 -0
  166. package/dist/sparkle-core/sparkle-export-lessons.entry.js +10081 -0
  167. package/dist/sparkle-core/sparkle-facilitator-dashboard.entry.js +93 -0
  168. package/dist/sparkle-core/sparkle-facilitator-header.entry.js +60 -0
  169. package/dist/sparkle-core/sparkle-facilitator-notes-form.entry.js +160 -0
  170. package/dist/sparkle-core/sparkle-facilitator-notes.entry.js +65 -0
  171. package/dist/sparkle-core/sparkle-facilitator-page.entry.js +198 -0
  172. package/dist/sparkle-core/sparkle-feed-post.entry.js +131 -0
  173. package/dist/sparkle-core/sparkle-feedback.entry.js +106 -0
  174. package/dist/sparkle-core/sparkle-file-upload.entry.js +57 -0
  175. package/dist/sparkle-core/sparkle-forgot-password.entry.js +80 -0
  176. package/dist/sparkle-core/sparkle-goal-form.entry.js +182 -0
  177. package/dist/sparkle-core/sparkle-goal-item.entry.js +15 -0
  178. package/dist/sparkle-core/sparkle-goal-progress.entry.js +15 -0
  179. package/dist/sparkle-core/sparkle-goals.entry.js +47 -0
  180. package/dist/sparkle-core/sparkle-gww-comment-list.entry.js +22 -0
  181. package/dist/sparkle-core/sparkle-gww-graph.entry.js +15 -0
  182. package/dist/sparkle-core/sparkle-gww-item.entry.js +80 -0
  183. package/dist/sparkle-core/sparkle-gww.entry.js +44 -0
  184. package/dist/sparkle-core/sparkle-header.entry.js +97 -0
  185. package/dist/sparkle-core/sparkle-health.entry.js +70 -0
  186. package/dist/sparkle-core/sparkle-input.entry.js +52 -0
  187. package/dist/sparkle-core/sparkle-intro.entry.js +22 -0
  188. package/dist/sparkle-core/sparkle-login.entry.js +116 -0
  189. package/dist/sparkle-core/sparkle-lower-content-nav.entry.js +18 -0
  190. package/dist/sparkle-core/sparkle-menu-collapsible.entry.js +42 -0
  191. package/dist/sparkle-core/sparkle-menu-toggle.entry.js +24 -0
  192. package/dist/sparkle-core/sparkle-menu.entry.js +26 -0
  193. package/dist/sparkle-core/sparkle-modal-image.entry.js +33 -0
  194. package/dist/sparkle-core/sparkle-mood.entry.js +76 -0
  195. package/dist/sparkle-core/sparkle-nav.entry.js +113 -0
  196. package/dist/sparkle-core/sparkle-notfound-page.entry.js +25 -0
  197. package/dist/sparkle-core/sparkle-online-students.entry.js +55 -0
  198. package/dist/sparkle-core/sparkle-overlay.entry.js +90 -0
  199. package/dist/sparkle-core/sparkle-page-footer.entry.js +24 -0
  200. package/dist/sparkle-core/sparkle-page.entry.js +245 -0
  201. package/dist/sparkle-core/sparkle-pagination.entry.js +67 -0
  202. package/dist/sparkle-core/sparkle-poll.entry.js +15 -0
  203. package/dist/sparkle-core/sparkle-quiz-container.entry.js +43 -0
  204. package/dist/sparkle-core/sparkle-quiz-feedback.entry.js +18 -0
  205. package/dist/sparkle-core/sparkle-quiz-input.entry.js +16 -0
  206. package/dist/sparkle-core/sparkle-quiz-old.entry.js +116 -0
  207. package/dist/sparkle-core/sparkle-quiz-opinion.entry.js +41 -0
  208. package/dist/sparkle-core/sparkle-quiz-poll.entry.js +16 -0
  209. package/dist/sparkle-core/sparkle-quiz-select.entry.js +29 -0
  210. package/dist/sparkle-core/sparkle-quiz.entry.js +98 -0
  211. package/dist/sparkle-core/sparkle-reset-password.entry.js +96 -0
  212. package/dist/sparkle-core/sparkle-root.entry.js +79 -0
  213. package/dist/sparkle-core/sparkle-select.entry.js +57 -0
  214. package/dist/sparkle-core/sparkle-sidebar.entry.js +39 -0
  215. package/dist/sparkle-core/sparkle-signup.entry.js +144 -0
  216. package/dist/sparkle-core/sparkle-tab.entry.js +22 -0
  217. package/dist/sparkle-core/sparkle-table-of-contents.entry.js +67 -0
  218. package/dist/sparkle-core/sparkle-tabs.entry.js +62 -0
  219. package/dist/sparkle-core/sparkle-unauthorized.entry.js +17 -0
  220. package/dist/sparkle-core/sparkle-user-enrollment.entry.js +85 -0
  221. package/dist/sparkle-core/sparkle-user-profile.entry.js +129 -0
  222. package/dist/sparkle-core/sparkle-validation-error.entry.js +17 -0
  223. package/dist/sparkle-core/sparkle-video-player.entry.js +18 -0
  224. package/dist/sparkle-core/sparkle-youtube.entry.js +35 -0
  225. package/dist/sparkle-core/status-tap-52feb1b1.js +40 -0
  226. package/dist/sparkle-core/stencil-async-content.entry.js +28 -0
  227. package/dist/sparkle-core/stencil-route-link.entry.js +74 -0
  228. package/dist/sparkle-core/stencil-route-switch.entry.js +100 -0
  229. package/dist/sparkle-core/stencil-route-title.entry.js +28 -0
  230. package/dist/sparkle-core/stencil-route.entry.js +93 -0
  231. package/dist/sparkle-core/stencil-router-prompt.entry.js +55 -0
  232. package/dist/sparkle-core/stencil-router-redirect.entry.js +28 -0
  233. package/dist/sparkle-core/stencil-router.entry.js +636 -0
  234. package/dist/sparkle-core/store.service-0f7d998b.js +16 -0
  235. package/dist/sparkle-core/student.service-f0375229.js +59 -0
  236. package/dist/sparkle-core/swipe-back-9a614189.js +73 -0
  237. package/dist/sparkle-core/swiper.bundle-4274e115.js +6418 -0
  238. package/dist/sparkle-core/user.store-3d052406.js +19 -0
  239. package/dist/sparkle-core/util-ba470e54.js +14683 -0
  240. package/dist/sparkle-core/utils-cae23bce.js +114 -0
  241. package/dist/types/components/sparkle-video-player/sparkle-video-player.d.ts +7 -0
  242. package/dist/types/components.d.ts +21 -0
  243. package/package.json +1 -1
  244. package/dist/cjs/PrivateRoute-f97245ce.js +0 -217
  245. package/dist/cjs/active-router-f9e18bd8.js +0 -75
  246. package/dist/cjs/animation-ee586546.js +0 -986
  247. package/dist/cjs/app-globals-33c9f31b.js +0 -9
  248. package/dist/cjs/appdata.service-c8d71e05.js +0 -73
  249. package/dist/cjs/assets.service-bfa75092.js +0 -50
  250. package/dist/cjs/assignment.service-690fb59c.js +0 -19
  251. package/dist/cjs/auth.store-1e630a7d.js +0 -3392
  252. package/dist/cjs/compass-svg.cjs.entry.js +0 -132
  253. package/dist/cjs/context-consumer.cjs.entry.js +0 -29
  254. package/dist/cjs/course-select.cjs.entry.js +0 -30
  255. package/dist/cjs/cubic-bezier-53d26d05.js +0 -93
  256. package/dist/cjs/dir-5af5259a.js +0 -20
  257. package/dist/cjs/environment-config.service-c8ff1f3d.js +0 -28
  258. package/dist/cjs/facilitator.service-ff0e1659.js +0 -95
  259. package/dist/cjs/feed.service-8eca4de6.js +0 -57
  260. package/dist/cjs/focus-visible-b0b07ba6.js +0 -76
  261. package/dist/cjs/framework-delegate-59a98abd.js +0 -111
  262. package/dist/cjs/gesture-controller-0eb5579e.js +0 -196
  263. package/dist/cjs/haptic-780f33c4.js +0 -116
  264. package/dist/cjs/hardware-back-button-92d97ff8.js +0 -76
  265. package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +0 -15124
  266. package/dist/cjs/helpers-c2496722.js +0 -425
  267. package/dist/cjs/httpService-d2e7bf8f.js +0 -687
  268. package/dist/cjs/icons-fda820af.js +0 -26
  269. package/dist/cjs/index-12082cba.js +0 -465
  270. package/dist/cjs/index-15ea05f5.js +0 -314
  271. package/dist/cjs/index-51e8292e.js +0 -1928
  272. package/dist/cjs/index-787d4498.js +0 -232
  273. package/dist/cjs/index-8b5629a6.js +0 -186
  274. package/dist/cjs/index-975586fd.js +0 -48
  275. package/dist/cjs/index-9c7b27e4.js +0 -140
  276. package/dist/cjs/index-af080b50.js +0 -139
  277. package/dist/cjs/index-e56e09b8.js +0 -38
  278. package/dist/cjs/index.cjs.js +0 -26
  279. package/dist/cjs/index.es-38cbcdbe.js +0 -10666
  280. package/dist/cjs/input-shims-eff63b88.js +0 -418
  281. package/dist/cjs/ion-accordion-group.cjs.entry.js +0 -205
  282. package/dist/cjs/ion-accordion.cjs.entry.js +0 -336
  283. package/dist/cjs/ion-action-sheet_7.cjs.entry.js +0 -2935
  284. package/dist/cjs/ion-app.cjs.entry.js +0 -79
  285. package/dist/cjs/ion-back-button.cjs.entry.js +0 -94
  286. package/dist/cjs/ion-backdrop.cjs.entry.js +0 -67
  287. package/dist/cjs/ion-badge.cjs.entry.js +0 -29
  288. package/dist/cjs/ion-breadcrumb.cjs.entry.js +0 -95
  289. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +0 -133
  290. package/dist/cjs/ion-buttons_3.cjs.entry.js +0 -153
  291. package/dist/cjs/ion-card-header.cjs.entry.js +0 -37
  292. package/dist/cjs/ion-card-subtitle.cjs.entry.js +0 -30
  293. package/dist/cjs/ion-card-title.cjs.entry.js +0 -30
  294. package/dist/cjs/ion-chip.cjs.entry.js +0 -40
  295. package/dist/cjs/ion-content_2.cjs.entry.js +0 -659
  296. package/dist/cjs/ion-datetime-button.cjs.entry.js +0 -312
  297. package/dist/cjs/ion-datetime.cjs.entry.js +0 -1623
  298. package/dist/cjs/ion-fab-button.cjs.entry.js +0 -108
  299. package/dist/cjs/ion-fab-list.cjs.entry.js +0 -45
  300. package/dist/cjs/ion-fab.cjs.entry.js +0 -76
  301. package/dist/cjs/ion-footer.cjs.entry.js +0 -120
  302. package/dist/cjs/ion-img.cjs.entry.js +0 -101
  303. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +0 -37
  304. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +0 -206
  305. package/dist/cjs/ion-item-divider.cjs.entry.js +0 -40
  306. package/dist/cjs/ion-item-group.cjs.entry.js +0 -31
  307. package/dist/cjs/ion-item-option.cjs.entry.js +0 -60
  308. package/dist/cjs/ion-item-options.cjs.entry.js +0 -47
  309. package/dist/cjs/ion-item-sliding.cjs.entry.js +0 -398
  310. package/dist/cjs/ion-loading.cjs.entry.js +0 -215
  311. package/dist/cjs/ion-menu-button.cjs.entry.js +0 -76
  312. package/dist/cjs/ion-menu-toggle.cjs.entry.js +0 -47
  313. package/dist/cjs/ion-menu.cjs.entry.js +0 -575
  314. package/dist/cjs/ion-modal.cjs.entry.js +0 -1711
  315. package/dist/cjs/ion-nav-link.cjs.entry.js +0 -47
  316. package/dist/cjs/ion-nav.cjs.entry.js +0 -872
  317. package/dist/cjs/ion-picker-column-internal_2.cjs.entry.js +0 -808
  318. package/dist/cjs/ion-picker-column.cjs.entry.js +0 -331
  319. package/dist/cjs/ion-picker.cjs.entry.js +0 -221
  320. package/dist/cjs/ion-progress-bar.cjs.entry.js +0 -74
  321. package/dist/cjs/ion-refresher-content.cjs.entry.js +0 -35
  322. package/dist/cjs/ion-refresher.cjs.entry.js +0 -802
  323. package/dist/cjs/ion-reorder-group.cjs.entry.js +0 -281
  324. package/dist/cjs/ion-reorder.cjs.entry.js +0 -38
  325. package/dist/cjs/ion-route-redirect.cjs.entry.js +0 -24
  326. package/dist/cjs/ion-route.cjs.entry.js +0 -49
  327. package/dist/cjs/ion-router-link.cjs.entry.js +0 -38
  328. package/dist/cjs/ion-router-outlet.cjs.entry.js +0 -200
  329. package/dist/cjs/ion-router.cjs.entry.js +0 -831
  330. package/dist/cjs/ion-searchbar.cjs.entry.js +0 -370
  331. package/dist/cjs/ion-segment-button.cjs.entry.js +0 -102
  332. package/dist/cjs/ion-segment.cjs.entry.js +0 -417
  333. package/dist/cjs/ion-skeleton-text.cjs.entry.js +0 -33
  334. package/dist/cjs/ion-slide.cjs.entry.js +0 -25
  335. package/dist/cjs/ion-slides.cjs.entry.js +0 -391
  336. package/dist/cjs/ion-split-pane.cjs.entry.js +0 -154
  337. package/dist/cjs/ion-tab-bar.cjs.entry.js +0 -75
  338. package/dist/cjs/ion-tab-button.cjs.entry.js +0 -103
  339. package/dist/cjs/ion-tab.cjs.entry.js +0 -59
  340. package/dist/cjs/ion-tabs.cjs.entry.js +0 -154
  341. package/dist/cjs/ion-thumbnail.cjs.entry.js +0 -20
  342. package/dist/cjs/ion-toast.cjs.entry.js +0 -272
  343. package/dist/cjs/ion-toggle.cjs.entry.js +0 -177
  344. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +0 -555
  345. package/dist/cjs/ionic-global-2cde9d3a.js +0 -231
  346. package/dist/cjs/ios.transition-da235483.js +0 -482
  347. package/dist/cjs/keyboard-91096619.js +0 -140
  348. package/dist/cjs/loader.cjs.js +0 -24
  349. package/dist/cjs/localstorage.service-6346a41d.js +0 -40
  350. package/dist/cjs/md.transition-be429e07.js +0 -57
  351. package/dist/cjs/media.service-8a1b9bc5.js +0 -40
  352. package/dist/cjs/menu-toggle-util-7a01448c.js +0 -14
  353. package/dist/cjs/overlays-32df265a.js +0 -507
  354. package/dist/cjs/parse-d0071120.js +0 -1237
  355. package/dist/cjs/purify-fb9c107e.js +0 -1468
  356. package/dist/cjs/signalR.service-bd6b42f9.js +0 -2985
  357. package/dist/cjs/sparkle-animation-player.cjs.entry.js +0 -515
  358. package/dist/cjs/sparkle-assignment.cjs.entry.js +0 -110
  359. package/dist/cjs/sparkle-character-intro.cjs.entry.js +0 -26
  360. package/dist/cjs/sparkle-code.cjs.entry.js +0 -43
  361. package/dist/cjs/sparkle-compass-post.cjs.entry.js +0 -133
  362. package/dist/cjs/sparkle-compass.cjs.entry.js +0 -126
  363. package/dist/cjs/sparkle-core.cjs.js +0 -22
  364. package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +0 -281
  365. package/dist/cjs/sparkle-discussion.cjs.entry.js +0 -42
  366. package/dist/cjs/sparkle-emoji.cjs.entry.js +0 -80
  367. package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +0 -121
  368. package/dist/cjs/sparkle-feed-post.cjs.entry.js +0 -116
  369. package/dist/cjs/sparkle-feedback.cjs.entry.js +0 -101
  370. package/dist/cjs/sparkle-file-upload.cjs.entry.js +0 -53
  371. package/dist/cjs/sparkle-goal-form.cjs.entry.js +0 -179
  372. package/dist/cjs/sparkle-gww-comment-list.cjs.entry.js +0 -26
  373. package/dist/cjs/sparkle-gww-graph.cjs.entry.js +0 -19
  374. package/dist/cjs/sparkle-input.cjs.entry.js +0 -56
  375. package/dist/cjs/sparkle-intro.cjs.entry.js +0 -26
  376. package/dist/cjs/sparkle-lower-content-nav.cjs.entry.js +0 -22
  377. package/dist/cjs/sparkle-menu-collapsible.cjs.entry.js +0 -46
  378. package/dist/cjs/sparkle-modal-image.cjs.entry.js +0 -34
  379. package/dist/cjs/sparkle-notfound-page.cjs.entry.js +0 -25
  380. package/dist/cjs/sparkle-overlay.cjs.entry.js +0 -92
  381. package/dist/cjs/sparkle-poll.cjs.entry.js +0 -19
  382. package/dist/cjs/sparkle-quiz-container.cjs.entry.js +0 -47
  383. package/dist/cjs/sparkle-quiz-feedback_5.cjs.entry.js +0 -117
  384. package/dist/cjs/sparkle-quiz-old.cjs.entry.js +0 -120
  385. package/dist/cjs/sparkle-quiz.cjs.entry.js +0 -103
  386. package/dist/cjs/sparkle-select.cjs.entry.js +0 -61
  387. package/dist/cjs/sparkle-sidebar.cjs.entry.js +0 -43
  388. package/dist/cjs/sparkle-tab.cjs.entry.js +0 -26
  389. package/dist/cjs/sparkle-table-of-contents.cjs.entry.js +0 -71
  390. package/dist/cjs/sparkle-tabs.cjs.entry.js +0 -66
  391. package/dist/cjs/sparkle-youtube.cjs.entry.js +0 -39
  392. package/dist/cjs/spinner-configs-0ac05f2d.js +0 -147
  393. package/dist/cjs/status-tap-033befa2.js +0 -42
  394. package/dist/cjs/stencil-async-content.cjs.entry.js +0 -32
  395. package/dist/cjs/stencil-route-title.cjs.entry.js +0 -32
  396. package/dist/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  397. package/dist/cjs/student.service-7e5385be.js +0 -78
  398. package/dist/cjs/swipe-back-4a826f9b.js +0 -76
  399. package/dist/cjs/swiper.bundle-8c897c07.js +0 -6420
  400. package/dist/cjs/theme-b0b295c1.js +0 -48
  401. package/dist/cjs/token.service-7a41953d.js +0 -97
  402. package/dist/cjs/util-47e320b2.js +0 -2462
  403. package/dist/collection/PrivateRoute.js +0 -27
  404. package/dist/collection/appconst.js +0 -13
  405. package/dist/collection/assets/img/forward.svg +0 -5
  406. package/dist/collection/assets/img/help/fitt-logo.svg +0 -1
  407. package/dist/collection/assets/img/home/big-white-wall.svg +0 -15
  408. package/dist/collection/assets/img/home/find-help.svg +0 -23
  409. package/dist/collection/assets/img/home/lessons.svg +0 -26
  410. package/dist/collection/assets/img/home/my-goals.svg +0 -19
  411. package/dist/collection/assets/img/home/my-health.svg +0 -17
  412. package/dist/collection/assets/img/home/my-mood.svg +0 -26
  413. package/dist/collection/assets/img/pause.svg +0 -5
  414. package/dist/collection/assets/img/play-symbol.svg +0 -8
  415. package/dist/collection/assets/img/play.svg +0 -4
  416. package/dist/collection/assets/img/rewind.svg +0 -5
  417. package/dist/collection/assets/lib/SignalRAspNetCoreHelper.js +0 -17
  418. package/dist/collection/assets/lib/sparkleUtility.js +0 -8
  419. package/dist/collection/assets/svg/profile.svg +0 -2
  420. package/dist/collection/collection-manifest.json +0 -218
  421. package/dist/collection/components/compass-svg/compass-svg.css +0 -15
  422. package/dist/collection/components/compass-svg/compass-svg.js +0 -156
  423. package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.css +0 -7
  424. package/dist/collection/components/layout/facilitator/export-lessons/export-lessons.js +0 -110
  425. package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.css +0 -3
  426. package/dist/collection/components/layout/facilitator/facilitator-dashboard/facilitator-dashboard.js +0 -214
  427. package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header-mobile-collapse/facilitator-header-mobile-collapse.js +0 -0
  428. package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header.css +0 -172
  429. package/dist/collection/components/layout/facilitator/facilitator-header/facilitator-header.js +0 -104
  430. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.css +0 -3
  431. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes-form/facilitator-notes-form.js +0 -144
  432. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.css +0 -14
  433. package/dist/collection/components/layout/facilitator/facilitator-notes/facilitator-notes.js +0 -64
  434. package/dist/collection/components/layout/facilitator/facilitator-page.css +0 -196
  435. package/dist/collection/components/layout/facilitator/facilitator-page.js +0 -281
  436. package/dist/collection/components/layout/facilitator/online-students/online-students.css +0 -0
  437. package/dist/collection/components/layout/facilitator/online-students/online-students.js +0 -70
  438. package/dist/collection/components/layout/page/page.css +0 -183
  439. package/dist/collection/components/layout/page/page.js +0 -321
  440. package/dist/collection/components/layout/page/templates/default.js +0 -9
  441. package/dist/collection/components/layout/page/templates/error.js +0 -33
  442. package/dist/collection/components/layout/page/templates/index.js +0 -8
  443. package/dist/collection/components/layout/page/templates/pdf.js +0 -8
  444. package/dist/collection/components/layout/page/to-hypertext.js +0 -27
  445. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.css +0 -3
  446. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-form/sparkle-goal-form.js +0 -252
  447. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.css +0 -12
  448. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-item/sparkle-goal-item.js +0 -59
  449. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.css +0 -33
  450. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goal-progress/sparkle-goal-progress.js +0 -37
  451. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.css +0 -8
  452. package/dist/collection/components/mini-apps/sparkle-goals/sparkle-goals.js +0 -40
  453. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.css +0 -7
  454. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-comment-list/sparkle-gww-comment-list.js +0 -52
  455. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-graph/sparkle-gww-graph.css +0 -3
  456. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-graph/sparkle-gww-graph.js +0 -14
  457. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.css +0 -30
  458. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww-item/sparkle-gww-item.js +0 -187
  459. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.css +0 -3
  460. package/dist/collection/components/mini-apps/sparkle-gww/sparkle-gww.js +0 -43
  461. package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.css +0 -10
  462. package/dist/collection/components/mini-apps/sparkle-health/sparkle-health.js +0 -111
  463. package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.css +0 -11
  464. package/dist/collection/components/mini-apps/sparkle-mood/sparkle-mood.js +0 -127
  465. package/dist/collection/components/modal-image/modal-image.css +0 -61
  466. package/dist/collection/components/modal-image/modal-image.js +0 -159
  467. package/dist/collection/components/sparkle-animation-player/assets/play-button-disabled-overlay.png +0 -0
  468. package/dist/collection/components/sparkle-animation-player/assets/play-button-overlay.png +0 -0
  469. package/dist/collection/components/sparkle-animation-player/caption-parser.js +0 -94
  470. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.css +0 -157
  471. package/dist/collection/components/sparkle-animation-player/sparkle-animation-player.js +0 -598
  472. package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +0 -30
  473. package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +0 -159
  474. package/dist/collection/components/sparkle-character-intro/assets/characters/character-img.jpg +0 -0
  475. package/dist/collection/components/sparkle-character-intro/assets/characters/jen.png +0 -0
  476. package/dist/collection/components/sparkle-character-intro/assets/characters/kimberly.png +0 -0
  477. package/dist/collection/components/sparkle-character-intro/assets/characters/valeria.png +0 -0
  478. package/dist/collection/components/sparkle-character-intro/assets/characters/yuna.png +0 -0
  479. package/dist/collection/components/sparkle-character-intro/assets/characters/zynab.png +0 -0
  480. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +0 -74
  481. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +0 -68
  482. package/dist/collection/components/sparkle-compass/sparkle-compass-post/sparkle-compass-post.css +0 -35
  483. package/dist/collection/components/sparkle-compass/sparkle-compass-post/sparkle-compass-post.js +0 -171
  484. package/dist/collection/components/sparkle-compass/sparkle-compass.css +0 -25
  485. package/dist/collection/components/sparkle-compass/sparkle-compass.js +0 -283
  486. package/dist/collection/components/sparkle-course-root/sparkle-course-root.css +0 -3
  487. package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +0 -196
  488. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.css +0 -157
  489. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +0 -232
  490. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.css +0 -158
  491. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +0 -274
  492. package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +0 -5
  493. package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +0 -112
  494. package/dist/collection/components/sparkle-emoji/sparkle-emoji.css +0 -16
  495. package/dist/collection/components/sparkle-emoji/sparkle-emoji.js +0 -116
  496. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.css +0 -35
  497. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +0 -193
  498. package/dist/collection/components/sparkle-feedback/sparkle-feedback.css +0 -3
  499. package/dist/collection/components/sparkle-feedback/sparkle-feedback.js +0 -118
  500. package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.css +0 -0
  501. package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.js +0 -105
  502. package/dist/collection/components/sparkle-forgot-password/sparkle-forgot-password.css +0 -4
  503. package/dist/collection/components/sparkle-forgot-password/sparkle-forgot-password.js +0 -107
  504. package/dist/collection/components/sparkle-input/sparkle-input.css +0 -0
  505. package/dist/collection/components/sparkle-input/sparkle-input.js +0 -212
  506. package/dist/collection/components/sparkle-intro/sparkle-intro.css +0 -15
  507. package/dist/collection/components/sparkle-intro/sparkle-intro.js +0 -35
  508. package/dist/collection/components/sparkle-login/sparkle-login.css +0 -4
  509. package/dist/collection/components/sparkle-login/sparkle-login.js +0 -173
  510. package/dist/collection/components/sparkle-poll/sparkle-poll.css +0 -3
  511. package/dist/collection/components/sparkle-poll/sparkle-poll.js +0 -15
  512. package/dist/collection/components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.css +0 -3
  513. package/dist/collection/components/sparkle-quiz/sparkle-quiz-feedback/sparkle-quiz-feedback.js +0 -69
  514. package/dist/collection/components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.css +0 -3
  515. package/dist/collection/components/sparkle-quiz/sparkle-quiz-input/sparkle-quiz-input.js +0 -59
  516. package/dist/collection/components/sparkle-quiz/sparkle-quiz-old/sparkle-quiz-old.css +0 -48
  517. package/dist/collection/components/sparkle-quiz/sparkle-quiz-old/sparkle-quiz-old.js +0 -327
  518. package/dist/collection/components/sparkle-quiz/sparkle-quiz-opinion/sparkle-quiz-opinion.css +0 -18
  519. package/dist/collection/components/sparkle-quiz/sparkle-quiz-opinion/sparkle-quiz-opinion.js +0 -106
  520. package/dist/collection/components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.css +0 -3
  521. package/dist/collection/components/sparkle-quiz/sparkle-quiz-poll/sparkle-quiz-poll.js +0 -59
  522. package/dist/collection/components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.css +0 -3
  523. package/dist/collection/components/sparkle-quiz/sparkle-quiz-select/sparkle-quiz-select.js +0 -100
  524. package/dist/collection/components/sparkle-quiz/sparkle-quiz.css +0 -48
  525. package/dist/collection/components/sparkle-quiz/sparkle-quiz.js +0 -221
  526. package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.css +0 -3
  527. package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +0 -98
  528. package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.css +0 -3
  529. package/dist/collection/components/sparkle-reset-password/sparkle-reset-password.js +0 -126
  530. package/dist/collection/components/sparkle-root/sparkle-root.css +0 -61
  531. package/dist/collection/components/sparkle-root/sparkle-root.js +0 -86
  532. package/dist/collection/components/sparkle-signup/sparkle-signup.css +0 -6
  533. package/dist/collection/components/sparkle-signup/sparkle-signup.js +0 -197
  534. package/dist/collection/components/sparkle-unauthorized/sparkle-unauthorized.css +0 -13
  535. package/dist/collection/components/sparkle-unauthorized/sparkle-unauthorized.js +0 -18
  536. package/dist/collection/components/sparkle-user-enrollment/sparkle-user-enrollment.css +0 -3
  537. package/dist/collection/components/sparkle-user-enrollment/sparkle-user-enrollment.js +0 -93
  538. package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.css +0 -54
  539. package/dist/collection/components/sparkle-user-profile/sparkle-user-profile.js +0 -151
  540. package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.css +0 -11
  541. package/dist/collection/components/sparkle-validation-error/sparkle-validation-error.js +0 -44
  542. package/dist/collection/components/sparkle-youtube/sparkle-youtube.css +0 -24
  543. package/dist/collection/components/sparkle-youtube/sparkle-youtube.js +0 -99
  544. package/dist/collection/global/app.js +0 -4
  545. package/dist/collection/helpers/utils.js +0 -3
  546. package/dist/collection/icons.js +0 -36
  547. package/dist/collection/index.js +0 -3
  548. package/dist/collection/l10n.js +0 -18
  549. package/dist/collection/models/api.model.js +0 -7
  550. package/dist/collection/models/assets.model.js +0 -1
  551. package/dist/collection/models/auth/auth.user.js +0 -1
  552. package/dist/collection/models/class.model.js +0 -5
  553. package/dist/collection/models/course.model.js +0 -10
  554. package/dist/collection/models/definitions.js +0 -1
  555. package/dist/collection/models/facilitator-dashboard.model.js +0 -5
  556. package/dist/collection/models/goal.model.js +0 -1
  557. package/dist/collection/models/index.js +0 -1
  558. package/dist/collection/models/markdown.model.js +0 -1
  559. package/dist/collection/models/page.model.js +0 -1
  560. package/dist/collection/models/quiz.model.js +0 -3
  561. package/dist/collection/models/user.model.js +0 -1
  562. package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1_part1.js +0 -2727
  563. package/dist/collection/pages/course/welcome-to-mind-body/introduction/animation/m4l1p1_part2.js +0 -2042
  564. package/dist/collection/services/account.service.js +0 -61
  565. package/dist/collection/services/appdata.service.js +0 -60
  566. package/dist/collection/services/assignment.service.js +0 -14
  567. package/dist/collection/services/auth/auth.service.js +0 -64
  568. package/dist/collection/services/core/assets.service.js +0 -45
  569. package/dist/collection/services/core/localstorage.service.js +0 -34
  570. package/dist/collection/services/environment/environment-config.js +0 -24
  571. package/dist/collection/services/environment/environment-config.service.js +0 -24
  572. package/dist/collection/services/facilitator.service.js +0 -76
  573. package/dist/collection/services/feed.service.js +0 -43
  574. package/dist/collection/services/httpService.js +0 -103
  575. package/dist/collection/services/index.js +0 -4
  576. package/dist/collection/services/media.service.js +0 -29
  577. package/dist/collection/services/signalR.service.js +0 -83
  578. package/dist/collection/services/store.service.js +0 -13
  579. package/dist/collection/services/student.service.js +0 -56
  580. package/dist/collection/services/token.service.js +0 -79
  581. package/dist/collection/stores/auth.store.js +0 -12
  582. package/dist/collection/stores/class.store.js +0 -5
  583. package/dist/collection/stores/error.store.js +0 -5
  584. package/dist/collection/stores/facilitator.store.js +0 -15
  585. package/dist/collection/stores/feed.store.js +0 -8
  586. package/dist/collection/stores/goal.store.js +0 -7
  587. package/dist/collection/stores/index.js +0 -1
  588. package/dist/collection/stores/media.store.js +0 -5
  589. package/dist/collection/stores/mood.store.js +0 -5
  590. package/dist/collection/stores/nav.store.js +0 -11
  591. package/dist/collection/stores/signalR.store.js +0 -6
  592. package/dist/collection/stores/theme.store.js +0 -9
  593. package/dist/collection/stores/toc.store.js +0 -5
  594. package/dist/collection/stores/user.store.js +0 -16
  595. package/dist/collection/util.js +0 -55
  596. package/dist/collection/utils.js +0 -92
  597. package/dist/esm/PrivateRoute-90ac95b8.js +0 -212
  598. package/dist/esm/active-router-fc9e4e06.js +0 -73
  599. package/dist/esm/animation-12377cb3.js +0 -984
  600. package/dist/esm/app-globals-3f0347b0.js +0 -7
  601. package/dist/esm/appdata.service-2e84e167.js +0 -70
  602. package/dist/esm/assets.service-def1d63c.js +0 -48
  603. package/dist/esm/assignment.service-8d31f141.js +0 -17
  604. package/dist/esm/auth.store-dba2c2da.js +0 -3381
  605. package/dist/esm/compass-svg.entry.js +0 -128
  606. package/dist/esm/context-consumer.entry.js +0 -25
  607. package/dist/esm/course-select.entry.js +0 -26
  608. package/dist/esm/dir-03012648.js +0 -18
  609. package/dist/esm/environment-config.service-b191f276.js +0 -26
  610. package/dist/esm/facilitator.service-18c47bdf.js +0 -92
  611. package/dist/esm/feed.service-b4f3cae4.js +0 -54
  612. package/dist/esm/framework-delegate-3e634a5c.js +0 -107
  613. package/dist/esm/gesture-controller-7be18351.js +0 -194
  614. package/dist/esm/haptic-522f76f2.js +0 -110
  615. package/dist/esm/header-mobile-collapse_61.entry.js +0 -15060
  616. package/dist/esm/helpers-bf0e23d6.js +0 -403
  617. package/dist/esm/httpService-7986aeed.js +0 -685
  618. package/dist/esm/icons-1c794c74.js +0 -18
  619. package/dist/esm/index-21661af2.js +0 -463
  620. package/dist/esm/index-2b84cad2.js +0 -223
  621. package/dist/esm/index-4044fde9.js +0 -25
  622. package/dist/esm/index-45fec1e7.js +0 -184
  623. package/dist/esm/index-5e8971ae.js +0 -128
  624. package/dist/esm/index-c04b9ed5.js +0 -1888
  625. package/dist/esm/index-cded2d87.js +0 -312
  626. package/dist/esm/index-dad75b83.js +0 -34
  627. package/dist/esm/index.es-e0c0f891.js +0 -10580
  628. package/dist/esm/index.js +0 -12
  629. package/dist/esm/input-shims-671d8d9f.js +0 -416
  630. package/dist/esm/ion-accordion-group.entry.js +0 -201
  631. package/dist/esm/ion-accordion.entry.js +0 -332
  632. package/dist/esm/ion-action-sheet_7.entry.js +0 -2925
  633. package/dist/esm/ion-app.entry.js +0 -75
  634. package/dist/esm/ion-back-button.entry.js +0 -90
  635. package/dist/esm/ion-backdrop.entry.js +0 -63
  636. package/dist/esm/ion-badge.entry.js +0 -25
  637. package/dist/esm/ion-breadcrumb.entry.js +0 -91
  638. package/dist/esm/ion-breadcrumbs.entry.js +0 -129
  639. package/dist/esm/ion-buttons_3.entry.js +0 -147
  640. package/dist/esm/ion-card-header.entry.js +0 -33
  641. package/dist/esm/ion-card-subtitle.entry.js +0 -26
  642. package/dist/esm/ion-card-title.entry.js +0 -26
  643. package/dist/esm/ion-chip.entry.js +0 -36
  644. package/dist/esm/ion-content_2.entry.js +0 -654
  645. package/dist/esm/ion-datetime-button.entry.js +0 -308
  646. package/dist/esm/ion-datetime.entry.js +0 -1619
  647. package/dist/esm/ion-fab-button.entry.js +0 -104
  648. package/dist/esm/ion-fab-list.entry.js +0 -41
  649. package/dist/esm/ion-fab.entry.js +0 -72
  650. package/dist/esm/ion-footer.entry.js +0 -116
  651. package/dist/esm/ion-img.entry.js +0 -97
  652. package/dist/esm/ion-infinite-scroll-content.entry.js +0 -33
  653. package/dist/esm/ion-infinite-scroll.entry.js +0 -202
  654. package/dist/esm/ion-item-divider.entry.js +0 -36
  655. package/dist/esm/ion-item-group.entry.js +0 -27
  656. package/dist/esm/ion-item-option.entry.js +0 -56
  657. package/dist/esm/ion-item-options.entry.js +0 -43
  658. package/dist/esm/ion-item-sliding.entry.js +0 -394
  659. package/dist/esm/ion-loading.entry.js +0 -211
  660. package/dist/esm/ion-menu-button.entry.js +0 -72
  661. package/dist/esm/ion-menu-toggle.entry.js +0 -43
  662. package/dist/esm/ion-menu.entry.js +0 -571
  663. package/dist/esm/ion-modal.entry.js +0 -1707
  664. package/dist/esm/ion-nav-link.entry.js +0 -43
  665. package/dist/esm/ion-nav.entry.js +0 -868
  666. package/dist/esm/ion-picker-column-internal_2.entry.js +0 -803
  667. package/dist/esm/ion-picker-column.entry.js +0 -327
  668. package/dist/esm/ion-picker.entry.js +0 -217
  669. package/dist/esm/ion-progress-bar.entry.js +0 -70
  670. package/dist/esm/ion-refresher-content.entry.js +0 -31
  671. package/dist/esm/ion-refresher.entry.js +0 -798
  672. package/dist/esm/ion-reorder-group.entry.js +0 -277
  673. package/dist/esm/ion-reorder.entry.js +0 -34
  674. package/dist/esm/ion-route-redirect.entry.js +0 -20
  675. package/dist/esm/ion-route.entry.js +0 -45
  676. package/dist/esm/ion-router-link.entry.js +0 -34
  677. package/dist/esm/ion-router-outlet.entry.js +0 -196
  678. package/dist/esm/ion-router.entry.js +0 -827
  679. package/dist/esm/ion-searchbar.entry.js +0 -366
  680. package/dist/esm/ion-segment-button.entry.js +0 -98
  681. package/dist/esm/ion-segment.entry.js +0 -413
  682. package/dist/esm/ion-skeleton-text.entry.js +0 -29
  683. package/dist/esm/ion-slide.entry.js +0 -21
  684. package/dist/esm/ion-slides.entry.js +0 -387
  685. package/dist/esm/ion-split-pane.entry.js +0 -150
  686. package/dist/esm/ion-tab-bar.entry.js +0 -71
  687. package/dist/esm/ion-tab-button.entry.js +0 -99
  688. package/dist/esm/ion-tab.entry.js +0 -55
  689. package/dist/esm/ion-tabs.entry.js +0 -150
  690. package/dist/esm/ion-thumbnail.entry.js +0 -16
  691. package/dist/esm/ion-toast.entry.js +0 -268
  692. package/dist/esm/ion-toggle.entry.js +0 -173
  693. package/dist/esm/ion-virtual-scroll.entry.js +0 -551
  694. package/dist/esm/ionic-global-4903e23e.js +0 -226
  695. package/dist/esm/ios.transition-131d64fe.js +0 -479
  696. package/dist/esm/loader.js +0 -20
  697. package/dist/esm/md.transition-f6126011.js +0 -55
  698. package/dist/esm/media.service-6e90bc41.js +0 -37
  699. package/dist/esm/menu-toggle-util-bace8ae6.js +0 -12
  700. package/dist/esm/overlays-4233a39d.js +0 -491
  701. package/dist/esm/parse-1ae3a9bb.js +0 -1196
  702. package/dist/esm/polyfills/core-js.js +0 -11
  703. package/dist/esm/polyfills/css-shim.js +0 -1
  704. package/dist/esm/polyfills/dom.js +0 -79
  705. package/dist/esm/polyfills/es5-html-element.js +0 -1
  706. package/dist/esm/polyfills/index.js +0 -34
  707. package/dist/esm/polyfills/system.js +0 -6
  708. package/dist/esm/purify-85bfcc69.js +0 -1466
  709. package/dist/esm/signalR.service-c33fba50.js +0 -2982
  710. package/dist/esm/sparkle-animation-player.entry.js +0 -511
  711. package/dist/esm/sparkle-assignment.entry.js +0 -106
  712. package/dist/esm/sparkle-character-intro.entry.js +0 -22
  713. package/dist/esm/sparkle-code.entry.js +0 -39
  714. package/dist/esm/sparkle-compass-post.entry.js +0 -129
  715. package/dist/esm/sparkle-compass.entry.js +0 -122
  716. package/dist/esm/sparkle-core.js +0 -20
  717. package/dist/esm/sparkle-discussion-questions_2.entry.js +0 -276
  718. package/dist/esm/sparkle-discussion.entry.js +0 -38
  719. package/dist/esm/sparkle-emoji.entry.js +0 -76
  720. package/dist/esm/sparkle-facilitator-notes-form.entry.js +0 -117
  721. package/dist/esm/sparkle-feed-post.entry.js +0 -112
  722. package/dist/esm/sparkle-feedback.entry.js +0 -97
  723. package/dist/esm/sparkle-file-upload.entry.js +0 -49
  724. package/dist/esm/sparkle-goal-form.entry.js +0 -175
  725. package/dist/esm/sparkle-gww-comment-list.entry.js +0 -22
  726. package/dist/esm/sparkle-gww-graph.entry.js +0 -15
  727. package/dist/esm/sparkle-input.entry.js +0 -52
  728. package/dist/esm/sparkle-intro.entry.js +0 -22
  729. package/dist/esm/sparkle-lower-content-nav.entry.js +0 -18
  730. package/dist/esm/sparkle-menu-collapsible.entry.js +0 -42
  731. package/dist/esm/sparkle-modal-image.entry.js +0 -30
  732. package/dist/esm/sparkle-notfound-page.entry.js +0 -21
  733. package/dist/esm/sparkle-overlay.entry.js +0 -88
  734. package/dist/esm/sparkle-poll.entry.js +0 -15
  735. package/dist/esm/sparkle-quiz-container.entry.js +0 -43
  736. package/dist/esm/sparkle-quiz-feedback_5.entry.js +0 -109
  737. package/dist/esm/sparkle-quiz-old.entry.js +0 -116
  738. package/dist/esm/sparkle-quiz.entry.js +0 -99
  739. package/dist/esm/sparkle-select.entry.js +0 -57
  740. package/dist/esm/sparkle-sidebar.entry.js +0 -39
  741. package/dist/esm/sparkle-tab.entry.js +0 -22
  742. package/dist/esm/sparkle-table-of-contents.entry.js +0 -67
  743. package/dist/esm/sparkle-tabs.entry.js +0 -62
  744. package/dist/esm/sparkle-youtube.entry.js +0 -35
  745. package/dist/esm/status-tap-dde52787.js +0 -40
  746. package/dist/esm/stencil-async-content.entry.js +0 -28
  747. package/dist/esm/stencil-route-title.entry.js +0 -28
  748. package/dist/esm/stencil-router-prompt.entry.js +0 -55
  749. package/dist/esm/student.service-08af124f.js +0 -75
  750. package/dist/esm/swipe-back-7847a0c1.js +0 -74
  751. package/dist/esm/swiper.bundle-b6a959de.js +0 -6418
  752. package/dist/esm/token.service-71a5d33f.js +0 -94
  753. package/dist/esm/util-57cc8006.js +0 -2451
  754. package/dist/index.cjs.js +0 -1
  755. package/dist/index.js +0 -1
  756. package/dist/loader/cdn.js +0 -3
  757. package/dist/loader/index.cjs.js +0 -3
  758. package/dist/loader/index.d.ts +0 -12
  759. package/dist/loader/index.es2017.js +0 -3
  760. package/dist/loader/index.js +0 -4
  761. package/dist/loader/package.json +0 -10
  762. package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.ios.css +0 -75
  763. package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.md.css +0 -72
  764. package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.ios.css +0 -25
  765. package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.md.css +0 -59
  766. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.ios.css +0 -357
  767. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.md.css +0 -290
  768. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.ios.css +0 -494
  769. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.md.css +0 -502
  770. package/dist/node_modules/@ionic/core/dist/collection/components/app/app.css +0 -17
  771. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.ios.css +0 -22
  772. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.md.css +0 -22
  773. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.ios.css +0 -281
  774. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.md.css +0 -309
  775. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.ios.css +0 -26
  776. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.md.css +0 -26
  777. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.ios.css +0 -58
  778. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.md.css +0 -62
  779. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.ios.css +0 -234
  780. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.md.css +0 -237
  781. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +0 -38
  782. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.md.css +0 -37
  783. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.ios.css +0 -439
  784. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.md.css +0 -428
  785. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.ios.css +0 -128
  786. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.md.css +0 -151
  787. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.ios.css +0 -101
  788. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.md.css +0 -95
  789. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.ios.css +0 -61
  790. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.md.css +0 -63
  791. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.ios.css +0 -37
  792. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.md.css +0 -35
  793. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.ios.css +0 -28
  794. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.md.css +0 -26
  795. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.ios.css +0 -27
  796. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.md.css +0 -27
  797. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.ios.css +0 -169
  798. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.md.css +0 -172
  799. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.ios.css +0 -200
  800. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.md.css +0 -200
  801. package/dist/node_modules/@ionic/core/dist/collection/components/col/col.css +0 -108
  802. package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +0 -237
  803. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +0 -648
  804. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +0 -637
  805. package/dist/node_modules/@ionic/core/dist/collection/components/datetime-button/datetime-button.css +0 -60
  806. package/dist/node_modules/@ionic/core/dist/collection/components/fab/fab.css +0 -61
  807. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.ios.css +0 -338
  808. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.md.css +0 -307
  809. package/dist/node_modules/@ionic/core/dist/collection/components/fab-list/fab-list.css +0 -116
  810. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.ios.css +0 -37
  811. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.md.css +0 -37
  812. package/dist/node_modules/@ionic/core/dist/collection/components/grid/grid.css +0 -151
  813. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.ios.css +0 -108
  814. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.md.css +0 -40
  815. package/dist/node_modules/@ionic/core/dist/collection/components/img/img.css +0 -12
  816. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll/infinite-scroll.css +0 -8
  817. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +0 -54
  818. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +0 -54
  819. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.ios.css +0 -185
  820. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.md.css +0 -185
  821. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +0 -669
  822. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +0 -928
  823. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.ios.css +0 -204
  824. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.md.css +0 -297
  825. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.ios.css +0 -3
  826. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.md.css +0 -3
  827. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +0 -186
  828. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +0 -180
  829. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.ios.css +0 -88
  830. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.md.css +0 -85
  831. package/dist/node_modules/@ionic/core/dist/collection/components/item-sliding/item-sliding.css +0 -42
  832. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +0 -156
  833. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.md.css +0 -250
  834. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.ios.css +0 -91
  835. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.md.css +0 -114
  836. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.ios.css +0 -118
  837. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.md.css +0 -94
  838. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +0 -109
  839. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +0 -100
  840. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +0 -127
  841. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +0 -123
  842. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.ios.css +0 -175
  843. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.md.css +0 -178
  844. package/dist/node_modules/@ionic/core/dist/collection/components/menu-toggle/menu-toggle.css +0 -3
  845. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +0 -250
  846. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +0 -177
  847. package/dist/node_modules/@ionic/core/dist/collection/components/nav/nav.css +0 -10
  848. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.ios.css +0 -16
  849. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.md.css +0 -17
  850. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.ios.css +0 -217
  851. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.md.css +0 -204
  852. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.ios.css +0 -122
  853. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.md.css +0 -123
  854. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +0 -82
  855. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +0 -85
  856. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +0 -126
  857. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +0 -122
  858. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.ios.css +0 -201
  859. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.md.css +0 -132
  860. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.ios.css +0 -206
  861. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.md.css +0 -206
  862. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.ios.css +0 -177
  863. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.md.css +0 -178
  864. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +0 -275
  865. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +0 -320
  866. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.ios.css +0 -189
  867. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.md.css +0 -210
  868. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.ios.css +0 -15
  869. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.md.css +0 -15
  870. package/dist/node_modules/@ionic/core/dist/collection/components/reorder-group/reorder-group.css +0 -33
  871. package/dist/node_modules/@ionic/core/dist/collection/components/ripple-effect/ripple-effect.css +0 -58
  872. package/dist/node_modules/@ionic/core/dist/collection/components/router-link/router-link.css +0 -29
  873. package/dist/node_modules/@ionic/core/dist/collection/components/router-outlet/route-outlet.css +0 -10
  874. package/dist/node_modules/@ionic/core/dist/collection/components/row/row.css +0 -4
  875. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.ios.css +0 -348
  876. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.md.css +0 -279
  877. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.ios.css +0 -65
  878. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.md.css +0 -36
  879. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.ios.css +0 -446
  880. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.md.css +0 -424
  881. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.ios.css +0 -145
  882. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.md.css +0 -177
  883. package/dist/node_modules/@ionic/core/dist/collection/components/select-option/select-option.css +0 -3
  884. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.ios.css +0 -14
  885. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.md.css +0 -37
  886. package/dist/node_modules/@ionic/core/dist/collection/components/skeleton-text/skeleton-text.css +0 -53
  887. package/dist/node_modules/@ionic/core/dist/collection/components/slide/slide.css +0 -31
  888. package/dist/node_modules/@ionic/core/dist/collection/components/slides/slides.ios.css +0 -764
  889. package/dist/node_modules/@ionic/core/dist/collection/components/slides/slides.md.css +0 -764
  890. package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +0 -167
  891. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.ios.css +0 -108
  892. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.md.css +0 -108
  893. package/dist/node_modules/@ionic/core/dist/collection/components/tab/tab.css +0 -4
  894. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.ios.css +0 -97
  895. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.md.css +0 -82
  896. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.ios.css +0 -308
  897. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.md.css +0 -331
  898. package/dist/node_modules/@ionic/core/dist/collection/components/tabs/tabs.css +0 -19
  899. package/dist/node_modules/@ionic/core/dist/collection/components/text/text.css +0 -3
  900. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +0 -175
  901. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +0 -179
  902. package/dist/node_modules/@ionic/core/dist/collection/components/thumbnail/thumbnail.css +0 -21
  903. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.ios.css +0 -122
  904. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.md.css +0 -55
  905. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.ios.css +0 -262
  906. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.md.css +0 -295
  907. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +0 -286
  908. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +0 -261
  909. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.ios.css +0 -175
  910. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.md.css +0 -168
  911. package/dist/node_modules/@ionic/core/dist/collection/components/virtual-scroll/virtual-scroll.css +0 -21
  912. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/button/button.css +0 -49
  913. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/card/card.css +0 -208
  914. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/cards/cards.css +0 -31
  915. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/code/code.css +0 -245
  916. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/dropdown/dropdown.css +0 -115
  917. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header-mobile-collapse/header-mobile-collapse.css +0 -255
  918. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/header/header.css +0 -232
  919. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/collapsible/collapsible.css +0 -3
  920. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu-toggle/menu-toggle.css +0 -25
  921. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/menu/menu.css +0 -71
  922. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/nav/nav.css +0 -194
  923. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/notfound-page/notfound-page.css +0 -4
  924. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/overlay/overlay.css +0 -67
  925. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/page-footer/page-footer.css +0 -25
  926. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/pagination/pagination.css +0 -93
  927. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/select/select.css +0 -52
  928. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sidebar/sidebar.css +0 -98
  929. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/sparkle-lower-content-nav/sparkle-lower-content-nav.css +0 -8
  930. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/table-of-contents/table-of-contents.css +0 -37
  931. package/dist/node_modules/@sparkle-learning/components/dist/collection/components/tabs/tabs.css +0 -64
  932. package/dist/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  933. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +0 -101
  934. package/dist/sparkle-core/p-00d10dc9.js +0 -4
  935. package/dist/sparkle-core/p-0147266a.js +0 -1
  936. package/dist/sparkle-core/p-04c7b276.entry.js +0 -1
  937. package/dist/sparkle-core/p-05c032dd.js +0 -4
  938. package/dist/sparkle-core/p-06642405.entry.js +0 -1
  939. package/dist/sparkle-core/p-0664370b.entry.js +0 -1
  940. package/dist/sparkle-core/p-06c7d0f2.entry.js +0 -1
  941. package/dist/sparkle-core/p-076f0239.js +0 -4
  942. package/dist/sparkle-core/p-077c732b.js +0 -4
  943. package/dist/sparkle-core/p-08420531.entry.js +0 -1
  944. package/dist/sparkle-core/p-08cca80d.entry.js +0 -1
  945. package/dist/sparkle-core/p-0ad5c123.entry.js +0 -1
  946. package/dist/sparkle-core/p-0afa3a4d.entry.js +0 -1
  947. package/dist/sparkle-core/p-0c3f3ea6.entry.js +0 -1
  948. package/dist/sparkle-core/p-0e4de1d0.js +0 -4
  949. package/dist/sparkle-core/p-0e8e539f.entry.js +0 -1
  950. package/dist/sparkle-core/p-11356b03.entry.js +0 -1
  951. package/dist/sparkle-core/p-11a6c175.entry.js +0 -1
  952. package/dist/sparkle-core/p-12dd96d7.js +0 -4
  953. package/dist/sparkle-core/p-13ec39db.entry.js +0 -1
  954. package/dist/sparkle-core/p-1adc98f6.js +0 -1
  955. package/dist/sparkle-core/p-1b1ba156.entry.js +0 -1
  956. package/dist/sparkle-core/p-1e125ca5.entry.js +0 -1
  957. package/dist/sparkle-core/p-1e4782af.entry.js +0 -1
  958. package/dist/sparkle-core/p-2033cd86.js +0 -7
  959. package/dist/sparkle-core/p-214d1229.entry.js +0 -1
  960. package/dist/sparkle-core/p-23aca7ca.js +0 -4
  961. package/dist/sparkle-core/p-24cb9a33.entry.js +0 -1
  962. package/dist/sparkle-core/p-27fbabc3.entry.js +0 -1
  963. package/dist/sparkle-core/p-2ba70507.entry.js +0 -1
  964. package/dist/sparkle-core/p-2c1ca854.entry.js +0 -1
  965. package/dist/sparkle-core/p-2d9659e2.entry.js +0 -1
  966. package/dist/sparkle-core/p-2f569553.js +0 -1
  967. package/dist/sparkle-core/p-30b810d1.entry.js +0 -4
  968. package/dist/sparkle-core/p-32f4e565.entry.js +0 -1
  969. package/dist/sparkle-core/p-352677e6.entry.js +0 -1
  970. package/dist/sparkle-core/p-38b7cf68.entry.js +0 -1
  971. package/dist/sparkle-core/p-38c842d5.entry.js +0 -1
  972. package/dist/sparkle-core/p-3963e02b.entry.js +0 -1
  973. package/dist/sparkle-core/p-39712c56.entry.js +0 -4
  974. package/dist/sparkle-core/p-39a31e43.js +0 -1
  975. package/dist/sparkle-core/p-3daf2915.entry.js +0 -352
  976. package/dist/sparkle-core/p-3de0e00c.js +0 -4
  977. package/dist/sparkle-core/p-4053ecdb.entry.js +0 -1
  978. package/dist/sparkle-core/p-408176ba.js +0 -1
  979. package/dist/sparkle-core/p-42ed7d5f.entry.js +0 -1
  980. package/dist/sparkle-core/p-48f72e63.js +0 -4
  981. package/dist/sparkle-core/p-4b4a8703.js +0 -1
  982. package/dist/sparkle-core/p-4c6a7e52.js +0 -1
  983. package/dist/sparkle-core/p-4d1cfcbe.entry.js +0 -1
  984. package/dist/sparkle-core/p-4d4077ea.js +0 -4
  985. package/dist/sparkle-core/p-4fba3e4c.js +0 -1
  986. package/dist/sparkle-core/p-506221fe.js +0 -4
  987. package/dist/sparkle-core/p-5096739e.entry.js +0 -1
  988. package/dist/sparkle-core/p-5322c920.entry.js +0 -1
  989. package/dist/sparkle-core/p-5893bbe5.entry.js +0 -1
  990. package/dist/sparkle-core/p-594a6982.entry.js +0 -1
  991. package/dist/sparkle-core/p-5c435d5a.entry.js +0 -1
  992. package/dist/sparkle-core/p-5cad23f1.js +0 -3
  993. package/dist/sparkle-core/p-5d409601.js +0 -1
  994. package/dist/sparkle-core/p-601397df.entry.js +0 -1
  995. package/dist/sparkle-core/p-604a7987.js +0 -4
  996. package/dist/sparkle-core/p-616941c6.entry.js +0 -1
  997. package/dist/sparkle-core/p-6316d124.entry.js +0 -1
  998. package/dist/sparkle-core/p-63f71ada.entry.js +0 -1
  999. package/dist/sparkle-core/p-69487d90.entry.js +0 -1
  1000. package/dist/sparkle-core/p-6bde0192.entry.js +0 -7
  1001. package/dist/sparkle-core/p-6d2f4093.entry.js +0 -7
  1002. package/dist/sparkle-core/p-6ffd2420.entry.js +0 -1
  1003. package/dist/sparkle-core/p-72053ae0.entry.js +0 -1
  1004. package/dist/sparkle-core/p-73721c84.js +0 -4
  1005. package/dist/sparkle-core/p-74864276.entry.js +0 -1
  1006. package/dist/sparkle-core/p-7d8427eb.js +0 -4
  1007. package/dist/sparkle-core/p-7dae0f0e.js +0 -1
  1008. package/dist/sparkle-core/p-7dbfc316.js +0 -1
  1009. package/dist/sparkle-core/p-7e7ce516.js +0 -4
  1010. package/dist/sparkle-core/p-81714d94.entry.js +0 -1
  1011. package/dist/sparkle-core/p-8492a765.entry.js +0 -1
  1012. package/dist/sparkle-core/p-859563db.entry.js +0 -1
  1013. package/dist/sparkle-core/p-85d4cd5c.entry.js +0 -1
  1014. package/dist/sparkle-core/p-865f36a8.entry.js +0 -1
  1015. package/dist/sparkle-core/p-86ed13f0.js +0 -5
  1016. package/dist/sparkle-core/p-871106e0.js +0 -4
  1017. package/dist/sparkle-core/p-894ff7e6.entry.js +0 -1
  1018. package/dist/sparkle-core/p-8a41b502.entry.js +0 -1
  1019. package/dist/sparkle-core/p-8b56f734.js +0 -1
  1020. package/dist/sparkle-core/p-8c74cbb6.entry.js +0 -1
  1021. package/dist/sparkle-core/p-924b2917.js +0 -4
  1022. package/dist/sparkle-core/p-9289cdbc.entry.js +0 -1
  1023. package/dist/sparkle-core/p-957715c5.entry.js +0 -1
  1024. package/dist/sparkle-core/p-973fe404.entry.js +0 -22
  1025. package/dist/sparkle-core/p-975b99ee.entry.js +0 -1
  1026. package/dist/sparkle-core/p-98daeddb.entry.js +0 -1
  1027. package/dist/sparkle-core/p-99ee9919.js +0 -1
  1028. package/dist/sparkle-core/p-9abbd715.entry.js +0 -1
  1029. package/dist/sparkle-core/p-9d894ed4.js +0 -4
  1030. package/dist/sparkle-core/p-9e309b3e.entry.js +0 -1
  1031. package/dist/sparkle-core/p-9e7fee8f.entry.js +0 -1
  1032. package/dist/sparkle-core/p-9ebf0537.entry.js +0 -1
  1033. package/dist/sparkle-core/p-a208ab2d.js +0 -4
  1034. package/dist/sparkle-core/p-a2638250.entry.js +0 -1
  1035. package/dist/sparkle-core/p-a2ebcf0a.entry.js +0 -1
  1036. package/dist/sparkle-core/p-a98d7ebe.entry.js +0 -1
  1037. package/dist/sparkle-core/p-add30d46.js +0 -4
  1038. package/dist/sparkle-core/p-b0603d19.js +0 -16
  1039. package/dist/sparkle-core/p-b06e2bef.js +0 -1
  1040. package/dist/sparkle-core/p-b3f375fb.entry.js +0 -1
  1041. package/dist/sparkle-core/p-b5f3e1bf.entry.js +0 -1
  1042. package/dist/sparkle-core/p-b6fec622.entry.js +0 -1
  1043. package/dist/sparkle-core/p-b8d71ff4.js +0 -1
  1044. package/dist/sparkle-core/p-b96f3c84.entry.js +0 -7
  1045. package/dist/sparkle-core/p-bd80ff43.js +0 -4
  1046. package/dist/sparkle-core/p-bd90903e.js +0 -1
  1047. package/dist/sparkle-core/p-be64105c.entry.js +0 -1
  1048. package/dist/sparkle-core/p-c0533c23.entry.js +0 -1
  1049. package/dist/sparkle-core/p-c2990b24.entry.js +0 -1
  1050. package/dist/sparkle-core/p-c3cadfc6.entry.js +0 -1
  1051. package/dist/sparkle-core/p-c60b29bd.entry.js +0 -4
  1052. package/dist/sparkle-core/p-c64a34cd.entry.js +0 -1
  1053. package/dist/sparkle-core/p-c9f753a4.js +0 -1
  1054. package/dist/sparkle-core/p-cabe9139.js +0 -1
  1055. package/dist/sparkle-core/p-cabfbf22.entry.js +0 -1
  1056. package/dist/sparkle-core/p-cc518c36.entry.js +0 -1
  1057. package/dist/sparkle-core/p-cffd4817.entry.js +0 -1
  1058. package/dist/sparkle-core/p-d0adf726.entry.js +0 -1
  1059. package/dist/sparkle-core/p-d20e4fcf.entry.js +0 -1
  1060. package/dist/sparkle-core/p-d24e53ab.entry.js +0 -1
  1061. package/dist/sparkle-core/p-d288e6c1.entry.js +0 -1
  1062. package/dist/sparkle-core/p-d601810e.entry.js +0 -1
  1063. package/dist/sparkle-core/p-d68092b7.js +0 -4
  1064. package/dist/sparkle-core/p-da391f3f.js +0 -1
  1065. package/dist/sparkle-core/p-de4deb61.entry.js +0 -1
  1066. package/dist/sparkle-core/p-e0cad1bb.js +0 -1
  1067. package/dist/sparkle-core/p-e249aebf.entry.js +0 -1
  1068. package/dist/sparkle-core/p-e3e36ce9.entry.js +0 -1
  1069. package/dist/sparkle-core/p-e421d638.entry.js +0 -1
  1070. package/dist/sparkle-core/p-e686d8b5.entry.js +0 -4
  1071. package/dist/sparkle-core/p-e8988989.entry.js +0 -1
  1072. package/dist/sparkle-core/p-e9431eeb.js +0 -7
  1073. package/dist/sparkle-core/p-ea962e1b.entry.js +0 -1
  1074. package/dist/sparkle-core/p-eaa8bbee.js +0 -4
  1075. package/dist/sparkle-core/p-ebd4354b.entry.js +0 -1
  1076. package/dist/sparkle-core/p-ee1e0eb4.js +0 -2
  1077. package/dist/sparkle-core/p-ef4edc48.entry.js +0 -4
  1078. package/dist/sparkle-core/p-f196c124.entry.js +0 -7
  1079. package/dist/sparkle-core/p-f3cba72a.js +0 -4
  1080. package/dist/sparkle-core/p-f47fe1fe.entry.js +0 -1
  1081. package/dist/sparkle-core/p-f714f77a.entry.js +0 -1
  1082. package/dist/sparkle-core/p-f891c79a.entry.js +0 -1
  1083. package/dist/sparkle-core/p-fb0ca75e.entry.js +0 -5
  1084. package/dist/sparkle-core/p-fb757951.entry.js +0 -1
  1085. package/dist/sparkle-core/p-fd8d0738.entry.js +0 -4
  1086. package/dist/sparkle-core/p-fda95b6e.entry.js +0 -1
  1087. package/dist/sparkle-core/p-fe6dc976.entry.js +0 -1
  1088. package/dist/sparkle-core/p-ff080f82.entry.js +0 -10
  1089. package/dist/sparkle-core/p-ff7a8a71.js +0 -4
  1090. /package/dist/{esm → sparkle-core}/cubic-bezier-4c0db14f.js +0 -0
  1091. /package/dist/{esm → sparkle-core}/focus-visible-4e9a0764.js +0 -0
  1092. /package/dist/{esm → sparkle-core}/hardware-back-button-fa04d6e9.js +0 -0
  1093. /package/dist/{esm → sparkle-core}/index-be6112f8.js +0 -0
  1094. /package/dist/{esm → sparkle-core}/keyboard-7e8329b3.js +0 -0
  1095. /package/dist/{esm → sparkle-core}/localstorage.service-4bf408c8.js +0 -0
  1096. /package/dist/{esm → sparkle-core}/spinner-configs-a37e628a.js +0 -0
  1097. /package/dist/{esm → sparkle-core}/theme-7ef00c83.js +0 -0
@@ -1,2982 +0,0 @@
1
- import { E as EnvironmentConfigService } from './environment-config.service-b191f276.js';
2
- import { d as createStore } from './auth.store-dba2c2da.js';
3
- import { T as TokenService } from './token.service-71a5d33f.js';
4
-
5
- // Licensed to the .NET Foundation under one or more agreements.
6
- // The .NET Foundation licenses this file to you under the MIT license.
7
- /** Error thrown when an HTTP request fails. */
8
- class HttpError extends Error {
9
- /** Constructs a new instance of {@link @microsoft/signalr.HttpError}.
10
- *
11
- * @param {string} errorMessage A descriptive error message.
12
- * @param {number} statusCode The HTTP status code represented by this error.
13
- */
14
- constructor(errorMessage, statusCode) {
15
- const trueProto = new.target.prototype;
16
- super(`${errorMessage}: Status code '${statusCode}'`);
17
- this.statusCode = statusCode;
18
- // Workaround issue in Typescript compiler
19
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
20
- this.__proto__ = trueProto;
21
- }
22
- }
23
- /** Error thrown when a timeout elapses. */
24
- class TimeoutError extends Error {
25
- /** Constructs a new instance of {@link @microsoft/signalr.TimeoutError}.
26
- *
27
- * @param {string} errorMessage A descriptive error message.
28
- */
29
- constructor(errorMessage = "A timeout occurred.") {
30
- const trueProto = new.target.prototype;
31
- super(errorMessage);
32
- // Workaround issue in Typescript compiler
33
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
34
- this.__proto__ = trueProto;
35
- }
36
- }
37
- /** Error thrown when an action is aborted. */
38
- class AbortError extends Error {
39
- /** Constructs a new instance of {@link AbortError}.
40
- *
41
- * @param {string} errorMessage A descriptive error message.
42
- */
43
- constructor(errorMessage = "An abort occurred.") {
44
- const trueProto = new.target.prototype;
45
- super(errorMessage);
46
- // Workaround issue in Typescript compiler
47
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
48
- this.__proto__ = trueProto;
49
- }
50
- }
51
- /** Error thrown when the selected transport is unsupported by the browser. */
52
- /** @private */
53
- class UnsupportedTransportError extends Error {
54
- /** Constructs a new instance of {@link @microsoft/signalr.UnsupportedTransportError}.
55
- *
56
- * @param {string} message A descriptive error message.
57
- * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on.
58
- */
59
- constructor(message, transport) {
60
- const trueProto = new.target.prototype;
61
- super(message);
62
- this.transport = transport;
63
- this.errorType = 'UnsupportedTransportError';
64
- // Workaround issue in Typescript compiler
65
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
66
- this.__proto__ = trueProto;
67
- }
68
- }
69
- /** Error thrown when the selected transport is disabled by the browser. */
70
- /** @private */
71
- class DisabledTransportError extends Error {
72
- /** Constructs a new instance of {@link @microsoft/signalr.DisabledTransportError}.
73
- *
74
- * @param {string} message A descriptive error message.
75
- * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on.
76
- */
77
- constructor(message, transport) {
78
- const trueProto = new.target.prototype;
79
- super(message);
80
- this.transport = transport;
81
- this.errorType = 'DisabledTransportError';
82
- // Workaround issue in Typescript compiler
83
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
84
- this.__proto__ = trueProto;
85
- }
86
- }
87
- /** Error thrown when the selected transport cannot be started. */
88
- /** @private */
89
- class FailedToStartTransportError extends Error {
90
- /** Constructs a new instance of {@link @microsoft/signalr.FailedToStartTransportError}.
91
- *
92
- * @param {string} message A descriptive error message.
93
- * @param {HttpTransportType} transport The {@link @microsoft/signalr.HttpTransportType} this error occured on.
94
- */
95
- constructor(message, transport) {
96
- const trueProto = new.target.prototype;
97
- super(message);
98
- this.transport = transport;
99
- this.errorType = 'FailedToStartTransportError';
100
- // Workaround issue in Typescript compiler
101
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
102
- this.__proto__ = trueProto;
103
- }
104
- }
105
- /** Error thrown when the negotiation with the server failed to complete. */
106
- /** @private */
107
- class FailedToNegotiateWithServerError extends Error {
108
- /** Constructs a new instance of {@link @microsoft/signalr.FailedToNegotiateWithServerError}.
109
- *
110
- * @param {string} message A descriptive error message.
111
- */
112
- constructor(message) {
113
- const trueProto = new.target.prototype;
114
- super(message);
115
- this.errorType = 'FailedToNegotiateWithServerError';
116
- // Workaround issue in Typescript compiler
117
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
118
- this.__proto__ = trueProto;
119
- }
120
- }
121
- /** Error thrown when multiple errors have occured. */
122
- /** @private */
123
- class AggregateErrors extends Error {
124
- /** Constructs a new instance of {@link @microsoft/signalr.AggregateErrors}.
125
- *
126
- * @param {string} message A descriptive error message.
127
- * @param {Error[]} innerErrors The collection of errors this error is aggregating.
128
- */
129
- constructor(message, innerErrors) {
130
- const trueProto = new.target.prototype;
131
- super(message);
132
- this.innerErrors = innerErrors;
133
- // Workaround issue in Typescript compiler
134
- // https://github.com/Microsoft/TypeScript/issues/13965#issuecomment-278570200
135
- this.__proto__ = trueProto;
136
- }
137
- }
138
-
139
- // Licensed to the .NET Foundation under one or more agreements.
140
- // The .NET Foundation licenses this file to you under the MIT license.
141
- /** Represents an HTTP response. */
142
- class HttpResponse {
143
- constructor(statusCode, statusText, content) {
144
- this.statusCode = statusCode;
145
- this.statusText = statusText;
146
- this.content = content;
147
- }
148
- }
149
- /** Abstraction over an HTTP client.
150
- *
151
- * This class provides an abstraction over an HTTP client so that a different implementation can be provided on different platforms.
152
- */
153
- class HttpClient {
154
- get(url, options) {
155
- return this.send({
156
- ...options,
157
- method: "GET",
158
- url,
159
- });
160
- }
161
- post(url, options) {
162
- return this.send({
163
- ...options,
164
- method: "POST",
165
- url,
166
- });
167
- }
168
- delete(url, options) {
169
- return this.send({
170
- ...options,
171
- method: "DELETE",
172
- url,
173
- });
174
- }
175
- /** Gets all cookies that apply to the specified URL.
176
- *
177
- * @param url The URL that the cookies are valid for.
178
- * @returns {string} A string containing all the key-value cookie pairs for the specified URL.
179
- */
180
- // @ts-ignore
181
- getCookieString(url) {
182
- return "";
183
- }
184
- }
185
-
186
- // Licensed to the .NET Foundation under one or more agreements.
187
- // The .NET Foundation licenses this file to you under the MIT license.
188
- // These values are designed to match the ASP.NET Log Levels since that's the pattern we're emulating here.
189
- /** Indicates the severity of a log message.
190
- *
191
- * Log Levels are ordered in increasing severity. So `Debug` is more severe than `Trace`, etc.
192
- */
193
- var LogLevel;
194
- (function (LogLevel) {
195
- /** Log level for very low severity diagnostic messages. */
196
- LogLevel[LogLevel["Trace"] = 0] = "Trace";
197
- /** Log level for low severity diagnostic messages. */
198
- LogLevel[LogLevel["Debug"] = 1] = "Debug";
199
- /** Log level for informational diagnostic messages. */
200
- LogLevel[LogLevel["Information"] = 2] = "Information";
201
- /** Log level for diagnostic messages that indicate a non-fatal problem. */
202
- LogLevel[LogLevel["Warning"] = 3] = "Warning";
203
- /** Log level for diagnostic messages that indicate a failure in the current operation. */
204
- LogLevel[LogLevel["Error"] = 4] = "Error";
205
- /** Log level for diagnostic messages that indicate a failure that will terminate the entire application. */
206
- LogLevel[LogLevel["Critical"] = 5] = "Critical";
207
- /** The highest possible log level. Used when configuring logging to indicate that no log messages should be emitted. */
208
- LogLevel[LogLevel["None"] = 6] = "None";
209
- })(LogLevel || (LogLevel = {}));
210
-
211
- // Licensed to the .NET Foundation under one or more agreements.
212
- // The .NET Foundation licenses this file to you under the MIT license.
213
- /** A logger that does nothing when log messages are sent to it. */
214
- class NullLogger {
215
- constructor() { }
216
- /** @inheritDoc */
217
- // eslint-disable-next-line
218
- log(_logLevel, _message) {
219
- }
220
- }
221
- /** The singleton instance of the {@link @microsoft/signalr.NullLogger}. */
222
- NullLogger.instance = new NullLogger();
223
-
224
- // Licensed to the .NET Foundation under one or more agreements.
225
- // Version token that will be replaced by the prepack command
226
- /** The version of the SignalR client. */
227
- const VERSION = "6.0.3";
228
- /** @private */
229
- class Arg {
230
- static isRequired(val, name) {
231
- if (val === null || val === undefined) {
232
- throw new Error(`The '${name}' argument is required.`);
233
- }
234
- }
235
- static isNotEmpty(val, name) {
236
- if (!val || val.match(/^\s*$/)) {
237
- throw new Error(`The '${name}' argument should not be empty.`);
238
- }
239
- }
240
- static isIn(val, values, name) {
241
- // TypeScript enums have keys for **both** the name and the value of each enum member on the type itself.
242
- if (!(val in values)) {
243
- throw new Error(`Unknown ${name} value: ${val}.`);
244
- }
245
- }
246
- }
247
- /** @private */
248
- class Platform {
249
- // react-native has a window but no document so we should check both
250
- static get isBrowser() {
251
- return typeof window === "object" && typeof window.document === "object";
252
- }
253
- // WebWorkers don't have a window object so the isBrowser check would fail
254
- static get isWebWorker() {
255
- return typeof self === "object" && "importScripts" in self;
256
- }
257
- // react-native has a window but no document
258
- static get isReactNative() {
259
- return typeof window === "object" && typeof window.document === "undefined";
260
- }
261
- // Node apps shouldn't have a window object, but WebWorkers don't either
262
- // so we need to check for both WebWorker and window
263
- static get isNode() {
264
- return !this.isBrowser && !this.isWebWorker && !this.isReactNative;
265
- }
266
- }
267
- /** @private */
268
- function getDataDetail(data, includeContent) {
269
- let detail = "";
270
- if (isArrayBuffer(data)) {
271
- detail = `Binary data of length ${data.byteLength}`;
272
- if (includeContent) {
273
- detail += `. Content: '${formatArrayBuffer(data)}'`;
274
- }
275
- }
276
- else if (typeof data === "string") {
277
- detail = `String data of length ${data.length}`;
278
- if (includeContent) {
279
- detail += `. Content: '${data}'`;
280
- }
281
- }
282
- return detail;
283
- }
284
- /** @private */
285
- function formatArrayBuffer(data) {
286
- const view = new Uint8Array(data);
287
- // Uint8Array.map only supports returning another Uint8Array?
288
- let str = "";
289
- view.forEach((num) => {
290
- const pad = num < 16 ? "0" : "";
291
- str += `0x${pad}${num.toString(16)} `;
292
- });
293
- // Trim of trailing space.
294
- return str.substr(0, str.length - 1);
295
- }
296
- // Also in signalr-protocol-msgpack/Utils.ts
297
- /** @private */
298
- function isArrayBuffer(val) {
299
- return val && typeof ArrayBuffer !== "undefined" &&
300
- (val instanceof ArrayBuffer ||
301
- // Sometimes we get an ArrayBuffer that doesn't satisfy instanceof
302
- (val.constructor && val.constructor.name === "ArrayBuffer"));
303
- }
304
- /** @private */
305
- async function sendMessage(logger, transportName, httpClient, url, accessTokenFactory, content, options) {
306
- let headers = {};
307
- if (accessTokenFactory) {
308
- const token = await accessTokenFactory();
309
- if (token) {
310
- headers = {
311
- ["Authorization"]: `Bearer ${token}`,
312
- };
313
- }
314
- }
315
- const [name, value] = getUserAgentHeader();
316
- headers[name] = value;
317
- logger.log(LogLevel.Trace, `(${transportName} transport) sending data. ${getDataDetail(content, options.logMessageContent)}.`);
318
- const responseType = isArrayBuffer(content) ? "arraybuffer" : "text";
319
- const response = await httpClient.post(url, {
320
- content,
321
- headers: { ...headers, ...options.headers },
322
- responseType,
323
- timeout: options.timeout,
324
- withCredentials: options.withCredentials,
325
- });
326
- logger.log(LogLevel.Trace, `(${transportName} transport) request complete. Response status: ${response.statusCode}.`);
327
- }
328
- /** @private */
329
- function createLogger(logger) {
330
- if (logger === undefined) {
331
- return new ConsoleLogger(LogLevel.Information);
332
- }
333
- if (logger === null) {
334
- return NullLogger.instance;
335
- }
336
- if (logger.log !== undefined) {
337
- return logger;
338
- }
339
- return new ConsoleLogger(logger);
340
- }
341
- /** @private */
342
- class SubjectSubscription {
343
- constructor(subject, observer) {
344
- this._subject = subject;
345
- this._observer = observer;
346
- }
347
- dispose() {
348
- const index = this._subject.observers.indexOf(this._observer);
349
- if (index > -1) {
350
- this._subject.observers.splice(index, 1);
351
- }
352
- if (this._subject.observers.length === 0 && this._subject.cancelCallback) {
353
- this._subject.cancelCallback().catch((_) => { });
354
- }
355
- }
356
- }
357
- /** @private */
358
- class ConsoleLogger {
359
- constructor(minimumLogLevel) {
360
- this._minLevel = minimumLogLevel;
361
- this.out = console;
362
- }
363
- log(logLevel, message) {
364
- if (logLevel >= this._minLevel) {
365
- const msg = `[${new Date().toISOString()}] ${LogLevel[logLevel]}: ${message}`;
366
- switch (logLevel) {
367
- case LogLevel.Critical:
368
- case LogLevel.Error:
369
- this.out.error(msg);
370
- break;
371
- case LogLevel.Warning:
372
- this.out.warn(msg);
373
- break;
374
- case LogLevel.Information:
375
- this.out.info(msg);
376
- break;
377
- default:
378
- // console.debug only goes to attached debuggers in Node, so we use console.log for Trace and Debug
379
- this.out.log(msg);
380
- break;
381
- }
382
- }
383
- }
384
- }
385
- /** @private */
386
- function getUserAgentHeader() {
387
- let userAgentHeaderName = "X-SignalR-User-Agent";
388
- if (Platform.isNode) {
389
- userAgentHeaderName = "User-Agent";
390
- }
391
- return [userAgentHeaderName, constructUserAgent(VERSION, getOsName(), getRuntime(), getRuntimeVersion())];
392
- }
393
- /** @private */
394
- function constructUserAgent(version, os, runtime, runtimeVersion) {
395
- // Microsoft SignalR/[Version] ([Detailed Version]; [Operating System]; [Runtime]; [Runtime Version])
396
- let userAgent = "Microsoft SignalR/";
397
- const majorAndMinor = version.split(".");
398
- userAgent += `${majorAndMinor[0]}.${majorAndMinor[1]}`;
399
- userAgent += ` (${version}; `;
400
- if (os && os !== "") {
401
- userAgent += `${os}; `;
402
- }
403
- else {
404
- userAgent += "Unknown OS; ";
405
- }
406
- userAgent += `${runtime}`;
407
- if (runtimeVersion) {
408
- userAgent += `; ${runtimeVersion}`;
409
- }
410
- else {
411
- userAgent += "; Unknown Runtime Version";
412
- }
413
- userAgent += ")";
414
- return userAgent;
415
- }
416
- // eslint-disable-next-line spaced-comment
417
- /*#__PURE__*/ function getOsName() {
418
- if (Platform.isNode) {
419
- switch (process.platform) {
420
- case "win32":
421
- return "Windows NT";
422
- case "darwin":
423
- return "macOS";
424
- case "linux":
425
- return "Linux";
426
- default:
427
- return process.platform;
428
- }
429
- }
430
- else {
431
- return "";
432
- }
433
- }
434
- // eslint-disable-next-line spaced-comment
435
- /*#__PURE__*/ function getRuntimeVersion() {
436
- if (Platform.isNode) {
437
- return process.versions.node;
438
- }
439
- return undefined;
440
- }
441
- function getRuntime() {
442
- if (Platform.isNode) {
443
- return "NodeJS";
444
- }
445
- else {
446
- return "Browser";
447
- }
448
- }
449
- /** @private */
450
- function getErrorString(e) {
451
- if (e.stack) {
452
- return e.stack;
453
- }
454
- else if (e.message) {
455
- return e.message;
456
- }
457
- return `${e}`;
458
- }
459
- /** @private */
460
- function getGlobalThis() {
461
- // globalThis is semi-new and not available in Node until v12
462
- if (typeof globalThis !== "undefined") {
463
- return globalThis;
464
- }
465
- if (typeof self !== "undefined") {
466
- return self;
467
- }
468
- if (typeof window !== "undefined") {
469
- return window;
470
- }
471
- if (typeof global !== "undefined") {
472
- return global;
473
- }
474
- throw new Error("could not find global");
475
- }
476
-
477
- // Licensed to the .NET Foundation under one or more agreements.
478
- class FetchHttpClient extends HttpClient {
479
- constructor(logger) {
480
- super();
481
- this._logger = logger;
482
- if (typeof fetch === "undefined") {
483
- // In order to ignore the dynamic require in webpack builds we need to do this magic
484
- // @ts-ignore: TS doesn't know about these names
485
- const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
486
- // Cookies aren't automatically handled in Node so we need to add a CookieJar to preserve cookies across requests
487
- this._jar = new (requireFunc("tough-cookie")).CookieJar();
488
- this._fetchType = requireFunc("node-fetch");
489
- // node-fetch doesn't have a nice API for getting and setting cookies
490
- // fetch-cookie will wrap a fetch implementation with a default CookieJar or a provided one
491
- this._fetchType = requireFunc("fetch-cookie")(this._fetchType, this._jar);
492
- }
493
- else {
494
- this._fetchType = fetch.bind(getGlobalThis());
495
- }
496
- if (typeof AbortController === "undefined") {
497
- // In order to ignore the dynamic require in webpack builds we need to do this magic
498
- // @ts-ignore: TS doesn't know about these names
499
- const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
500
- // Node needs EventListener methods on AbortController which our custom polyfill doesn't provide
501
- this._abortControllerType = requireFunc("abort-controller");
502
- }
503
- else {
504
- this._abortControllerType = AbortController;
505
- }
506
- }
507
- /** @inheritDoc */
508
- async send(request) {
509
- // Check that abort was not signaled before calling send
510
- if (request.abortSignal && request.abortSignal.aborted) {
511
- throw new AbortError();
512
- }
513
- if (!request.method) {
514
- throw new Error("No method defined.");
515
- }
516
- if (!request.url) {
517
- throw new Error("No url defined.");
518
- }
519
- const abortController = new this._abortControllerType();
520
- let error;
521
- // Hook our abortSignal into the abort controller
522
- if (request.abortSignal) {
523
- request.abortSignal.onabort = () => {
524
- abortController.abort();
525
- error = new AbortError();
526
- };
527
- }
528
- // If a timeout has been passed in, setup a timeout to call abort
529
- // Type needs to be any to fit window.setTimeout and NodeJS.setTimeout
530
- let timeoutId = null;
531
- if (request.timeout) {
532
- const msTimeout = request.timeout;
533
- timeoutId = setTimeout(() => {
534
- abortController.abort();
535
- this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);
536
- error = new TimeoutError();
537
- }, msTimeout);
538
- }
539
- let response;
540
- try {
541
- response = await this._fetchType(request.url, {
542
- body: request.content,
543
- cache: "no-cache",
544
- credentials: request.withCredentials === true ? "include" : "same-origin",
545
- headers: {
546
- "Content-Type": "text/plain;charset=UTF-8",
547
- "X-Requested-With": "XMLHttpRequest",
548
- ...request.headers,
549
- },
550
- method: request.method,
551
- mode: "cors",
552
- redirect: "follow",
553
- signal: abortController.signal,
554
- });
555
- }
556
- catch (e) {
557
- if (error) {
558
- throw error;
559
- }
560
- this._logger.log(LogLevel.Warning, `Error from HTTP request. ${e}.`);
561
- throw e;
562
- }
563
- finally {
564
- if (timeoutId) {
565
- clearTimeout(timeoutId);
566
- }
567
- if (request.abortSignal) {
568
- request.abortSignal.onabort = null;
569
- }
570
- }
571
- if (!response.ok) {
572
- const errorMessage = await deserializeContent(response, "text");
573
- throw new HttpError(errorMessage || response.statusText, response.status);
574
- }
575
- const content = deserializeContent(response, request.responseType);
576
- const payload = await content;
577
- return new HttpResponse(response.status, response.statusText, payload);
578
- }
579
- getCookieString(url) {
580
- let cookies = "";
581
- if (Platform.isNode && this._jar) {
582
- // @ts-ignore: unused variable
583
- this._jar.getCookies(url, (e, c) => cookies = c.join("; "));
584
- }
585
- return cookies;
586
- }
587
- }
588
- function deserializeContent(response, responseType) {
589
- let content;
590
- switch (responseType) {
591
- case "arraybuffer":
592
- content = response.arrayBuffer();
593
- break;
594
- case "text":
595
- content = response.text();
596
- break;
597
- case "blob":
598
- case "document":
599
- case "json":
600
- throw new Error(`${responseType} is not supported.`);
601
- default:
602
- content = response.text();
603
- break;
604
- }
605
- return content;
606
- }
607
-
608
- // Licensed to the .NET Foundation under one or more agreements.
609
- class XhrHttpClient extends HttpClient {
610
- constructor(logger) {
611
- super();
612
- this._logger = logger;
613
- }
614
- /** @inheritDoc */
615
- send(request) {
616
- // Check that abort was not signaled before calling send
617
- if (request.abortSignal && request.abortSignal.aborted) {
618
- return Promise.reject(new AbortError());
619
- }
620
- if (!request.method) {
621
- return Promise.reject(new Error("No method defined."));
622
- }
623
- if (!request.url) {
624
- return Promise.reject(new Error("No url defined."));
625
- }
626
- return new Promise((resolve, reject) => {
627
- const xhr = new XMLHttpRequest();
628
- xhr.open(request.method, request.url, true);
629
- xhr.withCredentials = request.withCredentials === undefined ? true : request.withCredentials;
630
- xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
631
- // Explicitly setting the Content-Type header for React Native on Android platform.
632
- xhr.setRequestHeader("Content-Type", "text/plain;charset=UTF-8");
633
- const headers = request.headers;
634
- if (headers) {
635
- Object.keys(headers)
636
- .forEach((header) => {
637
- xhr.setRequestHeader(header, headers[header]);
638
- });
639
- }
640
- if (request.responseType) {
641
- xhr.responseType = request.responseType;
642
- }
643
- if (request.abortSignal) {
644
- request.abortSignal.onabort = () => {
645
- xhr.abort();
646
- reject(new AbortError());
647
- };
648
- }
649
- if (request.timeout) {
650
- xhr.timeout = request.timeout;
651
- }
652
- xhr.onload = () => {
653
- if (request.abortSignal) {
654
- request.abortSignal.onabort = null;
655
- }
656
- if (xhr.status >= 200 && xhr.status < 300) {
657
- resolve(new HttpResponse(xhr.status, xhr.statusText, xhr.response || xhr.responseText));
658
- }
659
- else {
660
- reject(new HttpError(xhr.response || xhr.responseText || xhr.statusText, xhr.status));
661
- }
662
- };
663
- xhr.onerror = () => {
664
- this._logger.log(LogLevel.Warning, `Error from HTTP request. ${xhr.status}: ${xhr.statusText}.`);
665
- reject(new HttpError(xhr.statusText, xhr.status));
666
- };
667
- xhr.ontimeout = () => {
668
- this._logger.log(LogLevel.Warning, `Timeout from HTTP request.`);
669
- reject(new TimeoutError());
670
- };
671
- xhr.send(request.content || "");
672
- });
673
- }
674
- }
675
-
676
- // Licensed to the .NET Foundation under one or more agreements.
677
- /** Default implementation of {@link @microsoft/signalr.HttpClient}. */
678
- class DefaultHttpClient extends HttpClient {
679
- /** Creates a new instance of the {@link @microsoft/signalr.DefaultHttpClient}, using the provided {@link @microsoft/signalr.ILogger} to log messages. */
680
- constructor(logger) {
681
- super();
682
- if (typeof fetch !== "undefined" || Platform.isNode) {
683
- this._httpClient = new FetchHttpClient(logger);
684
- }
685
- else if (typeof XMLHttpRequest !== "undefined") {
686
- this._httpClient = new XhrHttpClient(logger);
687
- }
688
- else {
689
- throw new Error("No usable HttpClient found.");
690
- }
691
- }
692
- /** @inheritDoc */
693
- send(request) {
694
- // Check that abort was not signaled before calling send
695
- if (request.abortSignal && request.abortSignal.aborted) {
696
- return Promise.reject(new AbortError());
697
- }
698
- if (!request.method) {
699
- return Promise.reject(new Error("No method defined."));
700
- }
701
- if (!request.url) {
702
- return Promise.reject(new Error("No url defined."));
703
- }
704
- return this._httpClient.send(request);
705
- }
706
- getCookieString(url) {
707
- return this._httpClient.getCookieString(url);
708
- }
709
- }
710
-
711
- // Licensed to the .NET Foundation under one or more agreements.
712
- // The .NET Foundation licenses this file to you under the MIT license.
713
- // Not exported from index
714
- /** @private */
715
- class TextMessageFormat {
716
- static write(output) {
717
- return `${output}${TextMessageFormat.RecordSeparator}`;
718
- }
719
- static parse(input) {
720
- if (input[input.length - 1] !== TextMessageFormat.RecordSeparator) {
721
- throw new Error("Message is incomplete.");
722
- }
723
- const messages = input.split(TextMessageFormat.RecordSeparator);
724
- messages.pop();
725
- return messages;
726
- }
727
- }
728
- TextMessageFormat.RecordSeparatorCode = 0x1e;
729
- TextMessageFormat.RecordSeparator = String.fromCharCode(TextMessageFormat.RecordSeparatorCode);
730
-
731
- // Licensed to the .NET Foundation under one or more agreements.
732
- /** @private */
733
- class HandshakeProtocol {
734
- // Handshake request is always JSON
735
- writeHandshakeRequest(handshakeRequest) {
736
- return TextMessageFormat.write(JSON.stringify(handshakeRequest));
737
- }
738
- parseHandshakeResponse(data) {
739
- let messageData;
740
- let remainingData;
741
- if (isArrayBuffer(data)) {
742
- // Format is binary but still need to read JSON text from handshake response
743
- const binaryData = new Uint8Array(data);
744
- const separatorIndex = binaryData.indexOf(TextMessageFormat.RecordSeparatorCode);
745
- if (separatorIndex === -1) {
746
- throw new Error("Message is incomplete.");
747
- }
748
- // content before separator is handshake response
749
- // optional content after is additional messages
750
- const responseLength = separatorIndex + 1;
751
- messageData = String.fromCharCode.apply(null, Array.prototype.slice.call(binaryData.slice(0, responseLength)));
752
- remainingData = (binaryData.byteLength > responseLength) ? binaryData.slice(responseLength).buffer : null;
753
- }
754
- else {
755
- const textData = data;
756
- const separatorIndex = textData.indexOf(TextMessageFormat.RecordSeparator);
757
- if (separatorIndex === -1) {
758
- throw new Error("Message is incomplete.");
759
- }
760
- // content before separator is handshake response
761
- // optional content after is additional messages
762
- const responseLength = separatorIndex + 1;
763
- messageData = textData.substring(0, responseLength);
764
- remainingData = (textData.length > responseLength) ? textData.substring(responseLength) : null;
765
- }
766
- // At this point we should have just the single handshake message
767
- const messages = TextMessageFormat.parse(messageData);
768
- const response = JSON.parse(messages[0]);
769
- if (response.type) {
770
- throw new Error("Expected a handshake response from the server.");
771
- }
772
- const responseMessage = response;
773
- // multiple messages could have arrived with handshake
774
- // return additional data to be parsed as usual, or null if all parsed
775
- return [remainingData, responseMessage];
776
- }
777
- }
778
-
779
- // Licensed to the .NET Foundation under one or more agreements.
780
- // The .NET Foundation licenses this file to you under the MIT license.
781
- /** Defines the type of a Hub Message. */
782
- var MessageType;
783
- (function (MessageType) {
784
- /** Indicates the message is an Invocation message and implements the {@link @microsoft/signalr.InvocationMessage} interface. */
785
- MessageType[MessageType["Invocation"] = 1] = "Invocation";
786
- /** Indicates the message is a StreamItem message and implements the {@link @microsoft/signalr.StreamItemMessage} interface. */
787
- MessageType[MessageType["StreamItem"] = 2] = "StreamItem";
788
- /** Indicates the message is a Completion message and implements the {@link @microsoft/signalr.CompletionMessage} interface. */
789
- MessageType[MessageType["Completion"] = 3] = "Completion";
790
- /** Indicates the message is a Stream Invocation message and implements the {@link @microsoft/signalr.StreamInvocationMessage} interface. */
791
- MessageType[MessageType["StreamInvocation"] = 4] = "StreamInvocation";
792
- /** Indicates the message is a Cancel Invocation message and implements the {@link @microsoft/signalr.CancelInvocationMessage} interface. */
793
- MessageType[MessageType["CancelInvocation"] = 5] = "CancelInvocation";
794
- /** Indicates the message is a Ping message and implements the {@link @microsoft/signalr.PingMessage} interface. */
795
- MessageType[MessageType["Ping"] = 6] = "Ping";
796
- /** Indicates the message is a Close message and implements the {@link @microsoft/signalr.CloseMessage} interface. */
797
- MessageType[MessageType["Close"] = 7] = "Close";
798
- })(MessageType || (MessageType = {}));
799
-
800
- // Licensed to the .NET Foundation under one or more agreements.
801
- /** Stream implementation to stream items to the server. */
802
- class Subject {
803
- constructor() {
804
- this.observers = [];
805
- }
806
- next(item) {
807
- for (const observer of this.observers) {
808
- observer.next(item);
809
- }
810
- }
811
- error(err) {
812
- for (const observer of this.observers) {
813
- if (observer.error) {
814
- observer.error(err);
815
- }
816
- }
817
- }
818
- complete() {
819
- for (const observer of this.observers) {
820
- if (observer.complete) {
821
- observer.complete();
822
- }
823
- }
824
- }
825
- subscribe(observer) {
826
- this.observers.push(observer);
827
- return new SubjectSubscription(this, observer);
828
- }
829
- }
830
-
831
- // Licensed to the .NET Foundation under one or more agreements.
832
- const DEFAULT_TIMEOUT_IN_MS = 30 * 1000;
833
- const DEFAULT_PING_INTERVAL_IN_MS = 15 * 1000;
834
- /** Describes the current state of the {@link HubConnection} to the server. */
835
- var HubConnectionState;
836
- (function (HubConnectionState) {
837
- /** The hub connection is disconnected. */
838
- HubConnectionState["Disconnected"] = "Disconnected";
839
- /** The hub connection is connecting. */
840
- HubConnectionState["Connecting"] = "Connecting";
841
- /** The hub connection is connected. */
842
- HubConnectionState["Connected"] = "Connected";
843
- /** The hub connection is disconnecting. */
844
- HubConnectionState["Disconnecting"] = "Disconnecting";
845
- /** The hub connection is reconnecting. */
846
- HubConnectionState["Reconnecting"] = "Reconnecting";
847
- })(HubConnectionState || (HubConnectionState = {}));
848
- /** Represents a connection to a SignalR Hub. */
849
- class HubConnection {
850
- constructor(connection, logger, protocol, reconnectPolicy) {
851
- this._nextKeepAlive = 0;
852
- this._freezeEventListener = () => {
853
- this._logger.log(LogLevel.Warning, "The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep");
854
- };
855
- Arg.isRequired(connection, "connection");
856
- Arg.isRequired(logger, "logger");
857
- Arg.isRequired(protocol, "protocol");
858
- this.serverTimeoutInMilliseconds = DEFAULT_TIMEOUT_IN_MS;
859
- this.keepAliveIntervalInMilliseconds = DEFAULT_PING_INTERVAL_IN_MS;
860
- this._logger = logger;
861
- this._protocol = protocol;
862
- this.connection = connection;
863
- this._reconnectPolicy = reconnectPolicy;
864
- this._handshakeProtocol = new HandshakeProtocol();
865
- this.connection.onreceive = (data) => this._processIncomingData(data);
866
- this.connection.onclose = (error) => this._connectionClosed(error);
867
- this._callbacks = {};
868
- this._methods = {};
869
- this._closedCallbacks = [];
870
- this._reconnectingCallbacks = [];
871
- this._reconnectedCallbacks = [];
872
- this._invocationId = 0;
873
- this._receivedHandshakeResponse = false;
874
- this._connectionState = HubConnectionState.Disconnected;
875
- this._connectionStarted = false;
876
- this._cachedPingMessage = this._protocol.writeMessage({ type: MessageType.Ping });
877
- }
878
- /** @internal */
879
- // Using a public static factory method means we can have a private constructor and an _internal_
880
- // create method that can be used by HubConnectionBuilder. An "internal" constructor would just
881
- // be stripped away and the '.d.ts' file would have no constructor, which is interpreted as a
882
- // public parameter-less constructor.
883
- static create(connection, logger, protocol, reconnectPolicy) {
884
- return new HubConnection(connection, logger, protocol, reconnectPolicy);
885
- }
886
- /** Indicates the state of the {@link HubConnection} to the server. */
887
- get state() {
888
- return this._connectionState;
889
- }
890
- /** Represents the connection id of the {@link HubConnection} on the server. The connection id will be null when the connection is either
891
- * in the disconnected state or if the negotiation step was skipped.
892
- */
893
- get connectionId() {
894
- return this.connection ? (this.connection.connectionId || null) : null;
895
- }
896
- /** Indicates the url of the {@link HubConnection} to the server. */
897
- get baseUrl() {
898
- return this.connection.baseUrl || "";
899
- }
900
- /**
901
- * Sets a new url for the HubConnection. Note that the url can only be changed when the connection is in either the Disconnected or
902
- * Reconnecting states.
903
- * @param {string} url The url to connect to.
904
- */
905
- set baseUrl(url) {
906
- if (this._connectionState !== HubConnectionState.Disconnected && this._connectionState !== HubConnectionState.Reconnecting) {
907
- throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");
908
- }
909
- if (!url) {
910
- throw new Error("The HubConnection url must be a valid url.");
911
- }
912
- this.connection.baseUrl = url;
913
- }
914
- /** Starts the connection.
915
- *
916
- * @returns {Promise<void>} A Promise that resolves when the connection has been successfully established, or rejects with an error.
917
- */
918
- start() {
919
- this._startPromise = this._startWithStateTransitions();
920
- return this._startPromise;
921
- }
922
- async _startWithStateTransitions() {
923
- if (this._connectionState !== HubConnectionState.Disconnected) {
924
- return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));
925
- }
926
- this._connectionState = HubConnectionState.Connecting;
927
- this._logger.log(LogLevel.Debug, "Starting HubConnection.");
928
- try {
929
- await this._startInternal();
930
- if (Platform.isBrowser) {
931
- // Log when the browser freezes the tab so users know why their connection unexpectedly stopped working
932
- window.document.addEventListener("freeze", this._freezeEventListener);
933
- }
934
- this._connectionState = HubConnectionState.Connected;
935
- this._connectionStarted = true;
936
- this._logger.log(LogLevel.Debug, "HubConnection connected successfully.");
937
- }
938
- catch (e) {
939
- this._connectionState = HubConnectionState.Disconnected;
940
- this._logger.log(LogLevel.Debug, `HubConnection failed to start successfully because of error '${e}'.`);
941
- return Promise.reject(e);
942
- }
943
- }
944
- async _startInternal() {
945
- this._stopDuringStartError = undefined;
946
- this._receivedHandshakeResponse = false;
947
- // Set up the promise before any connection is (re)started otherwise it could race with received messages
948
- const handshakePromise = new Promise((resolve, reject) => {
949
- this._handshakeResolver = resolve;
950
- this._handshakeRejecter = reject;
951
- });
952
- await this.connection.start(this._protocol.transferFormat);
953
- try {
954
- const handshakeRequest = {
955
- protocol: this._protocol.name,
956
- version: this._protocol.version,
957
- };
958
- this._logger.log(LogLevel.Debug, "Sending handshake request.");
959
- await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(handshakeRequest));
960
- this._logger.log(LogLevel.Information, `Using HubProtocol '${this._protocol.name}'.`);
961
- // defensively cleanup timeout in case we receive a message from the server before we finish start
962
- this._cleanupTimeout();
963
- this._resetTimeoutPeriod();
964
- this._resetKeepAliveInterval();
965
- await handshakePromise;
966
- // It's important to check the stopDuringStartError instead of just relying on the handshakePromise
967
- // being rejected on close, because this continuation can run after both the handshake completed successfully
968
- // and the connection was closed.
969
- if (this._stopDuringStartError) {
970
- // It's important to throw instead of returning a rejected promise, because we don't want to allow any state
971
- // transitions to occur between now and the calling code observing the exceptions. Returning a rejected promise
972
- // will cause the calling continuation to get scheduled to run later.
973
- // eslint-disable-next-line @typescript-eslint/no-throw-literal
974
- throw this._stopDuringStartError;
975
- }
976
- }
977
- catch (e) {
978
- this._logger.log(LogLevel.Debug, `Hub handshake failed with error '${e}' during start(). Stopping HubConnection.`);
979
- this._cleanupTimeout();
980
- this._cleanupPingTimer();
981
- // HttpConnection.stop() should not complete until after the onclose callback is invoked.
982
- // This will transition the HubConnection to the disconnected state before HttpConnection.stop() completes.
983
- await this.connection.stop(e);
984
- throw e;
985
- }
986
- }
987
- /** Stops the connection.
988
- *
989
- * @returns {Promise<void>} A Promise that resolves when the connection has been successfully terminated, or rejects with an error.
990
- */
991
- async stop() {
992
- // Capture the start promise before the connection might be restarted in an onclose callback.
993
- const startPromise = this._startPromise;
994
- this._stopPromise = this._stopInternal();
995
- await this._stopPromise;
996
- try {
997
- // Awaiting undefined continues immediately
998
- await startPromise;
999
- }
1000
- catch (e) {
1001
- // This exception is returned to the user as a rejected Promise from the start method.
1002
- }
1003
- }
1004
- _stopInternal(error) {
1005
- if (this._connectionState === HubConnectionState.Disconnected) {
1006
- this._logger.log(LogLevel.Debug, `Call to HubConnection.stop(${error}) ignored because it is already in the disconnected state.`);
1007
- return Promise.resolve();
1008
- }
1009
- if (this._connectionState === HubConnectionState.Disconnecting) {
1010
- this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);
1011
- return this._stopPromise;
1012
- }
1013
- this._connectionState = HubConnectionState.Disconnecting;
1014
- this._logger.log(LogLevel.Debug, "Stopping HubConnection.");
1015
- if (this._reconnectDelayHandle) {
1016
- // We're in a reconnect delay which means the underlying connection is currently already stopped.
1017
- // Just clear the handle to stop the reconnect loop (which no one is waiting on thankfully) and
1018
- // fire the onclose callbacks.
1019
- this._logger.log(LogLevel.Debug, "Connection stopped during reconnect delay. Done reconnecting.");
1020
- clearTimeout(this._reconnectDelayHandle);
1021
- this._reconnectDelayHandle = undefined;
1022
- this._completeClose();
1023
- return Promise.resolve();
1024
- }
1025
- this._cleanupTimeout();
1026
- this._cleanupPingTimer();
1027
- this._stopDuringStartError = error || new Error("The connection was stopped before the hub handshake could complete.");
1028
- // HttpConnection.stop() should not complete until after either HttpConnection.start() fails
1029
- // or the onclose callback is invoked. The onclose callback will transition the HubConnection
1030
- // to the disconnected state if need be before HttpConnection.stop() completes.
1031
- return this.connection.stop(error);
1032
- }
1033
- /** Invokes a streaming hub method on the server using the specified name and arguments.
1034
- *
1035
- * @typeparam T The type of the items returned by the server.
1036
- * @param {string} methodName The name of the server method to invoke.
1037
- * @param {any[]} args The arguments used to invoke the server method.
1038
- * @returns {IStreamResult<T>} An object that yields results from the server as they are received.
1039
- */
1040
- stream(methodName, ...args) {
1041
- const [streams, streamIds] = this._replaceStreamingParams(args);
1042
- const invocationDescriptor = this._createStreamInvocation(methodName, args, streamIds);
1043
- // eslint-disable-next-line prefer-const
1044
- let promiseQueue;
1045
- const subject = new Subject();
1046
- subject.cancelCallback = () => {
1047
- const cancelInvocation = this._createCancelInvocation(invocationDescriptor.invocationId);
1048
- delete this._callbacks[invocationDescriptor.invocationId];
1049
- return promiseQueue.then(() => {
1050
- return this._sendWithProtocol(cancelInvocation);
1051
- });
1052
- };
1053
- this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {
1054
- if (error) {
1055
- subject.error(error);
1056
- return;
1057
- }
1058
- else if (invocationEvent) {
1059
- // invocationEvent will not be null when an error is not passed to the callback
1060
- if (invocationEvent.type === MessageType.Completion) {
1061
- if (invocationEvent.error) {
1062
- subject.error(new Error(invocationEvent.error));
1063
- }
1064
- else {
1065
- subject.complete();
1066
- }
1067
- }
1068
- else {
1069
- subject.next((invocationEvent.item));
1070
- }
1071
- }
1072
- };
1073
- promiseQueue = this._sendWithProtocol(invocationDescriptor)
1074
- .catch((e) => {
1075
- subject.error(e);
1076
- delete this._callbacks[invocationDescriptor.invocationId];
1077
- });
1078
- this._launchStreams(streams, promiseQueue);
1079
- return subject;
1080
- }
1081
- _sendMessage(message) {
1082
- this._resetKeepAliveInterval();
1083
- return this.connection.send(message);
1084
- }
1085
- /**
1086
- * Sends a js object to the server.
1087
- * @param message The js object to serialize and send.
1088
- */
1089
- _sendWithProtocol(message) {
1090
- return this._sendMessage(this._protocol.writeMessage(message));
1091
- }
1092
- /** Invokes a hub method on the server using the specified name and arguments. Does not wait for a response from the receiver.
1093
- *
1094
- * The Promise returned by this method resolves when the client has sent the invocation to the server. The server may still
1095
- * be processing the invocation.
1096
- *
1097
- * @param {string} methodName The name of the server method to invoke.
1098
- * @param {any[]} args The arguments used to invoke the server method.
1099
- * @returns {Promise<void>} A Promise that resolves when the invocation has been successfully sent, or rejects with an error.
1100
- */
1101
- send(methodName, ...args) {
1102
- const [streams, streamIds] = this._replaceStreamingParams(args);
1103
- const sendPromise = this._sendWithProtocol(this._createInvocation(methodName, args, true, streamIds));
1104
- this._launchStreams(streams, sendPromise);
1105
- return sendPromise;
1106
- }
1107
- /** Invokes a hub method on the server using the specified name and arguments.
1108
- *
1109
- * The Promise returned by this method resolves when the server indicates it has finished invoking the method. When the promise
1110
- * resolves, the server has finished invoking the method. If the server method returns a result, it is produced as the result of
1111
- * resolving the Promise.
1112
- *
1113
- * @typeparam T The expected return type.
1114
- * @param {string} methodName The name of the server method to invoke.
1115
- * @param {any[]} args The arguments used to invoke the server method.
1116
- * @returns {Promise<T>} A Promise that resolves with the result of the server method (if any), or rejects with an error.
1117
- */
1118
- invoke(methodName, ...args) {
1119
- const [streams, streamIds] = this._replaceStreamingParams(args);
1120
- const invocationDescriptor = this._createInvocation(methodName, args, false, streamIds);
1121
- const p = new Promise((resolve, reject) => {
1122
- // invocationId will always have a value for a non-blocking invocation
1123
- this._callbacks[invocationDescriptor.invocationId] = (invocationEvent, error) => {
1124
- if (error) {
1125
- reject(error);
1126
- return;
1127
- }
1128
- else if (invocationEvent) {
1129
- // invocationEvent will not be null when an error is not passed to the callback
1130
- if (invocationEvent.type === MessageType.Completion) {
1131
- if (invocationEvent.error) {
1132
- reject(new Error(invocationEvent.error));
1133
- }
1134
- else {
1135
- resolve(invocationEvent.result);
1136
- }
1137
- }
1138
- else {
1139
- reject(new Error(`Unexpected message type: ${invocationEvent.type}`));
1140
- }
1141
- }
1142
- };
1143
- const promiseQueue = this._sendWithProtocol(invocationDescriptor)
1144
- .catch((e) => {
1145
- reject(e);
1146
- // invocationId will always have a value for a non-blocking invocation
1147
- delete this._callbacks[invocationDescriptor.invocationId];
1148
- });
1149
- this._launchStreams(streams, promiseQueue);
1150
- });
1151
- return p;
1152
- }
1153
- /** Registers a handler that will be invoked when the hub method with the specified method name is invoked.
1154
- *
1155
- * @param {string} methodName The name of the hub method to define.
1156
- * @param {Function} newMethod The handler that will be raised when the hub method is invoked.
1157
- */
1158
- on(methodName, newMethod) {
1159
- if (!methodName || !newMethod) {
1160
- return;
1161
- }
1162
- methodName = methodName.toLowerCase();
1163
- if (!this._methods[methodName]) {
1164
- this._methods[methodName] = [];
1165
- }
1166
- // Preventing adding the same handler multiple times.
1167
- if (this._methods[methodName].indexOf(newMethod) !== -1) {
1168
- return;
1169
- }
1170
- this._methods[methodName].push(newMethod);
1171
- }
1172
- off(methodName, method) {
1173
- if (!methodName) {
1174
- return;
1175
- }
1176
- methodName = methodName.toLowerCase();
1177
- const handlers = this._methods[methodName];
1178
- if (!handlers) {
1179
- return;
1180
- }
1181
- if (method) {
1182
- const removeIdx = handlers.indexOf(method);
1183
- if (removeIdx !== -1) {
1184
- handlers.splice(removeIdx, 1);
1185
- if (handlers.length === 0) {
1186
- delete this._methods[methodName];
1187
- }
1188
- }
1189
- }
1190
- else {
1191
- delete this._methods[methodName];
1192
- }
1193
- }
1194
- /** Registers a handler that will be invoked when the connection is closed.
1195
- *
1196
- * @param {Function} callback The handler that will be invoked when the connection is closed. Optionally receives a single argument containing the error that caused the connection to close (if any).
1197
- */
1198
- onclose(callback) {
1199
- if (callback) {
1200
- this._closedCallbacks.push(callback);
1201
- }
1202
- }
1203
- /** Registers a handler that will be invoked when the connection starts reconnecting.
1204
- *
1205
- * @param {Function} callback The handler that will be invoked when the connection starts reconnecting. Optionally receives a single argument containing the error that caused the connection to start reconnecting (if any).
1206
- */
1207
- onreconnecting(callback) {
1208
- if (callback) {
1209
- this._reconnectingCallbacks.push(callback);
1210
- }
1211
- }
1212
- /** Registers a handler that will be invoked when the connection successfully reconnects.
1213
- *
1214
- * @param {Function} callback The handler that will be invoked when the connection successfully reconnects.
1215
- */
1216
- onreconnected(callback) {
1217
- if (callback) {
1218
- this._reconnectedCallbacks.push(callback);
1219
- }
1220
- }
1221
- _processIncomingData(data) {
1222
- this._cleanupTimeout();
1223
- if (!this._receivedHandshakeResponse) {
1224
- data = this._processHandshakeResponse(data);
1225
- this._receivedHandshakeResponse = true;
1226
- }
1227
- // Data may have all been read when processing handshake response
1228
- if (data) {
1229
- // Parse the messages
1230
- const messages = this._protocol.parseMessages(data, this._logger);
1231
- for (const message of messages) {
1232
- switch (message.type) {
1233
- case MessageType.Invocation:
1234
- this._invokeClientMethod(message);
1235
- break;
1236
- case MessageType.StreamItem:
1237
- case MessageType.Completion: {
1238
- const callback = this._callbacks[message.invocationId];
1239
- if (callback) {
1240
- if (message.type === MessageType.Completion) {
1241
- delete this._callbacks[message.invocationId];
1242
- }
1243
- try {
1244
- callback(message);
1245
- }
1246
- catch (e) {
1247
- this._logger.log(LogLevel.Error, `Stream callback threw error: ${getErrorString(e)}`);
1248
- }
1249
- }
1250
- break;
1251
- }
1252
- case MessageType.Ping:
1253
- // Don't care about pings
1254
- break;
1255
- case MessageType.Close: {
1256
- this._logger.log(LogLevel.Information, "Close message received from server.");
1257
- const error = message.error ? new Error("Server returned an error on close: " + message.error) : undefined;
1258
- if (message.allowReconnect === true) {
1259
- // It feels wrong not to await connection.stop() here, but processIncomingData is called as part of an onreceive callback which is not async,
1260
- // this is already the behavior for serverTimeout(), and HttpConnection.Stop() should catch and log all possible exceptions.
1261
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
1262
- this.connection.stop(error);
1263
- }
1264
- else {
1265
- // We cannot await stopInternal() here, but subsequent calls to stop() will await this if stopInternal() is still ongoing.
1266
- this._stopPromise = this._stopInternal(error);
1267
- }
1268
- break;
1269
- }
1270
- default:
1271
- this._logger.log(LogLevel.Warning, `Invalid message type: ${message.type}.`);
1272
- break;
1273
- }
1274
- }
1275
- }
1276
- this._resetTimeoutPeriod();
1277
- }
1278
- _processHandshakeResponse(data) {
1279
- let responseMessage;
1280
- let remainingData;
1281
- try {
1282
- [remainingData, responseMessage] = this._handshakeProtocol.parseHandshakeResponse(data);
1283
- }
1284
- catch (e) {
1285
- const message = "Error parsing handshake response: " + e;
1286
- this._logger.log(LogLevel.Error, message);
1287
- const error = new Error(message);
1288
- this._handshakeRejecter(error);
1289
- throw error;
1290
- }
1291
- if (responseMessage.error) {
1292
- const message = "Server returned handshake error: " + responseMessage.error;
1293
- this._logger.log(LogLevel.Error, message);
1294
- const error = new Error(message);
1295
- this._handshakeRejecter(error);
1296
- throw error;
1297
- }
1298
- else {
1299
- this._logger.log(LogLevel.Debug, "Server handshake complete.");
1300
- }
1301
- this._handshakeResolver();
1302
- return remainingData;
1303
- }
1304
- _resetKeepAliveInterval() {
1305
- if (this.connection.features.inherentKeepAlive) {
1306
- return;
1307
- }
1308
- // Set the time we want the next keep alive to be sent
1309
- // Timer will be setup on next message receive
1310
- this._nextKeepAlive = new Date().getTime() + this.keepAliveIntervalInMilliseconds;
1311
- this._cleanupPingTimer();
1312
- }
1313
- _resetTimeoutPeriod() {
1314
- if (!this.connection.features || !this.connection.features.inherentKeepAlive) {
1315
- // Set the timeout timer
1316
- this._timeoutHandle = setTimeout(() => this.serverTimeout(), this.serverTimeoutInMilliseconds);
1317
- // Set keepAlive timer if there isn't one
1318
- if (this._pingServerHandle === undefined) {
1319
- let nextPing = this._nextKeepAlive - new Date().getTime();
1320
- if (nextPing < 0) {
1321
- nextPing = 0;
1322
- }
1323
- // The timer needs to be set from a networking callback to avoid Chrome timer throttling from causing timers to run once a minute
1324
- this._pingServerHandle = setTimeout(async () => {
1325
- if (this._connectionState === HubConnectionState.Connected) {
1326
- try {
1327
- await this._sendMessage(this._cachedPingMessage);
1328
- }
1329
- catch {
1330
- // We don't care about the error. It should be seen elsewhere in the client.
1331
- // The connection is probably in a bad or closed state now, cleanup the timer so it stops triggering
1332
- this._cleanupPingTimer();
1333
- }
1334
- }
1335
- }, nextPing);
1336
- }
1337
- }
1338
- }
1339
- // eslint-disable-next-line @typescript-eslint/naming-convention
1340
- serverTimeout() {
1341
- // The server hasn't talked to us in a while. It doesn't like us anymore ... :(
1342
- // Terminate the connection, but we don't need to wait on the promise. This could trigger reconnecting.
1343
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
1344
- this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."));
1345
- }
1346
- _invokeClientMethod(invocationMessage) {
1347
- const methods = this._methods[invocationMessage.target.toLowerCase()];
1348
- if (methods) {
1349
- try {
1350
- methods.forEach((m) => m.apply(this, invocationMessage.arguments));
1351
- }
1352
- catch (e) {
1353
- this._logger.log(LogLevel.Error, `A callback for the method ${invocationMessage.target.toLowerCase()} threw error '${e}'.`);
1354
- }
1355
- if (invocationMessage.invocationId) {
1356
- // This is not supported in v1. So we return an error to avoid blocking the server waiting for the response.
1357
- const message = "Server requested a response, which is not supported in this version of the client.";
1358
- this._logger.log(LogLevel.Error, message);
1359
- // We don't want to wait on the stop itself.
1360
- this._stopPromise = this._stopInternal(new Error(message));
1361
- }
1362
- }
1363
- else {
1364
- this._logger.log(LogLevel.Warning, `No client method with the name '${invocationMessage.target}' found.`);
1365
- }
1366
- }
1367
- _connectionClosed(error) {
1368
- this._logger.log(LogLevel.Debug, `HubConnection.connectionClosed(${error}) called while in state ${this._connectionState}.`);
1369
- // Triggering this.handshakeRejecter is insufficient because it could already be resolved without the continuation having run yet.
1370
- this._stopDuringStartError = this._stopDuringStartError || error || new Error("The underlying connection was closed before the hub handshake could complete.");
1371
- // If the handshake is in progress, start will be waiting for the handshake promise, so we complete it.
1372
- // If it has already completed, this should just noop.
1373
- if (this._handshakeResolver) {
1374
- this._handshakeResolver();
1375
- }
1376
- this._cancelCallbacksWithError(error || new Error("Invocation canceled due to the underlying connection being closed."));
1377
- this._cleanupTimeout();
1378
- this._cleanupPingTimer();
1379
- if (this._connectionState === HubConnectionState.Disconnecting) {
1380
- this._completeClose(error);
1381
- }
1382
- else if (this._connectionState === HubConnectionState.Connected && this._reconnectPolicy) {
1383
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
1384
- this._reconnect(error);
1385
- }
1386
- else if (this._connectionState === HubConnectionState.Connected) {
1387
- this._completeClose(error);
1388
- }
1389
- // If none of the above if conditions were true were called the HubConnection must be in either:
1390
- // 1. The Connecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail it.
1391
- // 2. The Reconnecting state in which case the handshakeResolver will complete it and stopDuringStartError will fail the current reconnect attempt
1392
- // and potentially continue the reconnect() loop.
1393
- // 3. The Disconnected state in which case we're already done.
1394
- }
1395
- _completeClose(error) {
1396
- if (this._connectionStarted) {
1397
- this._connectionState = HubConnectionState.Disconnected;
1398
- this._connectionStarted = false;
1399
- if (Platform.isBrowser) {
1400
- window.document.removeEventListener("freeze", this._freezeEventListener);
1401
- }
1402
- try {
1403
- this._closedCallbacks.forEach((c) => c.apply(this, [error]));
1404
- }
1405
- catch (e) {
1406
- this._logger.log(LogLevel.Error, `An onclose callback called with error '${error}' threw error '${e}'.`);
1407
- }
1408
- }
1409
- }
1410
- async _reconnect(error) {
1411
- const reconnectStartTime = Date.now();
1412
- let previousReconnectAttempts = 0;
1413
- let retryError = error !== undefined ? error : new Error("Attempting to reconnect due to a unknown error.");
1414
- let nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, 0, retryError);
1415
- if (nextRetryDelay === null) {
1416
- this._logger.log(LogLevel.Debug, "Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt.");
1417
- this._completeClose(error);
1418
- return;
1419
- }
1420
- this._connectionState = HubConnectionState.Reconnecting;
1421
- if (error) {
1422
- this._logger.log(LogLevel.Information, `Connection reconnecting because of error '${error}'.`);
1423
- }
1424
- else {
1425
- this._logger.log(LogLevel.Information, "Connection reconnecting.");
1426
- }
1427
- if (this._reconnectingCallbacks.length !== 0) {
1428
- try {
1429
- this._reconnectingCallbacks.forEach((c) => c.apply(this, [error]));
1430
- }
1431
- catch (e) {
1432
- this._logger.log(LogLevel.Error, `An onreconnecting callback called with error '${error}' threw error '${e}'.`);
1433
- }
1434
- // Exit early if an onreconnecting callback called connection.stop().
1435
- if (this._connectionState !== HubConnectionState.Reconnecting) {
1436
- this._logger.log(LogLevel.Debug, "Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");
1437
- return;
1438
- }
1439
- }
1440
- while (nextRetryDelay !== null) {
1441
- this._logger.log(LogLevel.Information, `Reconnect attempt number ${previousReconnectAttempts} will start in ${nextRetryDelay} ms.`);
1442
- await new Promise((resolve) => {
1443
- this._reconnectDelayHandle = setTimeout(resolve, nextRetryDelay);
1444
- });
1445
- this._reconnectDelayHandle = undefined;
1446
- if (this._connectionState !== HubConnectionState.Reconnecting) {
1447
- this._logger.log(LogLevel.Debug, "Connection left the reconnecting state during reconnect delay. Done reconnecting.");
1448
- return;
1449
- }
1450
- try {
1451
- await this._startInternal();
1452
- this._connectionState = HubConnectionState.Connected;
1453
- this._logger.log(LogLevel.Information, "HubConnection reconnected successfully.");
1454
- if (this._reconnectedCallbacks.length !== 0) {
1455
- try {
1456
- this._reconnectedCallbacks.forEach((c) => c.apply(this, [this.connection.connectionId]));
1457
- }
1458
- catch (e) {
1459
- this._logger.log(LogLevel.Error, `An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${e}'.`);
1460
- }
1461
- }
1462
- return;
1463
- }
1464
- catch (e) {
1465
- this._logger.log(LogLevel.Information, `Reconnect attempt failed because of error '${e}'.`);
1466
- if (this._connectionState !== HubConnectionState.Reconnecting) {
1467
- this._logger.log(LogLevel.Debug, `Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`);
1468
- // The TypeScript compiler thinks that connectionState must be Connected here. The TypeScript compiler is wrong.
1469
- if (this._connectionState === HubConnectionState.Disconnecting) {
1470
- this._completeClose();
1471
- }
1472
- return;
1473
- }
1474
- retryError = e instanceof Error ? e : new Error(e.toString());
1475
- nextRetryDelay = this._getNextRetryDelay(previousReconnectAttempts++, Date.now() - reconnectStartTime, retryError);
1476
- }
1477
- }
1478
- this._logger.log(LogLevel.Information, `Reconnect retries have been exhausted after ${Date.now() - reconnectStartTime} ms and ${previousReconnectAttempts} failed attempts. Connection disconnecting.`);
1479
- this._completeClose();
1480
- }
1481
- _getNextRetryDelay(previousRetryCount, elapsedMilliseconds, retryReason) {
1482
- try {
1483
- return this._reconnectPolicy.nextRetryDelayInMilliseconds({
1484
- elapsedMilliseconds,
1485
- previousRetryCount,
1486
- retryReason,
1487
- });
1488
- }
1489
- catch (e) {
1490
- this._logger.log(LogLevel.Error, `IRetryPolicy.nextRetryDelayInMilliseconds(${previousRetryCount}, ${elapsedMilliseconds}) threw error '${e}'.`);
1491
- return null;
1492
- }
1493
- }
1494
- _cancelCallbacksWithError(error) {
1495
- const callbacks = this._callbacks;
1496
- this._callbacks = {};
1497
- Object.keys(callbacks)
1498
- .forEach((key) => {
1499
- const callback = callbacks[key];
1500
- try {
1501
- callback(null, error);
1502
- }
1503
- catch (e) {
1504
- this._logger.log(LogLevel.Error, `Stream 'error' callback called with '${error}' threw error: ${getErrorString(e)}`);
1505
- }
1506
- });
1507
- }
1508
- _cleanupPingTimer() {
1509
- if (this._pingServerHandle) {
1510
- clearTimeout(this._pingServerHandle);
1511
- this._pingServerHandle = undefined;
1512
- }
1513
- }
1514
- _cleanupTimeout() {
1515
- if (this._timeoutHandle) {
1516
- clearTimeout(this._timeoutHandle);
1517
- }
1518
- }
1519
- _createInvocation(methodName, args, nonblocking, streamIds) {
1520
- if (nonblocking) {
1521
- if (streamIds.length !== 0) {
1522
- return {
1523
- arguments: args,
1524
- streamIds,
1525
- target: methodName,
1526
- type: MessageType.Invocation,
1527
- };
1528
- }
1529
- else {
1530
- return {
1531
- arguments: args,
1532
- target: methodName,
1533
- type: MessageType.Invocation,
1534
- };
1535
- }
1536
- }
1537
- else {
1538
- const invocationId = this._invocationId;
1539
- this._invocationId++;
1540
- if (streamIds.length !== 0) {
1541
- return {
1542
- arguments: args,
1543
- invocationId: invocationId.toString(),
1544
- streamIds,
1545
- target: methodName,
1546
- type: MessageType.Invocation,
1547
- };
1548
- }
1549
- else {
1550
- return {
1551
- arguments: args,
1552
- invocationId: invocationId.toString(),
1553
- target: methodName,
1554
- type: MessageType.Invocation,
1555
- };
1556
- }
1557
- }
1558
- }
1559
- _launchStreams(streams, promiseQueue) {
1560
- if (streams.length === 0) {
1561
- return;
1562
- }
1563
- // Synchronize stream data so they arrive in-order on the server
1564
- if (!promiseQueue) {
1565
- promiseQueue = Promise.resolve();
1566
- }
1567
- // We want to iterate over the keys, since the keys are the stream ids
1568
- // eslint-disable-next-line guard-for-in
1569
- for (const streamId in streams) {
1570
- streams[streamId].subscribe({
1571
- complete: () => {
1572
- promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId)));
1573
- },
1574
- error: (err) => {
1575
- let message;
1576
- if (err instanceof Error) {
1577
- message = err.message;
1578
- }
1579
- else if (err && err.toString) {
1580
- message = err.toString();
1581
- }
1582
- else {
1583
- message = "Unknown error";
1584
- }
1585
- promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createCompletionMessage(streamId, message)));
1586
- },
1587
- next: (item) => {
1588
- promiseQueue = promiseQueue.then(() => this._sendWithProtocol(this._createStreamItemMessage(streamId, item)));
1589
- },
1590
- });
1591
- }
1592
- }
1593
- _replaceStreamingParams(args) {
1594
- const streams = [];
1595
- const streamIds = [];
1596
- for (let i = 0; i < args.length; i++) {
1597
- const argument = args[i];
1598
- if (this._isObservable(argument)) {
1599
- const streamId = this._invocationId;
1600
- this._invocationId++;
1601
- // Store the stream for later use
1602
- streams[streamId] = argument;
1603
- streamIds.push(streamId.toString());
1604
- // remove stream from args
1605
- args.splice(i, 1);
1606
- }
1607
- }
1608
- return [streams, streamIds];
1609
- }
1610
- _isObservable(arg) {
1611
- // This allows other stream implementations to just work (like rxjs)
1612
- return arg && arg.subscribe && typeof arg.subscribe === "function";
1613
- }
1614
- _createStreamInvocation(methodName, args, streamIds) {
1615
- const invocationId = this._invocationId;
1616
- this._invocationId++;
1617
- if (streamIds.length !== 0) {
1618
- return {
1619
- arguments: args,
1620
- invocationId: invocationId.toString(),
1621
- streamIds,
1622
- target: methodName,
1623
- type: MessageType.StreamInvocation,
1624
- };
1625
- }
1626
- else {
1627
- return {
1628
- arguments: args,
1629
- invocationId: invocationId.toString(),
1630
- target: methodName,
1631
- type: MessageType.StreamInvocation,
1632
- };
1633
- }
1634
- }
1635
- _createCancelInvocation(id) {
1636
- return {
1637
- invocationId: id,
1638
- type: MessageType.CancelInvocation,
1639
- };
1640
- }
1641
- _createStreamItemMessage(id, item) {
1642
- return {
1643
- invocationId: id,
1644
- item,
1645
- type: MessageType.StreamItem,
1646
- };
1647
- }
1648
- _createCompletionMessage(id, error, result) {
1649
- if (error) {
1650
- return {
1651
- error,
1652
- invocationId: id,
1653
- type: MessageType.Completion,
1654
- };
1655
- }
1656
- return {
1657
- invocationId: id,
1658
- result,
1659
- type: MessageType.Completion,
1660
- };
1661
- }
1662
- }
1663
-
1664
- // Licensed to the .NET Foundation under one or more agreements.
1665
- // The .NET Foundation licenses this file to you under the MIT license.
1666
- // 0, 2, 10, 30 second delays before reconnect attempts.
1667
- const DEFAULT_RETRY_DELAYS_IN_MILLISECONDS = [0, 2000, 10000, 30000, null];
1668
- /** @private */
1669
- class DefaultReconnectPolicy {
1670
- constructor(retryDelays) {
1671
- this._retryDelays = retryDelays !== undefined ? [...retryDelays, null] : DEFAULT_RETRY_DELAYS_IN_MILLISECONDS;
1672
- }
1673
- nextRetryDelayInMilliseconds(retryContext) {
1674
- return this._retryDelays[retryContext.previousRetryCount];
1675
- }
1676
- }
1677
-
1678
- // Licensed to the .NET Foundation under one or more agreements.
1679
- // The .NET Foundation licenses this file to you under the MIT license.
1680
- class HeaderNames {
1681
- }
1682
- HeaderNames.Authorization = "Authorization";
1683
- HeaderNames.Cookie = "Cookie";
1684
-
1685
- // Licensed to the .NET Foundation under one or more agreements.
1686
- // The .NET Foundation licenses this file to you under the MIT license.
1687
- // This will be treated as a bit flag in the future, so we keep it using power-of-two values.
1688
- /** Specifies a specific HTTP transport type. */
1689
- var HttpTransportType;
1690
- (function (HttpTransportType) {
1691
- /** Specifies no transport preference. */
1692
- HttpTransportType[HttpTransportType["None"] = 0] = "None";
1693
- /** Specifies the WebSockets transport. */
1694
- HttpTransportType[HttpTransportType["WebSockets"] = 1] = "WebSockets";
1695
- /** Specifies the Server-Sent Events transport. */
1696
- HttpTransportType[HttpTransportType["ServerSentEvents"] = 2] = "ServerSentEvents";
1697
- /** Specifies the Long Polling transport. */
1698
- HttpTransportType[HttpTransportType["LongPolling"] = 4] = "LongPolling";
1699
- })(HttpTransportType || (HttpTransportType = {}));
1700
- /** Specifies the transfer format for a connection. */
1701
- var TransferFormat;
1702
- (function (TransferFormat) {
1703
- /** Specifies that only text data will be transmitted over the connection. */
1704
- TransferFormat[TransferFormat["Text"] = 1] = "Text";
1705
- /** Specifies that binary data will be transmitted over the connection. */
1706
- TransferFormat[TransferFormat["Binary"] = 2] = "Binary";
1707
- })(TransferFormat || (TransferFormat = {}));
1708
-
1709
- // Licensed to the .NET Foundation under one or more agreements.
1710
- // The .NET Foundation licenses this file to you under the MIT license.
1711
- // Rough polyfill of https://developer.mozilla.org/en-US/docs/Web/API/AbortController
1712
- // We don't actually ever use the API being polyfilled, we always use the polyfill because
1713
- // it's a very new API right now.
1714
- // Not exported from index.
1715
- /** @private */
1716
- class AbortController$1 {
1717
- constructor() {
1718
- this._isAborted = false;
1719
- this.onabort = null;
1720
- }
1721
- abort() {
1722
- if (!this._isAborted) {
1723
- this._isAborted = true;
1724
- if (this.onabort) {
1725
- this.onabort();
1726
- }
1727
- }
1728
- }
1729
- get signal() {
1730
- return this;
1731
- }
1732
- get aborted() {
1733
- return this._isAborted;
1734
- }
1735
- }
1736
-
1737
- // Licensed to the .NET Foundation under one or more agreements.
1738
- // Not exported from 'index', this type is internal.
1739
- /** @private */
1740
- class LongPollingTransport {
1741
- constructor(httpClient, accessTokenFactory, logger, options) {
1742
- this._httpClient = httpClient;
1743
- this._accessTokenFactory = accessTokenFactory;
1744
- this._logger = logger;
1745
- this._pollAbort = new AbortController$1();
1746
- this._options = options;
1747
- this._running = false;
1748
- this.onreceive = null;
1749
- this.onclose = null;
1750
- }
1751
- // This is an internal type, not exported from 'index' so this is really just internal.
1752
- get pollAborted() {
1753
- return this._pollAbort.aborted;
1754
- }
1755
- async connect(url, transferFormat) {
1756
- Arg.isRequired(url, "url");
1757
- Arg.isRequired(transferFormat, "transferFormat");
1758
- Arg.isIn(transferFormat, TransferFormat, "transferFormat");
1759
- this._url = url;
1760
- this._logger.log(LogLevel.Trace, "(LongPolling transport) Connecting.");
1761
- // Allow binary format on Node and Browsers that support binary content (indicated by the presence of responseType property)
1762
- if (transferFormat === TransferFormat.Binary &&
1763
- (typeof XMLHttpRequest !== "undefined" && typeof new XMLHttpRequest().responseType !== "string")) {
1764
- throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");
1765
- }
1766
- const [name, value] = getUserAgentHeader();
1767
- const headers = { [name]: value, ...this._options.headers };
1768
- const pollOptions = {
1769
- abortSignal: this._pollAbort.signal,
1770
- headers,
1771
- timeout: 100000,
1772
- withCredentials: this._options.withCredentials,
1773
- };
1774
- if (transferFormat === TransferFormat.Binary) {
1775
- pollOptions.responseType = "arraybuffer";
1776
- }
1777
- const token = await this._getAccessToken();
1778
- this._updateHeaderToken(pollOptions, token);
1779
- // Make initial long polling request
1780
- // Server uses first long polling request to finish initializing connection and it returns without data
1781
- const pollUrl = `${url}&_=${Date.now()}`;
1782
- this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);
1783
- const response = await this._httpClient.get(pollUrl, pollOptions);
1784
- if (response.statusCode !== 200) {
1785
- this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);
1786
- // Mark running as false so that the poll immediately ends and runs the close logic
1787
- this._closeError = new HttpError(response.statusText || "", response.statusCode);
1788
- this._running = false;
1789
- }
1790
- else {
1791
- this._running = true;
1792
- }
1793
- this._receiving = this._poll(this._url, pollOptions);
1794
- }
1795
- async _getAccessToken() {
1796
- if (this._accessTokenFactory) {
1797
- return await this._accessTokenFactory();
1798
- }
1799
- return null;
1800
- }
1801
- _updateHeaderToken(request, token) {
1802
- if (!request.headers) {
1803
- request.headers = {};
1804
- }
1805
- if (token) {
1806
- request.headers[HeaderNames.Authorization] = `Bearer ${token}`;
1807
- return;
1808
- }
1809
- if (request.headers[HeaderNames.Authorization]) {
1810
- delete request.headers[HeaderNames.Authorization];
1811
- }
1812
- }
1813
- async _poll(url, pollOptions) {
1814
- try {
1815
- while (this._running) {
1816
- // We have to get the access token on each poll, in case it changes
1817
- const token = await this._getAccessToken();
1818
- this._updateHeaderToken(pollOptions, token);
1819
- try {
1820
- const pollUrl = `${url}&_=${Date.now()}`;
1821
- this._logger.log(LogLevel.Trace, `(LongPolling transport) polling: ${pollUrl}.`);
1822
- const response = await this._httpClient.get(pollUrl, pollOptions);
1823
- if (response.statusCode === 204) {
1824
- this._logger.log(LogLevel.Information, "(LongPolling transport) Poll terminated by server.");
1825
- this._running = false;
1826
- }
1827
- else if (response.statusCode !== 200) {
1828
- this._logger.log(LogLevel.Error, `(LongPolling transport) Unexpected response code: ${response.statusCode}.`);
1829
- // Unexpected status code
1830
- this._closeError = new HttpError(response.statusText || "", response.statusCode);
1831
- this._running = false;
1832
- }
1833
- else {
1834
- // Process the response
1835
- if (response.content) {
1836
- this._logger.log(LogLevel.Trace, `(LongPolling transport) data received. ${getDataDetail(response.content, this._options.logMessageContent)}.`);
1837
- if (this.onreceive) {
1838
- this.onreceive(response.content);
1839
- }
1840
- }
1841
- else {
1842
- // This is another way timeout manifest.
1843
- this._logger.log(LogLevel.Trace, "(LongPolling transport) Poll timed out, reissuing.");
1844
- }
1845
- }
1846
- }
1847
- catch (e) {
1848
- if (!this._running) {
1849
- // Log but disregard errors that occur after stopping
1850
- this._logger.log(LogLevel.Trace, `(LongPolling transport) Poll errored after shutdown: ${e.message}`);
1851
- }
1852
- else {
1853
- if (e instanceof TimeoutError) {
1854
- // Ignore timeouts and reissue the poll.
1855
- this._logger.log(LogLevel.Trace, "(LongPolling transport) Poll timed out, reissuing.");
1856
- }
1857
- else {
1858
- // Close the connection with the error as the result.
1859
- this._closeError = e;
1860
- this._running = false;
1861
- }
1862
- }
1863
- }
1864
- }
1865
- }
1866
- finally {
1867
- this._logger.log(LogLevel.Trace, "(LongPolling transport) Polling complete.");
1868
- // We will reach here with pollAborted==false when the server returned a response causing the transport to stop.
1869
- // If pollAborted==true then client initiated the stop and the stop method will raise the close event after DELETE is sent.
1870
- if (!this.pollAborted) {
1871
- this._raiseOnClose();
1872
- }
1873
- }
1874
- }
1875
- async send(data) {
1876
- if (!this._running) {
1877
- return Promise.reject(new Error("Cannot send until the transport is connected"));
1878
- }
1879
- return sendMessage(this._logger, "LongPolling", this._httpClient, this._url, this._accessTokenFactory, data, this._options);
1880
- }
1881
- async stop() {
1882
- this._logger.log(LogLevel.Trace, "(LongPolling transport) Stopping polling.");
1883
- // Tell receiving loop to stop, abort any current request, and then wait for it to finish
1884
- this._running = false;
1885
- this._pollAbort.abort();
1886
- try {
1887
- await this._receiving;
1888
- // Send DELETE to clean up long polling on the server
1889
- this._logger.log(LogLevel.Trace, `(LongPolling transport) sending DELETE request to ${this._url}.`);
1890
- const headers = {};
1891
- const [name, value] = getUserAgentHeader();
1892
- headers[name] = value;
1893
- const deleteOptions = {
1894
- headers: { ...headers, ...this._options.headers },
1895
- timeout: this._options.timeout,
1896
- withCredentials: this._options.withCredentials,
1897
- };
1898
- const token = await this._getAccessToken();
1899
- this._updateHeaderToken(deleteOptions, token);
1900
- await this._httpClient.delete(this._url, deleteOptions);
1901
- this._logger.log(LogLevel.Trace, "(LongPolling transport) DELETE request sent.");
1902
- }
1903
- finally {
1904
- this._logger.log(LogLevel.Trace, "(LongPolling transport) Stop finished.");
1905
- // Raise close event here instead of in polling
1906
- // It needs to happen after the DELETE request is sent
1907
- this._raiseOnClose();
1908
- }
1909
- }
1910
- _raiseOnClose() {
1911
- if (this.onclose) {
1912
- let logMessage = "(LongPolling transport) Firing onclose event.";
1913
- if (this._closeError) {
1914
- logMessage += " Error: " + this._closeError;
1915
- }
1916
- this._logger.log(LogLevel.Trace, logMessage);
1917
- this.onclose(this._closeError);
1918
- }
1919
- }
1920
- }
1921
-
1922
- // Licensed to the .NET Foundation under one or more agreements.
1923
- /** @private */
1924
- class ServerSentEventsTransport {
1925
- constructor(httpClient, accessTokenFactory, logger, options) {
1926
- this._httpClient = httpClient;
1927
- this._accessTokenFactory = accessTokenFactory;
1928
- this._logger = logger;
1929
- this._options = options;
1930
- this.onreceive = null;
1931
- this.onclose = null;
1932
- }
1933
- async connect(url, transferFormat) {
1934
- Arg.isRequired(url, "url");
1935
- Arg.isRequired(transferFormat, "transferFormat");
1936
- Arg.isIn(transferFormat, TransferFormat, "transferFormat");
1937
- this._logger.log(LogLevel.Trace, "(SSE transport) Connecting.");
1938
- // set url before accessTokenFactory because this.url is only for send and we set the auth header instead of the query string for send
1939
- this._url = url;
1940
- if (this._accessTokenFactory) {
1941
- const token = await this._accessTokenFactory();
1942
- if (token) {
1943
- url += (url.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(token)}`;
1944
- }
1945
- }
1946
- return new Promise((resolve, reject) => {
1947
- let opened = false;
1948
- if (transferFormat !== TransferFormat.Text) {
1949
- reject(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));
1950
- return;
1951
- }
1952
- let eventSource;
1953
- if (Platform.isBrowser || Platform.isWebWorker) {
1954
- eventSource = new this._options.EventSource(url, { withCredentials: this._options.withCredentials });
1955
- }
1956
- else {
1957
- // Non-browser passes cookies via the dictionary
1958
- const cookies = this._httpClient.getCookieString(url);
1959
- const headers = {};
1960
- headers.Cookie = cookies;
1961
- const [name, value] = getUserAgentHeader();
1962
- headers[name] = value;
1963
- eventSource = new this._options.EventSource(url, { withCredentials: this._options.withCredentials, headers: { ...headers, ...this._options.headers } });
1964
- }
1965
- try {
1966
- eventSource.onmessage = (e) => {
1967
- if (this.onreceive) {
1968
- try {
1969
- this._logger.log(LogLevel.Trace, `(SSE transport) data received. ${getDataDetail(e.data, this._options.logMessageContent)}.`);
1970
- this.onreceive(e.data);
1971
- }
1972
- catch (error) {
1973
- this._close(error);
1974
- return;
1975
- }
1976
- }
1977
- };
1978
- // @ts-ignore: not using event on purpose
1979
- eventSource.onerror = (e) => {
1980
- // EventSource doesn't give any useful information about server side closes.
1981
- if (opened) {
1982
- this._close();
1983
- }
1984
- else {
1985
- reject(new Error("EventSource failed to connect. The connection could not be found on the server,"
1986
- + " either the connection ID is not present on the server, or a proxy is refusing/buffering the connection."
1987
- + " If you have multiple servers check that sticky sessions are enabled."));
1988
- }
1989
- };
1990
- eventSource.onopen = () => {
1991
- this._logger.log(LogLevel.Information, `SSE connected to ${this._url}`);
1992
- this._eventSource = eventSource;
1993
- opened = true;
1994
- resolve();
1995
- };
1996
- }
1997
- catch (e) {
1998
- reject(e);
1999
- return;
2000
- }
2001
- });
2002
- }
2003
- async send(data) {
2004
- if (!this._eventSource) {
2005
- return Promise.reject(new Error("Cannot send until the transport is connected"));
2006
- }
2007
- return sendMessage(this._logger, "SSE", this._httpClient, this._url, this._accessTokenFactory, data, this._options);
2008
- }
2009
- stop() {
2010
- this._close();
2011
- return Promise.resolve();
2012
- }
2013
- _close(e) {
2014
- if (this._eventSource) {
2015
- this._eventSource.close();
2016
- this._eventSource = undefined;
2017
- if (this.onclose) {
2018
- this.onclose(e);
2019
- }
2020
- }
2021
- }
2022
- }
2023
-
2024
- // Licensed to the .NET Foundation under one or more agreements.
2025
- /** @private */
2026
- class WebSocketTransport {
2027
- constructor(httpClient, accessTokenFactory, logger, logMessageContent, webSocketConstructor, headers) {
2028
- this._logger = logger;
2029
- this._accessTokenFactory = accessTokenFactory;
2030
- this._logMessageContent = logMessageContent;
2031
- this._webSocketConstructor = webSocketConstructor;
2032
- this._httpClient = httpClient;
2033
- this.onreceive = null;
2034
- this.onclose = null;
2035
- this._headers = headers;
2036
- }
2037
- async connect(url, transferFormat) {
2038
- Arg.isRequired(url, "url");
2039
- Arg.isRequired(transferFormat, "transferFormat");
2040
- Arg.isIn(transferFormat, TransferFormat, "transferFormat");
2041
- this._logger.log(LogLevel.Trace, "(WebSockets transport) Connecting.");
2042
- if (this._accessTokenFactory) {
2043
- const token = await this._accessTokenFactory();
2044
- if (token) {
2045
- url += (url.indexOf("?") < 0 ? "?" : "&") + `access_token=${encodeURIComponent(token)}`;
2046
- }
2047
- }
2048
- return new Promise((resolve, reject) => {
2049
- url = url.replace(/^http/, "ws");
2050
- let webSocket;
2051
- const cookies = this._httpClient.getCookieString(url);
2052
- let opened = false;
2053
- if (Platform.isNode) {
2054
- const headers = {};
2055
- const [name, value] = getUserAgentHeader();
2056
- headers[name] = value;
2057
- if (cookies) {
2058
- headers[HeaderNames.Cookie] = `${cookies}`;
2059
- }
2060
- // Only pass headers when in non-browser environments
2061
- webSocket = new this._webSocketConstructor(url, undefined, {
2062
- headers: { ...headers, ...this._headers },
2063
- });
2064
- }
2065
- if (!webSocket) {
2066
- // Chrome is not happy with passing 'undefined' as protocol
2067
- webSocket = new this._webSocketConstructor(url);
2068
- }
2069
- if (transferFormat === TransferFormat.Binary) {
2070
- webSocket.binaryType = "arraybuffer";
2071
- }
2072
- webSocket.onopen = (_event) => {
2073
- this._logger.log(LogLevel.Information, `WebSocket connected to ${url}.`);
2074
- this._webSocket = webSocket;
2075
- opened = true;
2076
- resolve();
2077
- };
2078
- webSocket.onerror = (event) => {
2079
- let error = null;
2080
- // ErrorEvent is a browser only type we need to check if the type exists before using it
2081
- if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) {
2082
- error = event.error;
2083
- }
2084
- else {
2085
- error = "There was an error with the transport";
2086
- }
2087
- this._logger.log(LogLevel.Information, `(WebSockets transport) ${error}.`);
2088
- };
2089
- webSocket.onmessage = (message) => {
2090
- this._logger.log(LogLevel.Trace, `(WebSockets transport) data received. ${getDataDetail(message.data, this._logMessageContent)}.`);
2091
- if (this.onreceive) {
2092
- try {
2093
- this.onreceive(message.data);
2094
- }
2095
- catch (error) {
2096
- this._close(error);
2097
- return;
2098
- }
2099
- }
2100
- };
2101
- webSocket.onclose = (event) => {
2102
- // Don't call close handler if connection was never established
2103
- // We'll reject the connect call instead
2104
- if (opened) {
2105
- this._close(event);
2106
- }
2107
- else {
2108
- let error = null;
2109
- // ErrorEvent is a browser only type we need to check if the type exists before using it
2110
- if (typeof ErrorEvent !== "undefined" && event instanceof ErrorEvent) {
2111
- error = event.error;
2112
- }
2113
- else {
2114
- error = "WebSocket failed to connect. The connection could not be found on the server,"
2115
- + " either the endpoint may not be a SignalR endpoint,"
2116
- + " the connection ID is not present on the server, or there is a proxy blocking WebSockets."
2117
- + " If you have multiple servers check that sticky sessions are enabled.";
2118
- }
2119
- reject(new Error(error));
2120
- }
2121
- };
2122
- });
2123
- }
2124
- send(data) {
2125
- if (this._webSocket && this._webSocket.readyState === this._webSocketConstructor.OPEN) {
2126
- this._logger.log(LogLevel.Trace, `(WebSockets transport) sending data. ${getDataDetail(data, this._logMessageContent)}.`);
2127
- this._webSocket.send(data);
2128
- return Promise.resolve();
2129
- }
2130
- return Promise.reject("WebSocket is not in the OPEN state");
2131
- }
2132
- stop() {
2133
- if (this._webSocket) {
2134
- // Manually invoke onclose callback inline so we know the HttpConnection was closed properly before returning
2135
- // This also solves an issue where websocket.onclose could take 18+ seconds to trigger during network disconnects
2136
- this._close(undefined);
2137
- }
2138
- return Promise.resolve();
2139
- }
2140
- _close(event) {
2141
- // webSocket will be null if the transport did not start successfully
2142
- if (this._webSocket) {
2143
- // Clear websocket handlers because we are considering the socket closed now
2144
- this._webSocket.onclose = () => { };
2145
- this._webSocket.onmessage = () => { };
2146
- this._webSocket.onerror = () => { };
2147
- this._webSocket.close();
2148
- this._webSocket = undefined;
2149
- }
2150
- this._logger.log(LogLevel.Trace, "(WebSockets transport) socket closed.");
2151
- if (this.onclose) {
2152
- if (this._isCloseEvent(event) && (event.wasClean === false || event.code !== 1000)) {
2153
- this.onclose(new Error(`WebSocket closed with status code: ${event.code} (${event.reason || "no reason given"}).`));
2154
- }
2155
- else if (event instanceof Error) {
2156
- this.onclose(event);
2157
- }
2158
- else {
2159
- this.onclose();
2160
- }
2161
- }
2162
- }
2163
- _isCloseEvent(event) {
2164
- return event && typeof event.wasClean === "boolean" && typeof event.code === "number";
2165
- }
2166
- }
2167
-
2168
- // Licensed to the .NET Foundation under one or more agreements.
2169
- const MAX_REDIRECTS = 100;
2170
- /** @private */
2171
- class HttpConnection {
2172
- constructor(url, options = {}) {
2173
- this._stopPromiseResolver = () => { };
2174
- this.features = {};
2175
- this._negotiateVersion = 1;
2176
- Arg.isRequired(url, "url");
2177
- this._logger = createLogger(options.logger);
2178
- this.baseUrl = this._resolveUrl(url);
2179
- options = options || {};
2180
- options.logMessageContent = options.logMessageContent === undefined ? false : options.logMessageContent;
2181
- if (typeof options.withCredentials === "boolean" || options.withCredentials === undefined) {
2182
- options.withCredentials = options.withCredentials === undefined ? true : options.withCredentials;
2183
- }
2184
- else {
2185
- throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");
2186
- }
2187
- options.timeout = options.timeout === undefined ? 100 * 1000 : options.timeout;
2188
- let webSocketModule = null;
2189
- let eventSourceModule = null;
2190
- if (Platform.isNode && typeof require !== "undefined") {
2191
- // In order to ignore the dynamic require in webpack builds we need to do this magic
2192
- // @ts-ignore: TS doesn't know about these names
2193
- const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
2194
- webSocketModule = requireFunc("ws");
2195
- eventSourceModule = requireFunc("eventsource");
2196
- }
2197
- if (!Platform.isNode && typeof WebSocket !== "undefined" && !options.WebSocket) {
2198
- options.WebSocket = WebSocket;
2199
- }
2200
- else if (Platform.isNode && !options.WebSocket) {
2201
- if (webSocketModule) {
2202
- options.WebSocket = webSocketModule;
2203
- }
2204
- }
2205
- if (!Platform.isNode && typeof EventSource !== "undefined" && !options.EventSource) {
2206
- options.EventSource = EventSource;
2207
- }
2208
- else if (Platform.isNode && !options.EventSource) {
2209
- if (typeof eventSourceModule !== "undefined") {
2210
- options.EventSource = eventSourceModule;
2211
- }
2212
- }
2213
- this._httpClient = options.httpClient || new DefaultHttpClient(this._logger);
2214
- this._connectionState = "Disconnected" /* Disconnected */;
2215
- this._connectionStarted = false;
2216
- this._options = options;
2217
- this.onreceive = null;
2218
- this.onclose = null;
2219
- }
2220
- async start(transferFormat) {
2221
- transferFormat = transferFormat || TransferFormat.Binary;
2222
- Arg.isIn(transferFormat, TransferFormat, "transferFormat");
2223
- this._logger.log(LogLevel.Debug, `Starting connection with transfer format '${TransferFormat[transferFormat]}'.`);
2224
- if (this._connectionState !== "Disconnected" /* Disconnected */) {
2225
- return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));
2226
- }
2227
- this._connectionState = "Connecting" /* Connecting */;
2228
- this._startInternalPromise = this._startInternal(transferFormat);
2229
- await this._startInternalPromise;
2230
- // The TypeScript compiler thinks that connectionState must be Connecting here. The TypeScript compiler is wrong.
2231
- if (this._connectionState === "Disconnecting" /* Disconnecting */) {
2232
- // stop() was called and transitioned the client into the Disconnecting state.
2233
- const message = "Failed to start the HttpConnection before stop() was called.";
2234
- this._logger.log(LogLevel.Error, message);
2235
- // We cannot await stopPromise inside startInternal since stopInternal awaits the startInternalPromise.
2236
- await this._stopPromise;
2237
- return Promise.reject(new Error(message));
2238
- }
2239
- else if (this._connectionState !== "Connected" /* Connected */) {
2240
- // stop() was called and transitioned the client into the Disconnecting state.
2241
- const message = "HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";
2242
- this._logger.log(LogLevel.Error, message);
2243
- return Promise.reject(new Error(message));
2244
- }
2245
- this._connectionStarted = true;
2246
- }
2247
- send(data) {
2248
- if (this._connectionState !== "Connected" /* Connected */) {
2249
- return Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State."));
2250
- }
2251
- if (!this._sendQueue) {
2252
- this._sendQueue = new TransportSendQueue(this.transport);
2253
- }
2254
- // Transport will not be null if state is connected
2255
- return this._sendQueue.send(data);
2256
- }
2257
- async stop(error) {
2258
- if (this._connectionState === "Disconnected" /* Disconnected */) {
2259
- this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnected state.`);
2260
- return Promise.resolve();
2261
- }
2262
- if (this._connectionState === "Disconnecting" /* Disconnecting */) {
2263
- this._logger.log(LogLevel.Debug, `Call to HttpConnection.stop(${error}) ignored because the connection is already in the disconnecting state.`);
2264
- return this._stopPromise;
2265
- }
2266
- this._connectionState = "Disconnecting" /* Disconnecting */;
2267
- this._stopPromise = new Promise((resolve) => {
2268
- // Don't complete stop() until stopConnection() completes.
2269
- this._stopPromiseResolver = resolve;
2270
- });
2271
- // stopInternal should never throw so just observe it.
2272
- await this._stopInternal(error);
2273
- await this._stopPromise;
2274
- }
2275
- async _stopInternal(error) {
2276
- // Set error as soon as possible otherwise there is a race between
2277
- // the transport closing and providing an error and the error from a close message
2278
- // We would prefer the close message error.
2279
- this._stopError = error;
2280
- try {
2281
- await this._startInternalPromise;
2282
- }
2283
- catch (e) {
2284
- // This exception is returned to the user as a rejected Promise from the start method.
2285
- }
2286
- // The transport's onclose will trigger stopConnection which will run our onclose event.
2287
- // The transport should always be set if currently connected. If it wasn't set, it's likely because
2288
- // stop was called during start() and start() failed.
2289
- if (this.transport) {
2290
- try {
2291
- await this.transport.stop();
2292
- }
2293
- catch (e) {
2294
- this._logger.log(LogLevel.Error, `HttpConnection.transport.stop() threw error '${e}'.`);
2295
- this._stopConnection();
2296
- }
2297
- this.transport = undefined;
2298
- }
2299
- else {
2300
- this._logger.log(LogLevel.Debug, "HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.");
2301
- }
2302
- }
2303
- async _startInternal(transferFormat) {
2304
- // Store the original base url and the access token factory since they may change
2305
- // as part of negotiating
2306
- let url = this.baseUrl;
2307
- this._accessTokenFactory = this._options.accessTokenFactory;
2308
- try {
2309
- if (this._options.skipNegotiation) {
2310
- if (this._options.transport === HttpTransportType.WebSockets) {
2311
- // No need to add a connection ID in this case
2312
- this.transport = this._constructTransport(HttpTransportType.WebSockets);
2313
- // We should just call connect directly in this case.
2314
- // No fallback or negotiate in this case.
2315
- await this._startTransport(url, transferFormat);
2316
- }
2317
- else {
2318
- throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");
2319
- }
2320
- }
2321
- else {
2322
- let negotiateResponse = null;
2323
- let redirects = 0;
2324
- do {
2325
- negotiateResponse = await this._getNegotiationResponse(url);
2326
- // the user tries to stop the connection when it is being started
2327
- if (this._connectionState === "Disconnecting" /* Disconnecting */ || this._connectionState === "Disconnected" /* Disconnected */) {
2328
- throw new Error("The connection was stopped during negotiation.");
2329
- }
2330
- if (negotiateResponse.error) {
2331
- throw new Error(negotiateResponse.error);
2332
- }
2333
- if (negotiateResponse.ProtocolVersion) {
2334
- throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");
2335
- }
2336
- if (negotiateResponse.url) {
2337
- url = negotiateResponse.url;
2338
- }
2339
- if (negotiateResponse.accessToken) {
2340
- // Replace the current access token factory with one that uses
2341
- // the returned access token
2342
- const accessToken = negotiateResponse.accessToken;
2343
- this._accessTokenFactory = () => accessToken;
2344
- }
2345
- redirects++;
2346
- } while (negotiateResponse.url && redirects < MAX_REDIRECTS);
2347
- if (redirects === MAX_REDIRECTS && negotiateResponse.url) {
2348
- throw new Error("Negotiate redirection limit exceeded.");
2349
- }
2350
- await this._createTransport(url, this._options.transport, negotiateResponse, transferFormat);
2351
- }
2352
- if (this.transport instanceof LongPollingTransport) {
2353
- this.features.inherentKeepAlive = true;
2354
- }
2355
- if (this._connectionState === "Connecting" /* Connecting */) {
2356
- // Ensure the connection transitions to the connected state prior to completing this.startInternalPromise.
2357
- // start() will handle the case when stop was called and startInternal exits still in the disconnecting state.
2358
- this._logger.log(LogLevel.Debug, "The HttpConnection connected successfully.");
2359
- this._connectionState = "Connected" /* Connected */;
2360
- }
2361
- // stop() is waiting on us via this.startInternalPromise so keep this.transport around so it can clean up.
2362
- // This is the only case startInternal can exit in neither the connected nor disconnected state because stopConnection()
2363
- // will transition to the disconnected state. start() will wait for the transition using the stopPromise.
2364
- }
2365
- catch (e) {
2366
- this._logger.log(LogLevel.Error, "Failed to start the connection: " + e);
2367
- this._connectionState = "Disconnected" /* Disconnected */;
2368
- this.transport = undefined;
2369
- // if start fails, any active calls to stop assume that start will complete the stop promise
2370
- this._stopPromiseResolver();
2371
- return Promise.reject(e);
2372
- }
2373
- }
2374
- async _getNegotiationResponse(url) {
2375
- const headers = {};
2376
- if (this._accessTokenFactory) {
2377
- const token = await this._accessTokenFactory();
2378
- if (token) {
2379
- headers[HeaderNames.Authorization] = `Bearer ${token}`;
2380
- }
2381
- }
2382
- const [name, value] = getUserAgentHeader();
2383
- headers[name] = value;
2384
- const negotiateUrl = this._resolveNegotiateUrl(url);
2385
- this._logger.log(LogLevel.Debug, `Sending negotiation request: ${negotiateUrl}.`);
2386
- try {
2387
- const response = await this._httpClient.post(negotiateUrl, {
2388
- content: "",
2389
- headers: { ...headers, ...this._options.headers },
2390
- timeout: this._options.timeout,
2391
- withCredentials: this._options.withCredentials,
2392
- });
2393
- if (response.statusCode !== 200) {
2394
- return Promise.reject(new Error(`Unexpected status code returned from negotiate '${response.statusCode}'`));
2395
- }
2396
- const negotiateResponse = JSON.parse(response.content);
2397
- if (!negotiateResponse.negotiateVersion || negotiateResponse.negotiateVersion < 1) {
2398
- // Negotiate version 0 doesn't use connectionToken
2399
- // So we set it equal to connectionId so all our logic can use connectionToken without being aware of the negotiate version
2400
- negotiateResponse.connectionToken = negotiateResponse.connectionId;
2401
- }
2402
- return negotiateResponse;
2403
- }
2404
- catch (e) {
2405
- let errorMessage = "Failed to complete negotiation with the server: " + e;
2406
- if (e instanceof HttpError) {
2407
- if (e.statusCode === 404) {
2408
- errorMessage = errorMessage + " Either this is not a SignalR endpoint or there is a proxy blocking the connection.";
2409
- }
2410
- }
2411
- this._logger.log(LogLevel.Error, errorMessage);
2412
- return Promise.reject(new FailedToNegotiateWithServerError(errorMessage));
2413
- }
2414
- }
2415
- _createConnectUrl(url, connectionToken) {
2416
- if (!connectionToken) {
2417
- return url;
2418
- }
2419
- return url + (url.indexOf("?") === -1 ? "?" : "&") + `id=${connectionToken}`;
2420
- }
2421
- async _createTransport(url, requestedTransport, negotiateResponse, requestedTransferFormat) {
2422
- let connectUrl = this._createConnectUrl(url, negotiateResponse.connectionToken);
2423
- if (this._isITransport(requestedTransport)) {
2424
- this._logger.log(LogLevel.Debug, "Connection was provided an instance of ITransport, using that directly.");
2425
- this.transport = requestedTransport;
2426
- await this._startTransport(connectUrl, requestedTransferFormat);
2427
- this.connectionId = negotiateResponse.connectionId;
2428
- return;
2429
- }
2430
- const transportExceptions = [];
2431
- const transports = negotiateResponse.availableTransports || [];
2432
- let negotiate = negotiateResponse;
2433
- for (const endpoint of transports) {
2434
- const transportOrError = this._resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat);
2435
- if (transportOrError instanceof Error) {
2436
- // Store the error and continue, we don't want to cause a re-negotiate in these cases
2437
- transportExceptions.push(`${endpoint.transport} failed:`);
2438
- transportExceptions.push(transportOrError);
2439
- }
2440
- else if (this._isITransport(transportOrError)) {
2441
- this.transport = transportOrError;
2442
- if (!negotiate) {
2443
- try {
2444
- negotiate = await this._getNegotiationResponse(url);
2445
- }
2446
- catch (ex) {
2447
- return Promise.reject(ex);
2448
- }
2449
- connectUrl = this._createConnectUrl(url, negotiate.connectionToken);
2450
- }
2451
- try {
2452
- await this._startTransport(connectUrl, requestedTransferFormat);
2453
- this.connectionId = negotiate.connectionId;
2454
- return;
2455
- }
2456
- catch (ex) {
2457
- this._logger.log(LogLevel.Error, `Failed to start the transport '${endpoint.transport}': ${ex}`);
2458
- negotiate = undefined;
2459
- transportExceptions.push(new FailedToStartTransportError(`${endpoint.transport} failed: ${ex}`, HttpTransportType[endpoint.transport]));
2460
- if (this._connectionState !== "Connecting" /* Connecting */) {
2461
- const message = "Failed to select transport before stop() was called.";
2462
- this._logger.log(LogLevel.Debug, message);
2463
- return Promise.reject(new Error(message));
2464
- }
2465
- }
2466
- }
2467
- }
2468
- if (transportExceptions.length > 0) {
2469
- return Promise.reject(new AggregateErrors(`Unable to connect to the server with any of the available transports. ${transportExceptions.join(" ")}`, transportExceptions));
2470
- }
2471
- return Promise.reject(new Error("None of the transports supported by the client are supported by the server."));
2472
- }
2473
- _constructTransport(transport) {
2474
- switch (transport) {
2475
- case HttpTransportType.WebSockets:
2476
- if (!this._options.WebSocket) {
2477
- throw new Error("'WebSocket' is not supported in your environment.");
2478
- }
2479
- return new WebSocketTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options.logMessageContent, this._options.WebSocket, this._options.headers || {});
2480
- case HttpTransportType.ServerSentEvents:
2481
- if (!this._options.EventSource) {
2482
- throw new Error("'EventSource' is not supported in your environment.");
2483
- }
2484
- return new ServerSentEventsTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options);
2485
- case HttpTransportType.LongPolling:
2486
- return new LongPollingTransport(this._httpClient, this._accessTokenFactory, this._logger, this._options);
2487
- default:
2488
- throw new Error(`Unknown transport: ${transport}.`);
2489
- }
2490
- }
2491
- _startTransport(url, transferFormat) {
2492
- this.transport.onreceive = this.onreceive;
2493
- this.transport.onclose = (e) => this._stopConnection(e);
2494
- return this.transport.connect(url, transferFormat);
2495
- }
2496
- _resolveTransportOrError(endpoint, requestedTransport, requestedTransferFormat) {
2497
- const transport = HttpTransportType[endpoint.transport];
2498
- if (transport === null || transport === undefined) {
2499
- this._logger.log(LogLevel.Debug, `Skipping transport '${endpoint.transport}' because it is not supported by this client.`);
2500
- return new Error(`Skipping transport '${endpoint.transport}' because it is not supported by this client.`);
2501
- }
2502
- else {
2503
- if (transportMatches(requestedTransport, transport)) {
2504
- const transferFormats = endpoint.transferFormats.map((s) => TransferFormat[s]);
2505
- if (transferFormats.indexOf(requestedTransferFormat) >= 0) {
2506
- if ((transport === HttpTransportType.WebSockets && !this._options.WebSocket) ||
2507
- (transport === HttpTransportType.ServerSentEvents && !this._options.EventSource)) {
2508
- this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it is not supported in your environment.'`);
2509
- return new UnsupportedTransportError(`'${HttpTransportType[transport]}' is not supported in your environment.`, transport);
2510
- }
2511
- else {
2512
- this._logger.log(LogLevel.Debug, `Selecting transport '${HttpTransportType[transport]}'.`);
2513
- try {
2514
- return this._constructTransport(transport);
2515
- }
2516
- catch (ex) {
2517
- return ex;
2518
- }
2519
- }
2520
- }
2521
- else {
2522
- this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it does not support the requested transfer format '${TransferFormat[requestedTransferFormat]}'.`);
2523
- return new Error(`'${HttpTransportType[transport]}' does not support ${TransferFormat[requestedTransferFormat]}.`);
2524
- }
2525
- }
2526
- else {
2527
- this._logger.log(LogLevel.Debug, `Skipping transport '${HttpTransportType[transport]}' because it was disabled by the client.`);
2528
- return new DisabledTransportError(`'${HttpTransportType[transport]}' is disabled by the client.`, transport);
2529
- }
2530
- }
2531
- }
2532
- _isITransport(transport) {
2533
- return transport && typeof (transport) === "object" && "connect" in transport;
2534
- }
2535
- _stopConnection(error) {
2536
- this._logger.log(LogLevel.Debug, `HttpConnection.stopConnection(${error}) called while in state ${this._connectionState}.`);
2537
- this.transport = undefined;
2538
- // If we have a stopError, it takes precedence over the error from the transport
2539
- error = this._stopError || error;
2540
- this._stopError = undefined;
2541
- if (this._connectionState === "Disconnected" /* Disconnected */) {
2542
- this._logger.log(LogLevel.Debug, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is already in the disconnected state.`);
2543
- return;
2544
- }
2545
- if (this._connectionState === "Connecting" /* Connecting */) {
2546
- this._logger.log(LogLevel.Warning, `Call to HttpConnection.stopConnection(${error}) was ignored because the connection is still in the connecting state.`);
2547
- throw new Error(`HttpConnection.stopConnection(${error}) was called while the connection is still in the connecting state.`);
2548
- }
2549
- if (this._connectionState === "Disconnecting" /* Disconnecting */) {
2550
- // A call to stop() induced this call to stopConnection and needs to be completed.
2551
- // Any stop() awaiters will be scheduled to continue after the onclose callback fires.
2552
- this._stopPromiseResolver();
2553
- }
2554
- if (error) {
2555
- this._logger.log(LogLevel.Error, `Connection disconnected with error '${error}'.`);
2556
- }
2557
- else {
2558
- this._logger.log(LogLevel.Information, "Connection disconnected.");
2559
- }
2560
- if (this._sendQueue) {
2561
- this._sendQueue.stop().catch((e) => {
2562
- this._logger.log(LogLevel.Error, `TransportSendQueue.stop() threw error '${e}'.`);
2563
- });
2564
- this._sendQueue = undefined;
2565
- }
2566
- this.connectionId = undefined;
2567
- this._connectionState = "Disconnected" /* Disconnected */;
2568
- if (this._connectionStarted) {
2569
- this._connectionStarted = false;
2570
- try {
2571
- if (this.onclose) {
2572
- this.onclose(error);
2573
- }
2574
- }
2575
- catch (e) {
2576
- this._logger.log(LogLevel.Error, `HttpConnection.onclose(${error}) threw error '${e}'.`);
2577
- }
2578
- }
2579
- }
2580
- _resolveUrl(url) {
2581
- // startsWith is not supported in IE
2582
- if (url.lastIndexOf("https://", 0) === 0 || url.lastIndexOf("http://", 0) === 0) {
2583
- return url;
2584
- }
2585
- if (!Platform.isBrowser) {
2586
- throw new Error(`Cannot resolve '${url}'.`);
2587
- }
2588
- // Setting the url to the href propery of an anchor tag handles normalization
2589
- // for us. There are 3 main cases.
2590
- // 1. Relative path normalization e.g "b" -> "http://localhost:5000/a/b"
2591
- // 2. Absolute path normalization e.g "/a/b" -> "http://localhost:5000/a/b"
2592
- // 3. Networkpath reference normalization e.g "//localhost:5000/a/b" -> "http://localhost:5000/a/b"
2593
- const aTag = window.document.createElement("a");
2594
- aTag.href = url;
2595
- this._logger.log(LogLevel.Information, `Normalizing '${url}' to '${aTag.href}'.`);
2596
- return aTag.href;
2597
- }
2598
- _resolveNegotiateUrl(url) {
2599
- const index = url.indexOf("?");
2600
- let negotiateUrl = url.substring(0, index === -1 ? url.length : index);
2601
- if (negotiateUrl[negotiateUrl.length - 1] !== "/") {
2602
- negotiateUrl += "/";
2603
- }
2604
- negotiateUrl += "negotiate";
2605
- negotiateUrl += index === -1 ? "" : url.substring(index);
2606
- if (negotiateUrl.indexOf("negotiateVersion") === -1) {
2607
- negotiateUrl += index === -1 ? "?" : "&";
2608
- negotiateUrl += "negotiateVersion=" + this._negotiateVersion;
2609
- }
2610
- return negotiateUrl;
2611
- }
2612
- }
2613
- function transportMatches(requestedTransport, actualTransport) {
2614
- return !requestedTransport || ((actualTransport & requestedTransport) !== 0);
2615
- }
2616
- /** @private */
2617
- class TransportSendQueue {
2618
- constructor(_transport) {
2619
- this._transport = _transport;
2620
- this._buffer = [];
2621
- this._executing = true;
2622
- this._sendBufferedData = new PromiseSource();
2623
- this._transportResult = new PromiseSource();
2624
- this._sendLoopPromise = this._sendLoop();
2625
- }
2626
- send(data) {
2627
- this._bufferData(data);
2628
- if (!this._transportResult) {
2629
- this._transportResult = new PromiseSource();
2630
- }
2631
- return this._transportResult.promise;
2632
- }
2633
- stop() {
2634
- this._executing = false;
2635
- this._sendBufferedData.resolve();
2636
- return this._sendLoopPromise;
2637
- }
2638
- _bufferData(data) {
2639
- if (this._buffer.length && typeof (this._buffer[0]) !== typeof (data)) {
2640
- throw new Error(`Expected data to be of type ${typeof (this._buffer)} but was of type ${typeof (data)}`);
2641
- }
2642
- this._buffer.push(data);
2643
- this._sendBufferedData.resolve();
2644
- }
2645
- async _sendLoop() {
2646
- while (true) {
2647
- await this._sendBufferedData.promise;
2648
- if (!this._executing) {
2649
- if (this._transportResult) {
2650
- this._transportResult.reject("Connection stopped.");
2651
- }
2652
- break;
2653
- }
2654
- this._sendBufferedData = new PromiseSource();
2655
- const transportResult = this._transportResult;
2656
- this._transportResult = undefined;
2657
- const data = typeof (this._buffer[0]) === "string" ?
2658
- this._buffer.join("") :
2659
- TransportSendQueue._concatBuffers(this._buffer);
2660
- this._buffer.length = 0;
2661
- try {
2662
- await this._transport.send(data);
2663
- transportResult.resolve();
2664
- }
2665
- catch (error) {
2666
- transportResult.reject(error);
2667
- }
2668
- }
2669
- }
2670
- static _concatBuffers(arrayBuffers) {
2671
- const totalLength = arrayBuffers.map((b) => b.byteLength).reduce((a, b) => a + b);
2672
- const result = new Uint8Array(totalLength);
2673
- let offset = 0;
2674
- for (const item of arrayBuffers) {
2675
- result.set(new Uint8Array(item), offset);
2676
- offset += item.byteLength;
2677
- }
2678
- return result.buffer;
2679
- }
2680
- }
2681
- class PromiseSource {
2682
- constructor() {
2683
- this.promise = new Promise((resolve, reject) => [this._resolver, this._rejecter] = [resolve, reject]);
2684
- }
2685
- resolve() {
2686
- this._resolver();
2687
- }
2688
- reject(reason) {
2689
- this._rejecter(reason);
2690
- }
2691
- }
2692
-
2693
- // Licensed to the .NET Foundation under one or more agreements.
2694
- const JSON_HUB_PROTOCOL_NAME = "json";
2695
- /** Implements the JSON Hub Protocol. */
2696
- class JsonHubProtocol {
2697
- constructor() {
2698
- /** @inheritDoc */
2699
- this.name = JSON_HUB_PROTOCOL_NAME;
2700
- /** @inheritDoc */
2701
- this.version = 1;
2702
- /** @inheritDoc */
2703
- this.transferFormat = TransferFormat.Text;
2704
- }
2705
- /** Creates an array of {@link @microsoft/signalr.HubMessage} objects from the specified serialized representation.
2706
- *
2707
- * @param {string} input A string containing the serialized representation.
2708
- * @param {ILogger} logger A logger that will be used to log messages that occur during parsing.
2709
- */
2710
- parseMessages(input, logger) {
2711
- // The interface does allow "ArrayBuffer" to be passed in, but this implementation does not. So let's throw a useful error.
2712
- if (typeof input !== "string") {
2713
- throw new Error("Invalid input for JSON hub protocol. Expected a string.");
2714
- }
2715
- if (!input) {
2716
- return [];
2717
- }
2718
- if (logger === null) {
2719
- logger = NullLogger.instance;
2720
- }
2721
- // Parse the messages
2722
- const messages = TextMessageFormat.parse(input);
2723
- const hubMessages = [];
2724
- for (const message of messages) {
2725
- const parsedMessage = JSON.parse(message);
2726
- if (typeof parsedMessage.type !== "number") {
2727
- throw new Error("Invalid payload.");
2728
- }
2729
- switch (parsedMessage.type) {
2730
- case MessageType.Invocation:
2731
- this._isInvocationMessage(parsedMessage);
2732
- break;
2733
- case MessageType.StreamItem:
2734
- this._isStreamItemMessage(parsedMessage);
2735
- break;
2736
- case MessageType.Completion:
2737
- this._isCompletionMessage(parsedMessage);
2738
- break;
2739
- case MessageType.Ping:
2740
- // Single value, no need to validate
2741
- break;
2742
- case MessageType.Close:
2743
- // All optional values, no need to validate
2744
- break;
2745
- default:
2746
- // Future protocol changes can add message types, old clients can ignore them
2747
- logger.log(LogLevel.Information, "Unknown message type '" + parsedMessage.type + "' ignored.");
2748
- continue;
2749
- }
2750
- hubMessages.push(parsedMessage);
2751
- }
2752
- return hubMessages;
2753
- }
2754
- /** Writes the specified {@link @microsoft/signalr.HubMessage} to a string and returns it.
2755
- *
2756
- * @param {HubMessage} message The message to write.
2757
- * @returns {string} A string containing the serialized representation of the message.
2758
- */
2759
- writeMessage(message) {
2760
- return TextMessageFormat.write(JSON.stringify(message));
2761
- }
2762
- _isInvocationMessage(message) {
2763
- this._assertNotEmptyString(message.target, "Invalid payload for Invocation message.");
2764
- if (message.invocationId !== undefined) {
2765
- this._assertNotEmptyString(message.invocationId, "Invalid payload for Invocation message.");
2766
- }
2767
- }
2768
- _isStreamItemMessage(message) {
2769
- this._assertNotEmptyString(message.invocationId, "Invalid payload for StreamItem message.");
2770
- if (message.item === undefined) {
2771
- throw new Error("Invalid payload for StreamItem message.");
2772
- }
2773
- }
2774
- _isCompletionMessage(message) {
2775
- if (message.result && message.error) {
2776
- throw new Error("Invalid payload for Completion message.");
2777
- }
2778
- if (!message.result && message.error) {
2779
- this._assertNotEmptyString(message.error, "Invalid payload for Completion message.");
2780
- }
2781
- this._assertNotEmptyString(message.invocationId, "Invalid payload for Completion message.");
2782
- }
2783
- _assertNotEmptyString(value, errorMessage) {
2784
- if (typeof value !== "string" || value === "") {
2785
- throw new Error(errorMessage);
2786
- }
2787
- }
2788
- }
2789
-
2790
- // Licensed to the .NET Foundation under one or more agreements.
2791
- const LogLevelNameMapping = {
2792
- trace: LogLevel.Trace,
2793
- debug: LogLevel.Debug,
2794
- info: LogLevel.Information,
2795
- information: LogLevel.Information,
2796
- warn: LogLevel.Warning,
2797
- warning: LogLevel.Warning,
2798
- error: LogLevel.Error,
2799
- critical: LogLevel.Critical,
2800
- none: LogLevel.None,
2801
- };
2802
- function parseLogLevel(name) {
2803
- // Case-insensitive matching via lower-casing
2804
- // Yes, I know case-folding is a complicated problem in Unicode, but we only support
2805
- // the ASCII strings defined in LogLevelNameMapping anyway, so it's fine -anurse.
2806
- const mapping = LogLevelNameMapping[name.toLowerCase()];
2807
- if (typeof mapping !== "undefined") {
2808
- return mapping;
2809
- }
2810
- else {
2811
- throw new Error(`Unknown log level: ${name}`);
2812
- }
2813
- }
2814
- /** A builder for configuring {@link @microsoft/signalr.HubConnection} instances. */
2815
- class HubConnectionBuilder {
2816
- configureLogging(logging) {
2817
- Arg.isRequired(logging, "logging");
2818
- if (isLogger(logging)) {
2819
- this.logger = logging;
2820
- }
2821
- else if (typeof logging === "string") {
2822
- const logLevel = parseLogLevel(logging);
2823
- this.logger = new ConsoleLogger(logLevel);
2824
- }
2825
- else {
2826
- this.logger = new ConsoleLogger(logging);
2827
- }
2828
- return this;
2829
- }
2830
- withUrl(url, transportTypeOrOptions) {
2831
- Arg.isRequired(url, "url");
2832
- Arg.isNotEmpty(url, "url");
2833
- this.url = url;
2834
- // Flow-typing knows where it's at. Since HttpTransportType is a number and IHttpConnectionOptions is guaranteed
2835
- // to be an object, we know (as does TypeScript) this comparison is all we need to figure out which overload was called.
2836
- if (typeof transportTypeOrOptions === "object") {
2837
- this.httpConnectionOptions = { ...this.httpConnectionOptions, ...transportTypeOrOptions };
2838
- }
2839
- else {
2840
- this.httpConnectionOptions = {
2841
- ...this.httpConnectionOptions,
2842
- transport: transportTypeOrOptions,
2843
- };
2844
- }
2845
- return this;
2846
- }
2847
- /** Configures the {@link @microsoft/signalr.HubConnection} to use the specified Hub Protocol.
2848
- *
2849
- * @param {IHubProtocol} protocol The {@link @microsoft/signalr.IHubProtocol} implementation to use.
2850
- */
2851
- withHubProtocol(protocol) {
2852
- Arg.isRequired(protocol, "protocol");
2853
- this.protocol = protocol;
2854
- return this;
2855
- }
2856
- withAutomaticReconnect(retryDelaysOrReconnectPolicy) {
2857
- if (this.reconnectPolicy) {
2858
- throw new Error("A reconnectPolicy has already been set.");
2859
- }
2860
- if (!retryDelaysOrReconnectPolicy) {
2861
- this.reconnectPolicy = new DefaultReconnectPolicy();
2862
- }
2863
- else if (Array.isArray(retryDelaysOrReconnectPolicy)) {
2864
- this.reconnectPolicy = new DefaultReconnectPolicy(retryDelaysOrReconnectPolicy);
2865
- }
2866
- else {
2867
- this.reconnectPolicy = retryDelaysOrReconnectPolicy;
2868
- }
2869
- return this;
2870
- }
2871
- /** Creates a {@link @microsoft/signalr.HubConnection} from the configuration options specified in this builder.
2872
- *
2873
- * @returns {HubConnection} The configured {@link @microsoft/signalr.HubConnection}.
2874
- */
2875
- build() {
2876
- // If httpConnectionOptions has a logger, use it. Otherwise, override it with the one
2877
- // provided to configureLogger
2878
- const httpConnectionOptions = this.httpConnectionOptions || {};
2879
- // If it's 'null', the user **explicitly** asked for null, don't mess with it.
2880
- if (httpConnectionOptions.logger === undefined) {
2881
- // If our logger is undefined or null, that's OK, the HttpConnection constructor will handle it.
2882
- httpConnectionOptions.logger = this.logger;
2883
- }
2884
- // Now create the connection
2885
- if (!this.url) {
2886
- throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");
2887
- }
2888
- const connection = new HttpConnection(this.url, httpConnectionOptions);
2889
- return HubConnection.create(connection, this.logger || NullLogger.instance, this.protocol || new JsonHubProtocol(), this.reconnectPolicy);
2890
- }
2891
- }
2892
- function isLogger(logger) {
2893
- return logger.log !== undefined;
2894
- }
2895
-
2896
- const { state, onChange, reset } = createStore({
2897
- connecting: false,
2898
- connected: false
2899
- });
2900
- const signalRStore = { state, onChange, reset };
2901
-
2902
- class SignalRService {
2903
- constructor() {
2904
- console.log('Starting signalR');
2905
- //TODO: update courseClassId
2906
- var defaultCourseClassId = 1;
2907
- var sparkleConfig = EnvironmentConfigService.getInstance().get('sparkle');
2908
- this.connection = new HubConnectionBuilder()
2909
- .withUrl(`${sparkleConfig.apiUrl}hubs/sparkle?url=${window.location.href}${'&courseClassId=' + defaultCourseClassId }`, {
2910
- accessTokenFactory: () => this.getToken(),
2911
- skipNegotiation: true,
2912
- transport: HttpTransportType.WebSockets,
2913
- })
2914
- .configureLogging(LogLevel.Debug)
2915
- //.withAutomaticReconnect()
2916
- .withAutomaticReconnect({
2917
- nextRetryDelayInMilliseconds: retryContext => {
2918
- if (retryContext.elapsedMilliseconds < 60000) {
2919
- // If we've been reconnecting for less than 60 seconds so far,
2920
- // wait between 0 and 10 seconds before the next reconnect attempt.
2921
- return Math.random() * 10000;
2922
- }
2923
- else {
2924
- // If we've been reconnecting for more than 60 seconds so far, stop reconnecting.
2925
- return null;
2926
- }
2927
- },
2928
- })
2929
- .build();
2930
- this.connection.on('SendMessage', (user, data) => {
2931
- let payload = JSON.parse(data);
2932
- console.log('Server said ', user, payload);
2933
- });
2934
- this.connection.onclose(error => { });
2935
- this.connection.onreconnecting(error => {
2936
- console.assert(this.connection.state === HubConnectionState.Reconnecting);
2937
- });
2938
- this.connection.onreconnected(connectionId => {
2939
- console.assert(this.connection.state === HubConnectionState.Connected);
2940
- });
2941
- }
2942
- static getInstance() {
2943
- if (!SignalRService.instance) {
2944
- SignalRService.instance = new SignalRService();
2945
- }
2946
- return SignalRService.instance;
2947
- }
2948
- async start() {
2949
- console.log('start');
2950
- try {
2951
- signalRStore.state.connecting = true;
2952
- signalRStore.state.connected = !signalRStore.state.connecting;
2953
- await this.connection.start();
2954
- console.log(this.connection);
2955
- signalRStore.state.connecting = false;
2956
- signalRStore.state.connected = this.connection.state === HubConnectionState.Connected;
2957
- console.assert(this.connection.state === HubConnectionState.Connected);
2958
- console.log('SignalR Connected.');
2959
- }
2960
- catch (err) {
2961
- console.assert(this.connection.state === HubConnectionState.Disconnected);
2962
- console.log(err);
2963
- }
2964
- }
2965
- async callSignalR(hub, data) {
2966
- let token = await this.getToken();
2967
- if (!token) {
2968
- console.log('Cannot connect to signalR. Not logged in');
2969
- return;
2970
- }
2971
- this.connection.invoke(hub, JSON.stringify(data));
2972
- }
2973
- getToken() {
2974
- var token = TokenService.getInstance().getTokenSync();
2975
- if (token) {
2976
- return token;
2977
- }
2978
- return null;
2979
- }
2980
- }
2981
-
2982
- export { SignalRService as S, signalRStore as s };