@sparkle-learning/core 0.0.53 → 0.0.55

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 (177) hide show
  1. package/dist/cjs/{PrivateRoute-074c584e.js → PrivateRoute-f97245ce.js} +18 -30
  2. package/dist/cjs/{feed.service-b4f09441.js → appdata.service-c8d71e05.js} +4 -56
  3. package/dist/cjs/{assets.service-0c759d51.js → assets.service-bfa75092.js} +1 -1
  4. package/dist/cjs/assignment.service-690fb59c.js +19 -0
  5. package/dist/cjs/{environment-config.service-0e02b049.js → environment-config.service-c8ff1f3d.js} +0 -1
  6. package/dist/cjs/{facilitator.service-9e990274.js → facilitator.service-ff0e1659.js} +1 -1
  7. package/dist/cjs/feed.service-8eca4de6.js +57 -0
  8. package/dist/cjs/header-mobile-collapse_61.cjs.entry.js +76 -87
  9. package/dist/cjs/{httpService-7211d93b.js → httpService-d2e7bf8f.js} +13 -11
  10. package/dist/cjs/index.cjs.js +5 -4
  11. package/dist/cjs/{ion-action-sheet_4.cjs.entry.js → ion-action-sheet_7.cjs.entry.js} +728 -0
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/media.service-8a1b9bc5.js +40 -0
  14. package/dist/cjs/{signalR.service-5672eebc.js → signalR.service-bd6b42f9.js} +18 -20
  15. package/dist/cjs/sparkle-animation-player.cjs.entry.js +1 -1
  16. package/dist/cjs/sparkle-assignment.cjs.entry.js +110 -0
  17. package/dist/cjs/sparkle-character-intro.cjs.entry.js +2 -2
  18. package/dist/cjs/sparkle-core.cjs.js +1 -1
  19. package/dist/cjs/sparkle-discussion-questions_2.cjs.entry.js +20 -11
  20. package/dist/cjs/sparkle-discussion.cjs.entry.js +6 -4
  21. package/dist/cjs/sparkle-facilitator-notes-form.cjs.entry.js +5 -3
  22. package/dist/cjs/sparkle-feed-post.cjs.entry.js +116 -0
  23. package/dist/cjs/sparkle-feedback.cjs.entry.js +5 -3
  24. package/dist/cjs/sparkle-file-upload.cjs.entry.js +53 -0
  25. package/dist/cjs/sparkle-goal-form.cjs.entry.js +11 -8
  26. package/dist/cjs/sparkle-input.cjs.entry.js +56 -0
  27. package/dist/cjs/sparkle-quiz-container.cjs.entry.js +1 -1
  28. package/dist/cjs/sparkle-quiz-old.cjs.entry.js +120 -0
  29. package/dist/cjs/sparkle-quiz.cjs.entry.js +31 -48
  30. package/dist/cjs/{student.service-2e58f237.js → student.service-7e5385be.js} +1 -1
  31. package/dist/cjs/token.service-7a41953d.js +97 -0
  32. package/dist/cjs/{util-d383acb8.js → util-47e320b2.js} +2 -2
  33. package/dist/collection/PrivateRoute.js +2 -2
  34. package/dist/collection/collection-manifest.json +5 -2
  35. package/dist/collection/components/layout/facilitator/facilitator-page.js +2 -3
  36. package/dist/collection/components/layout/page/page.css +4 -0
  37. package/dist/collection/components/layout/page/page.js +39 -26
  38. package/dist/collection/components/sparkle-assignment/sparkle-assignment.css +30 -0
  39. package/dist/collection/components/sparkle-assignment/sparkle-assignment.js +159 -0
  40. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.css +8 -1
  41. package/dist/collection/components/sparkle-character-intro/sparkle-character-intro.js +10 -6
  42. package/dist/collection/components/sparkle-course-root/sparkle-course-root.js +13 -2
  43. package/dist/collection/components/sparkle-discussion/sparkle-discussion-questions/sparkle-discussion-questions.js +4 -2
  44. package/dist/collection/components/sparkle-discussion/sparkle-discussion-results/sparkle-discussion-results.js +15 -9
  45. package/dist/collection/components/sparkle-discussion/sparkle-discussion.css +5 -0
  46. package/dist/collection/components/sparkle-discussion/sparkle-discussion.js +5 -3
  47. package/dist/collection/components/sparkle-feed-post/sparkle-feed-post.js +54 -75
  48. package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.css +0 -0
  49. package/dist/collection/components/sparkle-file-upload/sparkle-file-upload.js +105 -0
  50. package/dist/collection/components/sparkle-input/sparkle-input.css +0 -0
  51. package/dist/collection/components/sparkle-input/sparkle-input.js +212 -0
  52. package/dist/collection/components/sparkle-login/sparkle-login.js +2 -1
  53. package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.css → sparkle-quiz-old/sparkle-quiz-old.css} +1 -1
  54. package/dist/collection/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.js → sparkle-quiz-old/sparkle-quiz-old.js} +4 -4
  55. package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.js → sparkle-quiz.js} +23 -25
  56. package/dist/collection/components/sparkle-quiz-container/sparkle-quiz-container.js +1 -1
  57. package/dist/collection/components/sparkle-root/sparkle-root.js +12 -10
  58. package/dist/collection/services/assignment.service.js +14 -0
  59. package/dist/collection/services/auth/auth.service.js +15 -14
  60. package/dist/collection/services/environment/environment-config.js +1 -1
  61. package/dist/collection/services/environment/environment-config.service.js +0 -1
  62. package/dist/collection/services/httpService.js +12 -10
  63. package/dist/collection/services/signalR.service.js +17 -19
  64. package/dist/collection/services/token.service.js +79 -0
  65. package/dist/collection/util.js +5 -2
  66. package/dist/esm/{PrivateRoute-c5441f35.js → PrivateRoute-90ac95b8.js} +17 -29
  67. package/dist/esm/{feed.service-8fbe4ce3.js → appdata.service-2e84e167.js} +5 -55
  68. package/dist/esm/{assets.service-66e848b8.js → assets.service-def1d63c.js} +1 -1
  69. package/dist/esm/assignment.service-8d31f141.js +17 -0
  70. package/dist/esm/{environment-config.service-2b5d692b.js → environment-config.service-b191f276.js} +0 -1
  71. package/dist/esm/{facilitator.service-b0292f7f.js → facilitator.service-18c47bdf.js} +1 -1
  72. package/dist/esm/feed.service-b4f3cae4.js +54 -0
  73. package/dist/esm/header-mobile-collapse_61.entry.js +71 -82
  74. package/dist/esm/{httpService-7b75b095.js → httpService-7986aeed.js} +14 -12
  75. package/dist/esm/index.js +6 -5
  76. package/dist/esm/{ion-action-sheet_4.entry.js → ion-action-sheet_7.entry.js} +729 -4
  77. package/dist/esm/ion-loading.entry.js +1 -1
  78. package/dist/esm/ion-menu.entry.js +1 -1
  79. package/dist/esm/ion-modal.entry.js +1 -1
  80. package/dist/esm/ion-picker.entry.js +1 -1
  81. package/dist/esm/ion-toast.entry.js +1 -1
  82. package/dist/esm/loader.js +1 -1
  83. package/dist/esm/media.service-6e90bc41.js +37 -0
  84. package/dist/esm/{overlays-3b4dca92.js → overlays-4233a39d.js} +1 -1
  85. package/dist/esm/{signalR.service-9d5b9f36.js → signalR.service-c33fba50.js} +18 -20
  86. package/dist/esm/sparkle-animation-player.entry.js +1 -1
  87. package/dist/esm/sparkle-assignment.entry.js +106 -0
  88. package/dist/esm/sparkle-character-intro.entry.js +3 -3
  89. package/dist/esm/sparkle-core.js +1 -1
  90. package/dist/esm/sparkle-discussion-questions_2.entry.js +20 -11
  91. package/dist/esm/sparkle-discussion.entry.js +6 -4
  92. package/dist/esm/sparkle-facilitator-notes-form.entry.js +6 -4
  93. package/dist/esm/sparkle-feed-post.entry.js +112 -0
  94. package/dist/esm/sparkle-feedback.entry.js +6 -4
  95. package/dist/esm/sparkle-file-upload.entry.js +49 -0
  96. package/dist/esm/sparkle-goal-form.entry.js +9 -6
  97. package/dist/esm/sparkle-input.entry.js +52 -0
  98. package/dist/esm/sparkle-quiz-container.entry.js +1 -1
  99. package/dist/esm/sparkle-quiz-old.entry.js +116 -0
  100. package/dist/esm/sparkle-quiz.entry.js +31 -48
  101. package/dist/esm/{student.service-0746418b.js → student.service-08af124f.js} +1 -1
  102. package/dist/esm/token.service-71a5d33f.js +94 -0
  103. package/dist/esm/{util-6ef753e9.js → util-57cc8006.js} +2 -2
  104. package/dist/sparkle-core/index.esm.js +1 -1
  105. package/dist/sparkle-core/p-08420531.entry.js +1 -0
  106. package/dist/sparkle-core/p-08cca80d.entry.js +1 -0
  107. package/dist/sparkle-core/p-0e8e539f.entry.js +1 -0
  108. package/dist/sparkle-core/p-13ec39db.entry.js +1 -0
  109. package/dist/sparkle-core/p-1adc98f6.js +1 -0
  110. package/dist/sparkle-core/p-38c842d5.entry.js +1 -0
  111. package/dist/sparkle-core/{p-fbccd30c.js → p-39a31e43.js} +1 -1
  112. package/dist/sparkle-core/{p-0a5d7c4f.entry.js → p-3daf2915.entry.js} +26 -26
  113. package/dist/sparkle-core/{p-9a443f51.js → p-408176ba.js} +1 -1
  114. package/dist/sparkle-core/p-42ed7d5f.entry.js +1 -0
  115. package/dist/sparkle-core/p-4b4a8703.js +1 -0
  116. package/dist/sparkle-core/p-4d1cfcbe.entry.js +1 -0
  117. package/dist/sparkle-core/p-4fba3e4c.js +1 -0
  118. package/dist/sparkle-core/{p-54dd894f.entry.js → p-6bde0192.entry.js} +1 -1
  119. package/dist/sparkle-core/{p-6faa194c.entry.js → p-6d2f4093.entry.js} +1 -1
  120. package/dist/sparkle-core/{p-162bff1a.entry.js → p-72053ae0.entry.js} +1 -1
  121. package/dist/sparkle-core/p-7dae0f0e.js +1 -0
  122. package/dist/sparkle-core/{p-18cdd458.entry.js → p-85d4cd5c.entry.js} +1 -1
  123. package/dist/sparkle-core/p-973fe404.entry.js +22 -0
  124. package/dist/sparkle-core/{p-ff0e0d4e.entry.js → p-98daeddb.entry.js} +1 -1
  125. package/dist/sparkle-core/p-b06e2bef.js +1 -0
  126. package/dist/sparkle-core/{p-e863bf1d.entry.js → p-b6fec622.entry.js} +1 -1
  127. package/dist/sparkle-core/p-b8d71ff4.js +1 -0
  128. package/dist/sparkle-core/p-bd90903e.js +1 -0
  129. package/dist/sparkle-core/{p-a49ab4e8.entry.js → p-c64a34cd.entry.js} +1 -1
  130. package/dist/sparkle-core/{p-5efc6566.js → p-c9f753a4.js} +1 -1
  131. package/dist/sparkle-core/p-da391f3f.js +1 -0
  132. package/dist/sparkle-core/p-e0cad1bb.js +1 -0
  133. package/dist/sparkle-core/{p-ce4b22f7.entry.js → p-f196c124.entry.js} +1 -1
  134. package/dist/sparkle-core/p-f47fe1fe.entry.js +1 -0
  135. package/dist/sparkle-core/p-f714f77a.entry.js +1 -0
  136. package/dist/sparkle-core/p-f891c79a.entry.js +1 -0
  137. package/dist/sparkle-core/{p-377b04c2.entry.js → p-ff080f82.entry.js} +1 -1
  138. package/dist/sparkle-core/{p-2ff67662.js → p-ff7a8a71.js} +1 -1
  139. package/dist/sparkle-core/sparkle-core.esm.js +1 -1
  140. package/dist/types/components/layout/page/page.d.ts +2 -0
  141. package/dist/types/components/sparkle-assignment/sparkle-assignment.d.ts +16 -0
  142. package/dist/types/components/sparkle-course-root/sparkle-course-root.d.ts +1 -0
  143. package/dist/types/components/sparkle-feed-post/sparkle-feed-post.d.ts +4 -3
  144. package/dist/types/components/sparkle-file-upload/sparkle-file-upload.d.ts +15 -0
  145. package/dist/types/components/sparkle-input/sparkle-input.d.ts +23 -0
  146. package/dist/types/components/sparkle-quiz/{sparkle-quiz/sparkle-quiz.d.ts → sparkle-quiz-old/sparkle-quiz-old.d.ts} +1 -1
  147. package/dist/types/components/sparkle-quiz/{sparkle-quiz-v1.d.ts → sparkle-quiz.d.ts} +1 -1
  148. package/dist/types/components.d.ts +111 -36
  149. package/dist/types/models/class.model.d.ts +4 -0
  150. package/dist/types/services/assignment.service.d.ts +8 -0
  151. package/dist/types/services/auth/auth.service.d.ts +1 -1
  152. package/dist/types/services/environment/environment-config.d.ts +3 -0
  153. package/dist/types/services/token.service.d.ts +13 -0
  154. package/dist/types/util.d.ts +1 -0
  155. package/package.json +1 -1
  156. package/dist/cjs/ion-select_3.cjs.entry.js +0 -618
  157. package/dist/cjs/ion-textarea.cjs.entry.js +0 -248
  158. package/dist/cjs/sparkle-quiz-v1.cjs.entry.js +0 -105
  159. package/dist/esm/ion-select_3.entry.js +0 -612
  160. package/dist/esm/ion-textarea.entry.js +0 -244
  161. package/dist/esm/sparkle-quiz-v1.entry.js +0 -101
  162. package/dist/sparkle-core/p-0f1c5899.entry.js +0 -18
  163. package/dist/sparkle-core/p-1d4c7c11.js +0 -1
  164. package/dist/sparkle-core/p-30767c1c.entry.js +0 -1
  165. package/dist/sparkle-core/p-3265ed87.entry.js +0 -1
  166. package/dist/sparkle-core/p-370609ba.entry.js +0 -1
  167. package/dist/sparkle-core/p-44334ef3.entry.js +0 -4
  168. package/dist/sparkle-core/p-462bffba.js +0 -1
  169. package/dist/sparkle-core/p-4c9f994f.js +0 -1
  170. package/dist/sparkle-core/p-58e4bbe5.entry.js +0 -1
  171. package/dist/sparkle-core/p-600cf6a3.js +0 -1
  172. package/dist/sparkle-core/p-641bfc92.entry.js +0 -1
  173. package/dist/sparkle-core/p-80d6b0e6.entry.js +0 -1
  174. package/dist/sparkle-core/p-af3cc111.entry.js +0 -1
  175. package/dist/sparkle-core/p-b226f54d.js +0 -1
  176. /package/dist/collection/components/sparkle-quiz/{sparkle-quiz-v1.css → sparkle-quiz.css} +0 -0
  177. /package/dist/sparkle-core/{p-935e7cfc.js → p-8b56f734.js} +0 -0
@@ -1 +1 @@
1
- import{E as t}from"./p-b226f54d.js";class s{constructor(){this.assetsList=void 0}static getInstance(){return s.instance||(s.instance=new s),s.instance}async assets(){return void 0===this.assetsList&&(this.assetsList=await this.init()),this.assetsList}async init(){try{const s=t.getInstance().get("sparkle"),a=await fetch(`${s.globalAssetsUrl}/assets.json`);if(!a)return;return await a.json()}catch(t){return}}async loadJsonFile(t){try{const s=await fetch(`${t}`);if(!s)return;return await s.json()}catch(t){return}}}export{s as A}
1
+ import{E as t}from"./p-bd90903e.js";class s{constructor(){this.assetsList=void 0}static getInstance(){return s.instance||(s.instance=new s),s.instance}async assets(){return void 0===this.assetsList&&(this.assetsList=await this.init()),this.assetsList}async init(){try{const s=t.getInstance().get("sparkle"),a=await fetch(`${s.globalAssetsUrl}/assets.json`);if(!a)return;return await a.json()}catch(t){return}}async loadJsonFile(t){try{const s=await fetch(`${t}`);if(!s)return;return await s.json()}catch(t){return}}}export{s as A}
@@ -0,0 +1 @@
1
+ import{r as i,h as t,e as s}from"./p-ee1e0eb4.js";import{S as e,G as a,e as o,f as n}from"./p-8b56f734.js";import{E as l}from"./p-bd90903e.js";import{A as h}from"./p-408176ba.js";import{A as r,g as d}from"./p-da391f3f.js";import{F as p,f as c}from"./p-b8d71ff4.js";import"./p-b06e2bef.js";import"./p-2f569553.js";import"./p-ff7a8a71.js";import"./p-871106e0.js";import"./p-add30d46.js";import"./p-d68092b7.js";import"./p-7dae0f0e.js";import"./p-5d409601.js";const u=class{constructor(t){i(this,t),this.name={valid:!1,value:""},this.description={valid:!1,value:""},this.category={valid:!1,value:""},this.progress=0,this.public=!0,this.goalUpdateText={valid:!0,value:""},this.submitted=!1}goalHanlder(i){this.updateGoal(i.AppData)}componentWillLoad(){this.appData&&this.updateGoal(this.appData.AppData)}updateGoal(i){i&&(this.name=Object.assign(Object.assign({},this.name),{value:i.Name}),this.description=Object.assign(Object.assign({},this.description),{value:i.Description}),this.category=Object.assign(Object.assign({},this.category),{value:i.Category}),this.goalUpdateText=Object.assign(Object.assign({},this.goalUpdateText),{value:i.GoalText}),this.progress=i.Percentage)}handleTitle(i){this.validateTitle(),this.name=Object.assign(Object.assign({},this.name),{value:i.target.value})}handleDescription(i){this.validateDescription(),this.description=Object.assign(Object.assign({},this.description),{value:i.target.value})}handleCategory(i){this.validateCategoy(),this.category=Object.assign(Object.assign({},this.category),{value:i.target.value})}handleGoalProgressInfo(i){this.goalUpdateText=Object.assign(Object.assign({},this.goalUpdateText),{value:i.target.value})}validateTitle(){this.name=Object.assign(Object.assign({},this.name),this.name.value&&this.name.value.length>0?{valid:!0}:{valid:!1})}validateDescription(){this.description=Object.assign(Object.assign({},this.description),this.description.value&&this.description.value.length>0?{valid:!0}:{valid:!1})}validateCategoy(){this.category=Object.assign(Object.assign({},this.category),this.category.value&&this.category.value.length>0?{valid:!0}:{valid:!1})}validateGoalUpdateText(){this.goalUpdateText=Object.assign(Object.assign({},this.goalUpdateText),this.goalUpdateText.value&&this.goalUpdateText.value.length>0?{valid:!0}:{valid:!1})}async onSubmit(i){if(i.preventDefault(),console.log("clicked signup"),this.validateTitle(),this.validateDescription(),this.validateCategoy(),this.submitted=!0,this.appData&&this.appData.Id>0){if(this.validateGoalUpdateText(),this.name.valid&&this.description.valid&&this.category.valid&&this.goalUpdateText.valid){var t=a(this.name.value,this.description.value,this.category.value,this.progress,this.goalUpdateText.value);(await r.getInstance().updateGoal({Id:this.appData.Id,MiniAppId:e.MY_GOALS_APP_ID,AppJsonData:JSON.stringify(t)})).Succeeded&&(this.public?await this.postToFeed():this.dismiss())}}else this.name.valid&&this.description.valid&&this.category.valid&&(t=a(this.name.value,this.description.value,this.category.value,this.progress,this.goalUpdateText.value),(await r.getInstance().createGoal({MiniAppId:e.MY_GOALS_APP_ID,AppJsonData:JSON.stringify(t)})).Succeeded&&this.dismiss())}async postToFeed(){const i=l.getInstance().get("sparkle");var t={CourseId:(await h.getInstance().loadJsonFile(i.tocPath)).id,MiniAppId:e.MY_GOALS_APP_ID,PostText:o(this.name.value,this.goalUpdateText.value,this.progress),PostTextJSON:n(this.name.value,this.goalUpdateText.value,this.progress),IsPublic:this.public,ExternalResourceUrl:""};(await p.getInstance().createPost(t)).Succeeded&&this.dismiss()}dismiss(i){this.el.closest("ion-modal").dismiss({dismissed:!0})}renderEditBookingFields(){if(this.appData)return t("div",null,t("ion-item",null,t("ion-label",{position:"stacked",color:"primary"},"Goal Progress Info"),t("ion-input",{name:"title",type:"text",value:this.goalUpdateText.value,onInput:i=>this.handleGoalProgressInfo(i)})),t("ion-text",{color:"danger"},t("p",{hidden:this.goalUpdateText.valid||!1===this.submitted,class:"ion-padding-start"},"Goal Progress text is required")),t("ion-item",null,t("ion-label",{position:"stacked"},"Progress"),t("ion-range",{value:this.progress,min:1,max:100,step:1,snaps:!0,pin:!0,onIonChange:i=>this.progress=+i.detail.value},t("ion-icon",{size:"small",slot:"start",name:"pulse"}),t("ion-icon",{name:"pulse",size:"small"}),t("strong",{slot:"end"},this.progress))),t("ion-text",{color:"danger"},t("p",{hidden:this.progress>0||!1===this.submitted,class:"ion-padding-start"},"Min Progress value should be 1")),t("ion-item",{lines:"none"},t("ion-label",null,"Share to Community Wall"),t("ion-checkbox",{slot:"start",onChange:i=>this.public=i.detail.checked,checked:!0})))}render(){return[t("div",null,t("ion-toolbar",{color:"primary"},t("ion-buttons",{slot:"start"},t("ion-back-button",{defaultHref:"home",onClick:()=>this.dismiss()})),t("ion-title",null,"Add New Goal")),t("div",{class:"inner-content"},t("form",{class:"ion-padding",novalidate:!0,onSubmit:i=>this.onSubmit(i)},t("ion-list",{"no-lines":!0},t("ion-item",null,t("ion-label",{position:"stacked",color:"primary"},"Title"),t("ion-input",{name:"title",type:"text",value:this.name.value,onInput:i=>this.handleTitle(i),required:!0})),t("ion-text",{color:"danger"},t("p",{hidden:this.name.valid||!1===this.submitted,class:"ion-padding-start"},"Title is required")),t("ion-item",null,t("ion-label",{position:"stacked",color:"primary"},"Description"),t("ion-textarea",{name:"desciption",value:this.description.value,onInput:i=>this.handleDescription(i),required:!0})),t("ion-text",{color:"danger"},t("p",{hidden:this.description.valid||!1===this.submitted,class:"ion-padding-start"},"Description is required")),t("ion-item",null,t("ion-label",null,"Category"),t("ion-select",{value:this.category.value,onIonChange:i=>this.handleCategory(i)},t("ion-select-option",{value:"Emotional"},"Emotional"),t("ion-select-option",{value:"Interpersonal"},"Interpersonal"),t("ion-select-option",{value:"Learning"},"Learning"),t("ion-select-option",{value:"Financial"},"Financial"),t("ion-select-option",{value:"Physical"},"Physical"))),t("ion-text",{color:"danger"},t("p",{hidden:this.category.valid||!1===this.submitted,class:"ion-padding-start"},"Category is required")),this.renderEditBookingFields()),t("div",{class:"ion-padding"},this.appData&&t("ion-button",{type:"submit",expand:"block",disabled:d.state.goalLoading||c.state.postIdLoading>0},d.state.goalLoading&&t("ion-spinner",{name:"dots"})," Update"),!this.appData&&t("ion-button",{type:"submit",expand:"block",disabled:d.state.goalLoading},d.state.goalLoading&&t("ion-spinner",{name:"dots"})," Add")))))]}get el(){return s(this)}static get watchers(){return{appData:["goalHanlder"]}}};u.style=":host{display:block}";export{u as sparkle_goal_form}
@@ -0,0 +1 @@
1
+ import{E as t}from"./p-bd90903e.js";import{d as e}from"./p-2f569553.js";import{T as s}from"./p-7dae0f0e.js";class n extends Error{constructor(t,e){const s=new.target.prototype;super(`${t}: Status code '${e}'`),this.statusCode=e,this.__proto__=s}}class i extends Error{constructor(t="A timeout occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class r extends Error{constructor(t="An abort occurred."){const e=new.target.prototype;super(t),this.__proto__=e}}class o extends Error{constructor(t,e){const s=new.target.prototype;super(t),this.transport=e,this.errorType="UnsupportedTransportError",this.__proto__=s}}class h extends Error{constructor(t,e){const s=new.target.prototype;super(t),this.transport=e,this.errorType="DisabledTransportError",this.__proto__=s}}class c extends Error{constructor(t,e){const s=new.target.prototype;super(t),this.transport=e,this.errorType="FailedToStartTransportError",this.__proto__=s}}class a extends Error{constructor(t){const e=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=e}}class l extends Error{constructor(t,e){const s=new.target.prototype;super(t),this.innerErrors=e,this.__proto__=s}}class u{constructor(t,e,s){this.statusCode=t,this.statusText=e,this.content=s}}class d{get(t,e){return this.send({...e,method:"GET",url:t})}post(t,e){return this.send({...e,method:"POST",url:t})}delete(t,e){return this.send({...e,method:"DELETE",url:t})}getCookieString(t){return""}}var p,f,w;!function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"}(p||(p={}));class g{constructor(){}log(t,e){}}g.instance=new g;class m{static isRequired(t,e){if(null==t)throw new Error(`The '${e}' argument is required.`)}static isNotEmpty(t,e){if(!t||t.match(/^\s*$/))throw new Error(`The '${e}' argument should not be empty.`)}static isIn(t,e,s){if(!(t in e))throw new Error(`Unknown ${s} value: ${t}.`)}}class y{static get isBrowser(){return"object"==typeof window&&"object"==typeof window.document}static get isWebWorker(){return"object"==typeof self&&"importScripts"in self}static get isReactNative(){return"object"==typeof window&&void 0===window.document}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function b(t,e){let s="";return v(t)?(s=`Binary data of length ${t.byteLength}`,e&&(s+=`. Content: '${function(t){const e=new Uint8Array(t);let s="";return e.forEach((t=>{s+=`0x${t<16?"0":""}${t.toString(16)} `})),s.substr(0,s.length-1)}(t)}'`)):"string"==typeof t&&(s=`String data of length ${t.length}`,e&&(s+=`. Content: '${t}'`)),s}function v(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}async function $(t,e,s,n,i,r,o){let h={};if(i){const t=await i();t&&(h={Authorization:`Bearer ${t}`})}const[c,a]=S();h[c]=a,t.log(p.Trace,`(${e} transport) sending data. ${b(r,o.logMessageContent)}.`);const l=v(r)?"arraybuffer":"text",u=await s.post(n,{content:r,headers:{...h,...o.headers},responseType:l,timeout:o.timeout,withCredentials:o.withCredentials});t.log(p.Trace,`(${e} transport) request complete. Response status: ${u.statusCode}.`)}class E{constructor(t,e){this._subject=t,this._observer=e}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),0===this._subject.observers.length&&this._subject.cancelCallback&&this._subject.cancelCallback().catch((()=>{}))}}class C{constructor(t){this._minLevel=t,this.out=console}log(t,e){if(t>=this._minLevel){const s=`[${(new Date).toISOString()}] ${p[t]}: ${e}`;switch(t){case p.Critical:case p.Error:this.out.error(s);break;case p.Warning:this.out.warn(s);break;case p.Information:this.out.info(s);break;default:this.out.log(s)}}}}function S(){let t="X-SignalR-User-Agent";return y.isNode&&(t="User-Agent"),[t,k("6.0.3",_(),y.isNode?"NodeJS":"Browser",P())]}function k(t,e,s,n){let i="Microsoft SignalR/";const r=t.split(".");return i+=`${r[0]}.${r[1]}`,i+=` (${t}; `,i+=e&&""!==e?`${e}; `:"Unknown OS; ",i+=`${s}`,i+=n?`; ${n}`:"; Unknown Runtime Version",i+=")",i}function _(){if(!y.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function P(){if(y.isNode)return process.versions.node}function T(t){return t.stack?t.stack:t.message?t.message:`${t}`}class I extends d{constructor(t){if(super(),this._logger=t,"undefined"==typeof fetch){const t="function"==typeof __webpack_require__?__non_webpack_require__:require;this._jar=new(t("tough-cookie").CookieJar),this._fetchType=t("node-fetch"),this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("could not find global")}());if("undefined"==typeof AbortController){const t="function"==typeof __webpack_require__?__non_webpack_require__:require;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}async send(t){if(t.abortSignal&&t.abortSignal.aborted)throw new r;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const e=new this._abortControllerType;let s;t.abortSignal&&(t.abortSignal.onabort=()=>{e.abort(),s=new r});let o,h=null;t.timeout&&(h=setTimeout((()=>{e.abort(),this._logger.log(p.Warning,"Timeout from HTTP request."),s=new i}),t.timeout));try{o=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:!0===t.withCredentials?"include":"same-origin",headers:{"Content-Type":"text/plain;charset=UTF-8","X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:e.signal})}catch(t){if(s)throw s;throw this._logger.log(p.Warning,`Error from HTTP request. ${t}.`),t}finally{h&&clearTimeout(h),t.abortSignal&&(t.abortSignal.onabort=null)}if(!o.ok){const t=await H(o,"text");throw new n(t||o.statusText,o.status)}const c=H(o,t.responseType),a=await c;return new u(o.status,o.statusText,a)}getCookieString(t){let e="";return y.isNode&&this._jar&&this._jar.getCookies(t,((t,s)=>e=s.join("; "))),e}}function H(t,e){let s;switch(e){case"arraybuffer":s=t.arrayBuffer();break;case"text":s=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:s=t.text()}return s}class D extends d{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new r):t.method?t.url?new Promise(((e,s)=>{const o=new XMLHttpRequest;o.open(t.method,t.url,!0),o.withCredentials=void 0===t.withCredentials||t.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.setRequestHeader("Content-Type","text/plain;charset=UTF-8");const h=t.headers;h&&Object.keys(h).forEach((t=>{o.setRequestHeader(t,h[t])})),t.responseType&&(o.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{o.abort(),s(new r)}),t.timeout&&(o.timeout=t.timeout),o.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),o.status>=200&&o.status<300?e(new u(o.status,o.statusText,o.response||o.responseText)):s(new n(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(p.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),s(new n(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(p.Warning,"Timeout from HTTP request."),s(new i)},o.send(t.content||"")})):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class R extends d{constructor(t){if(super(),"undefined"!=typeof fetch||y.isNode)this._httpClient=new I(t);else{if("undefined"==typeof XMLHttpRequest)throw new Error("No usable HttpClient found.");this._httpClient=new D(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new r):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}class x{static write(t){return`${t}${x.RecordSeparator}`}static parse(t){if(t[t.length-1]!==x.RecordSeparator)throw new Error("Message is incomplete.");const e=t.split(x.RecordSeparator);return e.pop(),e}}x.RecordSeparatorCode=30,x.RecordSeparator=String.fromCharCode(x.RecordSeparatorCode);class N{writeHandshakeRequest(t){return x.write(JSON.stringify(t))}parseHandshakeResponse(t){let e,s;if(v(t)){const n=new Uint8Array(t),i=n.indexOf(x.RecordSeparatorCode);if(-1===i)throw new Error("Message is incomplete.");const r=i+1;e=String.fromCharCode.apply(null,Array.prototype.slice.call(n.slice(0,r))),s=n.byteLength>r?n.slice(r).buffer:null}else{const n=t,i=n.indexOf(x.RecordSeparator);if(-1===i)throw new Error("Message is incomplete.");const r=i+1;e=n.substring(0,r),s=n.length>r?n.substring(r):null}const n=x.parse(e),i=JSON.parse(n[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[s,i]}}!function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close"}(f||(f={}));class q{constructor(){this.observers=[]}next(t){for(const e of this.observers)e.next(t)}error(t){for(const e of this.observers)e.error&&e.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new E(this,t)}}!function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"}(w||(w={}));class U{constructor(t,e,s,n){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(p.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")},m.isRequired(t,"connection"),m.isRequired(e,"logger"),m.isRequired(s,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=e,this._protocol=s,this.connection=t,this._reconnectPolicy=n,this._handshakeProtocol=new N,this.connection.onreceive=t=>this._processIncomingData(t),this.connection.onclose=t=>this._connectionClosed(t),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=w.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:f.Ping})}static create(t,e,s,n){return new U(t,e,s,n)}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){if(this._connectionState!==w.Disconnected&&this._connectionState!==w.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==w.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=w.Connecting,this._logger.log(p.Debug,"Starting HubConnection.");try{await this._startInternal(),y.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=w.Connected,this._connectionStarted=!0,this._logger.log(p.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=w.Disconnected,this._logger.log(p.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise(((t,e)=>{this._handshakeResolver=t,this._handshakeRejecter=e}));await this.connection.start(this._protocol.transferFormat);try{const e={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(p.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(e)),this._logger.log(p.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError}catch(t){throw this._logger.log(p.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(t),t}}async stop(){const t=this._startPromise;this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch(t){}}_stopInternal(t){return this._connectionState===w.Disconnected?(this._logger.log(p.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===w.Disconnecting?(this._logger.log(p.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState=w.Disconnecting,this._logger.log(p.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(p.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new Error("The connection was stopped before the hub handshake could complete."),this.connection.stop(t)))}stream(t,...e){const[s,n]=this._replaceStreamingParams(e),i=this._createStreamInvocation(t,e,n);let r;const o=new q;return o.cancelCallback=()=>{const t=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],r.then((()=>this._sendWithProtocol(t)))},this._callbacks[i.invocationId]=(t,e)=>{e?o.error(e):t&&(t.type===f.Completion?t.error?o.error(new Error(t.error)):o.complete():o.next(t.item))},r=this._sendWithProtocol(i).catch((t=>{o.error(t),delete this._callbacks[i.invocationId]})),this._launchStreams(s,r),o}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._sendMessage(this._protocol.writeMessage(t))}send(t,...e){const[s,n]=this._replaceStreamingParams(e),i=this._sendWithProtocol(this._createInvocation(t,e,!0,n));return this._launchStreams(s,i),i}invoke(t,...e){const[s,n]=this._replaceStreamingParams(e),i=this._createInvocation(t,e,!1,n);return new Promise(((t,e)=>{this._callbacks[i.invocationId]=(s,n)=>{n?e(n):s&&(s.type===f.Completion?s.error?e(new Error(s.error)):t(s.result):e(new Error(`Unexpected message type: ${s.type}`)))};const n=this._sendWithProtocol(i).catch((t=>{e(t),delete this._callbacks[i.invocationId]}));this._launchStreams(s,n)}))}on(t,e){t&&e&&(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),-1===this._methods[t].indexOf(e)&&this._methods[t].push(e))}off(t,e){if(!t)return;t=t.toLowerCase();const s=this._methods[t];if(s)if(e){const n=s.indexOf(e);-1!==n&&(s.splice(n,1),0===s.length&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const e=this._protocol.parseMessages(t,this._logger);for(const t of e)switch(t.type){case f.Invocation:this._invokeClientMethod(t);break;case f.StreamItem:case f.Completion:{const e=this._callbacks[t.invocationId];if(e){t.type===f.Completion&&delete this._callbacks[t.invocationId];try{e(t)}catch(t){this._logger.log(p.Error,`Stream callback threw error: ${T(t)}`)}}break}case f.Ping:break;case f.Close:{this._logger.log(p.Information,"Close message received from server.");const e=t.error?new Error("Server returned an error on close: "+t.error):void 0;!0===t.allowReconnect?this.connection.stop(e):this._stopPromise=this._stopInternal(e);break}default:this._logger.log(p.Warning,`Invalid message type: ${t.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let e,s;try{[s,e]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(t){const e="Error parsing handshake response: "+t;this._logger.log(p.Error,e);const s=new Error(e);throw this._handshakeRejecter(s),s}if(e.error){const t="Server returned handshake error: "+e.error;this._logger.log(p.Error,t);const s=new Error(t);throw this._handshakeRejecter(s),s}return this._logger.log(p.Debug,"Server handshake complete."),this._handshakeResolver(),s}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=(new Date).getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout((()=>this.serverTimeout()),this.serverTimeoutInMilliseconds),void 0!==this._pingServerHandle))){let t=this._nextKeepAlive-(new Date).getTime();t<0&&(t=0),this._pingServerHandle=setTimeout((async()=>{if(this._connectionState===w.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}}),t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(t){const e=this._methods[t.target.toLowerCase()];if(e){try{e.forEach((e=>e.apply(this,t.arguments)))}catch(e){this._logger.log(p.Error,`A callback for the method ${t.target.toLowerCase()} threw error '${e}'.`)}if(t.invocationId){const t="Server requested a response, which is not supported in this version of the client.";this._logger.log(p.Error,t),this._stopPromise=this._stopInternal(new Error(t))}}else this._logger.log(p.Warning,`No client method with the name '${t.target}' found.`)}_connectionClosed(t){this._logger.log(p.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new Error("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===w.Disconnecting?this._completeClose(t):this._connectionState===w.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===w.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=w.Disconnected,this._connectionStarted=!1,y.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach((e=>e.apply(this,[t])))}catch(e){this._logger.log(p.Error,`An onclose callback called with error '${t}' threw error '${e}'.`)}}}async _reconnect(t){const e=Date.now();let s=0,n=void 0!==t?t:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(s++,0,n);if(null===i)return this._logger.log(p.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=w.Reconnecting,this._logger.log(p.Information,t?`Connection reconnecting because of error '${t}'.`:"Connection reconnecting."),0!==this._reconnectingCallbacks.length){try{this._reconnectingCallbacks.forEach((e=>e.apply(this,[t])))}catch(e){this._logger.log(p.Error,`An onreconnecting callback called with error '${t}' threw error '${e}'.`)}if(this._connectionState!==w.Reconnecting)return void this._logger.log(p.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;null!==i;){if(this._logger.log(p.Information,`Reconnect attempt number ${s} will start in ${i} ms.`),await new Promise((t=>{this._reconnectDelayHandle=setTimeout(t,i)})),this._reconnectDelayHandle=void 0,this._connectionState!==w.Reconnecting)return void this._logger.log(p.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=w.Connected,this._logger.log(p.Information,"HubConnection reconnected successfully."),0!==this._reconnectedCallbacks.length)try{this._reconnectedCallbacks.forEach((t=>t.apply(this,[this.connection.connectionId])))}catch(t){this._logger.log(p.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${t}'.`)}return}catch(t){if(this._logger.log(p.Information,`Reconnect attempt failed because of error '${t}'.`),this._connectionState!==w.Reconnecting)return this._logger.log(p.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===w.Disconnecting&&this._completeClose());n=t instanceof Error?t:new Error(t.toString()),i=this._getNextRetryDelay(s++,Date.now()-e,n)}}this._logger.log(p.Information,`Reconnect retries have been exhausted after ${Date.now()-e} ms and ${s} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,e,s){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:e,previousRetryCount:t,retryReason:s})}catch(s){return this._logger.log(p.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${e}) threw error '${s}'.`),null}}_cancelCallbacksWithError(t){const e=this._callbacks;this._callbacks={},Object.keys(e).forEach((s=>{const n=e[s];try{n(null,t)}catch(e){this._logger.log(p.Error,`Stream 'error' callback called with '${t}' threw error: ${T(e)}`)}}))}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,e,s,n){if(s)return 0!==n.length?{arguments:e,streamIds:n,target:t,type:f.Invocation}:{arguments:e,target:t,type:f.Invocation};{const s=this._invocationId;return this._invocationId++,0!==n.length?{arguments:e,invocationId:s.toString(),streamIds:n,target:t,type:f.Invocation}:{arguments:e,invocationId:s.toString(),target:t,type:f.Invocation}}}_launchStreams(t,e){if(0!==t.length){e||(e=Promise.resolve());for(const s in t)t[s].subscribe({complete:()=>{e=e.then((()=>this._sendWithProtocol(this._createCompletionMessage(s))))},error:t=>{let n;n=t instanceof Error?t.message:t&&t.toString?t.toString():"Unknown error",e=e.then((()=>this._sendWithProtocol(this._createCompletionMessage(s,n))))},next:t=>{e=e.then((()=>this._sendWithProtocol(this._createStreamItemMessage(s,t))))}})}}_replaceStreamingParams(t){const e=[],s=[];for(let n=0;n<t.length;n++){const i=t[n];if(this._isObservable(i)){const r=this._invocationId;this._invocationId++,e[r]=i,s.push(r.toString()),t.splice(n,1)}}return[e,s]}_isObservable(t){return t&&t.subscribe&&"function"==typeof t.subscribe}_createStreamInvocation(t,e,s){const n=this._invocationId;return this._invocationId++,0!==s.length?{arguments:e,invocationId:n.toString(),streamIds:s,target:t,type:f.StreamInvocation}:{arguments:e,invocationId:n.toString(),target:t,type:f.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:f.CancelInvocation}}_createStreamItemMessage(t,e){return{invocationId:t,item:e,type:f.StreamItem}}_createCompletionMessage(t,e,s){return e?{error:e,invocationId:t,type:f.Completion}:{invocationId:t,result:s,type:f.Completion}}}const L=[0,2e3,1e4,3e4,null];class A{constructor(t){this._retryDelays=void 0!==t?[...t,null]:L}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class M{}var W,F;M.Authorization="Authorization",M.Cookie="Cookie",function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"}(W||(W={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(F||(F={}));class O{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class j{constructor(t,e,s,n){this._httpClient=t,this._accessTokenFactory=e,this._logger=s,this._pollAbort=new O,this._options=n,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(t,e){if(m.isRequired(t,"url"),m.isRequired(e,"transferFormat"),m.isIn(e,F,"transferFormat"),this._url=t,this._logger.log(p.Trace,"(LongPolling transport) Connecting."),e===F.Binary&&"undefined"!=typeof XMLHttpRequest&&"string"!=typeof(new XMLHttpRequest).responseType)throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[s,i]=S(),r={[s]:i,...this._options.headers},o={abortSignal:this._pollAbort.signal,headers:r,timeout:1e5,withCredentials:this._options.withCredentials};e===F.Binary&&(o.responseType="arraybuffer");const h=await this._getAccessToken();this._updateHeaderToken(o,h);const c=`${t}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${c}.`);const a=await this._httpClient.get(c,o);200!==a.statusCode?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new n(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,o)}async _getAccessToken(){return this._accessTokenFactory?await this._accessTokenFactory():null}_updateHeaderToken(t,e){t.headers||(t.headers={}),e?t.headers[M.Authorization]=`Bearer ${e}`:t.headers[M.Authorization]&&delete t.headers[M.Authorization]}async _poll(t,e){try{for(;this._running;){const s=await this._getAccessToken();this._updateHeaderToken(e,s);try{const s=`${t}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${s}.`);const i=await this._httpClient.get(s,e);204===i.statusCode?(this._logger.log(p.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):200!==i.statusCode?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${i.statusCode}.`),this._closeError=new n(i.statusText||"",i.statusCode),this._running=!1):i.content?(this._logger.log(p.Trace,`(LongPolling transport) data received. ${b(i.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(i.content)):this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(t){this._running?t instanceof i?this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=t,this._running=!1):this._logger.log(p.Trace,`(LongPolling transport) Poll errored after shutdown: ${t.message}`)}}}finally{this._logger.log(p.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?$(this._logger,"LongPolling",this._httpClient,this._url,this._accessTokenFactory,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(p.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(p.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[e,s]=S();t[e]=s;const n={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials},i=await this._getAccessToken();this._updateHeaderToken(n,i),await this._httpClient.delete(this._url,n),this._logger.log(p.Trace,"(LongPolling transport) DELETE request sent.")}finally{this._logger.log(p.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(p.Trace,t),this.onclose(this._closeError)}}}class B{constructor(t,e,s,n){this._httpClient=t,this._accessTokenFactory=e,this._logger=s,this._options=n,this.onreceive=null,this.onclose=null}async connect(t,e){if(m.isRequired(t,"url"),m.isRequired(e,"transferFormat"),m.isIn(e,F,"transferFormat"),this._logger.log(p.Trace,"(SSE transport) Connecting."),this._url=t,this._accessTokenFactory){const e=await this._accessTokenFactory();e&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(e)}`)}return new Promise(((s,n)=>{let i,r=!1;if(e===F.Text){if(y.isBrowser||y.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const e=this._httpClient.getCookieString(t),s={};s.Cookie=e;const[n,r]=S();s[n]=r,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...s,...this._options.headers}})}try{i.onmessage=t=>{if(this.onreceive)try{this._logger.log(p.Trace,`(SSE transport) data received. ${b(t.data,this._options.logMessageContent)}.`),this.onreceive(t.data)}catch(t){return void this._close(t)}},i.onerror=()=>{r?this._close():n(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(p.Information,`SSE connected to ${this._url}`),this._eventSource=i,r=!0,s()}}catch(t){return void n(t)}}else n(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))}))}async send(t){return this._eventSource?$(this._logger,"SSE",this._httpClient,this._url,this._accessTokenFactory,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class X{constructor(t,e,s,n,i,r){this._logger=s,this._accessTokenFactory=e,this._logMessageContent=n,this._webSocketConstructor=i,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=r}async connect(t,e){if(m.isRequired(t,"url"),m.isRequired(e,"transferFormat"),m.isIn(e,F,"transferFormat"),this._logger.log(p.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory){const e=await this._accessTokenFactory();e&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(e)}`)}return new Promise(((s,n)=>{let i;t=t.replace(/^http/,"ws");const r=this._httpClient.getCookieString(t);let o=!1;if(y.isNode){const e={},[s,n]=S();e[s]=n,r&&(e[M.Cookie]=`${r}`),i=new this._webSocketConstructor(t,void 0,{headers:{...e,...this._headers}})}i||(i=new this._webSocketConstructor(t)),e===F.Binary&&(i.binaryType="arraybuffer"),i.onopen=()=>{this._logger.log(p.Information,`WebSocket connected to ${t}.`),this._webSocket=i,o=!0,s()},i.onerror=t=>{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"There was an error with the transport",this._logger.log(p.Information,`(WebSockets transport) ${e}.`)},i.onmessage=t=>{if(this._logger.log(p.Trace,`(WebSockets transport) data received. ${b(t.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(t.data)}catch(t){return void this._close(t)}},i.onclose=t=>{if(o)this._close(t);else{let e=null;e="undefined"!=typeof ErrorEvent&&t instanceof ErrorEvent?t.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",n(new Error(e))}}}))}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(p.Trace,`(WebSockets transport) sending data. ${b(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(p.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(t)||!1!==t.wasClean&&1e3===t.code?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}_isCloseEvent(t){return t&&"boolean"==typeof t.wasClean&&"number"==typeof t.code}}class J{constructor(t,e={}){var s;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,m.isRequired(t,"url"),this._logger=void 0===(s=e.logger)?new C(p.Information):null===s?g.instance:void 0!==s.log?s:new C(s),this.baseUrl=this._resolveUrl(t),(e=e||{}).logMessageContent=void 0!==e.logMessageContent&&e.logMessageContent,"boolean"!=typeof e.withCredentials&&void 0!==e.withCredentials)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");e.withCredentials=void 0===e.withCredentials||e.withCredentials,e.timeout=void 0===e.timeout?1e5:e.timeout;let n=null,i=null;if(y.isNode&&"undefined"!=typeof require){const t="function"==typeof __webpack_require__?__non_webpack_require__:require;n=t("ws"),i=t("eventsource")}y.isNode||"undefined"==typeof WebSocket||e.WebSocket?y.isNode&&!e.WebSocket&&n&&(e.WebSocket=n):e.WebSocket=WebSocket,y.isNode||"undefined"==typeof EventSource||e.EventSource?y.isNode&&!e.EventSource&&void 0!==i&&(e.EventSource=i):e.EventSource=EventSource,this._httpClient=e.httpClient||new R(this._logger),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=e,this.onreceive=null,this.onclose=null}async start(t){if(m.isIn(t=t||F.Binary,F,"transferFormat"),this._logger.log(p.Debug,`Starting connection with transfer format '${F[t]}'.`),"Disconnected"!==this._connectionState)return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(t),await this._startInternalPromise,"Disconnecting"===this._connectionState){const t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(p.Error,t),await this._stopPromise,Promise.reject(new Error(t))}if("Connected"!==this._connectionState){const t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(p.Error,t),Promise.reject(new Error(t))}this._connectionStarted=!0}send(t){return"Connected"!==this._connectionState?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new z(this.transport)),this._sendQueue.send(t))}async stop(t){return"Disconnected"===this._connectionState?(this._logger.log(p.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):"Disconnecting"===this._connectionState?(this._logger.log(p.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise((t=>{this._stopPromiseResolver=t})),await this._stopInternal(t),void await this._stopPromise)}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch(t){}if(this.transport){try{await this.transport.stop()}catch(t){this._logger.log(p.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(p.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let e=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==W.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(W.WebSockets),await this._startTransport(e,t)}else{let s=null,n=0;do{if(s=await this._getNegotiationResponse(e),"Disconnecting"===this._connectionState||"Disconnected"===this._connectionState)throw new Error("The connection was stopped during negotiation.");if(s.error)throw new Error(s.error);if(s.ProtocolVersion)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.");if(s.url&&(e=s.url),s.accessToken){const t=s.accessToken;this._accessTokenFactory=()=>t}n++}while(s.url&&n<100);if(100===n&&s.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(e,this._options.transport,s,t)}this.transport instanceof j&&(this.features.inherentKeepAlive=!0),"Connecting"===this._connectionState&&(this._logger.log(p.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(t){return this._logger.log(p.Error,"Failed to start the connection: "+t),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(t)}}async _getNegotiationResponse(t){const e={};if(this._accessTokenFactory){const t=await this._accessTokenFactory();t&&(e[M.Authorization]=`Bearer ${t}`)}const[s,i]=S();e[s]=i;const r=this._resolveNegotiateUrl(t);this._logger.log(p.Debug,`Sending negotiation request: ${r}.`);try{const t=await this._httpClient.post(r,{content:"",headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(200!==t.statusCode)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${t.statusCode}'`));const s=JSON.parse(t.content);return(!s.negotiateVersion||s.negotiateVersion<1)&&(s.connectionToken=s.connectionId),s}catch(t){let e="Failed to complete negotiation with the server: "+t;return t instanceof n&&404===t.statusCode&&(e+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(p.Error,e),Promise.reject(new a(e))}}_createConnectUrl(t,e){return e?t+(-1===t.indexOf("?")?"?":"&")+`id=${e}`:t}async _createTransport(t,e,s,n){let i=this._createConnectUrl(t,s.connectionToken);if(this._isITransport(e))return this._logger.log(p.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=e,await this._startTransport(i,n),void(this.connectionId=s.connectionId);const r=[],o=s.availableTransports||[];let h=s;for(const s of o){const o=this._resolveTransportOrError(s,e,n);if(o instanceof Error)r.push(`${s.transport} failed:`),r.push(o);else if(this._isITransport(o)){if(this.transport=o,!h){try{h=await this._getNegotiationResponse(t)}catch(t){return Promise.reject(t)}i=this._createConnectUrl(t,h.connectionToken)}try{return await this._startTransport(i,n),void(this.connectionId=h.connectionId)}catch(t){if(this._logger.log(p.Error,`Failed to start the transport '${s.transport}': ${t}`),h=void 0,r.push(new c(`${s.transport} failed: ${t}`,W[s.transport])),"Connecting"!==this._connectionState){const t="Failed to select transport before stop() was called.";return this._logger.log(p.Debug,t),Promise.reject(new Error(t))}}}}return Promise.reject(r.length>0?new l(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`,r):new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(t){switch(t){case W.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new X(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case W.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new B(this._httpClient,this._accessTokenFactory,this._logger,this._options);case W.LongPolling:return new j(this._httpClient,this._accessTokenFactory,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,e){return this.transport.onreceive=this.onreceive,this.transport.onclose=t=>this._stopConnection(t),this.transport.connect(t,e)}_resolveTransportOrError(t,e,s){const n=W[t.transport];if(null==n)return this._logger.log(p.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(t,e){return!t||0!=(e&t)}(e,n))return this._logger.log(p.Debug,`Skipping transport '${W[n]}' because it was disabled by the client.`),new h(`'${W[n]}' is disabled by the client.`,n);if(!(t.transferFormats.map((t=>F[t])).indexOf(s)>=0))return this._logger.log(p.Debug,`Skipping transport '${W[n]}' because it does not support the requested transfer format '${F[s]}'.`),new Error(`'${W[n]}' does not support ${F[s]}.`);if(n===W.WebSockets&&!this._options.WebSocket||n===W.ServerSentEvents&&!this._options.EventSource)return this._logger.log(p.Debug,`Skipping transport '${W[n]}' because it is not supported in your environment.'`),new o(`'${W[n]}' is not supported in your environment.`,n);this._logger.log(p.Debug,`Selecting transport '${W[n]}'.`);try{return this._constructTransport(n)}catch(t){return t}}_isITransport(t){return t&&"object"==typeof t&&"connect"in t}_stopConnection(t){if(this._logger.log(p.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,"Disconnected"!==this._connectionState){if("Connecting"===this._connectionState)throw this._logger.log(p.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if("Disconnecting"===this._connectionState&&this._stopPromiseResolver(),t?this._logger.log(p.Error,`Connection disconnected with error '${t}'.`):this._logger.log(p.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch((t=>{this._logger.log(p.Error,`TransportSendQueue.stop() threw error '${t}'.`)})),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(t)}catch(e){this._logger.log(p.Error,`HttpConnection.onclose(${t}) threw error '${e}'.`)}}}else this._logger.log(p.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(t){if(0===t.lastIndexOf("https://",0)||0===t.lastIndexOf("http://",0))return t;if(!y.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const e=window.document.createElement("a");return e.href=t,this._logger.log(p.Information,`Normalizing '${t}' to '${e.href}'.`),e.href}_resolveNegotiateUrl(t){const e=t.indexOf("?");let s=t.substring(0,-1===e?t.length:e);return"/"!==s[s.length-1]&&(s+="/"),s+="negotiate",s+=-1===e?"":t.substring(e),-1===s.indexOf("negotiateVersion")&&(s+=-1===e?"?":"&",s+="negotiateVersion="+this._negotiateVersion),s}}class z{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new V,this._transportResult=new V,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new V),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new V;const t=this._transportResult;this._transportResult=void 0;const e="string"==typeof this._buffer[0]?this._buffer.join(""):z._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(e),t.resolve()}catch(e){t.reject(e)}}}static _concatBuffers(t){const e=t.map((t=>t.byteLength)).reduce(((t,e)=>t+e)),s=new Uint8Array(e);let n=0;for(const e of t)s.set(new Uint8Array(e),n),n+=e.byteLength;return s.buffer}}class V{constructor(){this.promise=new Promise(((t,e)=>[this._resolver,this._rejecter]=[t,e]))}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class G{constructor(){this.name="json",this.version=1,this.transferFormat=F.Text}parseMessages(t,e){if("string"!=typeof t)throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];null===e&&(e=g.instance);const s=x.parse(t),n=[];for(const t of s){const s=JSON.parse(t);if("number"!=typeof s.type)throw new Error("Invalid payload.");switch(s.type){case f.Invocation:this._isInvocationMessage(s);break;case f.StreamItem:this._isStreamItemMessage(s);break;case f.Completion:this._isCompletionMessage(s);break;case f.Ping:case f.Close:break;default:e.log(p.Information,"Unknown message type '"+s.type+"' ignored.");continue}n.push(s)}return n}writeMessage(t){return x.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),void 0!==t.invocationId&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),void 0===t.item)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_assertNotEmptyString(t,e){if("string"!=typeof t||""===t)throw new Error(e)}}const K={trace:p.Trace,debug:p.Debug,info:p.Information,information:p.Information,warn:p.Warning,warning:p.Warning,error:p.Error,critical:p.Critical,none:p.None};class Q{configureLogging(t){if(m.isRequired(t,"logging"),void 0!==t.log)this.logger=t;else if("string"==typeof t){const e=function(t){const e=K[t.toLowerCase()];if(void 0!==e)return e;throw new Error(`Unknown log level: ${t}`)}(t);this.logger=new C(e)}else this.logger=new C(t);return this}withUrl(t,e){return m.isRequired(t,"url"),m.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions="object"==typeof e?{...this.httpConnectionOptions,...e}:{...this.httpConnectionOptions,transport:e},this}withHubProtocol(t){return m.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return this.reconnectPolicy=t?Array.isArray(t)?new A(t):t:new A,this}build(){const t=this.httpConnectionOptions||{};if(void 0===t.logger&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const e=new J(this.url,t);return U.create(e,this.logger||g.instance,this.protocol||new G,this.reconnectPolicy)}}const{state:Y,onChange:Z,reset:tt}=e({connecting:!1,connected:!1}),et={state:Y,onChange:Z,reset:tt};class st{constructor(){console.log("Starting signalR");var e=t.getInstance().get("sparkle");this.connection=(new Q).withUrl(`${e.apiUrl}hubs/sparkle?url=${window.location.href}&courseClassId=1`,{accessTokenFactory:()=>this.getToken(),skipNegotiation:!0,transport:W.WebSockets}).configureLogging(p.Debug).withAutomaticReconnect({nextRetryDelayInMilliseconds:t=>t.elapsedMilliseconds<6e4?1e4*Math.random():null}).build(),this.connection.on("SendMessage",((t,e)=>{let s=JSON.parse(e);console.log("Server said ",t,s)})),this.connection.onclose((()=>{})),this.connection.onreconnecting((()=>{console.assert(this.connection.state===w.Reconnecting)})),this.connection.onreconnected((()=>{console.assert(this.connection.state===w.Connected)}))}static getInstance(){return st.instance||(st.instance=new st),st.instance}async start(){console.log("start");try{et.state.connecting=!0,et.state.connected=!et.state.connecting,await this.connection.start(),console.log(this.connection),et.state.connecting=!1,et.state.connected=this.connection.state===w.Connected,console.assert(this.connection.state===w.Connected),console.log("SignalR Connected.")}catch(t){console.assert(this.connection.state===w.Disconnected),console.log(t)}}async callSignalR(t,e){await this.getToken()?this.connection.invoke(t,JSON.stringify(e)):console.log("Cannot connect to signalR. Not logged in")}getToken(){return s.getInstance().getTokenSync()||null}}export{st as S,et as s}
@@ -0,0 +1 @@
1
+ import{r as i,h as t,H as e,e as o}from"./p-ee1e0eb4.js";import{S as s}from"./p-c9f753a4.js";import{t as l}from"./p-ff7a8a71.js";import"./p-b06e2bef.js";import"./p-2f569553.js";import"./p-bd90903e.js";import"./p-7dae0f0e.js";import"./p-5d409601.js";import"./p-871106e0.js";import"./p-add30d46.js";import"./p-d68092b7.js";const n=class{constructor(t){i(this,t),this.formControls={type:{isValid:!0,value:1,validate:i=>!!i},note:{isValid:!1,value:"",validate:i=>!!i}},this.submitted=!0}async onSubmit(i){i.preventDefault(),this.submitted=!0;let t=!0;for(let i in this.formControls){let e=this.formControls[i];e.validate(e.value),e.isValid||(t=!1)}if(t){let i=await s.getInstance().submitFeedback({Note:this.formControls.note.value,Type:this.formControls.type.value});console.log(i),i.Succeeded?((await l.create({message:"Feedback submitted successfully",duration:3e3})).present(),this.dismiss()):(await l.create({message:i.Message,duration:3e3})).present()}}dismiss(i){this.el.closest("ion-modal").dismiss({dismissed:!0})}changeFormValue(i,t){this.formControls=Object.assign(Object.assign({},this.formControls),{[i]:Object.assign(Object.assign({},this.formControls[i]),{value:t,isValid:this.formControls[i].validate(t)})})}render(){return t(e,null,t("ion-header",{translucent:!0},t("ion-toolbar",null,t("ion-title",null,"Feedback"),t("ion-buttons",{slot:"end"},t("ion-button",{onClick:()=>this.dismiss()},"Close")))),t("ion-content",{class:"ion-padding"},t("form",{onSubmit:i=>this.onSubmit(i),novalidate:!0},t("ion-list",null,t("ion-radio-group",{value:this.formControls.type.value,onChange:i=>this.changeFormValue("type",+i.target.value)},t("ion-list-header",null,t("ion-label",null,"Feedback Type")),t("ion-item",null,t("ion-label",null,"Comments"),t("ion-radio",{value:1})),t("ion-item",null,t("ion-label",null,"Suggestions"),t("ion-radio",{value:2})),t("ion-item",null,t("ion-label",null,"Questions"),t("ion-radio",{value:3}))),t("ion-item",null,t("ion-label",{position:"floating"},"Notes"),t("ion-textarea",{value:this.formControls.note.value,onChange:i=>this.changeFormValue("note",i.target.value)})),t("br",null),t("ion-button",{color:"primary",type:"submit"},"Submit")))))}get el(){return o(this)}};n.style=":host{display:block}";export{n as sparkle_feedback}
@@ -0,0 +1 @@
1
+ import{H as t}from"./p-b06e2bef.js";class e{constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}async createAssignment(e){return await t.http.post("api/v1/Assignment/Create",e)}}export{e as A}
@@ -1,4 +1,4 @@
1
- import{r as i,i as r,h as o,H as t,e}from"./p-ee1e0eb4.js";import{g as n}from"./p-871106e0.js";import{B as a,i as s,p as c,b as d,d as p,e as l,s as h}from"./p-2ff67662.js";import{g}from"./p-0e4de1d0.js";import{c as b}from"./p-48f72e63.js";import"./p-add30d46.js";import"./p-d68092b7.js";
1
+ import{r as i,i as r,h as o,H as t,e}from"./p-ee1e0eb4.js";import{g as n}from"./p-871106e0.js";import{B as a,i as s,p as c,b as d,d as p,e as l,s as h}from"./p-ff7a8a71.js";import{g}from"./p-0e4de1d0.js";import{c as b}from"./p-48f72e63.js";import"./p-add30d46.js";import"./p-d68092b7.js";
2
2
  /*!
3
3
  * (C) Ionic http://ionicframework.com - MIT License
4
4
  */const k=i=>{const r=b(),o=b(),t=b();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),t.addElement(i.querySelector(".picker-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),r.addElement(i).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([o,t])},m=i=>{const r=b(),o=b(),t=b();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",.01),t.addElement(i.querySelector(".picker-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),r.addElement(i).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([o,t])},u=class{constructor(o){i(this,o),this.didPresent=r(this,"ionPickerDidPresent",7),this.willPresent=r(this,"ionPickerWillPresent",7),this.willDismiss=r(this,"ionPickerWillDismiss",7),this.didDismiss=r(this,"ionPickerDidDismiss",7),this.presented=!1,this.keyboardClose=!0,this.buttons=[],this.columns=[],this.duration=0,this.showBackdrop=!0,this.backdropDismiss=!0,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,a)},this.dispatchCancelHandler=i=>{if(s(i.detail.role)){const i=this.buttons.find((i=>"cancel"===i.role));this.callButtonHandler(i)}}}connectedCallback(){c(this.el)}async present(){await d(this,"pickerEnter",k,k,void 0),this.duration>0&&(this.durationTimeout=setTimeout((()=>this.dismiss()),this.duration))}dismiss(i,r){return this.durationTimeout&&clearTimeout(this.durationTimeout),p(this,i,r,"pickerLeave",m,m)}onDidDismiss(){return l(this.el,"ionPickerDidDismiss")}onWillDismiss(){return l(this.el,"ionPickerWillDismiss")}getColumn(i){return Promise.resolve(this.columns.find((r=>r.name===i)))}async buttonClick(i){const r=i.role;return s(r)?this.dismiss(void 0,r):await this.callButtonHandler(i)?this.dismiss(this.getSelected(),i.role):Promise.resolve()}async callButtonHandler(i){return!i||!1!==await h(i.handler,this.getSelected())}getSelected(){const i={};return this.columns.forEach(((r,o)=>{const t=void 0!==r.selectedIndex?r.options[r.selectedIndex]:void 0;i[r.name]={text:t?t.text:void 0,value:t?t.value:void 0,columnIndex:o}})),i}render(){const{htmlAttributes:i}=this,r=n(this);return o(t,Object.assign({"aria-modal":"true",tabindex:"-1"},i,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign({[r]:!0,[`picker-${r}`]:!0,"overlay-hidden":!0},g(this.cssClass)),onIonBackdropTap:this.onBackdropTap,onIonPickerWillDismiss:this.dispatchCancelHandler}),o("ion-backdrop",{visible:this.showBackdrop,tappable:this.backdropDismiss}),o("div",{tabindex:"0"}),o("div",{class:"picker-wrapper ion-overlay-wrapper",role:"dialog"},o("div",{class:"picker-toolbar"},this.buttons.map((i=>o("div",{class:v(i)},o("button",{type:"button",onClick:()=>this.buttonClick(i),class:f(i)},i.text))))),o("div",{class:"picker-columns"},o("div",{class:"picker-above-highlight"}),this.presented&&this.columns.map((i=>o("ion-picker-column",{col:i}))),o("div",{class:"picker-below-highlight"}))),o("div",{tabindex:"0"}))}get el(){return e(this)}},v=i=>({[`picker-toolbar-${i.role}`]:void 0!==i.role,"picker-toolbar-button":!0}),f=i=>Object.assign({"picker-button":!0,"ion-activatable":!0},g(i.cssClass));
@@ -1,4 +1,4 @@
1
- import{r as i,i as n,h as o,H as t,e as a}from"./p-ee1e0eb4.js";import{g as s,c as e}from"./p-871106e0.js";import{B as r,p as d,b as p,d as l,e as c}from"./p-2ff67662.js";import{s as g}from"./p-7d8427eb.js";import{g as h}from"./p-0e4de1d0.js";import{c as m}from"./p-48f72e63.js";import"./p-add30d46.js";import"./p-d68092b7.js";
1
+ import{r as i,i as n,h as o,H as t,e as a}from"./p-ee1e0eb4.js";import{g as s,c as e}from"./p-871106e0.js";import{B as r,p as d,b as p,d as l,e as c}from"./p-ff7a8a71.js";import{s as g}from"./p-7d8427eb.js";import{g as h}from"./p-0e4de1d0.js";import{c as m}from"./p-48f72e63.js";import"./p-add30d46.js";import"./p-d68092b7.js";
2
2
  /*!
3
3
  * (C) Ionic http://ionicframework.com - MIT License
4
4
  */const f=i=>{const n=m(),o=m(),t=m();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),t.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.01,transform:"scale(1.1)"},{offset:1,opacity:1,transform:"scale(1)"}]),n.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,t])},b=i=>{const n=m(),o=m(),t=m();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),t.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]),n.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,t])},u=i=>{const n=m(),o=m(),t=m();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),t.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.01,transform:"scale(1.1)"},{offset:1,opacity:1,transform:"scale(1)"}]),n.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,t])},x=i=>{const n=m(),o=m(),t=m();return o.addElement(i.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),t.addElement(i.querySelector(".loading-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]),n.addElement(i).easing("ease-in-out").duration(200).addAnimation([o,t])},v=class{constructor(o){i(this,o),this.didPresent=n(this,"ionLoadingDidPresent",7),this.willPresent=n(this,"ionLoadingWillPresent",7),this.willDismiss=n(this,"ionLoadingWillDismiss",7),this.didDismiss=n(this,"ionLoadingDidDismiss",7),this.presented=!1,this.keyboardClose=!0,this.duration=0,this.backdropDismiss=!1,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,r)}}connectedCallback(){d(this.el)}componentWillLoad(){if(void 0===this.spinner){const i=s(this);this.spinner=e.get("loadingSpinner",e.get("spinner","ios"===i?"lines":"crescent"))}}async present(){await p(this,"loadingEnter",f,u,void 0),this.duration>0&&(this.durationTimeout=setTimeout((()=>this.dismiss()),this.duration+10))}dismiss(i,n){return this.durationTimeout&&clearTimeout(this.durationTimeout),l(this,i,n,"loadingLeave",b,x)}onDidDismiss(){return c(this.el,"ionLoadingDidDismiss")}onWillDismiss(){return c(this.el,"ionLoadingWillDismiss")}render(){const{message:i,spinner:n,htmlAttributes:a}=this,e=s(this);return o(t,Object.assign({tabindex:"-1"},a,{style:{zIndex:`${4e4+this.overlayIndex}`},onIonBackdropTap:this.onBackdropTap,class:Object.assign(Object.assign({},h(this.cssClass)),{[e]:!0,"overlay-hidden":!0,"loading-translucent":this.translucent})}),o("ion-backdrop",{visible:this.showBackdrop,tappable:this.backdropDismiss}),o("div",{tabindex:"0"}),o("div",{class:"loading-wrapper ion-overlay-wrapper",role:"dialog"},n&&o("div",{class:"loading-spinner"},o("ion-spinner",{name:n,"aria-hidden":"true"})),i&&o("div",{class:"loading-content",innerHTML:g(i)})),o("div",{tabindex:"0"}))}get el(){return a(this)}};
@@ -1 +1 @@
1
- import{r as i,i as e,h as s,e as t}from"./p-ee1e0eb4.js";import{A as r}from"./p-9a443f51.js";import{E as n}from"./p-b226f54d.js";const a=class{constructor(s){i(this,s),this.quizAnswerChanged=e(this,"quizAnswerChanged",7)}async loadQuestion(){this.quizData&&(this.question=this.quizData[+this.questionId])}async componentWillLoad(){}async componentDidLoad(){const i=n.getInstance().get("sparkle");this.quizData=await r.getInstance().loadJsonFile(i.quizPath),await this.loadQuestion(),this.quizAnswerChanged.emit({question:null,answer:"1"})}quizInputChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}quizFeedbackChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}quizSelectChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}quizOpinionChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}getQuestionFeedback(){if("MULTIPLE-CHOICE"==this.question.questionType){const i=this.question.options.filter((i=>1==i.correct)).map((i=>i.feedback));return i.length>0&&i.map((i=>s("small",null,i)))}if("FEEDBACK"==this.question.questionType||"TEXT"==this.question.questionType)return this.question.feedback&&s("small",null," ",this.question.feedback)}showAnswerStatus(){return s("div",null,s("strong",null,this.correct?"Good job!":"Incorrect answer, please try again."))}renderQuestion(){return"MULTIPLE-CHOICE"==this.question.questionType?s("sparkle-quiz-select",{question:this.question,allowMultiple:!0}):"FEEDBACK"==this.question.questionType?s("sparkle-quiz-feedback",{question:this.question}):"TEXT"==this.question.questionType?s("sparkle-quiz-input",{question:this.question}):"OPINION"==this.question.questionType?s("sparkle-quiz-opinion",{question:this.question}):"POLL"==this.question.questionType?s("sparkle-quiz-poll",{question:this.question}):void 0}render(){return this.question?s("div",{class:{correct:this.submitted&&this.correct,incorrect:this.submitted&&!this.correct}},this.renderQuestion(),this.submitted&&this.showInstantResult&&s("div",{class:"feedback-container"},[this.showAnswerStatus(),this.getQuestionFeedback()])):s("p",null,"No question found.")}get el(){return t(this)}static get watchers(){return{questionId:["loadQuestion"]}}};a.style="sparkle-quiz-v1{display:block;font-family:var(--font-family);--sparkle-quiz-question-container-padding:10px 0px;--sparkle-quiz-question-container-margin:0px;--sparkle-quiz-question-text-padding:10px 0px;--sparkle-quiz-option-border:2px solid var(--line-rule-color);--sparkle-quiz-selected-option-border:2px solid var(--text-color--dark);--sparkle-quiz-option-border-radius:4px;--sparkle-quiz-option-padding:5px 10px;--sparkle-quiz-option-width:100%;--sparkle-quiz-error-bg-color:#fbaeae;--sparkle-quiz-success-bg-color:#fbaeae;padding:var(--sparkle-quiz-question-container-padding);margin:var(--sparkle-quiz-question-container-margin)}.question-text{padding:var(--sparkle-quiz-question-text-padding)}.option{padding:5px 0px}.number{padding:0px 14px;border:1px solid #ebebeb;border-radius:4px;margin-right:10px;font-size:14px;width:14px;display:inline-flex;justify-content:center}.feedback-container{padding:10px;border-radius:4px}.incorrect .feedback-container{background-color:var(--sparkle-quiz-error-bg-color, #fbaeae)}.correct .feedback-container{background-color:var(--sparkle-quiz-success-bg-color, #fbaeae)}";export{a as sparkle_quiz_v1}
1
+ import{r as i,i as e,h as s,e as t}from"./p-ee1e0eb4.js";import{A as r}from"./p-408176ba.js";import{E as n}from"./p-bd90903e.js";const a=class{constructor(s){i(this,s),this.quizAnswerChanged=e(this,"quizAnswerChanged",7)}async loadQuestion(){this.quizData&&(this.question=this.quizData[+this.questionId])}async componentWillLoad(){}async componentDidLoad(){const i=n.getInstance().get("sparkle");this.quizData=await r.getInstance().loadJsonFile(i.quizPath),await this.loadQuestion(),this.quizAnswerChanged.emit({question:null,answer:"1"})}quizInputChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}quizFeedbackChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}quizSelectChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}quizOpinionChangeHandler(i){this.quizAnswerChanged.emit({question:i.detail.question,answer:i.detail.value})}getQuestionFeedback(){if("MULTIPLE-CHOICE"==this.question.questionType){const i=this.question.options.filter((i=>1==i.correct)).map((i=>i.feedback));return i.length>0&&i.map((i=>s("small",null,i)))}if("FEEDBACK"==this.question.questionType||"TEXT"==this.question.questionType)return this.question.feedback&&s("small",null," ",this.question.feedback)}showAnswerStatus(){return s("div",null,s("strong",null,this.correct?"Good job!":"Incorrect answer, please try again."))}renderQuestion(){return"MULTIPLE-CHOICE"==this.question.questionType?s("sparkle-quiz-select",{question:this.question,allowMultiple:!0}):"FEEDBACK"==this.question.questionType?s("sparkle-quiz-feedback",{question:this.question}):"TEXT"==this.question.questionType?s("sparkle-quiz-input",{question:this.question}):"OPINION"==this.question.questionType?s("sparkle-quiz-opinion",{question:this.question}):"POLL"==this.question.questionType?s("sparkle-quiz-poll",{question:this.question}):void 0}render(){return this.question?s("div",{class:{correct:this.submitted&&this.correct,incorrect:this.submitted&&!this.correct}},this.renderQuestion(),this.submitted&&this.showInstantResult&&s("div",{class:"feedback-container"},[this.showAnswerStatus(),this.getQuestionFeedback()])):s("p",null,"No question found.")}get el(){return t(this)}static get watchers(){return{questionId:["loadQuestion"]}}};a.style="sparkle-quiz-v1{display:block;font-family:var(--font-family);--sparkle-quiz-question-container-padding:10px 0px;--sparkle-quiz-question-container-margin:0px;--sparkle-quiz-question-text-padding:10px 0px;--sparkle-quiz-option-border:2px solid var(--line-rule-color);--sparkle-quiz-selected-option-border:2px solid var(--text-color--dark);--sparkle-quiz-option-border-radius:4px;--sparkle-quiz-option-padding:5px 10px;--sparkle-quiz-option-width:100%;--sparkle-quiz-error-bg-color:#fbaeae;--sparkle-quiz-success-bg-color:#fbaeae;padding:var(--sparkle-quiz-question-container-padding);margin:var(--sparkle-quiz-question-container-margin)}.question-text{padding:var(--sparkle-quiz-question-text-padding)}.option{padding:5px 0px}.number{padding:0px 14px;border:1px solid #ebebeb;border-radius:4px;margin-right:10px;font-size:14px;width:14px;display:inline-flex;justify-content:center}.feedback-container{padding:10px;border-radius:4px}.incorrect .feedback-container{background-color:var(--sparkle-quiz-error-bg-color, #fbaeae)}.correct .feedback-container{background-color:var(--sparkle-quiz-success-bg-color, #fbaeae)}";export{a as sparkle_quiz}
@@ -0,0 +1 @@
1
+ import{A as e}from"./p-2f569553.js";import{g as t,s as a,r as n}from"./p-5d409601.js";const r={AUTH_USER_LOCALSTORAGE:"CurrentUser",userManagement:{defaultAdminUserName:"admin"},localization:{defaultLocalizationSourceName:"Test"},authorization:{encrptedAuthTokenName:"enc_auth_token"}};class s{static getInstance(){return s.instance||(s.instance=new s),s.instance}async getToken(){let e=await t(r.AUTH_USER_LOCALSTORAGE);return e&&e.JWToken&&new Date(e.ExpiresOn).getTime()>(new Date).getTime()?e.JWToken:null}async getAuthUser(){let e=await t(r.AUTH_USER_LOCALSTORAGE);return e&&e.JWToken&&new Date(e.ExpiresOn).getTime()>(new Date).getTime()?e:null}getAuthUserSync(){let e=JSON.parse(localStorage.getItem(r.AUTH_USER_LOCALSTORAGE));return e&&e.JWToken&&new Date(e.ExpiresOn).getTime()>(new Date).getTime()?e:null}getTokenSync(){let e=JSON.parse(localStorage.getItem(r.AUTH_USER_LOCALSTORAGE));return e&&e.JWToken&&new Date(e.ExpiresOn).getTime()>(new Date).getTime()?e.JWToken:null}isAuthenticated(){try{if(this.getTokenSync())return!0}catch(e){return!1}}async getTokenExpiry(){let e=await t(r.AUTH_USER_LOCALSTORAGE);if(!e)return 0;let a=0;return e.ExpiresOn&&(a=new Date(e.ExpiresOn).getTime()-(new Date).getTime()),Math.max(0,a)}async saveAuthUser(t){e.state.authUser=Object.assign({},t),e.state.isAuthenticated=!0,await a(r.AUTH_USER_LOCALSTORAGE,t)}async removeAuthUser(){e.state.authUser=null,e.state.isAuthenticated=!1,await n(r.AUTH_USER_LOCALSTORAGE)}}export{r as A,s as T}
@@ -1 +1 @@
1
- import{r as t,h as i,c as s,e}from"./p-ee1e0eb4.js";import{g as o}from"./p-5d409601.js";import{S as a}from"./p-935e7cfc.js";class n{constructor(){this.pItems={}}fromSrt(t,i){var s=!!i;(t=(t=t.replace(/\r/g,"")).split(/(\d+)\n(\d{2}:\d{2}:\d{2},\d{3}) --> (\d{2}:\d{2}:\d{2},\d{3})/g)).shift();for(var e={},o=0;o<t.length;o+=4)e[s?this.timeS(t[o+1].trim()):t[o+1].trim()]=t[o+3].trim();return e}toSrt(t){if(!(t instanceof Array))return"";for(var i="",s=0;s<t.length;s++){var e=t[s];isNaN(e.startTime)||isNaN(e.endTime)||(e.startTime=this.msTime(parseInt(e.startTime,10)),e.endTime=this.msTime(parseInt(e.endTime,10))),i+=e.id+"\r\n",i+=e.startTime+" --\x3e "+e.endTime+"\r\n",i+=e.text.replace("\n","\r\n")+"\r\n\r\n"}return i}timeS(t){var i=/(\d+):(\d{2}):(\d{2}),(\d{3})/.exec(t);if(null===i)return 0;for(var s=1;s<5;s++)i[s]=parseInt(i[s],10).toString(),isNaN(parseInt(i[s],10))&&(i[s]="0");return 3600*parseInt(i[1],10)+60*parseInt(i[2],10)+parseInt(i[3],10)+Math.floor(parseInt(i[4],10)/1e3)}msTime(t){var i=[36e5,6e4,1e3],s=[];for(var e in i){var o=(t/i[e]>>0).toString();o.length<2&&(o="0"+o),t%=i[e],s.push(o)}var a=t.toString();if(a.length<3)for(let t=0;t<=3-a.length;t++)a="0"+a;return s.join(":")+","+a}}const r=class{constructor(i){t(this,i),this.showCaption=!1,this.paused=!0,this.dataLoaded=!1,this.currentProgressWidth=0,this.captionText="",this.showFirstFrame=!1,this.firstFramePath="",this.isBusy=!1,this.animationVideoProgress="0",this.captionData={}}closedCaptionChange(t){this.showCaption=!this.showCaption}onClassRoomModeChanged(t){this.classMode=t.detail}componentWillLoad(){this.classMode=o(a.LOCALSTORAGE_CLASSROOM_MODE);const t=document.createElement("script");this.firstFramePath=this.src.replace(".js",".png"),t.src=this.src,document.body.appendChild(t),this.readTextFile(this.src.replace(".js",".srt")),this.rergisterSoundControls()}readTextFile(t){let i=this;var s=new XMLHttpRequest;s.open("GET",t,!1),s.onreadystatechange=function(){if(4===s.readyState&&(200===s.status||0==s.status)){var t=s.responseText,e=new n;i.captionData=e.fromSrt(t,!0)}},s.send(null)}isScriptLoaded(t){for(var i=document.getElementsByTagName("script"),s=i.length;s--;)if(i[s].getAttribute("src")==t)return!0;return!1}rergisterSoundControls(){window.playSound=t=>(this.sound&&this.sound.stop(),this.sound=createjs.Sound.play(t,{interrupt:createjs.Sound.INTERRUPT_EARLY,loop:0,volume:1}),this.sound),window.resetToStart=()=>{console.log("reset"),this.rewindAnimationToStart()}}startLoading(){this.isBusy=!0,this.paused=!1}doneLoading(){this.isBusy=!1,this.dataLoaded=!0,this.paused=!1}handleFileLoad(t){var i=this.comp.getImages();t&&"image"==t.item.type&&(i[t.item.id]=t.result)}handleQueueProgress(t){return t=>{this.animationVideoProgress=t.loaded?(100*t.loaded).toFixed(0):"0",1==t.loaded&&this.doneLoading()}}handleComplete(t){for(var i=this.comp.getSpriteSheet(),s=t.target,e=this.library.ssMetadata,o=0;o<e.length;o++)i[e[o].name]=new createjs.SpriteSheet({images:[s.getResult(e[o].name)],frames:e[o].frames});var a=this.src.substring(this.src.lastIndexOf("/")+1,this.src.lastIndexOf("."));this.exportRoot=new this.library[a],this.stage=new this.library.Stage(this.canvas),this.makeResponsive(!0,"both",!1,1),AdobeAn.compositionLoaded(this.library.properties.id),this.stage.addChild(this.exportRoot),createjs.Ticker.framerate=this.library.properties.fps,createjs.Ticker.paused=!1,createjs.Ticker.addEventListener("tick",this.stage),createjs.Ticker.addEventListener("tick",(t=>{this.tickHandler(t)}))}loadAnimation(){this.startLoading(),createjs.Sound.initializeDefaultPlugins()&&(this.canvas=this.el.querySelector(".video-canvas"),this.anim_container=this.el.querySelector(".canvas-container"),this.comp=AdobeAn.getComposition(this.composition),this.canvas.style.width="100%",this.canvas.style.height=this.canvas.offsetWidth+"px",this.anim_container.style.height=this.canvas.offsetWidth+"px",this.library=this.comp.getLibrary(),this.loader=new createjs.LoadQueue(!1),this.loader.setMaxConnections(3),this.loader.maintainScriptOrder=!0,this.loader.installPlugin(createjs.Sound),this.loader.addEventListener("complete",(t=>{this.handleComplete(t)})),this.loader.addEventListener("fileload",(t=>{this.handleFileLoad(t)})),this.loader.addEventListener("progress",this.handleQueueProgress(this)),this.loader.loadManifest(this.library.properties.manifest,!0,this.src.substring(0,this.src.lastIndexOf("/")+1)))}playButtonAction(){this.dataLoaded?this.playPauseAnimation():this.loadAnimation()}playPauseAnimation(){createjs.Ticker.paused?this.playAnimation():this.pauseAnimation()}async playAnimation(){if(this.showFirstFrame=!1,null!=this.loader&&this.loader.close(),createjs&&createjs.Ticker){let t=!1,i=this.sound;i&&(i.paused=t),createjs.Ticker.paused=t,createjs.Ticker.addEventListener("tick",this.stage),this.paused=t}}async pauseAnimation(){if(null!=this.loader&&this.loader.close(),createjs&&createjs.Ticker){let t=!0,i=this.sound;i&&(i.paused=t),createjs.Ticker.paused=t,createjs.Ticker.removeEventListener("tick",this.stage),this.paused=t}}disconnectedCallback(){this.pauseAnimation(),createjs.Sound.removeAllSounds()}async classRoomModeChanged(t){this.classMode=t}async destroyAnimation(){this.pauseAnimation()}makeResponsive(t,i,s,e){window.addEventListener("resize",(()=>this.resizeCanvas(t,i,s,e))),this.resizeCanvas(t,i,s,e)}resizeCanvas(t,i,s,e){var o,a,n=1,r=this.library.properties.width,h=this.library.properties.height,l=window.innerWidth,c=window.innerHeight,d=window.devicePixelRatio||1,p=l/r,u=c/h,m=1;t&&("width"==i&&o==l||"height"==i&&a==c?m=n:s?1==e?m=Math.min(p,u):2==e&&(m=Math.max(p,u)):(l<r||c<h)&&(m=Math.min(p,u)));var g=this.el.querySelector(".canvas-container");this.canvas.width=r*d*m,this.canvas.height=h*d*m,this.canvas.style.width="100%",this.canvas.style.height=this.canvas.offsetWidth+"px",g.style.height=this.canvas.offsetWidth+"px",this.stage.scaleX=d*m,this.stage.scaleY=d*m,o=l,a=c,n=m,this.sizeOfCanvas=this.canvas.offsetWidth;var v=this.el.querySelector(".progressBar");this.sizeofProgressBar=v.offsetWidth,this.stage.tickOnUpdate=!1,this.stage.update(),this.stage.tickOnUpdate=!0}tickHandler(t){t.paused||(this.timeline=this.stage.children[0].timeline,this.captionData[Math.floor(this.timeline.position/this.library.properties.fps)]&&(this.captionText=this.captionData[Math.floor(this.timeline.position/this.library.properties.fps)]),this.timeline.position%10==0&&(console.log(this.timeline.duration-10,this.timeline.position),this.timeline.position>this.timeline.duration-10&&this.animationCompleted(),this.currentProgressWidth=parseFloat((this.timeline.position/this.timeline.duration*this.sizeofProgressBar).toFixed(0))))}animationCompleted(){console.log("completed"),this.showFirstFrame=!0,this.rewindAnimationTo(0),this.pauseAnimation()}rewindAnimationTo(t){let i=this.sound;i&&(i.paused=!0);let s=this.stage.children[0],e=s.timeline;t<0&&(t=0),t>e.duration&&(t=e.duration-10),this.paused?(s.gotoAndStop(t),this.stage.update(),i&&!i.getPaused()&&(createjs.Ticker.paused=!0)):(s.gotoAndPlay(t),createjs.Ticker.paused=!1)}rewindAnimationToStart(){this.paused=!0,this.rewindAnimationTo(0)}rewindAnimation(t){t.stopPropagation();let i=Math.round(t.offsetX/this.sizeofProgressBar*this.stage.children[0].timeline.duration);this.rewindAnimationTo(i)}rewind5Sec(){this.rewindAnimationTo(this.stage.children[0].timeline.position-5*this.library.properties.fps)}fastForward5Sec(){this.rewindAnimationTo(this.stage.children[0].timeline.position+5*this.library.properties.fps)}muteVolume(){let t=this.sound;t&&(t.volume=0)}downVolume(){let t=this.sound;t&&t._getVolume()>.9&&(t.volume=t._getVolume()-.1)}upVolume(){let t=this.sound;t&&t._getVolume()<1&&(t.volume=t._getVolume()+.1)}render(){return i("div",{class:"cavase-main-container"},i("div",{class:"canvas-container",id:"canvas-container"},this.classMode?"":i("div",null,i("canvas",{class:"video-canvas",onClick:()=>this.playButtonAction()}),this.showCaption?i("div",{class:"caption"},this.captionText):""),!this.dataLoaded||this.showFirstFrame?i("img",{class:"frame-img",src:this.firstFramePath}):"",this.classMode?i("img",{class:"overlay-img",src:s("./assets/play-button-disabled-overlay.png")}):"",!this.classMode&&this.paused?i("img",{class:"overlay-img",onClick:()=>this.playButtonAction(),src:s("./assets/play-button-overlay.png")}):"",this.isBusy?i("div",{class:"loading-container"},i("div",{class:"uil-ring-css"},i("div",null),i("a",null,"Loading ",this.animationVideoProgress,"%"))):""),this.dataLoaded?i("div",{class:"navControls"},i("div",{class:"progressBar",onClick:t=>this.rewindAnimation(t)},i("div",{class:"currentProgress",style:{width:this.currentProgressWidth+"px"}})),i("div",{class:"button-panel"},i("ion-button",{size:"small",color:"transperant",onClick:()=>this.rewind5Sec()}," ",i("ion-icon",{name:"play-back-outline"})," "),i("ion-button",{size:"small",color:"transperant",onClick:()=>this.playButtonAction()}," ",i("ion-icon",this.paused?{name:"pause-outline"}:{name:"play-outline"})),i("ion-button",{size:"small",color:"transperant",onClick:()=>this.fastForward5Sec()}," ",i("ion-icon",{name:"play-forward-outline"})))):"",this.dataLoaded&&this.captionText?i("div",{class:"closed-caption"},i("ion-item",{lines:"none"},i("ion-label",null,"Closed Caption"),i("ion-toggle",{slot:"end",color:"primary",checked:this.showCaption}))):"")}static get assetsDirs(){return["assets"]}get el(){return e(this)}};r.style='.video-canvas{position:absolute;display:block;background-color:#f5f5f5;width:auto}.closed-caption{justify-content:flex-end;width:100%;display:flex}sparkle-animation-player{width:100%;margin:0 auto}.caption{position:absolute;bottom:0px;color:white;text-align:center;width:100%;text-shadow:1px 1px 2px #e50539}.canvas-container{width:680px;height:680px;background-color:#f5f5f5;border-radius:10px;position:relative}.frame-img{position:absolute;display:block;max-width:100%;width:100%;height:auto}.overlay-img{position:absolute;z-index:9999;top:0px;display:block;max-width:100%;width:100%;height:auto}.button-panel{display:flex;justify-content:center}ion-icon{color:var(--ion-color-primary)}.navControls{width:680px;background:transparent;border-radius:10px;position:relative;padding-top:15px;display:flex;flex-direction:column;align-items:center}.navControls .progressBar{flex:100%;border-radius:20px;position:relative;left:0;right:0;height:4px;background-color:rgba(205, 205, 205, 0.7);width:100%}.navControls .progressBar .currentProgress{border-radius:20px;position:absolute;height:25px;background-color:var(--ion-color-primary);transition:width 0.5s;width:100%}.navControls .progressBar .currentProgress:before{position:absolute;top:50%;right:4px;content:" ";display:block;width:12px;height:12px;margin-top:-10px;background:#e5053a;border-radius:10px;border:4px solid #d9d4d4;z-index:10}#dom_overlay_container{pointer-events:none;overflow:hidden;position:absolute;left:0px;top:0px;display:block}.cavase-main-container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;padding:15px;background-position:center;background-size:cover;background-repeat:no-repeat}.loading-container{height:100%;display:flex;justify-content:center;align-items:center}.uil-ring-css{position:absolute}ion-button{--ion-color-base:transparent;--ion-color-contrast:var(--ion-color-primary);--box-shadow:none !important}@media screen and (min-width: 760px){.navControls{flex-direction:row}.navControls .progressBar{height:24px;flex:75%;width:75%}.button-panel{flex:25%;width:25%}}';export{r as sparkle_animation_player}
1
+ import{r as t,h as i,c as s,e}from"./p-ee1e0eb4.js";import{g as o}from"./p-5d409601.js";import{S as a}from"./p-8b56f734.js";class n{constructor(){this.pItems={}}fromSrt(t,i){var s=!!i;(t=(t=t.replace(/\r/g,"")).split(/(\d+)\n(\d{2}:\d{2}:\d{2},\d{3}) --> (\d{2}:\d{2}:\d{2},\d{3})/g)).shift();for(var e={},o=0;o<t.length;o+=4)e[s?this.timeS(t[o+1].trim()):t[o+1].trim()]=t[o+3].trim();return e}toSrt(t){if(!(t instanceof Array))return"";for(var i="",s=0;s<t.length;s++){var e=t[s];isNaN(e.startTime)||isNaN(e.endTime)||(e.startTime=this.msTime(parseInt(e.startTime,10)),e.endTime=this.msTime(parseInt(e.endTime,10))),i+=e.id+"\r\n",i+=e.startTime+" --\x3e "+e.endTime+"\r\n",i+=e.text.replace("\n","\r\n")+"\r\n\r\n"}return i}timeS(t){var i=/(\d+):(\d{2}):(\d{2}),(\d{3})/.exec(t);if(null===i)return 0;for(var s=1;s<5;s++)i[s]=parseInt(i[s],10).toString(),isNaN(parseInt(i[s],10))&&(i[s]="0");return 3600*parseInt(i[1],10)+60*parseInt(i[2],10)+parseInt(i[3],10)+Math.floor(parseInt(i[4],10)/1e3)}msTime(t){var i=[36e5,6e4,1e3],s=[];for(var e in i){var o=(t/i[e]>>0).toString();o.length<2&&(o="0"+o),t%=i[e],s.push(o)}var a=t.toString();if(a.length<3)for(let t=0;t<=3-a.length;t++)a="0"+a;return s.join(":")+","+a}}const r=class{constructor(i){t(this,i),this.showCaption=!1,this.paused=!0,this.dataLoaded=!1,this.currentProgressWidth=0,this.captionText="",this.showFirstFrame=!1,this.firstFramePath="",this.isBusy=!1,this.animationVideoProgress="0",this.captionData={}}closedCaptionChange(t){this.showCaption=!this.showCaption}onClassRoomModeChanged(t){this.classMode=t.detail}componentWillLoad(){this.classMode=o(a.LOCALSTORAGE_CLASSROOM_MODE);const t=document.createElement("script");this.firstFramePath=this.src.replace(".js",".png"),t.src=this.src,document.body.appendChild(t),this.readTextFile(this.src.replace(".js",".srt")),this.rergisterSoundControls()}readTextFile(t){let i=this;var s=new XMLHttpRequest;s.open("GET",t,!1),s.onreadystatechange=function(){if(4===s.readyState&&(200===s.status||0==s.status)){var t=s.responseText,e=new n;i.captionData=e.fromSrt(t,!0)}},s.send(null)}isScriptLoaded(t){for(var i=document.getElementsByTagName("script"),s=i.length;s--;)if(i[s].getAttribute("src")==t)return!0;return!1}rergisterSoundControls(){window.playSound=t=>(this.sound&&this.sound.stop(),this.sound=createjs.Sound.play(t,{interrupt:createjs.Sound.INTERRUPT_EARLY,loop:0,volume:1}),this.sound),window.resetToStart=()=>{console.log("reset"),this.rewindAnimationToStart()}}startLoading(){this.isBusy=!0,this.paused=!1}doneLoading(){this.isBusy=!1,this.dataLoaded=!0,this.paused=!1}handleFileLoad(t){var i=this.comp.getImages();t&&"image"==t.item.type&&(i[t.item.id]=t.result)}handleQueueProgress(t){return t=>{this.animationVideoProgress=t.loaded?(100*t.loaded).toFixed(0):"0",1==t.loaded&&this.doneLoading()}}handleComplete(t){for(var i=this.comp.getSpriteSheet(),s=t.target,e=this.library.ssMetadata,o=0;o<e.length;o++)i[e[o].name]=new createjs.SpriteSheet({images:[s.getResult(e[o].name)],frames:e[o].frames});var a=this.src.substring(this.src.lastIndexOf("/")+1,this.src.lastIndexOf("."));this.exportRoot=new this.library[a],this.stage=new this.library.Stage(this.canvas),this.makeResponsive(!0,"both",!1,1),AdobeAn.compositionLoaded(this.library.properties.id),this.stage.addChild(this.exportRoot),createjs.Ticker.framerate=this.library.properties.fps,createjs.Ticker.paused=!1,createjs.Ticker.addEventListener("tick",this.stage),createjs.Ticker.addEventListener("tick",(t=>{this.tickHandler(t)}))}loadAnimation(){this.startLoading(),createjs.Sound.initializeDefaultPlugins()&&(this.canvas=this.el.querySelector(".video-canvas"),this.anim_container=this.el.querySelector(".canvas-container"),this.comp=AdobeAn.getComposition(this.composition),this.canvas.style.width="100%",this.canvas.style.height=this.canvas.offsetWidth+"px",this.anim_container.style.height=this.canvas.offsetWidth+"px",this.library=this.comp.getLibrary(),this.loader=new createjs.LoadQueue(!1),this.loader.setMaxConnections(3),this.loader.maintainScriptOrder=!0,this.loader.installPlugin(createjs.Sound),this.loader.addEventListener("complete",(t=>{this.handleComplete(t)})),this.loader.addEventListener("fileload",(t=>{this.handleFileLoad(t)})),this.loader.addEventListener("progress",this.handleQueueProgress(this)),this.loader.loadManifest(this.library.properties.manifest,!0,this.src.substring(0,this.src.lastIndexOf("/")+1)))}playButtonAction(){this.dataLoaded?this.playPauseAnimation():this.loadAnimation()}playPauseAnimation(){createjs.Ticker.paused?this.playAnimation():this.pauseAnimation()}async playAnimation(){if(this.showFirstFrame=!1,null!=this.loader&&this.loader.close(),createjs&&createjs.Ticker){let t=!1,i=this.sound;i&&(i.paused=t),createjs.Ticker.paused=t,createjs.Ticker.addEventListener("tick",this.stage),this.paused=t}}async pauseAnimation(){if(null!=this.loader&&this.loader.close(),createjs&&createjs.Ticker){let t=!0,i=this.sound;i&&(i.paused=t),createjs.Ticker.paused=t,createjs.Ticker.removeEventListener("tick",this.stage),this.paused=t}}disconnectedCallback(){this.pauseAnimation(),createjs.Sound.removeAllSounds()}async classRoomModeChanged(t){this.classMode=t}async destroyAnimation(){this.pauseAnimation()}makeResponsive(t,i,s,e){window.addEventListener("resize",(()=>this.resizeCanvas(t,i,s,e))),this.resizeCanvas(t,i,s,e)}resizeCanvas(t,i,s,e){var o,a,n=1,r=this.library.properties.width,h=this.library.properties.height,l=window.innerWidth,c=window.innerHeight,d=window.devicePixelRatio||1,p=l/r,u=c/h,m=1;t&&("width"==i&&o==l||"height"==i&&a==c?m=n:s?1==e?m=Math.min(p,u):2==e&&(m=Math.max(p,u)):(l<r||c<h)&&(m=Math.min(p,u)));var g=this.el.querySelector(".canvas-container");this.canvas.width=r*d*m,this.canvas.height=h*d*m,this.canvas.style.width="100%",this.canvas.style.height=this.canvas.offsetWidth+"px",g.style.height=this.canvas.offsetWidth+"px",this.stage.scaleX=d*m,this.stage.scaleY=d*m,o=l,a=c,n=m,this.sizeOfCanvas=this.canvas.offsetWidth;var v=this.el.querySelector(".progressBar");this.sizeofProgressBar=v.offsetWidth,this.stage.tickOnUpdate=!1,this.stage.update(),this.stage.tickOnUpdate=!0}tickHandler(t){t.paused||(this.timeline=this.stage.children[0].timeline,this.captionData[Math.floor(this.timeline.position/this.library.properties.fps)]&&(this.captionText=this.captionData[Math.floor(this.timeline.position/this.library.properties.fps)]),this.timeline.position%10==0&&(console.log(this.timeline.duration-10,this.timeline.position),this.timeline.position>this.timeline.duration-10&&this.animationCompleted(),this.currentProgressWidth=parseFloat((this.timeline.position/this.timeline.duration*this.sizeofProgressBar).toFixed(0))))}animationCompleted(){console.log("completed"),this.showFirstFrame=!0,this.rewindAnimationTo(0),this.pauseAnimation()}rewindAnimationTo(t){let i=this.sound;i&&(i.paused=!0);let s=this.stage.children[0],e=s.timeline;t<0&&(t=0),t>e.duration&&(t=e.duration-10),this.paused?(s.gotoAndStop(t),this.stage.update(),i&&!i.getPaused()&&(createjs.Ticker.paused=!0)):(s.gotoAndPlay(t),createjs.Ticker.paused=!1)}rewindAnimationToStart(){this.paused=!0,this.rewindAnimationTo(0)}rewindAnimation(t){t.stopPropagation();let i=Math.round(t.offsetX/this.sizeofProgressBar*this.stage.children[0].timeline.duration);this.rewindAnimationTo(i)}rewind5Sec(){this.rewindAnimationTo(this.stage.children[0].timeline.position-5*this.library.properties.fps)}fastForward5Sec(){this.rewindAnimationTo(this.stage.children[0].timeline.position+5*this.library.properties.fps)}muteVolume(){let t=this.sound;t&&(t.volume=0)}downVolume(){let t=this.sound;t&&t._getVolume()>.9&&(t.volume=t._getVolume()-.1)}upVolume(){let t=this.sound;t&&t._getVolume()<1&&(t.volume=t._getVolume()+.1)}render(){return i("div",{class:"cavase-main-container"},i("div",{class:"canvas-container",id:"canvas-container"},this.classMode?"":i("div",null,i("canvas",{class:"video-canvas",onClick:()=>this.playButtonAction()}),this.showCaption?i("div",{class:"caption"},this.captionText):""),!this.dataLoaded||this.showFirstFrame?i("img",{class:"frame-img",src:this.firstFramePath}):"",this.classMode?i("img",{class:"overlay-img",src:s("./assets/play-button-disabled-overlay.png")}):"",!this.classMode&&this.paused?i("img",{class:"overlay-img",onClick:()=>this.playButtonAction(),src:s("./assets/play-button-overlay.png")}):"",this.isBusy?i("div",{class:"loading-container"},i("div",{class:"uil-ring-css"},i("div",null),i("a",null,"Loading ",this.animationVideoProgress,"%"))):""),this.dataLoaded?i("div",{class:"navControls"},i("div",{class:"progressBar",onClick:t=>this.rewindAnimation(t)},i("div",{class:"currentProgress",style:{width:this.currentProgressWidth+"px"}})),i("div",{class:"button-panel"},i("ion-button",{size:"small",color:"transperant",onClick:()=>this.rewind5Sec()}," ",i("ion-icon",{name:"play-back-outline"})," "),i("ion-button",{size:"small",color:"transperant",onClick:()=>this.playButtonAction()}," ",i("ion-icon",this.paused?{name:"pause-outline"}:{name:"play-outline"})),i("ion-button",{size:"small",color:"transperant",onClick:()=>this.fastForward5Sec()}," ",i("ion-icon",{name:"play-forward-outline"})))):"",this.dataLoaded&&this.captionText?i("div",{class:"closed-caption"},i("ion-item",{lines:"none"},i("ion-label",null,"Closed Caption"),i("ion-toggle",{slot:"end",color:"primary",checked:this.showCaption}))):"")}static get assetsDirs(){return["assets"]}get el(){return e(this)}};r.style='.video-canvas{position:absolute;display:block;background-color:#f5f5f5;width:auto}.closed-caption{justify-content:flex-end;width:100%;display:flex}sparkle-animation-player{width:100%;margin:0 auto}.caption{position:absolute;bottom:0px;color:white;text-align:center;width:100%;text-shadow:1px 1px 2px #e50539}.canvas-container{width:680px;height:680px;background-color:#f5f5f5;border-radius:10px;position:relative}.frame-img{position:absolute;display:block;max-width:100%;width:100%;height:auto}.overlay-img{position:absolute;z-index:9999;top:0px;display:block;max-width:100%;width:100%;height:auto}.button-panel{display:flex;justify-content:center}ion-icon{color:var(--ion-color-primary)}.navControls{width:680px;background:transparent;border-radius:10px;position:relative;padding-top:15px;display:flex;flex-direction:column;align-items:center}.navControls .progressBar{flex:100%;border-radius:20px;position:relative;left:0;right:0;height:4px;background-color:rgba(205, 205, 205, 0.7);width:100%}.navControls .progressBar .currentProgress{border-radius:20px;position:absolute;height:25px;background-color:var(--ion-color-primary);transition:width 0.5s;width:100%}.navControls .progressBar .currentProgress:before{position:absolute;top:50%;right:4px;content:" ";display:block;width:12px;height:12px;margin-top:-10px;background:#e5053a;border-radius:10px;border:4px solid #d9d4d4;z-index:10}#dom_overlay_container{pointer-events:none;overflow:hidden;position:absolute;left:0px;top:0px;display:block}.cavase-main-container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;padding:15px;background-position:center;background-size:cover;background-repeat:no-repeat}.loading-container{height:100%;display:flex;justify-content:center;align-items:center}.uil-ring-css{position:absolute}ion-button{--ion-color-base:transparent;--ion-color-contrast:var(--ion-color-primary);--box-shadow:none !important}@media screen and (min-width: 760px){.navControls{flex-direction:row}.navControls .progressBar{height:24px;flex:75%;width:75%}.button-panel{flex:25%;width:25%}}';export{r as sparkle_animation_player}
@@ -0,0 +1,22 @@
1
+ import{w as t,r as e,i,j as o,h as r,H as n,e as a,f as s}from"./p-ee1e0eb4.js";import{g as l,a as d}from"./p-871106e0.js";import{c,a as p,b as h}from"./p-604a7987.js";import{createGesture as g}from"./p-e9431eeb.js";import{B as b,i as u,b as m,p as v,d as x,e as f,s as w,f as k,h as y,j as z,a as C}from"./p-ff7a8a71.js";import{g as j,h as D,c as O}from"./p-0e4de1d0.js";import{c as A}from"./p-48f72e63.js";import{s as P}from"./p-7d8427eb.js";import{C as $,a as I,d as L}from"./p-05c032dd.js";import{l as T,g as W,a as S,f as E,k as Y,b as N,d as B,e as H,i as X,j as V}from"./p-d68092b7.js";import{d as _}from"./p-00d10dc9.js";import"./p-076f0239.js";import"./p-add30d46.js";
2
+ /*!
3
+ * (C) Ionic http://ionicframework.com - MIT License
4
+ */const F=(e,i)=>{let o,r;const n=(t,e,r)=>{if("undefined"==typeof document)return;const n=document.elementFromPoint(t,e);n&&i(n)?n!==o&&(s(),a(n,r)):s()},a=(e,i)=>{o=e,r||(r=o);const n=o;t((()=>n.classList.add("ion-activated"))),i()},s=(e=!1)=>{if(!o)return;const i=o;t((()=>i.classList.remove("ion-activated"))),e&&r!==o&&o.click(),o=void 0};return g({el:e,gestureName:"buttonActiveDrag",threshold:0,onStart:t=>n(t.currentX,t.currentY,p),onMove:t=>n(t.currentX,t.currentY,h),onEnd:()=>{s(!0),c(),r=void 0}})},M=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),o.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),e.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([i,o])},R=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),o.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),e.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(450).addAnimation([i,o])},K=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),o.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(100%)","translateY(0%)"),e.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation([i,o])},U=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),o.addElement(t.querySelector(".action-sheet-wrapper")).fromTo("transform","translateY(0%)","translateY(100%)"),e.addElement(t).easing("cubic-bezier(.36,.66,.04,1)").duration(450).addAnimation([i,o])},q=class{constructor(t){e(this,t),this.didPresent=i(this,"ionActionSheetDidPresent",7),this.willPresent=i(this,"ionActionSheetWillPresent",7),this.willDismiss=i(this,"ionActionSheetWillDismiss",7),this.didDismiss=i(this,"ionActionSheetDidDismiss",7),this.presented=!1,this.keyboardClose=!0,this.buttons=[],this.backdropDismiss=!0,this.translucent=!1,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,b)},this.dispatchCancelHandler=t=>{if(u(t.detail.role)){const t=this.getButtons().find((t=>"cancel"===t.role));this.callButtonHandler(t)}}}present(){return m(this,"actionSheetEnter",M,K)}connectedCallback(){v(this.el)}dismiss(t,e){return x(this,t,e,"actionSheetLeave",R,U)}onDidDismiss(){return f(this.el,"ionActionSheetDidDismiss")}onWillDismiss(){return f(this.el,"ionActionSheetWillDismiss")}async buttonClick(t){const e=t.role;return u(e)?this.dismiss(t.data,e):await this.callButtonHandler(t)?this.dismiss(t.data,t.role):Promise.resolve()}async callButtonHandler(t){return!t||!1!==await w(t.handler)}getButtons(){return this.buttons.map((t=>"string"==typeof t?{text:t}:t))}disconnectedCallback(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}componentDidLoad(){const{groupEl:t,wrapperEl:e}=this;!this.gesture&&"md"!==l(this)&&e&&t&&o((()=>{t.scrollHeight>t.clientHeight||(this.gesture=F(e,(t=>t.classList.contains("action-sheet-button"))),this.gesture.enable(!0))}))}render(){const{htmlAttributes:t}=this,e=l(this),i=this.getButtons(),o=i.find((t=>"cancel"===t.role)),a=i.filter((t=>"cancel"!==t.role));return r(n,Object.assign({role:"dialog","aria-modal":"true",tabindex:"-1"},t,{style:{zIndex:`${2e4+this.overlayIndex}`},class:Object.assign(Object.assign({[e]:!0},j(this.cssClass)),{"overlay-hidden":!0,"action-sheet-translucent":this.translucent}),onIonActionSheetWillDismiss:this.dispatchCancelHandler,onIonBackdropTap:this.onBackdropTap}),r("ion-backdrop",{tappable:this.backdropDismiss}),r("div",{tabindex:"0"}),r("div",{class:"action-sheet-wrapper ion-overlay-wrapper",role:"dialog",ref:t=>this.wrapperEl=t},r("div",{class:"action-sheet-container"},r("div",{class:"action-sheet-group",ref:t=>this.groupEl=t},void 0!==this.header&&r("div",{class:{"action-sheet-title":!0,"action-sheet-has-sub-title":void 0!==this.subHeader}},this.header,this.subHeader&&r("div",{class:"action-sheet-sub-title"},this.subHeader)),a.map((t=>r("button",{type:"button",id:t.id,class:G(t),onClick:()=>this.buttonClick(t)},r("span",{class:"action-sheet-button-inner"},t.icon&&r("ion-icon",{icon:t.icon,lazy:!1,class:"action-sheet-icon"}),t.text),"md"===e&&r("ion-ripple-effect",null))))),o&&r("div",{class:"action-sheet-group action-sheet-group-cancel"},r("button",{type:"button",class:G(o),onClick:()=>this.buttonClick(o)},r("span",{class:"action-sheet-button-inner"},o.icon&&r("ion-icon",{icon:o.icon,lazy:!1,class:"action-sheet-icon"}),o.text),"md"===e&&r("ion-ripple-effect",null))))),r("div",{tabindex:"0"}))}get el(){return a(this)}},G=t=>Object.assign({"action-sheet-button":!0,"ion-activatable":!0,"ion-focusable":!0,[`action-sheet-${t.role}`]:void 0!==t.role},j(t.cssClass));
5
+ /*!
6
+ * (C) Ionic http://ionicframework.com - MIT License
7
+ */q.style={ios:'.sc-ion-action-sheet-ios-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-ios-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-ios{left:0;right:0;bottom:0;transform:translate3d(0, 100%, 0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}.action-sheet-button.sc-ion-action-sheet-ios{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-ios{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-ios{display:flex;flex-flow:column;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-ios{flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-ios::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-ios{flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-ios::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.action-sheet-selected.sc-ion-action-sheet-ios{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-ios::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-ios::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-ios:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-ios:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--backdrop-opacity:var(--ion-backdrop-opacity, 0.4);--button-background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent;--button-background-activated:var(--ion-text-color, #000);--button-background-activated-opacity:.08;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-background-selected:var(--ion-color-step-150, var(--ion-background-color, #fff));--button-background-selected-opacity:1;--button-color:var(--ion-color-primary, #3880ff);--color:var(--ion-color-step-400, #999999);text-align:center}.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:auto;margin-right:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:var(--ion-safe-area-bottom, 0)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-container.sc-ion-action-sheet-ios{padding-left:8px;padding-right:8px;padding-top:0;padding-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-container.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.action-sheet-group.sc-ion-action-sheet-ios{border-radius:13px;margin-bottom:8px}.action-sheet-group.sc-ion-action-sheet-ios:first-child{margin-top:10px}.action-sheet-group.sc-ion-action-sheet-ios:last-child{margin-bottom:10px}@supports (backdrop-filter: blur(0)){.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-group.sc-ion-action-sheet-ios{background-color:transparent;backdrop-filter:saturate(280%) blur(20px)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-title.sc-ion-action-sheet-ios,.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.sc-ion-action-sheet-ios{background-color:transparent;background-image:linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%), linear-gradient(0deg, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4), rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.4) 50%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 50%);background-repeat:no-repeat;background-position:top, bottom;background-size:100% calc(100% - 1px), 100% 1px;backdrop-filter:saturate(120%)}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-button.ion-activated.sc-ion-action-sheet-ios{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.7);background-image:none}.action-sheet-translucent.sc-ion-action-sheet-ios-h .action-sheet-cancel.sc-ion-action-sheet-ios{background:var(--button-background-selected)}}.action-sheet-title.sc-ion-action-sheet-ios{background:linear-gradient(0deg, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08), rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.08) 50%, transparent 50%) bottom/100% 1px no-repeat transparent}.action-sheet-title.sc-ion-action-sheet-ios{padding-left:10px;padding-right:10px;padding-top:14px;padding-bottom:13px;color:var(--color, var(--ion-color-step-400, #999999));font-size:13px;font-weight:400;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.action-sheet-title.action-sheet-has-sub-title.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-sub-title.sc-ion-action-sheet-ios{padding-left:0;padding-right:0;padding-top:6px;padding-bottom:0;font-size:13px;font-weight:400}.action-sheet-button.sc-ion-action-sheet-ios{padding-left:18px;padding-right:18px;padding-top:18px;padding-bottom:18px;height:56px;font-size:20px;contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:18px;padding-inline-start:18px;-webkit-padding-end:18px;padding-inline-end:18px}}.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:0.3em;font-size:28px;pointer-events:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-ios .action-sheet-icon.sc-ion-action-sheet-ios{margin-right:unset;-webkit-margin-end:0.3em;margin-inline-end:0.3em}}.action-sheet-button.sc-ion-action-sheet-ios:last-child{background-image:none}.action-sheet-selected.sc-ion-action-sheet-ios{font-weight:bold}.action-sheet-cancel.sc-ion-action-sheet-ios{font-weight:600}.action-sheet-cancel.sc-ion-action-sheet-ios::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-destructive.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-activated.sc-ion-action-sheet-ios,.action-sheet-destructive.ion-focused.sc-ion-action-sheet-ios{color:var(--ion-color-danger, #eb445a)}@media (any-hover: hover){.action-sheet-destructive.sc-ion-action-sheet-ios:hover{color:var(--ion-color-danger, #eb445a)}}',md:'.sc-ion-action-sheet-md-h{--color:initial;--button-color-activated:var(--button-color);--button-color-focused:var(--button-color);--button-color-hover:var(--button-color);--button-color-selected:var(--button-color);--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--height:100%;--max-height:calc(100% - (var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:block;position:fixed;outline:none;font-family:var(--ion-font-family, inherit);touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-action-sheet-md-h{display:none}.action-sheet-wrapper.sc-ion-action-sheet-md{left:0;right:0;bottom:0;transform:translate3d(0, 100%, 0);display:block;position:absolute;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);z-index:10;pointer-events:none}.action-sheet-button.sc-ion-action-sheet-md{display:block;position:relative;width:100%;border:0;outline:none;background:var(--button-background);color:var(--button-color);font-family:inherit;overflow:hidden}.action-sheet-button-inner.sc-ion-action-sheet-md{display:flex;position:relative;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;pointer-events:none;width:100%;height:100%;z-index:1}.action-sheet-container.sc-ion-action-sheet-md{display:flex;flex-flow:column;justify-content:flex-end;height:100%;max-height:100%}.action-sheet-group.sc-ion-action-sheet-md{flex-shrink:2;overscroll-behavior-y:contain;overflow-y:auto;-webkit-overflow-scrolling:touch;pointer-events:all;background:var(--background)}.action-sheet-group.sc-ion-action-sheet-md::-webkit-scrollbar{display:none}.action-sheet-group-cancel.sc-ion-action-sheet-md{flex-shrink:0;overflow:hidden}.action-sheet-button.sc-ion-action-sheet-md::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0}.action-sheet-selected.sc-ion-action-sheet-md{color:var(--button-color-selected)}.action-sheet-selected.sc-ion-action-sheet-md::after{background:var(--button-background-selected);opacity:var(--button-background-selected-opacity)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md{color:var(--button-color-activated)}.action-sheet-button.ion-activated.sc-ion-action-sheet-md::after{background:var(--button-background-activated);opacity:var(--button-background-activated-opacity)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md{color:var(--button-color-focused)}.action-sheet-button.ion-focused.sc-ion-action-sheet-md::after{background:var(--button-background-focused);opacity:var(--button-background-focused-opacity)}@media (any-hover: hover){.action-sheet-button.sc-ion-action-sheet-md:hover{color:var(--button-color-hover)}.action-sheet-button.sc-ion-action-sheet-md:hover::after{background:var(--button-background-hover);opacity:var(--button-background-hover-opacity)}}.sc-ion-action-sheet-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);--button-background:transparent;--button-background-selected:currentColor;--button-background-selected-opacity:0;--button-background-activated:transparent;--button-background-activated-opacity:0;--button-background-hover:currentColor;--button-background-hover-opacity:.04;--button-background-focused:currentColor;--button-background-focused-opacity:.12;--button-color:var(--ion-color-step-850, #262626);--color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54)}.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:auto;margin-right:auto;margin-top:var(--ion-safe-area-top, 0);margin-bottom:0}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-wrapper.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.action-sheet-title.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:20px;padding-bottom:17px;min-height:60px;color:var(--color, rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.54));font-size:16px;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-title.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-sub-title.sc-ion-action-sheet-md{padding-left:0;padding-right:0;padding-top:16px;padding-bottom:0;font-size:14px}.action-sheet-group.sc-ion-action-sheet-md:first-child{padding-top:0}.action-sheet-group.sc-ion-action-sheet-md:last-child{padding-bottom:var(--ion-safe-area-bottom)}.action-sheet-button.sc-ion-action-sheet-md{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:0;position:relative;height:52px;font-size:16px;text-align:start;contain:strict;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-button.sc-ion-action-sheet-md{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.action-sheet-icon.sc-ion-action-sheet-md{padding-bottom:4px;margin-left:0;margin-right:32px;margin-top:0;margin-bottom:0;color:var(--color);font-size:24px}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.action-sheet-icon.sc-ion-action-sheet-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:32px;margin-inline-end:32px}}.action-sheet-button-inner.sc-ion-action-sheet-md{justify-content:flex-start}.action-sheet-selected.sc-ion-action-sheet-md{font-weight:bold}'};
8
+ /*!
9
+ * (C) Ionic http://ionicframework.com - MIT License
10
+ */
11
+ const J=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),o.addElement(t.querySelector(".alert-wrapper")).keyframes([{offset:0,opacity:"0.01",transform:"scale(1.1)"},{offset:1,opacity:"1",transform:"scale(1)"}]),e.addElement(t).easing("ease-in-out").duration(200).addAnimation([i,o])},Q=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),o.addElement(t.querySelector(".alert-wrapper")).keyframes([{offset:0,opacity:.99,transform:"scale(1)"},{offset:1,opacity:0,transform:"scale(0.9)"}]),e.addElement(t).easing("ease-in-out").duration(200).addAnimation([i,o])},Z=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),o.addElement(t.querySelector(".alert-wrapper")).keyframes([{offset:0,opacity:"0.01",transform:"scale(0.9)"},{offset:1,opacity:"1",transform:"scale(1)"}]),e.addElement(t).easing("ease-in-out").duration(150).addAnimation([i,o])},tt=t=>{const e=A(),i=A(),o=A();return i.addElement(t.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),o.addElement(t.querySelector(".alert-wrapper")).fromTo("opacity",.99,0),e.addElement(t).easing("ease-in-out").duration(150).addAnimation([i,o])},et=class{constructor(t){e(this,t),this.didPresent=i(this,"ionAlertDidPresent",7),this.willPresent=i(this,"ionAlertWillPresent",7),this.willDismiss=i(this,"ionAlertWillDismiss",7),this.didDismiss=i(this,"ionAlertDidDismiss",7),this.processedInputs=[],this.processedButtons=[],this.presented=!1,this.keyboardClose=!0,this.buttons=[],this.inputs=[],this.backdropDismiss=!0,this.translucent=!1,this.animated=!0,this.onBackdropTap=()=>{this.dismiss(void 0,b)},this.dispatchCancelHandler=t=>{if(u(t.detail.role)){const t=this.processedButtons.find((t=>"cancel"===t.role));this.callButtonHandler(t)}}}onKeydown(t){if(!new Set(this.processedInputs.map((t=>t.type))).has("radio")||t.target&&!this.el.contains(t.target)||t.target.classList.contains("alert-button"))return;const e=this.el.querySelectorAll(".alert-radio"),i=Array.from(e).filter((t=>!t.disabled)),o=i.findIndex((e=>e.id===t.target.id));let r;if(["ArrowDown","ArrowRight"].includes(t.code)&&(r=o===i.length-1?i[0]:i[o+1]),["ArrowUp","ArrowLeft"].includes(t.code)&&(r=0===o?i[i.length-1]:i[o-1]),r&&i.includes(r)){const t=this.processedInputs.find((t=>t.id===(null==r?void 0:r.id)));t&&(this.rbClick(t),r.focus())}}buttonsChanged(){this.processedButtons=this.buttons.map((t=>"string"==typeof t?{text:t,role:"cancel"===t.toLowerCase()?"cancel":void 0}:t))}inputsChanged(){const t=this.inputs,e=t.find((t=>!t.disabled)),i=t.find((t=>t.checked&&!t.disabled))||e,o=new Set(t.map((t=>t.type)));o.has("checkbox")&&o.has("radio")&&console.warn(`Alert cannot mix input types: ${Array.from(o.values()).join("/")}. Please see alert docs for more info.`),this.inputType=o.values().next().value,this.processedInputs=t.map(((t,e)=>({type:t.type||"text",name:t.name||`${e}`,placeholder:t.placeholder||"",value:t.value,label:t.label,checked:!!t.checked,disabled:!!t.disabled,id:t.id||`alert-input-${this.overlayIndex}-${e}`,handler:t.handler,min:t.min,max:t.max,cssClass:t.cssClass||"",attributes:t.attributes||{},tabindex:"radio"===t.type&&t!==i?-1:0})))}connectedCallback(){v(this.el)}componentWillLoad(){this.inputsChanged(),this.buttonsChanged()}disconnectedCallback(){this.gesture&&(this.gesture.destroy(),this.gesture=void 0)}componentDidLoad(){!this.gesture&&"md"!==l(this)&&this.wrapperEl&&(this.gesture=F(this.wrapperEl,(t=>t.classList.contains("alert-button"))),this.gesture.enable(!0))}present(){return m(this,"alertEnter",J,Z)}dismiss(t,e){return x(this,t,e,"alertLeave",Q,tt)}onDidDismiss(){return f(this.el,"ionAlertDidDismiss")}onWillDismiss(){return f(this.el,"ionAlertWillDismiss")}rbClick(t){for(const e of this.processedInputs)e.checked=e===t,e.tabindex=e===t?0:-1;this.activeId=t.id,w(t.handler,t),s(this)}cbClick(t){t.checked=!t.checked,w(t.handler,t),s(this)}buttonClick(t){const e=t.role,i=this.getValues();if(u(e))return this.dismiss({values:i},e);const o=this.callButtonHandler(t,i);return!1!==o?this.dismiss(Object.assign({values:i},o),t.role):Promise.resolve(!1)}callButtonHandler(t,e){if(null==t?void 0:t.handler){const i=w(t.handler,e);if(!1===i)return!1;if("object"==typeof i)return i}return{}}getValues(){if(0===this.processedInputs.length)return;if("radio"===this.inputType){const t=this.processedInputs.find((t=>!!t.checked));return t?t.value:void 0}if("checkbox"===this.inputType)return this.processedInputs.filter((t=>t.checked)).map((t=>t.value));const t={};return this.processedInputs.forEach((e=>{t[e.name]=e.value||""})),t}renderAlertInputs(){switch(this.inputType){case"checkbox":return this.renderCheckbox();case"radio":return this.renderRadio();default:return this.renderInput()}}renderCheckbox(){const t=this.processedInputs,e=l(this);return 0===t.length?null:r("div",{class:"alert-checkbox-group"},t.map((t=>r("button",{type:"button",onClick:()=>this.cbClick(t),"aria-checked":`${t.checked}`,id:t.id,disabled:t.disabled,tabIndex:t.tabindex,role:"checkbox",class:Object.assign(Object.assign({},j(t.cssClass)),{"alert-tappable":!0,"alert-checkbox":!0,"alert-checkbox-button":!0,"ion-focusable":!0,"alert-checkbox-button-disabled":t.disabled||!1})},r("div",{class:"alert-button-inner"},r("div",{class:"alert-checkbox-icon"},r("div",{class:"alert-checkbox-inner"})),r("div",{class:"alert-checkbox-label"},t.label)),"md"===e&&r("ion-ripple-effect",null)))))}renderRadio(){const t=this.processedInputs;return 0===t.length?null:r("div",{class:"alert-radio-group",role:"radiogroup","aria-activedescendant":this.activeId},t.map((t=>r("button",{type:"button",onClick:()=>this.rbClick(t),"aria-checked":`${t.checked}`,disabled:t.disabled,id:t.id,tabIndex:t.tabindex,class:Object.assign(Object.assign({},j(t.cssClass)),{"alert-radio-button":!0,"alert-tappable":!0,"alert-radio":!0,"ion-focusable":!0,"alert-radio-button-disabled":t.disabled||!1}),role:"radio"},r("div",{class:"alert-button-inner"},r("div",{class:"alert-radio-icon"},r("div",{class:"alert-radio-inner"})),r("div",{class:"alert-radio-label"},t.label))))))}renderInput(){const t=this.processedInputs;return 0===t.length?null:r("div",{class:"alert-input-group"},t.map((t=>{var e,i,o,n;return r("div",{class:"alert-input-wrapper"},"textarea"===t.type?r("textarea",Object.assign({placeholder:t.placeholder,value:t.value,id:t.id,tabIndex:t.tabindex},t.attributes,{disabled:null!==(i=null===(e=t.attributes)||void 0===e?void 0:e.disabled)&&void 0!==i?i:t.disabled,class:it(t),onInput:e=>{var i;t.value=e.target.value,(null===(i=t.attributes)||void 0===i?void 0:i.onInput)&&t.attributes.onInput(e)}})):r("input",Object.assign({placeholder:t.placeholder,type:t.type,min:t.min,max:t.max,value:t.value,id:t.id,tabIndex:t.tabindex},t.attributes,{disabled:null!==(n=null===(o=t.attributes)||void 0===o?void 0:o.disabled)&&void 0!==n?n:t.disabled,class:it(t),onInput:e=>{var i;t.value=e.target.value,(null===(i=t.attributes)||void 0===i?void 0:i.onInput)&&t.attributes.onInput(e)}})))})))}renderAlertButtons(){const t=this.processedButtons,e=l(this);return r("div",{class:{"alert-button-group":!0,"alert-button-group-vertical":t.length>2}},t.map((t=>r("button",{type:"button",id:t.id,class:ot(t),tabIndex:0,onClick:()=>this.buttonClick(t)},r("span",{class:"alert-button-inner"},t.text),"md"===e&&r("ion-ripple-effect",null)))))}render(){const{overlayIndex:t,header:e,subHeader:i,htmlAttributes:o}=this,a=l(this),s=`alert-${t}-hdr`,d=`alert-${t}-sub-hdr`,c=`alert-${t}-msg`;return r(n,Object.assign({role:this.inputs.length>0||this.buttons.length>0?"alertdialog":"alert","aria-modal":"true",tabindex:"-1"},o,{style:{zIndex:`${2e4+t}`},class:Object.assign(Object.assign({},j(this.cssClass)),{[a]:!0,"overlay-hidden":!0,"alert-translucent":this.translucent}),onIonAlertWillDismiss:this.dispatchCancelHandler,onIonBackdropTap:this.onBackdropTap}),r("ion-backdrop",{tappable:this.backdropDismiss}),r("div",{tabindex:"0"}),r("div",{class:"alert-wrapper ion-overlay-wrapper",ref:t=>this.wrapperEl=t},r("div",{class:"alert-head"},e&&r("h2",{id:s,class:"alert-title"},e),i&&r("h2",{id:d,class:"alert-sub-title"},i)),r("div",{id:c,class:"alert-message",innerHTML:P(this.message)}),this.renderAlertInputs(),this.renderAlertButtons()),r("div",{tabindex:"0"}))}get el(){return a(this)}static get watchers(){return{buttons:["buttonsChanged"],inputs:["inputsChanged"]}}},it=t=>{var e,i,o;return Object.assign(Object.assign({"alert-input":!0,"alert-input-disabled":(null!==(i=null===(e=t.attributes)||void 0===e?void 0:e.disabled)&&void 0!==i?i:t.disabled)||!1},j(t.cssClass)),j(t.attributes?null===(o=t.attributes.class)||void 0===o?void 0:o.toString():""))},ot=t=>Object.assign({"alert-button":!0,"ion-focusable":!0,"ion-activatable":!0,[`alert-button-role-${t.role}`]:void 0!==t.role},j(t.cssClass));
12
+ /*!
13
+ * (C) Ionic http://ionicframework.com - MIT License
14
+ */et.style={ios:".sc-ion-alert-ios-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-ios-h{display:none}.alert-top.sc-ion-alert-ios-h{padding-top:50px;align-items:flex-start}.alert-wrapper.sc-ion-alert-ios{display:flex;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-ios{box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-ios::-webkit-scrollbar,.alert-message.sc-ion-alert-ios::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-ios{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;box-sizing:border-box}.alert-button-group.sc-ion-alert-ios{display:flex;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-ios{flex-direction:column;flex-wrap:nowrap}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-ios,.alert-tappable.ion-focused.sc-ion-alert-ios{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-ios{display:flex;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-ios,.alert-checkbox-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios,.alert-radio-button-disabled.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;appearance:none;contain:strict}.alert-button.sc-ion-alert-ios,.alert-checkbox.sc-ion-alert-ios,.alert-input.sc-ion-alert-ios,.alert-radio.sc-ion-alert-ios{outline:none}.alert-radio-icon.sc-ion-alert-ios,.alert-checkbox-icon.sc-ion-alert-ios,.alert-checkbox-inner.sc-ion-alert-ios{box-sizing:border-box}textarea.alert-input.sc-ion-alert-ios{min-height:37px;resize:none}.sc-ion-alert-ios-h{--background:var(--ion-overlay-background-color, var(--ion-color-step-100, #f9f9f9));--max-width:270px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.3);font-size:14px}.alert-wrapper.sc-ion-alert-ios{border-radius:13px;box-shadow:none;overflow:hidden}.alert-button.sc-ion-alert-ios .alert-button-inner.sc-ion-alert-ios{pointer-events:none}@supports (backdrop-filter: blur(0)){.alert-translucent.sc-ion-alert-ios-h .alert-wrapper.sc-ion-alert-ios{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.9);backdrop-filter:saturate(180%) blur(20px)}}.alert-head.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:12px;padding-bottom:7px;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-title.sc-ion-alert-ios{margin-top:8px;color:var(--ion-text-color, #000);font-size:17px;font-weight:600}.alert-sub-title.sc-ion-alert-ios{color:var(--ion-color-step-600, #666666);font-size:14px}.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:16px;padding-right:16px;padding-top:0;padding-bottom:21px;color:var(--ion-text-color, #000);font-size:13px;text-align:center}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-ios,.alert-input-group.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px}}.alert-message.sc-ion-alert-ios{max-height:240px}.alert-message.sc-ion-alert-ios:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:12px}.alert-input.sc-ion-alert-ios{border-radius:4px;margin-top:10px;padding-left:6px;padding-right:6px;padding-top:6px;padding-bottom:6px;border:0.55px solid var(--ion-color-step-250, #bfbfbf);background-color:var(--ion-background-color, #fff);appearance:none}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-input.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:6px;padding-inline-start:6px;-webkit-padding-end:6px;padding-inline-end:6px}}.alert-input.sc-ion-alert-ios::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-ios::-ms-clear{display:none}.alert-radio-group.sc-ion-alert-ios,.alert-checkbox-group.sc-ion-alert-ios{overscroll-behavior:contain;max-height:240px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);overflow-y:auto;-webkit-overflow-scrolling:touch}.alert-tappable.sc-ion-alert-ios{height:44px}.alert-radio-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;flex:1;order:0;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}[aria-checked=true].sc-ion-alert-ios .alert-radio-label.sc-ion-alert-ios{color:var(--ion-color-primary, #3880ff)}.alert-radio-icon.sc-ion-alert-ios{position:relative;order:1;min-width:30px}[aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:7px;top:-7px;position:absolute;width:6px;height:12px;transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-radio-inner.sc-ion-alert-ios{left:unset;right:unset;right:7px}.alert-checkbox-label.sc-ion-alert-ios{padding-left:13px;padding-right:13px;padding-top:13px;padding-bottom:13px;flex:1;color:var(--ion-text-color, #000);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-ios{padding-left:unset;padding-right:unset;-webkit-padding-start:13px;padding-inline-start:13px;-webkit-padding-end:13px;padding-inline-end:13px}}.alert-checkbox-icon.sc-ion-alert-ios{border-radius:50%;margin-left:16px;margin-right:6px;margin-top:10px;margin-bottom:10px;position:relative;width:24px;height:24px;border-width:1px;border-style:solid;border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, #c8c7cc)));background-color:var(--ion-item-background, var(--ion-background-color, #fff));contain:strict}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-checkbox-icon.sc-ion-alert-ios{margin-left:unset;margin-right:unset;-webkit-margin-start:16px;margin-inline-start:16px;-webkit-margin-end:6px;margin-inline-end:6px}}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-icon.sc-ion-alert-ios{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:9px;top:4px;position:absolute;width:5px;height:12px;transform:rotate(45deg);border-width:1px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-background-color, #fff)}[dir=rtl].sc-ion-alert-ios [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl].sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios,[dir=rtl] .sc-ion-alert-ios-h [aria-checked=true].sc-ion-alert-ios .alert-checkbox-inner.sc-ion-alert-ios{left:unset;right:unset;right:9px}.alert-button-group.sc-ion-alert-ios{margin-right:-0.55px;flex-wrap:wrap}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-ios{margin-right:unset;-webkit-margin-end:-0.55px;margin-inline-end:-0.55px}}.alert-button.sc-ion-alert-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;border-radius:0;flex:1 1 auto;min-width:50%;height:44px;border-top:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2);background-color:transparent;color:var(--ion-color-primary, #3880ff);font-size:17px;overflow:hidden}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:first-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:first-child{border-right:0}.alert-button.sc-ion-alert-ios:last-child{border-right:0;font-weight:bold}[dir=rtl].sc-ion-alert-ios .alert-button.sc-ion-alert-ios:last-child,[dir=rtl].sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child,[dir=rtl] .sc-ion-alert-ios-h .alert-button.sc-ion-alert-ios:last-child{border-right:0.55px solid rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.2)}.alert-button.ion-activated.sc-ion-alert-ios{background-color:rgba(var(--ion-text-color-rgb, 0, 0, 0), 0.1)}.alert-button-role-destructive.sc-ion-alert-ios,.alert-button-role-destructive.ion-activated.sc-ion-alert-ios,.alert-button-role-destructive.ion-focused.sc-ion-alert-ios{color:var(--ion-color-danger, #eb445a)}",md:".sc-ion-alert-md-h{--min-width:250px;--width:auto;--min-height:auto;--height:auto;--max-height:90%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;touch-action:none;user-select:none;z-index:1001}.overlay-hidden.sc-ion-alert-md-h{display:none}.alert-top.sc-ion-alert-md-h{padding-top:50px;align-items:flex-start}.alert-wrapper.sc-ion-alert-md{display:flex;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);contain:content;opacity:0;z-index:10}.alert-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-sub-title.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;font-weight:normal}.alert-message.sc-ion-alert-md{box-sizing:border-box;-webkit-overflow-scrolling:touch;overflow-y:auto;overscroll-behavior-y:contain}.alert-checkbox-group.sc-ion-alert-md::-webkit-scrollbar,.alert-radio-group.sc-ion-alert-md::-webkit-scrollbar,.alert-message.sc-ion-alert-md::-webkit-scrollbar{display:none}.alert-input.sc-ion-alert-md{padding-left:0;padding-right:0;padding-top:10px;padding-bottom:10px;width:100%;border:0;background:inherit;font:inherit;box-sizing:border-box}.alert-button-group.sc-ion-alert-md{display:flex;flex-direction:row;width:100%}.alert-button-group-vertical.sc-ion-alert-md{flex-direction:column;flex-wrap:nowrap}.alert-button.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;border:0;font-size:14px;line-height:20px;z-index:0}.alert-button.ion-focused.sc-ion-alert-md,.alert-tappable.ion-focused.sc-ion-alert-md{background:var(--ion-color-step-100, #e6e6e6)}.alert-button-inner.sc-ion-alert-md{display:flex;flex-flow:row nowrap;flex-shrink:0;align-items:center;justify-content:center;width:100%;height:100%}.alert-input-disabled.sc-ion-alert-md,.alert-checkbox-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md,.alert-radio-button-disabled.sc-ion-alert-md .alert-button-inner.sc-ion-alert-md{cursor:default;opacity:0.5;pointer-events:none}.alert-tappable.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;display:flex;width:100%;border:0;background:transparent;font-size:inherit;line-height:initial;text-align:start;appearance:none;contain:strict}.alert-button.sc-ion-alert-md,.alert-checkbox.sc-ion-alert-md,.alert-input.sc-ion-alert-md,.alert-radio.sc-ion-alert-md{outline:none}.alert-radio-icon.sc-ion-alert-md,.alert-checkbox-icon.sc-ion-alert-md,.alert-checkbox-inner.sc-ion-alert-md{box-sizing:border-box}textarea.alert-input.sc-ion-alert-md{min-height:37px;resize:none}.sc-ion-alert-md-h{--background:var(--ion-overlay-background-color, var(--ion-background-color, #fff));--max-width:280px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.32);font-size:14px}.alert-wrapper.sc-ion-alert-md{border-radius:4px;box-shadow:0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12)}.alert-head.sc-ion-alert-md{padding-left:23px;padding-right:23px;padding-top:20px;padding-bottom:15px;text-align:start}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-head.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:23px;padding-inline-start:23px;-webkit-padding-end:23px;padding-inline-end:23px}}.alert-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:20px;font-weight:500}.alert-sub-title.sc-ion-alert-md{color:var(--ion-text-color, #000);font-size:16px}.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:24px;padding-right:24px;padding-top:20px;padding-bottom:20px;color:var(--ion-color-step-550, #737373)}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-message.sc-ion-alert-md,.alert-input-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:24px;padding-inline-start:24px;-webkit-padding-end:24px;padding-inline-end:24px}}.alert-message.sc-ion-alert-md{max-height:266px;font-size:16px}.alert-message.sc-ion-alert-md:empty{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}.alert-head.sc-ion-alert-md+.alert-message.sc-ion-alert-md{padding-top:0}.alert-input.sc-ion-alert-md{margin-left:0;margin-right:0;margin-top:5px;margin-bottom:5px;border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);color:var(--ion-text-color, #000)}.alert-input.sc-ion-alert-md::placeholder{color:var(--ion-placeholder-color, var(--ion-color-step-400, #999999));font-family:inherit;font-weight:inherit}.alert-input.sc-ion-alert-md::-ms-clear{display:none}.alert-input.sc-ion-alert-md:focus{margin-bottom:4px;border-bottom:2px solid var(--ion-color-primary, #3880ff)}.alert-radio-group.sc-ion-alert-md,.alert-checkbox-group.sc-ion-alert-md{position:relative;max-height:266px;border-top:1px solid var(--ion-color-step-150, #d9d9d9);border-bottom:1px solid var(--ion-color-step-150, #d9d9d9);overflow:auto}.alert-tappable.sc-ion-alert-md{position:relative;height:48px;overflow:hidden}.alert-radio-label.sc-ion-alert-md{padding-left:52px;padding-right:26px;padding-top:13px;padding-bottom:13px;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-radio-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:52px;padding-inline-start:52px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-radio-icon.sc-ion-alert-md{left:26px;top:0;border-radius:50%;display:block;position:relative;width:20px;height:20px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373)}[dir=rtl].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}.alert-radio-inner.sc-ion-alert-md{left:3px;top:3px;border-radius:50%;position:absolute;width:10px;height:10px;transform:scale3d(0, 0, 0);transition:transform 280ms cubic-bezier(0.4, 0, 0.2, 1);background-color:var(--ion-color-primary, #3880ff)}[dir=rtl].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-radio-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}[aria-checked=true].sc-ion-alert-md .alert-radio-label.sc-ion-alert-md{color:var(--ion-color-step-850, #262626)}[aria-checked=true].sc-ion-alert-md .alert-radio-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-radio-inner.sc-ion-alert-md{transform:scale3d(1, 1, 1)}.alert-checkbox-label.sc-ion-alert-md{padding-left:53px;padding-right:26px;padding-top:13px;padding-bottom:13px;flex:1;color:var(--ion-color-step-850, #262626);font-size:16px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-checkbox-label.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:53px;padding-inline-start:53px;-webkit-padding-end:26px;padding-inline-end:26px}}.alert-checkbox-icon.sc-ion-alert-md{left:26px;top:0;border-radius:2px;position:relative;width:16px;height:16px;border-width:2px;border-style:solid;border-color:var(--ion-color-step-550, #737373);contain:strict}[dir=rtl].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h .alert-checkbox-icon.sc-ion-alert-md{left:unset;right:unset;right:26px}[aria-checked=true].sc-ion-alert-md .alert-checkbox-icon.sc-ion-alert-md{border-color:var(--ion-color-primary, #3880ff);background-color:var(--ion-color-primary, #3880ff)}[aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:3px;top:0;position:absolute;width:6px;height:10px;transform:rotate(45deg);border-width:2px;border-top-width:0;border-left-width:0;border-style:solid;border-color:var(--ion-color-primary-contrast, #fff)}[dir=rtl].sc-ion-alert-md [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl].sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md,[dir=rtl] .sc-ion-alert-md-h [aria-checked=true].sc-ion-alert-md .alert-checkbox-inner.sc-ion-alert-md{left:unset;right:unset;right:3px}.alert-button-group.sc-ion-alert-md{padding-left:8px;padding-right:8px;padding-top:8px;padding-bottom:8px;box-sizing:border-box;flex-wrap:wrap-reverse;justify-content:flex-end}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button-group.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px}}.alert-button.sc-ion-alert-md{border-radius:2px;margin-left:0;margin-right:8px;margin-top:0;margin-bottom:0;padding-left:10px;padding-right:10px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;color:var(--ion-color-primary, #3880ff);font-weight:500;text-align:end;text-transform:uppercase;overflow:hidden}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{margin-left:unset;margin-right:unset;-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px}}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.alert-button.sc-ion-alert-md{padding-left:unset;padding-right:unset;-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px}}.alert-button-inner.sc-ion-alert-md{justify-content:flex-end}"};
15
+ /*!
16
+ * (C) Ionic http://ionicframework.com - MIT License
17
+ */
18
+ const rt=(t,e,i)=>{const o=e.getBoundingClientRect(),r=o.height;let n=o.width;return"cover"===t&&i&&(n=i.getBoundingClientRect().width),{contentWidth:n,contentHeight:r}},nt=(t,e)=>e&&"ION-ITEM"===e.tagName?t.findIndex((t=>t===e)):-1,at=t=>{const e=W(t).querySelector("button");e&&T((()=>e.focus()))},st=(t,e,i,o,r,n,a,s,l,d,c)=>{var p;let h={top:0,left:0,width:0,height:0};switch(n){case"event":if(!c)return l;h={top:c.clientY,left:c.clientX,width:1,height:1};break;case"trigger":default:const t=c,e=d||(null===(p=null==t?void 0:t.detail)||void 0===p?void 0:p.ionShadowTarget)||(null==t?void 0:t.target);if(!e)return l;const i=e.getBoundingClientRect();h={top:i.top,left:i.left,width:i.width,height:i.height}}const g=ht(a,h,e,i,o,r,t),b=gt(s,a,h,e,i),u=g.top+b.top,m=g.left+b.left,{arrowTop:v,arrowLeft:x}=pt(a,o,r,u,m,e,i,t),{originX:f,originY:w}=lt(a,s,t);return{top:u,left:m,referenceCoordinates:h,arrowTop:v,arrowLeft:x,originX:f,originY:w}},lt=(t,e,i)=>{switch(t){case"top":return{originX:dt(e),originY:"bottom"};case"bottom":return{originX:dt(e),originY:"top"};case"left":return{originX:"right",originY:ct(e)};case"right":return{originX:"left",originY:ct(e)};case"start":return{originX:i?"left":"right",originY:ct(e)};case"end":return{originX:i?"right":"left",originY:ct(e)}}},dt=t=>{switch(t){case"start":return"left";case"center":return"center";case"end":return"right"}},ct=t=>{switch(t){case"start":return"top";case"center":return"center";case"end":return"bottom"}},pt=(t,e,i,o,r,n,a,s)=>{const l={arrowTop:o+a/2-e/2,arrowLeft:r+n-e/2},d={arrowTop:o+a/2-e/2,arrowLeft:r-1.5*e};switch(t){case"top":return{arrowTop:o+a,arrowLeft:r+n/2-e/2};case"bottom":return{arrowTop:o-i,arrowLeft:r+n/2-e/2};case"left":return l;case"right":return d;case"start":return s?d:l;case"end":return s?l:d;default:return{arrowTop:0,arrowLeft:0}}},ht=(t,e,i,o,r,n,a)=>{const s={top:e.top,left:e.left-i-r},l={top:e.top,left:e.left+e.width+r};switch(t){case"top":return{top:e.top-o-n,left:e.left};case"right":return l;case"bottom":return{top:e.top+e.height+n,left:e.left};case"left":return s;case"start":return a?l:s;case"end":return a?s:l}},gt=(t,e,i,o,r)=>{switch(t){case"center":return ut(e,i,o,r);case"end":return bt(e,i,o,r);case"start":default:return{top:0,left:0}}},bt=(t,e,i,o)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(o-e.height),left:0};case"top":case"bottom":default:return{top:0,left:-(i-e.width)}}},ut=(t,e,i,o)=>{switch(t){case"start":case"end":case"left":case"right":return{top:-(o/2-e.height/2),left:0};case"top":case"bottom":default:return{top:0,left:-(i/2-e.width/2)}}},mt=(t,e,i,o,r,n,a,s,l,d,c,p,h=0,g=0,b=0)=>{let u=h;const m=g;let v,x=i,f=e,w=d,k=c,y=!1,z=!1;const C=p?p.top+p.height:n/2-s/2,j=p?p.height:0;let D=!1;return x<o+l?(x=o,y=!0,w="left"):a+o+x+l>r&&(z=!0,x=r-a-o,w="right"),C+j+s>n&&("top"===t||"bottom"===t)&&(C-s>0?(f=Math.max(12,C-s-j-(b-1)),u=f+s,k="bottom",D=!0):v=o),{top:f,left:x,bottom:v,originX:w,originY:k,checkSafeAreaLeft:y,checkSafeAreaRight:z,arrowTop:u,arrowLeft:m,addPopoverBottomClass:D}},vt=(t,e)=>{var i;const{event:o,size:r,trigger:n,reference:a,side:s,align:l}=e,d=t.ownerDocument,c="rtl"===d.dir,p=d.defaultView.innerWidth,h=d.defaultView.innerHeight,g=W(t),b=g.querySelector(".popover-content"),u=g.querySelector(".popover-arrow"),m=n||(null===(i=null==o?void 0:o.detail)||void 0===i?void 0:i.ionShadowTarget)||(null==o?void 0:o.target),{contentWidth:v,contentHeight:x}=rt(r,b,m),{arrowWidth:f,arrowHeight:w}=(t=>{if(!t)return{arrowWidth:0,arrowHeight:0};const{width:e,height:i}=t.getBoundingClientRect();return{arrowWidth:e,arrowHeight:i}})(u),k=st(c,v,x,f,w,a,s,l,{top:h/2-x/2,left:p/2-v/2,originX:c?"right":"left",originY:"top"},n,o),y="cover"===r?0:5,z="cover"===r?0:25,{originX:C,originY:j,top:D,left:O,bottom:P,checkSafeAreaLeft:$,checkSafeAreaRight:I,arrowTop:L,arrowLeft:T,addPopoverBottomClass:S}=mt(s,k.top,k.left,y,p,h,v,x,z,k.originX,k.originY,k.referenceCoordinates,k.arrowTop,k.arrowLeft,w),E=A(),Y=A(),N=A();return Y.addElement(g.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),N.addElement(g.querySelector(".popover-wrapper")).fromTo("opacity",.01,1),E.easing("ease").duration(100).beforeAddWrite((()=>{"cover"===r&&t.style.setProperty("--width",`${v}px`),S&&t.classList.add("popover-bottom"),void 0!==P&&b.style.setProperty("bottom",`${P}px`);let e=`${O}px`;$&&(e=`${O}px + var(--ion-safe-area-left, 0)`),I&&(e=`${O}px - var(--ion-safe-area-right, 0)`),b.style.setProperty("top",`calc(${D}px + var(--offset-y, 0))`),b.style.setProperty("left",`calc(${e} + var(--offset-x, 0))`),b.style.setProperty("transform-origin",`${j} ${C}`),null!==u&&(((t,e=!1,i,o)=>!(!i&&!o||"top"!==t&&"bottom"!==t&&e))(s,k.top!==D||k.left!==O,o,n)?(u.style.setProperty("top",`calc(${L}px + var(--offset-y, 0))`),u.style.setProperty("left",`calc(${T}px + var(--offset-x, 0))`)):u.style.setProperty("display","none"))})).addAnimation([Y,N])},xt=t=>{const e=W(t),i=e.querySelector(".popover-content"),o=e.querySelector(".popover-arrow"),r=A(),n=A(),a=A();return n.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),a.addElement(e.querySelector(".popover-wrapper")).fromTo("opacity",.99,0),r.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),i.style.removeProperty("top"),i.style.removeProperty("left"),i.style.removeProperty("bottom"),i.style.removeProperty("transform-origin"),o&&(o.style.removeProperty("top"),o.style.removeProperty("left"),o.style.removeProperty("display"))})).duration(300).addAnimation([n,a])},ft=(t,e)=>{var i;const{event:o,size:r,trigger:n,reference:a,side:s,align:l}=e,d=t.ownerDocument,c="rtl"===d.dir,p=d.defaultView.innerWidth,h=d.defaultView.innerHeight,g=W(t),b=g.querySelector(".popover-content"),u=n||(null===(i=null==o?void 0:o.detail)||void 0===i?void 0:i.ionShadowTarget)||(null==o?void 0:o.target),{contentWidth:m,contentHeight:v}=rt(r,b,u),x=st(c,m,v,0,0,a,s,l,{top:h/2-v/2,left:p/2-m/2,originX:c?"right":"left",originY:"top"},n,o),f="cover"===r?0:12,{originX:w,originY:k,top:y,left:z,bottom:C}=mt(s,x.top,x.left,f,p,h,m,v,0,x.originX,x.originY,x.referenceCoordinates),j=A(),D=A(),O=A(),P=A(),$=A();return D.addElement(g.querySelector("ion-backdrop")).fromTo("opacity",.01,"var(--backdrop-opacity)").beforeStyles({"pointer-events":"none"}).afterClearStyles(["pointer-events"]),O.addElement(g.querySelector(".popover-wrapper")).duration(150).fromTo("opacity",.01,1),P.addElement(b).beforeStyles({top:`calc(${y}px + var(--offset-y, 0px))`,left:`calc(${z}px + var(--offset-x, 0px))`,"transform-origin":`${k} ${w}`}).beforeAddWrite((()=>{void 0!==C&&b.style.setProperty("bottom",`${C}px`)})).fromTo("transform","scale(0.8)","scale(1)"),$.addElement(g.querySelector(".popover-viewport")).fromTo("opacity",.01,1),j.easing("cubic-bezier(0.36,0.66,0.04,1)").duration(300).beforeAddWrite((()=>{"cover"===r&&t.style.setProperty("--width",`${m}px`),"bottom"===k&&t.classList.add("popover-bottom")})).addAnimation([D,O,P,$])},wt=t=>{const e=W(t),i=e.querySelector(".popover-content"),o=A(),r=A(),n=A();return r.addElement(e.querySelector("ion-backdrop")).fromTo("opacity","var(--backdrop-opacity)",0),n.addElement(e.querySelector(".popover-wrapper")).fromTo("opacity",.99,0),o.easing("ease").afterAddWrite((()=>{t.style.removeProperty("--width"),t.classList.remove("popover-bottom"),i.style.removeProperty("top"),i.style.removeProperty("left"),i.style.removeProperty("bottom"),i.style.removeProperty("transform-origin")})).duration(150).addAnimation([r,n])},kt=class{constructor(t){e(this,t),this.didPresent=i(this,"ionPopoverDidPresent",7),this.willPresent=i(this,"ionPopoverWillPresent",7),this.willDismiss=i(this,"ionPopoverWillDismiss",7),this.didDismiss=i(this,"ionPopoverDidDismiss",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.parentPopover=null,this.popoverIndex=zt++,this.coreDelegate=$(),this.inline=!1,this.focusDescendantOnPresent=!1,this.presented=!1,this.hasController=!1,this.keyboardClose=!0,this.backdropDismiss=!0,this.showBackdrop=!0,this.translucent=!1,this.animated=!0,this.triggerAction="click",this.size="auto",this.dismissOnSelect=!1,this.reference="trigger",this.side="bottom",this.arrow=!0,this.isOpen=!1,this.keyboardEvents=!1,this.keepContentsMounted=!1,this.onBackdropTap=()=>{this.dismiss(void 0,b)},this.onLifecycle=t=>{const e=this.usersElement,i=yt[t.type];if(e&&i){const o=new CustomEvent(i,{bubbles:!1,cancelable:!1,detail:t.detail});e.dispatchEvent(o)}},this.configureTriggerInteraction=()=>{const{trigger:t,triggerAction:e,el:i,destroyTriggerInteraction:o}=this;o&&o();const r=this.triggerEl=void 0!==t?document.getElementById(t):null;r&&(this.destroyTriggerInteraction=((t,e,i)=>{let o=[];switch(e){case"hover":let t;o=[{eventName:"mouseenter",callback:async e=>{e.stopPropagation(),t&&clearTimeout(t),t=setTimeout((()=>{T((()=>{i.presentFromTrigger(e),t=void 0}))}),100)}},{eventName:"mouseleave",callback:e=>{t&&clearTimeout(t);const o=e.relatedTarget;o&&o.closest("ion-popover")!==i&&i.dismiss(void 0,void 0,!1)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>i.presentFromTrigger(t,!0)}];break;case"context-menu":o=[{eventName:"contextmenu",callback:t=>{t.preventDefault(),i.presentFromTrigger(t)}},{eventName:"click",callback:t=>t.stopPropagation()},{eventName:"ionPopoverActivateTrigger",callback:t=>i.presentFromTrigger(t,!0)}];break;case"click":default:o=[{eventName:"click",callback:t=>i.presentFromTrigger(t)},{eventName:"ionPopoverActivateTrigger",callback:t=>i.presentFromTrigger(t,!0)}]}return o.forEach((({eventName:e,callback:i})=>t.addEventListener(e,i))),t.setAttribute("data-ion-popover-trigger","true"),()=>{o.forEach((({eventName:e,callback:i})=>t.removeEventListener(e,i))),t.removeAttribute("data-ion-popover-trigger")}})(r,e,i))},this.configureKeyboardInteraction=()=>{const{destroyKeyboardInteraction:t,el:e}=this;t&&t(),this.destroyKeyboardInteraction=(t=>{const e=async e=>{var i;const o=document.activeElement;let r=[];const n=null===(i=e.target)||void 0===i?void 0:i.tagName;if("ION-POPOVER"===n||"ION-ITEM"===n){try{r=Array.from(t.querySelectorAll("ion-item:not(ion-popover ion-popover *):not([disabled])"))}catch(t){}switch(e.key){case"ArrowLeft":await t.getParentPopover()&&t.dismiss(void 0,void 0,!1);break;case"ArrowDown":e.preventDefault();const i=((t,e)=>t[nt(t,e)+1])(r,o);void 0!==i&&at(i);break;case"ArrowUp":e.preventDefault();const n=((t,e)=>t[nt(t,e)-1])(r,o);void 0!==n&&at(n);break;case"Home":e.preventDefault();const a=r[0];void 0!==a&&at(a);break;case"End":e.preventDefault();const s=r[r.length-1];void 0!==s&&at(s);break;case"ArrowRight":case" ":case"Enter":if(o&&o.hasAttribute("data-ion-popover-trigger")){const t=new CustomEvent("ionPopoverActivateTrigger");o.dispatchEvent(t)}}}};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)})(e)},this.configureDismissInteraction=()=>{const{destroyDismissInteraction:t,parentPopover:e,triggerAction:i,triggerEl:o,el:r}=this;e&&o&&(t&&t(),this.destroyDismissInteraction=((t,e,i,o)=>{let r=[];const n=W(o).querySelector(".popover-content");switch(e){case"hover":r=[{eventName:"mouseenter",callback:e=>{document.elementFromPoint(e.clientX,e.clientY)!==t&&i.dismiss(void 0,void 0,!1)}}];break;case"context-menu":case"click":default:r=[{eventName:"click",callback:e=>{e.target.closest("[data-ion-popover-trigger]")!==t?i.dismiss(void 0,void 0,!1):e.stopPropagation()}}]}return r.forEach((({eventName:t,callback:e})=>n.addEventListener(t,e))),()=>{r.forEach((({eventName:t,callback:e})=>n.removeEventListener(t,e)))}})(o,i,r,e))}}onTriggerChange(){this.configureTriggerInteraction()}onIsOpenChange(t,e){!0===t&&!1===e?this.present():!1===t&&!0===e&&this.dismiss()}connectedCallback(){v(this.el)}componentWillLoad(){this.popoverId=this.el.hasAttribute("id")?this.el.getAttribute("id"):`ion-popover-${this.popoverIndex}`,this.parentPopover=this.el.closest(`ion-popover:not(#${this.popoverId})`),void 0===this.alignment&&(this.alignment="ios"===l(this)?"center":"start")}componentDidLoad(){const{parentPopover:t,isOpen:e}=this;!0===e&&T((()=>this.present())),t&&S(t,"ionPopoverWillDismiss",(()=>{this.dismiss(void 0,void 0,!1)})),this.configureTriggerInteraction()}async presentFromTrigger(t,e=!1){this.focusDescendantOnPresent=e,await this.present(t),this.focusDescendantOnPresent=!1}getDelegate(t=!1){if(this.workingDelegate&&!t)return{delegate:this.workingDelegate,inline:this.inline};const e=this.inline=null!==this.el.parentNode&&!this.hasController;return{inline:e,delegate:this.workingDelegate=e?this.delegate||this.coreDelegate:this.delegate}}async present(t){if(this.presented)return;void 0!==this.currentTransition&&await this.currentTransition;const e=Object.assign(Object.assign({},this.componentProps),{popover:this.el}),{inline:i,delegate:o}=this.getDelegate(!0);this.usersElement=await I(o,this.el,this.component,["popover-viewport"],e,i),await _(this.usersElement),this.keyboardEvents||this.configureKeyboardInteraction(),this.configureDismissInteraction(),this.currentTransition=m(this,"popoverEnter",vt,ft,{event:t||this.event,size:this.size,trigger:this.triggerEl,reference:this.reference,side:this.side,align:this.alignment}),await this.currentTransition,this.currentTransition=void 0,this.focusDescendantOnPresent&&k(this.el,this.el)}async dismiss(t,e,i=!0){void 0!==this.currentTransition&&await this.currentTransition;const{destroyKeyboardInteraction:o,destroyDismissInteraction:r}=this;i&&this.parentPopover&&this.parentPopover.dismiss(t,e,i),this.currentTransition=x(this,t,e,"popoverLeave",xt,wt,this.event);const n=await this.currentTransition;if(n){o&&(o(),this.destroyKeyboardInteraction=void 0),r&&(r(),this.destroyDismissInteraction=void 0);const{delegate:t}=this.getDelegate();await L(t,this.usersElement)}return this.currentTransition=void 0,n}async getParentPopover(){return this.parentPopover}onDidDismiss(){return f(this.el,"ionPopoverDidDismiss")}onWillDismiss(){return f(this.el,"ionPopoverWillDismiss")}render(){const t=l(this),{onLifecycle:e,popoverId:i,parentPopover:o,dismissOnSelect:a,side:s,arrow:c,htmlAttributes:p}=this,h=d("desktop"),g=c&&!o;return r(n,Object.assign({"aria-modal":"true","no-router":!0,tabindex:"-1"},p,{style:{zIndex:`${2e4+this.overlayIndex}`},id:i,class:Object.assign(Object.assign({},j(this.cssClass)),{[t]:!0,"popover-translucent":this.translucent,"overlay-hidden":!0,"popover-desktop":h,[`popover-side-${s}`]:!0,"popover-nested":!!o}),onIonPopoverDidPresent:e,onIonPopoverWillPresent:e,onIonPopoverWillDismiss:e,onIonPopoverDidDismiss:e,onIonBackdropTap:this.onBackdropTap}),!o&&r("ion-backdrop",{tappable:this.backdropDismiss,visible:this.showBackdrop,part:"backdrop"}),r("div",{class:"popover-wrapper ion-overlay-wrapper",onClick:a?()=>this.dismiss():void 0},g&&r("div",{class:"popover-arrow",part:"arrow"}),r("div",{class:"popover-content",part:"content"},r("slot",null))))}get el(){return a(this)}static get watchers(){return{trigger:["onTriggerChange"],triggerAction:["onTriggerChange"],isOpen:["onIsOpenChange"]}}},yt={ionPopoverDidPresent:"ionViewDidEnter",ionPopoverWillPresent:"ionViewWillEnter",ionPopoverWillDismiss:"ionViewWillLeave",ionPopoverDidDismiss:"ionViewDidLeave"};let zt=0;kt.style={ios:':host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:flex;position:fixed;align-items:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{opacity:0;z-index:10}.popover-content{display:flex;position:absolute;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:flex;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, #e6e6e6)}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden}.popover-arrow::after{left:3px;top:3px;border-radius:3px;position:absolute;width:14px;height:14px;transform:rotate(45deg);background:var(--background);content:"";z-index:10}[dir=rtl] .popover-arrow::after,:host-context([dir=rtl]) .popover-arrow::after{left:unset;right:unset;right:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{transform:rotate(-90deg)}:host(.popover-side-end) .popover-arrow{transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{transform:rotate(90deg)}@supports (backdrop-filter: blur(0)){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);backdrop-filter:saturate(180%) blur(20px)}}',md:":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:flex;position:fixed;align-items:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{opacity:0;z-index:10}.popover-content{display:flex;position:absolute;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);background:var(--background);box-shadow:var(--box-shadow);overflow:auto;z-index:10}.popover-viewport{--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:flex;flex-direction:column;overflow:hidden}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;transform-origin:left top}[dir=rtl] .popover-content,:host-context([dir=rtl]) .popover-content{transform-origin:right top}.popover-viewport{transition-delay:100ms}"};
19
+ /*!
20
+ * (C) Ionic http://ionicframework.com - MIT License
21
+ */
22
+ const Ct=(t,e)=>{if(1===t.nodeType)return(t.tagName===e.toUpperCase()?[t]:Array.from(t.querySelectorAll(e))).find((e=>e.value===t.value))},jt=class{constructor(t){e(this,t),this.ionChange=i(this,"ionChange",7),this.ionCancel=i(this,"ionCancel",7),this.ionDismiss=i(this,"ionDismiss",7),this.ionFocus=i(this,"ionFocus",7),this.ionBlur=i(this,"ionBlur",7),this.ionStyle=i(this,"ionStyle",7),this.inputId="ion-sel-"+Lt++,this.didInit=!1,this.isExpanded=!1,this.disabled=!1,this.cancelText="Cancel",this.okText="OK",this.name=this.inputId,this.multiple=!1,this.interface="alert",this.interfaceOptions={},this.onClick=t=>{this.setFocus(),this.open(t)},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()}}styleChanged(){this.emitStyle()}valueChanged(){this.emitStyle(),this.didInit&&this.ionChange.emit({value:this.value})}async connectedCallback(){this.updateOverlayOptions(),this.emitStyle(),this.mutationO=((t,e,i)=>{if("undefined"==typeof MutationObserver)return;const o=new MutationObserver((t=>{i(((t,e)=>{let i;t.forEach((t=>{for(let o=0;o<t.addedNodes.length;o++)i=Ct(t.addedNodes[o],e)||i}))})(t,"ion-select-option"))}));return o.observe(t,{childList:!0,subtree:!0}),o})(this.el,0,(async()=>{this.updateOverlayOptions()}))}disconnectedCallback(){this.mutationO&&(this.mutationO.disconnect(),this.mutationO=void 0)}componentDidLoad(){this.didInit=!0}async open(t){if(this.disabled||this.isExpanded)return;this.isExpanded=!0;const e=this.overlay=await this.createOverlay(t);if(e.onDidDismiss().then((()=>{this.overlay=void 0,this.isExpanded=!1,this.ionDismiss.emit(),this.setFocus()})),await e.present(),"popover"===this.interface){let t=this.childOpts.map((t=>t.value)).indexOf(this.value);t=t>-1?t:0;const i=e.querySelector(`.select-interface-option:nth-child(${t+1})`);i&&E(i)}return e}createOverlay(t){let e=this.interface;return"action-sheet"===e&&this.multiple&&(console.warn(`Select interface cannot be "${e}" with a multi-value select. Using the "alert" interface instead.`),e="alert"),"popover"!==e||t||(console.warn(`Select interface cannot be a "${e}" without passing an event. Using the "alert" interface instead.`),e="alert"),"action-sheet"===e?this.openActionSheet():"popover"===e?this.openPopover(t):this.openAlert()}updateOverlayOptions(){const t=this.overlay;if(!t)return;const e=this.childOpts,i=this.value;switch(this.interface){case"action-sheet":t.buttons=this.createActionSheetButtons(e,i);break;case"popover":const o=t.querySelector("ion-select-popover");o&&(o.options=this.createPopoverOptions(e,i));break;case"alert":t.inputs=this.createAlertInputs(e,this.multiple?"checkbox":"radio",i)}}createActionSheetButtons(t,e){const i=t.map((t=>{const i=Ot(t),o=Array.from(t.classList).filter((t=>"hydrated"!==t)).join(" "),r=`${Tt} ${o}`;return{role:Dt(e,i,this.compareWith)?"selected":"",text:t.textContent,cssClass:r,handler:()=>{this.value=i}}}));return i.push({text:this.cancelText,role:"cancel",handler:()=>{this.ionCancel.emit()}}),i}createAlertInputs(t,e,i){return t.map((t=>{const o=Ot(t),r=Array.from(t.classList).filter((t=>"hydrated"!==t)).join(" ");return{type:e,cssClass:`${Tt} ${r}`,label:t.textContent||"",value:o,checked:Dt(i,o,this.compareWith),disabled:t.disabled}}))}createPopoverOptions(t,e){return t.map((t=>{const i=Ot(t),o=Array.from(t.classList).filter((t=>"hydrated"!==t)).join(" ");return{text:t.textContent||"",cssClass:`${Tt} ${o}`,value:i,checked:Dt(e,i,this.compareWith),disabled:t.disabled,handler:t=>{this.value=t,this.multiple||this.close()}}}))}async openPopover(t){const e=this.interfaceOptions,i=l(this),o="md"!==i,r=this.multiple,n=this.value;let a=t,s="auto";const d=this.el.closest("ion-item");d&&(d.classList.contains("item-label-floating")||d.classList.contains("item-label-stacked"))&&(a=Object.assign(Object.assign({},t),{detail:{ionShadowTarget:d}}),s="cover");const c=Object.assign(Object.assign({mode:i,event:a,alignment:"center",size:s,showBackdrop:o},e),{component:"ion-select-popover",cssClass:["select-popover",e.cssClass],componentProps:{header:e.header,subHeader:e.subHeader,message:e.message,multiple:r,value:n,options:this.createPopoverOptions(this.childOpts,n)}});return y.create(c)}async openActionSheet(){const t=l(this),e=this.interfaceOptions,i=Object.assign(Object.assign({mode:t},e),{buttons:this.createActionSheetButtons(this.childOpts,this.value),cssClass:["select-action-sheet",e.cssClass]});return z.create(i)}async openAlert(){const t=this.getLabel(),e=t?t.textContent:null,i=this.interfaceOptions,o=this.multiple?"checkbox":"radio",r=l(this),n=Object.assign(Object.assign({mode:r},i),{header:i.header?i.header:e,inputs:this.createAlertInputs(this.childOpts,o,this.value),buttons:[{text:this.cancelText,role:"cancel",handler:()=>{this.ionCancel.emit()}},{text:this.okText,handler:t=>{this.value=t}}],cssClass:["select-alert",i.cssClass,this.multiple?"multiple-select-alert":"single-select-alert"]});return C.create(n)}close(){return this.overlay?this.overlay.dismiss():Promise.resolve(!1)}getLabel(){return Y(this.el)}hasValue(){return""!==this.getText()}get childOpts(){return Array.from(this.el.querySelectorAll("ion-select-option"))}getText(){const t=this.selectedText;return null!=t&&""!==t?t:$t(this.childOpts,this.value,this.compareWith)}setFocus(){this.focusEl&&this.focusEl.focus()}emitStyle(){this.ionStyle.emit({interactive:!0,"interactive-disabled":this.disabled,select:!0,"select-disabled":this.disabled,"has-placeholder":void 0!==this.placeholder,"has-value":this.hasValue(),"has-focus":this.isExpanded})}render(){const{disabled:t,el:e,inputId:i,isExpanded:o,name:a,placeholder:s,value:d}=this,c=l(this),{labelText:p,labelId:h}=N(e,i);B(!0,e,a,At(d),t);let g=!1,b=this.getText();""===b&&void 0!==s&&(b=s,g=!0);const u={"select-text":!0,"select-placeholder":g},m=g?"placeholder":"text",v=void 0!==p?""!==b?`${b}, ${p}`:p:b;return r(n,{onClick:this.onClick,role:"button","aria-haspopup":"listbox","aria-disabled":t?"true":null,"aria-label":v,class:{[c]:!0,"in-item":D("ion-item",e),"select-disabled":t,"select-expanded":o}},r("div",{"aria-hidden":"true",class:u,part:m},b),r("div",{class:"select-icon",role:"presentation",part:"icon"},r("div",{class:"select-icon-inner"})),r("label",{id:h},v),r("button",{type:"button",disabled:t,id:i,"aria-labelledby":h,"aria-haspopup":"listbox","aria-expanded":`${o}`,onFocus:this.onFocus,onBlur:this.onBlur,ref:t=>this.focusEl=t}))}get el(){return a(this)}static get watchers(){return{disabled:["styleChanged"],placeholder:["styleChanged"],isExpanded:["styleChanged"],value:["valueChanged"]}}},Dt=(t,e,i)=>void 0!==t&&(Array.isArray(t)?t.some((t=>Pt(t,e,i))):Pt(t,e,i)),Ot=t=>{const e=t.value;return void 0===e?t.textContent||"":e},At=t=>{if(null!=t)return Array.isArray(t)?t.join(","):t.toString()},Pt=(t,e,i)=>"function"==typeof i?i(t,e):"string"==typeof i?t[i]===e[i]:Array.isArray(e)?e.includes(t):t===e,$t=(t,e,i)=>void 0===e?"":Array.isArray(e)?e.map((e=>It(t,e,i))).filter((t=>null!==t)).join(", "):It(t,e,i)||"",It=(t,e,i)=>{const o=t.find((t=>Pt(Ot(t),e,i)));return o?o.textContent:null};let Lt=0;const Tt="select-interface-option";jt.style={ios:":host{--placeholder-color:currentColor;--placeholder-opacity:0.33;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;align-items:center;font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static;max-width:45%}:host(.select-disabled){opacity:0.4;pointer-events:none}:host(.ion-focused) button{border:2px solid #5e9ed6}.select-placeholder{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;appearance:none;outline:none;display:flex;align-items:center;opacity:0}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}button{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.select-icon{position:relative}.select-text{flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.select-icon-inner{left:5px;top:50%;margin-top:-2px;position:absolute;width:0;height:0;border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent;color:currentColor;pointer-events:none}[dir=rtl] .select-icon-inner,:host-context([dir=rtl]) .select-icon-inner{left:unset;right:unset;right:5px}:host{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:20px}.select-icon{width:12px;height:18px;opacity:0.33}",md:":host{--placeholder-color:currentColor;--placeholder-opacity:0.33;padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);display:flex;position:relative;align-items:center;font-family:var(--ion-font-family, inherit);overflow:hidden;z-index:2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){:host{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}:host(.in-item){position:static;max-width:45%}:host(.select-disabled){opacity:0.4;pointer-events:none}:host(.ion-focused) button{border:2px solid #5e9ed6}.select-placeholder{color:var(--placeholder-color);opacity:var(--placeholder-opacity)}label{left:0;top:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;position:absolute;width:100%;height:100%;border:0;background:transparent;cursor:pointer;appearance:none;outline:none;display:flex;align-items:center;opacity:0}[dir=rtl] label,:host-context([dir=rtl]) label{left:unset;right:unset;right:0}label::-moz-focus-inner{border:0}button{position:absolute;top:0;left:0;right:0;bottom:0;width:100%;height:100%;margin:0;padding:0;border:0;outline:0;clip:rect(0 0 0 0);opacity:0;overflow:hidden;-webkit-appearance:none;-moz-appearance:none}.select-icon{position:relative}.select-text{flex:1;min-width:16px;font-size:inherit;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.select-icon-inner{left:5px;top:50%;margin-top:-2px;position:absolute;width:0;height:0;border-top:5px solid;border-right:5px solid transparent;border-left:5px solid transparent;color:currentColor;pointer-events:none}[dir=rtl] .select-icon-inner,:host-context([dir=rtl]) .select-icon-inner{left:unset;right:unset;right:5px}:host{--padding-top:10px;--padding-end:0;--padding-bottom:10px;--padding-start:16px}.select-icon{width:19px;height:19px;transition:transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:0.55}:host-context(.item-label-stacked) .select-icon,:host-context(.item-label-floating:not(.item-fill-outline)) .select-icon,:host-context(.item-label-floating.item-fill-outline){transform:translate3d(0, -9px, 0)}:host-context(.item-has-focus) .select-icon{transform:rotate(180deg)}:host-context(.item-has-focus.item-label-stacked) .select-icon,:host-context(.item-has-focus.item-label-floating:not(.item-fill-outline)) .select-icon{transform:translate3d(0, -9px, 0) rotate(180deg)}:host-context(ion-item.ion-focused) .select-icon,:host-context(.item-has-focus) .select-icon{color:var(--highlight-color-focused);opacity:1}"};const Wt=class{constructor(t){e(this,t),this.inputId="ion-selopt-"+St++,this.disabled=!1}render(){return r(n,{role:"option",id:this.inputId,class:l(this)})}get el(){return a(this)}};let St=0;Wt.style=":host{display:none}";const Et=class{constructor(t){e(this,t),this.options=[]}onSelect(t){this.setChecked(t),this.callOptionHandler(t)}findOptionFromEvent(t){const{options:e}=this;return e.find((e=>e.value===t.target.value))}callOptionHandler(t){const e=this.findOptionFromEvent(t),i=this.getValues(t);(null==e?void 0:e.handler)&&w(e.handler,i)}rbClick(t){this.callOptionHandler(t)}setChecked(t){const{multiple:e}=this,i=this.findOptionFromEvent(t);e&&i&&(i.checked=t.detail.checked)}getValues(t){const{multiple:e,options:i}=this;if(e)return i.filter((t=>t.checked)).map((t=>t.value));const o=this.findOptionFromEvent(t);return o?o.value:void 0}renderOptions(t){const{multiple:e}=this;switch(e){case!0:return this.renderCheckboxOptions(t);default:return this.renderRadioOptions(t)}}renderCheckboxOptions(t){return t.map((t=>r("ion-item",{class:j(t.cssClass)},r("ion-checkbox",{slot:"start",value:t.value,disabled:t.disabled,checked:t.checked}),r("ion-label",null,t.text))))}renderRadioOptions(t){const e=t.filter((t=>t.checked)).map((t=>t.value))[0];return r("ion-radio-group",{value:e},t.map((t=>r("ion-item",{class:j(t.cssClass)},r("ion-label",null,t.text),r("ion-radio",{value:t.value,disabled:t.disabled,onClick:t=>this.rbClick(t)})))))}render(){const{header:t,message:e,options:i,subHeader:o}=this,a=void 0!==o||void 0!==e;return r(n,{class:l(this)},r("ion-list",null,void 0!==t&&r("ion-list-header",null,t),a&&r("ion-item",null,r("ion-label",{class:"ion-text-wrap"},void 0!==o&&r("h3",null,o),void 0!==e&&r("p",null,e))),this.renderOptions(i)))}};Et.style={ios:".sc-ion-select-popover-ios-h ion-list.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-ios,ion-label.sc-ion-select-popover-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}",md:".sc-ion-select-popover-md-h ion-list.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list-header.sc-ion-select-popover-md,ion-label.sc-ion-select-popover-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}ion-list.sc-ion-select-popover-md ion-radio.sc-ion-select-popover-md{opacity:0}ion-item.sc-ion-select-popover-md{--inner-border-width:0}.item-radio-checked.sc-ion-select-popover-md{--background:rgba(var(--ion-color-primary-rgb, 56, 128, 255), 0.08);--background-focused:var(--ion-color-primary, #3880ff);--background-focused-opacity:0.2;--background-hover:var(--ion-color-primary, #3880ff);--background-hover-opacity:0.12}.item-checkbox-checked.sc-ion-select-popover-md{--background-activated:var(--ion-item-color, var(--ion-text-color, #000));--background-focused:var(--ion-item-color, var(--ion-text-color, #000));--background-hover:var(--ion-item-color, var(--ion-text-color, #000));--color:var(--ion-color-primary, #3880ff)}"};const Yt=class{constructor(t){e(this,t),this.ionChange=i(this,"ionChange",7),this.ionInput=i(this,"ionInput",7),this.ionStyle=i(this,"ionStyle",7),this.ionBlur=i(this,"ionBlur",7),this.ionFocus=i(this,"ionFocus",7),this.inputId="ion-textarea-"+Nt++,this.didBlurAfterEdit=!1,this.inheritedAttributes={},this.fireFocusEvents=!0,this.hasFocus=!1,this.autocapitalize="none",this.autofocus=!1,this.clearOnEdit=!1,this.debounce=0,this.disabled=!1,this.name=this.inputId,this.readonly=!1,this.required=!1,this.spellcheck=!1,this.autoGrow=!1,this.value="",this.onInput=t=>{this.nativeInput&&(this.value=this.nativeInput.value),this.emitStyle(),this.ionInput.emit(t)},this.onFocus=t=>{this.hasFocus=!0,this.focusChange(),this.fireFocusEvents&&this.ionFocus.emit(t)},this.onBlur=t=>{this.hasFocus=!1,this.focusChange(),this.fireFocusEvents&&this.ionBlur.emit(t)},this.onKeyDown=()=>{this.checkClearOnEdit()}}debounceChanged(){this.ionChange=H(this.ionChange,this.debounce)}disabledChanged(){this.emitStyle()}valueChanged(){const t=this.nativeInput,e=this.getValue();t&&t.value!==e&&(t.value=e),this.runAutoGrow(),this.emitStyle(),this.ionChange.emit({value:e})}connectedCallback(){this.emitStyle(),this.debounceChanged(),document.dispatchEvent(new CustomEvent("ionInputDidLoad",{detail:this.el}))}disconnectedCallback(){document.dispatchEvent(new CustomEvent("ionInputDidUnload",{detail:this.el}))}componentWillLoad(){this.inheritedAttributes=Object.assign(Object.assign({},X(this.el)),V(this.el,["title"]))}componentDidLoad(){this.runAutoGrow()}async setFocus(){this.nativeInput&&this.nativeInput.focus()}async setBlur(){this.nativeInput&&this.nativeInput.blur()}getInputElement(){return Promise.resolve(this.nativeInput)}emitStyle(){this.ionStyle.emit({interactive:!0,textarea:!0,input:!0,"interactive-disabled":this.disabled,"has-placeholder":void 0!==this.placeholder,"has-value":this.hasValue(),"has-focus":this.hasFocus})}runAutoGrow(){this.nativeInput&&this.autoGrow&&t((()=>{var t;this.textareaWrapper&&(this.textareaWrapper.dataset.replicatedValue=null!==(t=this.value)&&void 0!==t?t:"")}))}checkClearOnEdit(){this.clearOnEdit&&(this.didBlurAfterEdit&&this.hasValue()&&(this.value=""),this.didBlurAfterEdit=!1)}focusChange(){this.clearOnEdit&&!this.hasFocus&&this.hasValue()&&(this.didBlurAfterEdit=!0),this.emitStyle()}hasValue(){return""!==this.getValue()}getValue(){return this.value||""}render(){const t=l(this),e=this.getValue(),i=this.inputId+"-lbl",o=Y(this.el);return o&&(o.id=i),r(n,{"aria-disabled":this.disabled?"true":null,class:O(this.color,{[t]:!0})},r("div",{class:"textarea-wrapper",ref:t=>this.textareaWrapper=t},r("textarea",Object.assign({class:"native-textarea","aria-labelledby":o?i:null,ref:t=>this.nativeInput=t,autoCapitalize:this.autocapitalize,autoFocus:this.autofocus,enterKeyHint:this.enterkeyhint,inputMode:this.inputmode,disabled:this.disabled,maxLength:this.maxlength,minLength:this.minlength,name:this.name,placeholder:this.placeholder||"",readOnly:this.readonly,required:this.required,spellcheck:this.spellcheck,cols:this.cols,rows:this.rows,wrap:this.wrap,onInput:this.onInput,onBlur:this.onBlur,onFocus:this.onFocus,onKeyDown:this.onKeyDown},this.inheritedAttributes),e)))}get el(){return a(this)}static get watchers(){return{debounce:["debounceChanged"],disabled:["disabledChanged"],value:["valueChanged"]}}};let Nt=0;Yt.style={ios:'.sc-ion-textarea-ios-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;box-sizing:border-box}.ion-color.sc-ion-textarea-ios-h{background:initial}.ion-color.sc-ion-textarea-ios-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-ios-h,ion-item .sc-ion-textarea-ios-h{align-self:baseline}ion-item.sc-ion-textarea-ios-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-ios-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-ios{display:grid;min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.textarea-wrapper.sc-ion-textarea-ios::after{white-space:pre-wrap;content:attr(data-replicated-value) " ";visibility:hidden}.native-textarea.sc-ion-textarea-ios,.textarea-wrapper.sc-ion-textarea-ios::after{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;grid-area:1/1/2/2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-ios,.textarea-wrapper.sc-ion-textarea-ios::after{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-ios{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;resize:none;appearance:none;overflow:hidden}.native-textarea.sc-ion-textarea-ios::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-ios{opacity:0.4}.cloned-input.sc-ion-textarea-ios{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-ios .cloned-input.sc-ion-textarea-ios,[dir=rtl].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios,[dir=rtl] .sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{left:unset;right:unset;right:0}[auto-grow].sc-ion-textarea-ios-h .cloned-input.sc-ion-textarea-ios{height:100%}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-ios-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-ios-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-ios-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-ios-h{--padding-top:10px;--padding-end:10px;--padding-bottom:10px;--padding-start:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-ios-h,.item-label-stacked .sc-ion-textarea-ios-h,.item-label-floating.sc-ion-textarea-ios-h,.item-label-floating .sc-ion-textarea-ios-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0px}',md:'.sc-ion-textarea-md-h{--background:initial;--color:initial;--placeholder-color:initial;--placeholder-font-style:initial;--placeholder-font-weight:initial;--placeholder-opacity:0.5;--padding-top:0;--padding-end:0;--padding-bottom:0;--padding-start:0;--border-radius:0;display:block;position:relative;flex:1;width:100%;background:var(--background);color:var(--color);font-family:var(--ion-font-family, inherit);white-space:pre-wrap;z-index:2;box-sizing:border-box}.ion-color.sc-ion-textarea-md-h{background:initial}.ion-color.sc-ion-textarea-md-h{color:var(--ion-color-base)}ion-item.sc-ion-textarea-md-h,ion-item .sc-ion-textarea-md-h{align-self:baseline}ion-item.sc-ion-textarea-md-h:not(.item-label),ion-item:not(.item-label) .sc-ion-textarea-md-h{--padding-start:0}.textarea-wrapper.sc-ion-textarea-md{display:grid;min-width:inherit;max-width:inherit;min-height:inherit;max-height:inherit}.textarea-wrapper.sc-ion-textarea-md::after{white-space:pre-wrap;content:attr(data-replicated-value) " ";visibility:hidden}.native-textarea.sc-ion-textarea-md,.textarea-wrapper.sc-ion-textarea-md::after{padding-left:var(--padding-start);padding-right:var(--padding-end);padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;grid-area:1/1/2/2}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.native-textarea.sc-ion-textarea-md,.textarea-wrapper.sc-ion-textarea-md::after{padding-left:unset;padding-right:unset;-webkit-padding-start:var(--padding-start);padding-inline-start:var(--padding-start);-webkit-padding-end:var(--padding-end);padding-inline-end:var(--padding-end)}}.native-textarea.sc-ion-textarea-md{border-radius:var(--border-radius);margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;display:block;width:100%;max-width:100%;max-height:100%;border:0;outline:none;background:transparent;box-sizing:border-box;resize:none;appearance:none;overflow:hidden}.native-textarea.sc-ion-textarea-md::placeholder{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;color:var(--placeholder-color);font-family:inherit;font-style:var(--placeholder-font-style);font-weight:var(--placeholder-font-weight);opacity:var(--placeholder-opacity)}.native-textarea[disabled].sc-ion-textarea-md{opacity:0.4}.cloned-input.sc-ion-textarea-md{left:0;top:0;position:absolute;pointer-events:none}[dir=rtl].sc-ion-textarea-md .cloned-input.sc-ion-textarea-md,[dir=rtl].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md,[dir=rtl] .sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{left:unset;right:unset;right:0}[auto-grow].sc-ion-textarea-md-h .cloned-input.sc-ion-textarea-md{height:100%}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value),.item-label-floating.item-has-placeholder:not(.item-has-value) .sc-ion-textarea-md-h{opacity:0}.item-label-floating.item-has-placeholder.sc-ion-textarea-md-h:not(.item-has-value).item-has-focus,.item-label-floating.item-has-placeholder:not(.item-has-value).item-has-focus .sc-ion-textarea-md-h{transition:opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);opacity:1}.sc-ion-textarea-md-h{--padding-top:10px;--padding-end:0;--padding-bottom:11px;--padding-start:8px;margin-left:0;margin-right:0;margin-top:8px;margin-bottom:0;font-size:inherit}.item-label-stacked.sc-ion-textarea-md-h,.item-label-stacked .sc-ion-textarea-md-h,.item-label-floating.sc-ion-textarea-md-h,.item-label-floating .sc-ion-textarea-md-h{--padding-top:8px;--padding-bottom:8px;--padding-start:0}'};export{q as ion_action_sheet,et as ion_alert,kt as ion_popover,jt as ion_select,Wt as ion_select_option,Et as ion_select_popover,Yt as ion_textarea}
@@ -1 +1 @@
1
- import{r as s,h as t,H as i}from"./p-ee1e0eb4.js";const e=class{constructor(t){s(this,t),this.showInstantResult=!1,this.submitted=!1,this.answers={}}pageDidLoadHandler(s){s&&(this.pageInfo=s.detail.pageInfo,console.log("pageInfo",this.pageInfo))}updateQuizAnswerModelHandler(s){s.detail.question&&(this.answers[s.detail.question.questionId]={question:s.detail.question,answer:s.detail.answer}),console.log(this.answers)}submitQuiz(){this.submitted=!0,console.log({pageInfo:this.pageInfo,quiz:this.answers})}render(){return t(i,null,this.questionIds&&this.questionIds.split(",").map((s=>t("sparkle-quiz",{questionId:+s,submitted:this.submitted,showInstantResult:this.showInstantResult}))),t("ion-button",{slot:"end",onClick:()=>this.submitQuiz()},"Submit"))}};e.style=":host{display:block}";export{e as sparkle_quiz_container}
1
+ import{r as s,h as t,H as i}from"./p-ee1e0eb4.js";const e=class{constructor(t){s(this,t),this.showInstantResult=!1,this.submitted=!1,this.answers={}}pageDidLoadHandler(s){s&&(this.pageInfo=s.detail.pageInfo,console.log("pageInfo",this.pageInfo))}updateQuizAnswerModelHandler(s){s.detail.question&&(this.answers[s.detail.question.questionId]={question:s.detail.question,answer:s.detail.answer}),console.log(this.answers)}submitQuiz(){this.submitted=!0,console.log({pageInfo:this.pageInfo,quiz:this.answers})}render(){return t(i,null,this.questionIds&&this.questionIds.split(",").map((s=>t("sparkle-quiz-v1",{questionId:+s,submitted:this.submitted,showInstantResult:this.showInstantResult}))),t("ion-button",{slot:"end",onClick:()=>this.submitQuiz()},"Submit"))}};e.style=":host{display:block}";export{e as sparkle_quiz_container}
@@ -0,0 +1 @@
1
+ import{a as e,u as t,f as r,s as o,T as n}from"./p-2f569553.js";import{t as i}from"./p-ff7a8a71.js";import{E as a}from"./p-bd90903e.js";import{T as f}from"./p-7dae0f0e.js";var s=e,u=Object.prototype.hasOwnProperty,c={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,p=String.prototype.split,d=Array.prototype.push,m=function(e,t){d.apply(e,l(t)?t:[t])},y=Date.prototype.toISOString,v=r.default,b={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:t.encode,encodeValuesOnly:!1,format:v,formatter:r.formatters[v],indices:!1,serializeDate:function(e){return y.call(e)},skipNulls:!1,strictNullHandling:!1},w={},h=function e(r,n,i,a,f,s,u,c,d,y,v,h,g,j,k){for(var E,T=r,D=k,P=0,S=!1;void 0!==(D=D.get(w))&&!S;){var O=D.get(r);if(P+=1,void 0!==O){if(O===P)throw new RangeError("Cyclic object value");S=!0}void 0===D.get(w)&&(P=0)}if("function"==typeof u?T=u(n,T):T instanceof Date?T=y(T):"comma"===i&&l(T)&&(T=t.maybeMap(T,(function(e){return e instanceof Date?y(e):e}))),null===T){if(a)return s&&!g?s(n,b.encoder,j,"key",v):n;T=""}if("string"==typeof(E=T)||"number"==typeof E||"boolean"==typeof E||"symbol"==typeof E||"bigint"==typeof E||t.isBuffer(T)){if(s){var N=g?n:s(n,b.encoder,j,"key",v);if("comma"===i&&g){for(var x=p.call(String(T),","),z="",C=0;C<x.length;++C)z+=(0===C?"":",")+h(s(x[C],b.encoder,j,"value",v));return[h(N)+"="+z]}return[h(N)+"="+h(s(T,b.encoder,j,"value",v))]}return[h(n)+"="+h(String(T))]}var H,U=[];if(void 0===T)return U;if("comma"===i&&l(T))H=[{value:T.length>0?T.join(",")||null:void 0}];else if(l(u))H=u;else{var A=Object.keys(T);H=c?A.sort(c):A}for(var B=0;B<H.length;++B){var Q=H[B],R="object"==typeof Q&&void 0!==Q.value?Q.value:T[Q];if(!f||null!==R){var V=l(T)?"function"==typeof i?i(n,Q):n:n+(d?"."+Q:"["+Q+"]");k.set(r,P);var I=o();I.set(w,k),m(U,e(R,V,i,a,f,s,u,c,d,y,v,h,g,j,I))}}return U};class g{constructor(){}static getInstance(){return g.instance||(g.instance=new g),g.instance}static init(){var e=a.getInstance().get("sparkle");this.http=s.create({baseURL:e.apiUrl,headers:{"Content-Type":"application/json"},timeout:3e4,paramsSerializer:function(e){return function(e,t){var n,i=e,a=function(e){if(!e)return b;if(null!=e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||b.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var o=r.default;if(void 0!==e.format){if(!u.call(r.formatters,e.format))throw new TypeError("Unknown format option provided.");o=e.format}var n=r.formatters[o],i=b.filter;return("function"==typeof e.filter||l(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:b.addQueryPrefix,allowDots:void 0===e.allowDots?b.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:b.charsetSentinel,delimiter:void 0===e.delimiter?b.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:b.encode,encoder:"function"==typeof e.encoder?e.encoder:b.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:b.encodeValuesOnly,filter:i,format:o,formatter:n,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:b.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:b.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:b.strictNullHandling}}(t);"function"==typeof a.filter?i=(0,a.filter)("",i):l(a.filter)&&(n=a.filter);var f=[];if("object"!=typeof i||null===i)return"";var s=c[t&&t.arrayFormat in c?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices"];n||(n=Object.keys(i)),a.sort&&n.sort(a.sort);for(var p=o(),d=0;d<n.length;++d){var y=n[d];a.skipNulls&&null===i[y]||m(f,h(i[y],y,s,a.strictNullHandling,a.skipNulls,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,p))}var v=f.join(a.delimiter),w=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&(w+="iso-8859-1"===a.charset?"utf8=%26%2310003%3B&":"utf8=%E2%9C%93&"),v.length>0?w+v:""}(e,{encode:!1})}}),this.http.interceptors.request.use((async function(t){let r=await f.getInstance().getToken();return r&&(t.headers.common.Authorization="Bearer "+r),t.headers.common["Sparkle.CourseId"]=e.courseId,console.log(n.state.pageInfo),n.state.pageInfo&&(t.headers.common["Sparkle.CourseModuleId"]=n.state.pageInfo.courseModuleId,t.headers.common["Sparkle.SessionId"]=n.state.pageInfo.sessionId,t.headers.common["Sparkle.PageId"]=n.state.pageInfo.pageId),t}),(function(e){return Promise.reject(e)})),this.http.interceptors.response.use((async e=>(e.data.Message&&(await i.create({message:e.data.Message,duration:3e3})).present(),e.data.Failed?null:e.data)),(async e=>e.response&&e.response.data&&e.response.data.ErrorMessage?((await i.create({message:e.response.data.ErrorMessage,duration:3e3})).present(),Promise.reject(e)):e.response&&e.response.data&&400==e.response.status?((await i.create({message:e.response.data.Message,duration:3e3})).present(),Promise.reject(e.response.data)):e.response&&e.response.data&&e.response.data.Message?((await i.create({message:e.response.data.Message,duration:3e3})).present(),Promise.reject(e)):(e.request?console.log(e.request):(await i.create({message:"Unknown Error",duration:3e3})).present(),setTimeout((()=>{}),1e3),Promise.reject(e))))}}export{g as H}