@templatical/editor 0.61.0 → 0.62.1

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 (231) hide show
  1. package/LICENSE +21 -109
  2. package/README.md +3 -3
  3. package/dist/{AiAltTextPopover-DSA1wiiW.js → AiAltTextPopover-C1Ike67q.js} +3 -4
  4. package/dist/{AiAltTextReview-B9-vfzCj.js → AiAltTextReview-BjT7_PoG.js} +2 -3
  5. package/dist/{AiChatPanel-DF5TvO9H.js → AiChatPanel-C82fJozf.js} +3 -4
  6. package/dist/{AiPanels-zRqC5DIP.js → AiPanels-sam_GMNs.js} +1 -1
  7. package/dist/{AiRewriteMenu-CmZKTO-O.js → AiRewriteMenu-BG3-appN.js} +3 -4
  8. package/dist/{BlockIssueBadge-Bug5iqcK.js → BlockIssueBadge-D3OmWkCh.js} +2 -3
  9. package/dist/{BlockPreviewCanvas-knSyWaCP.js → BlockPreviewCanvas-oxkPHm78.js} +6 -6
  10. package/dist/{CollaborationNotices-BM35YG72.js → CollaborationNotices-Cmc7Ziuf.js} +1 -1
  11. package/dist/{CollaboratorBar-DMsEOndt.js → CollaboratorBar-DVtWefk1.js} +1 -1
  12. package/dist/{CommentsPanel-BMYvXRKK.js → CommentsPanel-BSt22Zw9.js} +1 -1
  13. package/dist/{cdn/chunks/CommentsSidebar-BEiOQ_zT.js → CommentsSidebar-C8qbxjyN.js} +228 -205
  14. package/dist/{CountdownBlock-AYPypmcX.js → CountdownBlock-bFAELCB6.js} +3 -4
  15. package/dist/{CountdownToolbar-BprSuPJk.js → CountdownToolbar-CJbPEVV5.js} +4 -4
  16. package/dist/{IssuesPanel-CeCvUfa7.js → IssuesPanel-CKYf6K84.js} +4 -5
  17. package/dist/{LanguageMenu-CkGqLYjf.js → LanguageMenu-8yH1Ypum.js} +5 -6
  18. package/dist/{LocaleNotices-D0be8ovO.js → LocaleNotices-24UYFxo2.js} +7 -8
  19. package/dist/{LogicTagInsertButton-BzEZUTRZ.js → LogicTagInsertButton-DdaafrjI.js} +95 -96
  20. package/dist/{MergeTagInput-By2FSStk.js → MergeTagInput-BXM6-eF-.js} +1 -1
  21. package/dist/{MergeTagModeToggle-DtjOZhoD.js → MergeTagModeToggle-ooA_Ytfq.js} +2 -3
  22. package/dist/{MergeTagTextarea-BjHlamJv.js → MergeTagTextarea-B86MPY89.js} +3 -4
  23. package/dist/{ParagraphEditor-Ctu4fSsl.js → ParagraphEditor-B2BpfcoY.js} +78 -79
  24. package/dist/{RestoreVersionDialog-DvZoTJVa.js → RestoreVersionDialog-BF9Wyma8.js} +2 -2
  25. package/dist/{RichTextEditorContent-B1p7Ykq8.js → RichTextEditorContent-BNMBOkdy.js} +5 -6
  26. package/dist/{SaveBlockDialog-DHfT-Tpx.js → SaveBlockDialog-BZQkihki.js} +23 -24
  27. package/dist/{SavedBlocksBrowserModal-BjJuuXQv.js → SavedBlocksBrowserModal-CQNnmeGv.js} +8 -9
  28. package/dist/{SavedBlocksPanels-D6eiMQZ3.js → SavedBlocksPanels-n-IdFD6E.js} +1 -1
  29. package/dist/{SavedBlocksPickBar-BkgCDSXe.js → SavedBlocksPickBar-BtQgXlKF.js} +2 -2
  30. package/dist/{TemplateSettings-DQAbNsiS.js → TemplateSettings-Z-i-_xF5.js} +19 -20
  31. package/dist/{TestEmailModal-m_AEa36T.js → TestEmailModal-IeP1EsJ5.js} +17 -18
  32. package/dist/{TestEmailPanel-OApkuaVd.js → TestEmailPanel-DVxTZJ4H.js} +1 -1
  33. package/dist/{TitleEditor-Cwdtfk15.js → TitleEditor-D1UDQaHM.js} +8 -9
  34. package/dist/{Toolbar-D_T55elL.js → Toolbar-bwAdFK4A.js} +308 -310
  35. package/dist/{TplModal-2MKm5y6r.js → TplModal-BvUeHkqB.js} +4 -4
  36. package/dist/{VersionHistoryMenu-B3-xJ7GO.js → VersionHistoryMenu-qoOkZKal.js} +6 -7
  37. package/dist/{VersionHistoryPanels-CCM0IQBg.js → VersionHistoryPanels-rkOqdUem.js} +1 -1
  38. package/dist/{VersionPreviewBanner-DLAB4ZbS.js → VersionPreviewBanner-DEN9rl6y.js} +1 -1
  39. package/dist/{WrapperBlock-BZl10HLy.js → WrapperBlock-CvEmjNKs.js} +4 -4
  40. package/dist/{blockTypeIcons-C691ZY1l.js → blockTypeIcons-C1S2wVx8.js} +4 -4
  41. package/dist/bundle-stats.json +8 -8
  42. package/dist/{ca-C8N05sCU.js → ca-BIseSbs-.js} +1 -2
  43. package/dist/cdn/chunks/{AiAltTextPopover-BLNN_Pnd.js → AiAltTextPopover-mDx_knAl.js} +4 -5
  44. package/dist/cdn/chunks/{AiAltTextPopover-BLNN_Pnd.js.map → AiAltTextPopover-mDx_knAl.js.map} +1 -1
  45. package/dist/cdn/chunks/{AiAltTextReview-Db8vSNpe.js → AiAltTextReview-Dmg8iVWD.js} +3 -4
  46. package/dist/cdn/chunks/{AiAltTextReview-Db8vSNpe.js.map → AiAltTextReview-Dmg8iVWD.js.map} +1 -1
  47. package/dist/cdn/chunks/{AiChatPanel-BYAsgmoC.js → AiChatPanel-CEDr_x8G.js} +4 -5
  48. package/dist/cdn/chunks/{AiChatPanel-BYAsgmoC.js.map → AiChatPanel-CEDr_x8G.js.map} +1 -1
  49. package/dist/cdn/chunks/{AiPanels-MY_YPls8.js → AiPanels-qJgLTYPs.js} +2 -2
  50. package/dist/cdn/chunks/{AiPanels-MY_YPls8.js.map → AiPanels-qJgLTYPs.js.map} +1 -1
  51. package/dist/cdn/chunks/{AiRewriteMenu-BSePiXe_.js → AiRewriteMenu-DoZh5Q74.js} +4 -5
  52. package/dist/cdn/chunks/{AiRewriteMenu-BSePiXe_.js.map → AiRewriteMenu-DoZh5Q74.js.map} +1 -1
  53. package/dist/cdn/chunks/{BlockIssueBadge-fYeNnepj.js → BlockIssueBadge-D87CYoPw.js} +3 -4
  54. package/dist/cdn/chunks/{BlockIssueBadge-fYeNnepj.js.map → BlockIssueBadge-D87CYoPw.js.map} +1 -1
  55. package/dist/cdn/chunks/{BlockPreviewCanvas-B153A3hu.js → BlockPreviewCanvas-BrxWnLLK.js} +8 -8
  56. package/dist/cdn/chunks/{BlockPreviewCanvas-B153A3hu.js.map → BlockPreviewCanvas-BrxWnLLK.js.map} +1 -1
  57. package/dist/cdn/chunks/{CollaborationNotices-COkmBmps.js → CollaborationNotices-DyzhN_Ns.js} +2 -2
  58. package/dist/cdn/chunks/{CollaborationNotices-COkmBmps.js.map → CollaborationNotices-DyzhN_Ns.js.map} +1 -1
  59. package/dist/cdn/chunks/{CollaboratorBar-BSzI8YIU.js → CollaboratorBar-bNFuQxxP.js} +2 -2
  60. package/dist/cdn/chunks/{CollaboratorBar-BSzI8YIU.js.map → CollaboratorBar-bNFuQxxP.js.map} +1 -1
  61. package/dist/cdn/chunks/{CommentsPanel-R27fqh9O.js → CommentsPanel-D-D2qsS6.js} +2 -2
  62. package/dist/cdn/chunks/{CommentsPanel-R27fqh9O.js.map → CommentsPanel-D-D2qsS6.js.map} +1 -1
  63. package/dist/cdn/chunks/CommentsSidebar-CCVp8M2T.js +479 -0
  64. package/dist/cdn/chunks/CommentsSidebar-CCVp8M2T.js.map +1 -0
  65. package/dist/cdn/chunks/{CountdownBlock--hlKE2aj.js → CountdownBlock-5hUzymeP.js} +4 -5
  66. package/dist/cdn/chunks/{CountdownBlock--hlKE2aj.js.map → CountdownBlock-5hUzymeP.js.map} +1 -1
  67. package/dist/cdn/chunks/{CountdownToolbar-DOhXnbsq.js → CountdownToolbar-DaGxwKfG.js} +5 -5
  68. package/dist/cdn/chunks/{CountdownToolbar-DOhXnbsq.js.map → CountdownToolbar-DaGxwKfG.js.map} +1 -1
  69. package/dist/cdn/chunks/{IssuesPanel-DgxiS3hF.js → IssuesPanel-DQQo1B1z.js} +10 -11
  70. package/dist/cdn/chunks/IssuesPanel-DQQo1B1z.js.map +1 -0
  71. package/dist/cdn/chunks/{LanguageMenu-B6kt8SgX.js → LanguageMenu-CyWfHmkP.js} +6 -7
  72. package/dist/cdn/chunks/{LanguageMenu-B6kt8SgX.js.map → LanguageMenu-CyWfHmkP.js.map} +1 -1
  73. package/dist/cdn/chunks/{LocaleNotices-Bleg4gTu.js → LocaleNotices-DSfOyyyf.js} +8 -9
  74. package/dist/cdn/chunks/{LocaleNotices-Bleg4gTu.js.map → LocaleNotices-DSfOyyyf.js.map} +1 -1
  75. package/dist/cdn/chunks/{LogicTagInsertButton-DGg1Wvhp.js → LogicTagInsertButton-CumMM1rP.js} +7 -8
  76. package/dist/cdn/chunks/{LogicTagInsertButton-DGg1Wvhp.js.map → LogicTagInsertButton-CumMM1rP.js.map} +1 -1
  77. package/dist/cdn/chunks/{MergeTagInput-BVfTwujW.js → MergeTagInput-Dm_QiG96.js} +2 -2
  78. package/dist/cdn/chunks/{MergeTagInput-BVfTwujW.js.map → MergeTagInput-Dm_QiG96.js.map} +1 -1
  79. package/dist/cdn/chunks/{MergeTagModeToggle-BoI0C1Y6.js → MergeTagModeToggle-Bir7lkLe.js} +3 -4
  80. package/dist/cdn/chunks/{MergeTagModeToggle-BoI0C1Y6.js.map → MergeTagModeToggle-Bir7lkLe.js.map} +1 -1
  81. package/dist/cdn/chunks/{MergeTagTextarea-DGDv-pdn.js → MergeTagTextarea-B_IFeWfZ.js} +4 -5
  82. package/dist/cdn/chunks/{MergeTagTextarea-DGDv-pdn.js.map → MergeTagTextarea-B_IFeWfZ.js.map} +1 -1
  83. package/dist/cdn/chunks/{ParagraphEditor-D0q36Myd.js → ParagraphEditor-DUbU-eqS.js} +135 -136
  84. package/dist/cdn/chunks/{ParagraphEditor-D0q36Myd.js.map → ParagraphEditor-DUbU-eqS.js.map} +1 -1
  85. package/dist/cdn/chunks/{RestoreVersionDialog-CJggFdbi.js → RestoreVersionDialog-hDWvu1Fk.js} +3 -3
  86. package/dist/cdn/chunks/{RestoreVersionDialog-CJggFdbi.js.map → RestoreVersionDialog-hDWvu1Fk.js.map} +1 -1
  87. package/dist/cdn/chunks/{RichTextEditorContent-D3ihUF8v.js → RichTextEditorContent-CuvFVxEq.js} +6 -7
  88. package/dist/cdn/chunks/{RichTextEditorContent-D3ihUF8v.js.map → RichTextEditorContent-CuvFVxEq.js.map} +1 -1
  89. package/dist/cdn/chunks/{SaveBlockDialog-BzES5tqd.js → SaveBlockDialog-DVVG78vs.js} +25 -26
  90. package/dist/cdn/chunks/{SaveBlockDialog-BzES5tqd.js.map → SaveBlockDialog-DVVG78vs.js.map} +1 -1
  91. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CLNcZcLd.js → SavedBlocksBrowserModal-CJjVM9pN.js} +9 -10
  92. package/dist/cdn/chunks/{SavedBlocksBrowserModal-CLNcZcLd.js.map → SavedBlocksBrowserModal-CJjVM9pN.js.map} +1 -1
  93. package/dist/cdn/chunks/{SavedBlocksPanels-R0W9LElD.js → SavedBlocksPanels-CUu9BLen.js} +2 -2
  94. package/dist/cdn/chunks/{SavedBlocksPanels-R0W9LElD.js.map → SavedBlocksPanels-CUu9BLen.js.map} +1 -1
  95. package/dist/cdn/chunks/{SavedBlocksPickBar-JNi5Rx4V.js → SavedBlocksPickBar-ClGm41Wt.js} +3 -3
  96. package/dist/cdn/chunks/{SavedBlocksPickBar-JNi5Rx4V.js.map → SavedBlocksPickBar-ClGm41Wt.js.map} +1 -1
  97. package/dist/cdn/chunks/{TemplateSettings-C5wsNcgX.js → TemplateSettings-B8Ch5ps8.js} +20 -21
  98. package/dist/cdn/chunks/{TemplateSettings-C5wsNcgX.js.map → TemplateSettings-B8Ch5ps8.js.map} +1 -1
  99. package/dist/cdn/chunks/{TestEmailModal-BxIAwjww.js → TestEmailModal-BtrjByCC.js} +16 -17
  100. package/dist/cdn/chunks/{TestEmailModal-BxIAwjww.js.map → TestEmailModal-BtrjByCC.js.map} +1 -1
  101. package/dist/cdn/chunks/{TestEmailPanel-B8BsWXjE.js → TestEmailPanel-EjyQvj_M.js} +2 -2
  102. package/dist/cdn/chunks/{TestEmailPanel-B8BsWXjE.js.map → TestEmailPanel-EjyQvj_M.js.map} +1 -1
  103. package/dist/cdn/chunks/{TitleEditor-DhcI1aRS.js → TitleEditor-B0SHe63R.js} +17 -18
  104. package/dist/cdn/chunks/{TitleEditor-DhcI1aRS.js.map → TitleEditor-B0SHe63R.js.map} +1 -1
  105. package/dist/cdn/chunks/{Toolbar-Ch3h2BUs.js → Toolbar-BnTSuZQb.js} +310 -312
  106. package/dist/cdn/chunks/Toolbar-BnTSuZQb.js.map +1 -0
  107. package/dist/cdn/chunks/{TplModal-CPOqOxVf.js → TplModal-uqelrGih.js} +5 -5
  108. package/dist/cdn/chunks/{TplModal-CPOqOxVf.js.map → TplModal-uqelrGih.js.map} +1 -1
  109. package/dist/cdn/chunks/{VersionHistoryMenu-DTDO48HI.js → VersionHistoryMenu-DlPr3twf.js} +7 -8
  110. package/dist/cdn/chunks/{VersionHistoryMenu-DTDO48HI.js.map → VersionHistoryMenu-DlPr3twf.js.map} +1 -1
  111. package/dist/cdn/chunks/{VersionHistoryPanels-CVrXHYxT.js → VersionHistoryPanels-B1DN6c4B.js} +2 -2
  112. package/dist/cdn/chunks/{VersionHistoryPanels-CVrXHYxT.js.map → VersionHistoryPanels-B1DN6c4B.js.map} +1 -1
  113. package/dist/cdn/chunks/{VersionPreviewBanner-C1H_fYAr.js → VersionPreviewBanner-anJgZOcw.js} +2 -2
  114. package/dist/cdn/chunks/VersionPreviewBanner-anJgZOcw.js.map +1 -0
  115. package/dist/cdn/chunks/{WrapperBlock-B8SJ7Q4w.js → WrapperBlock-CUuF8Ese.js} +5 -5
  116. package/dist/cdn/chunks/{WrapperBlock-B8SJ7Q4w.js.map → WrapperBlock-CUuF8Ese.js.map} +1 -1
  117. package/dist/cdn/chunks/{ca-C8N05sCU.js → ca-BIseSbs-.js} +2 -3
  118. package/dist/cdn/chunks/{ca-C8N05sCU.js.map → ca-BIseSbs-.js.map} +1 -1
  119. package/dist/cdn/chunks/{composables-CKXPwWo9.js → composables-CuAVj7Ex.js} +444 -464
  120. package/dist/cdn/chunks/composables-CuAVj7Ex.js.map +1 -0
  121. package/dist/{da-Dno_4nGy.js → cdn/chunks/da-DN46iRXS.js} +3 -2
  122. package/dist/cdn/chunks/{da-Dno_4nGy.js.map → da-DN46iRXS.js.map} +1 -1
  123. package/dist/{de-DRR5JSkh.js → cdn/chunks/de-Dyk8PPCm.js} +3 -2
  124. package/dist/cdn/chunks/{de-DRR5JSkh.js.map → de-Dyk8PPCm.js.map} +1 -1
  125. package/dist/{en-DAcLbbpg.js → cdn/chunks/en-BzMbMmgz.js} +3 -2
  126. package/dist/cdn/chunks/{en-DAcLbbpg.js.map → en-BzMbMmgz.js.map} +1 -1
  127. package/dist/{es-BcEQLQxe.js → cdn/chunks/es-KSHEXYyf.js} +3 -2
  128. package/dist/cdn/chunks/{es-BcEQLQxe.js.map → es-KSHEXYyf.js.map} +1 -1
  129. package/dist/cdn/chunks/{extensions-Bq9nXmBP.js → extensions-CqhrbdGN.js} +35 -18
  130. package/dist/cdn/chunks/extensions-CqhrbdGN.js.map +1 -0
  131. package/dist/{fr-CNQG7ESr.js → cdn/chunks/fr-DtKHfZyk.js} +3 -2
  132. package/dist/cdn/chunks/{fr-CNQG7ESr.js.map → fr-DtKHfZyk.js.map} +1 -1
  133. package/dist/{ja-CMxWxqSH.js → cdn/chunks/ja-DUSaDVPA.js} +3 -2
  134. package/dist/cdn/chunks/{ja-CMxWxqSH.js.map → ja-DUSaDVPA.js.map} +1 -1
  135. package/dist/{nl-BjyYZDkC.js → cdn/chunks/nl-DQbuxzD6.js} +3 -2
  136. package/dist/cdn/chunks/{nl-BjyYZDkC.js.map → nl-DQbuxzD6.js.map} +1 -1
  137. package/dist/{pt-BR-DC2A3C0v.js → cdn/chunks/pt-BR-CxpxBtvc.js} +3 -2
  138. package/dist/cdn/chunks/{pt-BR-DC2A3C0v.js.map → pt-BR-CxpxBtvc.js.map} +1 -1
  139. package/dist/cdn/chunks/rolldown-runtime-CGnMp29N.js +10 -0
  140. package/dist/cdn/chunks/{socialIcons-CSe4YJ52.js → socialIcons-CXQfKLUV.js} +156 -136
  141. package/dist/cdn/chunks/socialIcons-CXQfKLUV.js.map +1 -0
  142. package/dist/cdn/chunks/src-A0kzK-pR.js.map +1 -1
  143. package/dist/cdn/chunks/{src-edESkGqO.js → src-C9jjLNMg.js} +2 -2
  144. package/dist/cdn/chunks/{src-edESkGqO.js.map → src-C9jjLNMg.js.map} +1 -1
  145. package/dist/cdn/chunks/{src-Bk1LF1np.js → src-DxIDI6ZB.js} +4 -2
  146. package/dist/cdn/chunks/src-DxIDI6ZB.js.map +1 -0
  147. package/dist/cdn/chunks/{tiptap-DDhueoan.js → tiptap-DLW5XdqI.js} +2 -2
  148. package/dist/cdn/chunks/{tiptap-DDhueoan.js.map → tiptap-DLW5XdqI.js.map} +1 -1
  149. package/dist/cdn/chunks/{useEditorRoot-D0Lp2x4_.js → useEditorRoot-BPVxLYFD.js} +2 -2
  150. package/dist/cdn/chunks/{useEditorRoot-D0Lp2x4_.js.map → useEditorRoot-BPVxLYFD.js.map} +1 -1
  151. package/dist/cdn/chunks/useI18n-DwP1ksBW.js +24 -0
  152. package/dist/cdn/chunks/{keys-ywH4jHJ2.js.map → useI18n-DwP1ksBW.js.map} +1 -1
  153. package/dist/cdn/chunks/{useLanguageName-DDhdVpqh.js → useLanguageName-CeuoO9WZ.js} +2 -2
  154. package/dist/cdn/chunks/{useLanguageName-DDhdVpqh.js.map → useLanguageName-CeuoO9WZ.js.map} +1 -1
  155. package/dist/cdn/chunks/{useLogicTag-CKtQlJDa.js → useLogicTag-gphGbQfy.js} +3 -3
  156. package/dist/cdn/chunks/{useLogicTag-CKtQlJDa.js.map → useLogicTag-gphGbQfy.js.map} +1 -1
  157. package/dist/cdn/chunks/{useMergeTag-Dwy3U0PI.js → useMergeTag-QM-tkBc6.js} +3 -3
  158. package/dist/cdn/chunks/{useMergeTag-Dwy3U0PI.js.map → useMergeTag-QM-tkBc6.js.map} +1 -1
  159. package/dist/cdn/chunks/{usePopoverPosition-CBp9uwjV.js → usePopoverPosition-Cg8LR0W4.js} +2 -2
  160. package/dist/cdn/chunks/{usePopoverPosition-CBp9uwjV.js.map → usePopoverPosition-Cg8LR0W4.js.map} +1 -1
  161. package/dist/cdn/chunks/{useScrollToBlock-32EnuMwu.js → useScrollToBlock-CS7zo4oQ.js} +2 -2
  162. package/dist/cdn/chunks/{useScrollToBlock-32EnuMwu.js.map → useScrollToBlock-CS7zo4oQ.js.map} +1 -1
  163. package/dist/cdn/editor.css +1 -1
  164. package/dist/cdn/editor.js +877 -975
  165. package/dist/cdn/editor.js.map +1 -1
  166. package/dist/{composables-26aR45W3.js → composables-DZWtVCMq.js} +817 -837
  167. package/dist/{cdn/chunks/da-Dno_4nGy.js → da-DN46iRXS.js} +1 -4
  168. package/dist/{cdn/chunks/de-DRR5JSkh.js → de-Dyk8PPCm.js} +1 -4
  169. package/dist/{cdn/chunks/en-DAcLbbpg.js → en-BzMbMmgz.js} +1 -4
  170. package/dist/{cdn/chunks/es-BcEQLQxe.js → es-KSHEXYyf.js} +1 -4
  171. package/dist/{extensions-zHf8YFRw.js → extensions-DfhOxy6Z.js} +341 -324
  172. package/dist/{cdn/chunks/fr-CNQG7ESr.js → fr-DtKHfZyk.js} +1 -4
  173. package/dist/index.d.ts +33 -405
  174. package/dist/{cdn/chunks/ja-CMxWxqSH.js → ja-DUSaDVPA.js} +1 -4
  175. package/dist/{cdn/chunks/nl-BjyYZDkC.js → nl-DQbuxzD6.js} +1 -4
  176. package/dist/{cdn/chunks/pt-BR-DC2A3C0v.js → pt-BR-CxpxBtvc.js} +1 -4
  177. package/dist/{socialIcons-mWE33bOn.js → socialIcons-K89pe-h2.js} +84 -64
  178. package/dist/style.css +1 -1
  179. package/dist/templatical-editor.js +1060 -1158
  180. package/dist/{useEditorRoot-DWfC2CVC.js → useEditorRoot-CQeutW_s.js} +1 -1
  181. package/dist/useI18n-B05qsAsl.js +22 -0
  182. package/dist/{useLanguageName-CEFzafHB.js → useLanguageName-CnpG7FD5.js} +1 -1
  183. package/dist/{useLogicTag-K5CPoMTk.js → useLogicTag-DSa1si4o.js} +2 -2
  184. package/dist/{useMergeTag-tsU_Sw2x.js → useMergeTag-DwxbvRZI.js} +2 -2
  185. package/dist/{usePopoverPosition-DF0ZYH7g.js → usePopoverPosition-B8CXTr8v.js} +1 -1
  186. package/dist/{useScrollToBlock-eZXiGa8o.js → useScrollToBlock-ZZBBGFan.js} +1 -1
  187. package/package.json +11 -13
  188. package/dist/CloudHeaderExtras-DC_oNrxz.js +0 -22
  189. package/dist/CloudPanels-BbHJHZri.js +0 -167
  190. package/dist/CommentsSidebar-_8at1Rug.js +0 -516
  191. package/dist/cdn/chunks/CloudHeaderExtras-Cd-ePldd.js +0 -24
  192. package/dist/cdn/chunks/CloudHeaderExtras-Cd-ePldd.js.map +0 -1
  193. package/dist/cdn/chunks/CloudPanels-Bv26_Sd8.js +0 -167
  194. package/dist/cdn/chunks/CloudPanels-Bv26_Sd8.js.map +0 -1
  195. package/dist/cdn/chunks/CommentsSidebar-BEiOQ_zT.js.map +0 -1
  196. package/dist/cdn/chunks/IssuesPanel-DgxiS3hF.js.map +0 -1
  197. package/dist/cdn/chunks/Toolbar-Ch3h2BUs.js.map +0 -1
  198. package/dist/cdn/chunks/VersionPreviewBanner-C1H_fYAr.js.map +0 -1
  199. package/dist/cdn/chunks/composables-CKXPwWo9.js.map +0 -1
  200. package/dist/cdn/chunks/createCloudRuntime-CUlw09ix.js +0 -1405
  201. package/dist/cdn/chunks/createCloudRuntime-CUlw09ix.js.map +0 -1
  202. package/dist/cdn/chunks/de-6M4JoHoD.js +0 -21
  203. package/dist/cdn/chunks/de-6M4JoHoD.js.map +0 -1
  204. package/dist/cdn/chunks/en-FzUuJ8HW.js +0 -21
  205. package/dist/cdn/chunks/en-FzUuJ8HW.js.map +0 -1
  206. package/dist/cdn/chunks/extensions-Bq9nXmBP.js.map +0 -1
  207. package/dist/cdn/chunks/keys-ywH4jHJ2.js +0 -11
  208. package/dist/cdn/chunks/logger-CqQTfJGx.js +0 -26
  209. package/dist/cdn/chunks/logger-CqQTfJGx.js.map +0 -1
  210. package/dist/cdn/chunks/preRenderCustomBlocks-BLVFtvl8.js +0 -22
  211. package/dist/cdn/chunks/preRenderCustomBlocks-BLVFtvl8.js.map +0 -1
  212. package/dist/cdn/chunks/pt-BR-Bp92Fc6J.js +0 -21
  213. package/dist/cdn/chunks/pt-BR-Bp92Fc6J.js.map +0 -1
  214. package/dist/cdn/chunks/pusher-x9rNqzon.js +0 -2473
  215. package/dist/cdn/chunks/pusher-x9rNqzon.js.map +0 -1
  216. package/dist/cdn/chunks/rolldown-runtime-QGRDbDUS.js +0 -19
  217. package/dist/cdn/chunks/socialIcons-CSe4YJ52.js.map +0 -1
  218. package/dist/cdn/chunks/src-Bk1LF1np.js.map +0 -1
  219. package/dist/cdn/chunks/useCloudI18n-BTV9uu3c.js +0 -24
  220. package/dist/cdn/chunks/useCloudI18n-BTV9uu3c.js.map +0 -1
  221. package/dist/cdn/chunks/useI18n-DPg6rPbu.js +0 -18
  222. package/dist/cdn/chunks/useI18n-DPg6rPbu.js.map +0 -1
  223. package/dist/createCloudRuntime-CiEo0wkr.js +0 -1389
  224. package/dist/de-6M4JoHoD.js +0 -19
  225. package/dist/en-FzUuJ8HW.js +0 -19
  226. package/dist/keys-B4DimcgX.js +0 -9
  227. package/dist/logger-BOu7oEtk.js +0 -24
  228. package/dist/preRenderCustomBlocks-6CLw2rP6.js +0 -20
  229. package/dist/pt-BR-Bp92Fc6J.js +0 -19
  230. package/dist/useCloudI18n-BnuOL1YS.js +0 -22
  231. package/dist/useI18n-Cx9W7OWb.js +0 -16
@@ -1,2473 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-QGRDbDUS.js";
2
- // ../../node_modules/.pnpm/pusher-js@8.6.0/node_modules/pusher-js/dist/web/pusher.js
3
- var t = /* @__PURE__ */ e(((e, t) => {
4
- (function(n, r) {
5
- typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define([], r) : typeof e == "object" ? e.Pusher = r() : n.Pusher = r();
6
- })(self, () => (() => {
7
- var e = {
8
- 594(e, t) {
9
- var n = this && this.__extends || (function() {
10
- var e = function(t, n) {
11
- return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
12
- e.__proto__ = t;
13
- } || function(e, t) {
14
- for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
15
- }, e(t, n);
16
- };
17
- return function(t, n) {
18
- e(t, n);
19
- function r() {
20
- this.constructor = t;
21
- }
22
- t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
23
- };
24
- })();
25
- Object.defineProperty(t, "__esModule", { value: !0 });
26
- var r = 256, i = function() {
27
- function e(e) {
28
- e === void 0 && (e = "="), this._paddingCharacter = e;
29
- }
30
- return e.prototype.encodedLength = function(e) {
31
- return this._paddingCharacter ? (e + 2) / 3 * 4 | 0 : (e * 8 + 5) / 6 | 0;
32
- }, e.prototype.encode = function(e) {
33
- for (var t = "", n = 0; n < e.length - 2; n += 3) {
34
- var r = e[n] << 16 | e[n + 1] << 8 | e[n + 2];
35
- t += this._encodeByte(r >>> 18 & 63), t += this._encodeByte(r >>> 12 & 63), t += this._encodeByte(r >>> 6 & 63), t += this._encodeByte(r >>> 0 & 63);
36
- }
37
- var i = e.length - n;
38
- if (i > 0) {
39
- var r = e[n] << 16 | (i === 2 ? e[n + 1] << 8 : 0);
40
- t += this._encodeByte(r >>> 18 & 63), t += this._encodeByte(r >>> 12 & 63), t += i === 2 ? this._encodeByte(r >>> 6 & 63) : this._paddingCharacter || "", t += this._paddingCharacter || "";
41
- }
42
- return t;
43
- }, e.prototype.maxDecodedLength = function(e) {
44
- return this._paddingCharacter ? e / 4 * 3 | 0 : (e * 6 + 7) / 8 | 0;
45
- }, e.prototype.decodedLength = function(e) {
46
- return this.maxDecodedLength(e.length - this._getPaddingLength(e));
47
- }, e.prototype.decode = function(e) {
48
- if (e.length === 0) return /* @__PURE__ */ new Uint8Array();
49
- for (var t = this._getPaddingLength(e), n = e.length - t, i = new Uint8Array(this.maxDecodedLength(n)), a = 0, o = 0, s = 0, c = 0, l = 0, u = 0, d = 0; o < n - 4; o += 4) c = this._decodeChar(e.charCodeAt(o + 0)), l = this._decodeChar(e.charCodeAt(o + 1)), u = this._decodeChar(e.charCodeAt(o + 2)), d = this._decodeChar(e.charCodeAt(o + 3)), i[a++] = c << 2 | l >>> 4, i[a++] = l << 4 | u >>> 2, i[a++] = u << 6 | d, s |= c & r, s |= l & r, s |= u & r, s |= d & r;
50
- if (o < n - 1 && (c = this._decodeChar(e.charCodeAt(o)), l = this._decodeChar(e.charCodeAt(o + 1)), i[a++] = c << 2 | l >>> 4, s |= c & r, s |= l & r), o < n - 2 && (u = this._decodeChar(e.charCodeAt(o + 2)), i[a++] = l << 4 | u >>> 2, s |= u & r), o < n - 3 && (d = this._decodeChar(e.charCodeAt(o + 3)), i[a++] = u << 6 | d, s |= d & r), s !== 0) throw Error("Base64Coder: incorrect characters for decoding");
51
- return i;
52
- }, e.prototype._encodeByte = function(e) {
53
- var t = e;
54
- return t += 65, t += 25 - e >>> 8 & 6, t += 51 - e >>> 8 & -75, t += 61 - e >>> 8 & -15, t += 62 - e >>> 8 & 3, String.fromCharCode(t);
55
- }, e.prototype._decodeChar = function(e) {
56
- var t = r;
57
- return t += (42 - e & e - 44) >>> 8 & -r + e - 43 + 62, t += (46 - e & e - 48) >>> 8 & -r + e - 47 + 63, t += (47 - e & e - 58) >>> 8 & -r + e - 48 + 52, t += (64 - e & e - 91) >>> 8 & -r + e - 65 + 0, t += (96 - e & e - 123) >>> 8 & -r + e - 97 + 26, t;
58
- }, e.prototype._getPaddingLength = function(e) {
59
- var t = 0;
60
- if (this._paddingCharacter) {
61
- for (var n = e.length - 1; n >= 0 && e[n] === this._paddingCharacter; n--) t++;
62
- if (e.length < 4 || t > 2) throw Error("Base64Coder: incorrect padding");
63
- }
64
- return t;
65
- }, e;
66
- }();
67
- t.Coder = i;
68
- var a = new i();
69
- function o(e) {
70
- return a.encode(e);
71
- }
72
- t.encode = o;
73
- function s(e) {
74
- return a.decode(e);
75
- }
76
- t.decode = s;
77
- var c = function(e) {
78
- n(t, e);
79
- function t() {
80
- return e !== null && e.apply(this, arguments) || this;
81
- }
82
- return t.prototype._encodeByte = function(e) {
83
- var t = e;
84
- return t += 65, t += 25 - e >>> 8 & 6, t += 51 - e >>> 8 & -75, t += 61 - e >>> 8 & -13, t += 62 - e >>> 8 & 49, String.fromCharCode(t);
85
- }, t.prototype._decodeChar = function(e) {
86
- var t = r;
87
- return t += (44 - e & e - 46) >>> 8 & -r + e - 45 + 62, t += (94 - e & e - 96) >>> 8 & -r + e - 95 + 63, t += (47 - e & e - 58) >>> 8 & -r + e - 48 + 52, t += (64 - e & e - 91) >>> 8 & -r + e - 65 + 0, t += (96 - e & e - 123) >>> 8 & -r + e - 97 + 26, t;
88
- }, t;
89
- }(i);
90
- t.URLSafeCoder = c;
91
- var l = new c();
92
- function u(e) {
93
- return l.encode(e);
94
- }
95
- t.encodeURLSafe = u;
96
- function d(e) {
97
- return l.decode(e);
98
- }
99
- t.decodeURLSafe = d, t.encodedLength = function(e) {
100
- return a.encodedLength(e);
101
- }, t.maxDecodedLength = function(e) {
102
- return a.maxDecodedLength(e);
103
- }, t.decodedLength = function(e) {
104
- return a.decodedLength(e);
105
- };
106
- },
107
- 978(e, t) {
108
- var n = "utf8: invalid source encoding";
109
- function r(e) {
110
- for (var t = [], r = 0; r < e.length; r++) {
111
- var i = e[r];
112
- if (i & 128) {
113
- var a = void 0;
114
- if (i < 224) {
115
- if (r >= e.length) throw Error(n);
116
- var o = e[++r];
117
- if ((o & 192) != 128) throw Error(n);
118
- i = (i & 31) << 6 | o & 63, a = 128;
119
- } else if (i < 240) {
120
- if (r >= e.length - 1) throw Error(n);
121
- var o = e[++r], s = e[++r];
122
- if ((o & 192) != 128 || (s & 192) != 128) throw Error(n);
123
- i = (i & 15) << 12 | (o & 63) << 6 | s & 63, a = 2048;
124
- } else if (i < 248) {
125
- if (r >= e.length - 2) throw Error(n);
126
- var o = e[++r], s = e[++r], c = e[++r];
127
- if ((o & 192) != 128 || (s & 192) != 128 || (c & 192) != 128) throw Error(n);
128
- i = (i & 15) << 18 | (o & 63) << 12 | (s & 63) << 6 | c & 63, a = 65536;
129
- } else throw Error(n);
130
- if (i < a || i >= 55296 && i <= 57343) throw Error(n);
131
- if (i >= 65536) {
132
- if (i > 1114111) throw Error(n);
133
- i -= 65536, t.push(String.fromCharCode(55296 | i >> 10)), i = 56320 | i & 1023;
134
- }
135
- }
136
- t.push(String.fromCharCode(i));
137
- }
138
- return t.join("");
139
- }
140
- t.D4 = r;
141
- },
142
- 721(e, t, n) {
143
- e.exports = n(207).default;
144
- },
145
- 207(e, t, n) {
146
- n.d(t, { default: () => $ });
147
- class r {
148
- constructor(e, t) {
149
- this.lastId = 0, this.prefix = e, this.name = t;
150
- }
151
- create(e) {
152
- this.lastId++;
153
- var t = this.lastId, n = this.prefix + t, r = this.name + "[" + t + "]", i = !1, a = function() {
154
- i ||= (e.apply(null, arguments), !0);
155
- };
156
- return this[t] = a, {
157
- number: t,
158
- id: n,
159
- name: r,
160
- callback: a
161
- };
162
- }
163
- remove(e) {
164
- delete this[e.number];
165
- }
166
- }
167
- var i = new r("_pusher_script_", "Pusher.ScriptReceivers");
168
- let a = {
169
- VERSION: "8.6.0",
170
- PROTOCOL: 7,
171
- wsPort: 80,
172
- wssPort: 443,
173
- wsPath: "",
174
- httpHost: "sockjs.pusher.com",
175
- httpPort: 80,
176
- httpsPort: 443,
177
- httpPath: "/pusher",
178
- stats_host: "stats.pusher.com",
179
- authEndpoint: "/pusher/auth",
180
- authTransport: "ajax",
181
- activityTimeout: 12e4,
182
- pongTimeout: 3e4,
183
- unavailableTimeout: 1e4,
184
- userAuthentication: {
185
- endpoint: "/pusher/user-auth",
186
- transport: "ajax"
187
- },
188
- channelAuthorization: {
189
- endpoint: "/pusher/auth",
190
- transport: "ajax"
191
- },
192
- cdn_http: "http://js.pusher.com",
193
- cdn_https: "https://js.pusher.com",
194
- dependency_suffix: ""
195
- };
196
- class o {
197
- constructor(e) {
198
- this.options = e, this.receivers = e.receivers || i, this.loading = {};
199
- }
200
- load(e, t, n) {
201
- var r = this;
202
- if (r.loading[e] && r.loading[e].length > 0) r.loading[e].push(n);
203
- else {
204
- r.loading[e] = [n];
205
- var i = Y.createScriptRequest(r.getPath(e, t)), a = r.receivers.create(function(t) {
206
- if (r.receivers.remove(a), r.loading[e]) {
207
- var n = r.loading[e];
208
- delete r.loading[e];
209
- for (var o = function(e) {
210
- e || i.cleanup();
211
- }, s = 0; s < n.length; s++) n[s](t, o);
212
- }
213
- });
214
- i.send(a);
215
- }
216
- }
217
- getRoot(e) {
218
- var t, n = Y.getDocument().location.protocol;
219
- return t = e && e.useTLS || n === "https:" ? this.options.cdn_https : this.options.cdn_http, t.replace(/\/*$/, "") + "/" + this.options.version;
220
- }
221
- getPath(e, t) {
222
- return this.getRoot(t) + "/" + e + this.options.suffix + ".js";
223
- }
224
- }
225
- var s = new r("_pusher_dependencies", "Pusher.DependenciesReceivers"), c = new o({
226
- cdn_http: a.cdn_http,
227
- cdn_https: a.cdn_https,
228
- version: a.VERSION,
229
- suffix: a.dependency_suffix,
230
- receivers: s
231
- });
232
- let l = {
233
- baseUrl: "https://pusher.com",
234
- urls: {
235
- authenticationEndpoint: { path: "/docs/channels/server_api/authenticating_users" },
236
- authorizationEndpoint: { path: "/docs/channels/server_api/authorizing-users/" },
237
- javascriptQuickStart: { path: "/docs/javascript_quick_start" },
238
- triggeringClientEvents: { path: "/docs/client_api_guide/client_events#trigger-events" },
239
- encryptedChannelSupport: { fullUrl: "https://github.com/pusher/pusher-js/tree/cc491015371a4bde5743d1c87a0fbac0feb53195#encrypted-channel-support" }
240
- }
241
- }, u = { buildLogSuffix: function(e) {
242
- let t = l.urls[e];
243
- if (!t) return "";
244
- let n;
245
- return t.fullUrl ? n = t.fullUrl : t.path && (n = l.baseUrl + t.path), n ? `See: ${n}` : "";
246
- } };
247
- var d;
248
- (function(e) {
249
- e.UserAuthentication = "user-authentication", e.ChannelAuthorization = "channel-authorization";
250
- })(d ||= {});
251
- class ee extends Error {
252
- constructor(e) {
253
- super(e), Object.setPrototypeOf(this, new.target.prototype);
254
- }
255
- }
256
- class te extends Error {
257
- constructor(e) {
258
- super(e), Object.setPrototypeOf(this, new.target.prototype);
259
- }
260
- }
261
- class f extends Error {
262
- constructor(e) {
263
- super(e), Object.setPrototypeOf(this, new.target.prototype);
264
- }
265
- }
266
- class ne extends Error {
267
- constructor(e) {
268
- super(e), Object.setPrototypeOf(this, new.target.prototype);
269
- }
270
- }
271
- class p extends Error {
272
- constructor(e) {
273
- super(e), Object.setPrototypeOf(this, new.target.prototype);
274
- }
275
- }
276
- class m extends Error {
277
- constructor(e) {
278
- super(e), Object.setPrototypeOf(this, new.target.prototype);
279
- }
280
- }
281
- class h extends Error {
282
- constructor(e) {
283
- super(e), Object.setPrototypeOf(this, new.target.prototype);
284
- }
285
- }
286
- class g extends Error {
287
- constructor(e) {
288
- super(e), Object.setPrototypeOf(this, new.target.prototype);
289
- }
290
- }
291
- class _ extends Error {
292
- constructor(e, t) {
293
- super(t), this.status = e, Object.setPrototypeOf(this, new.target.prototype);
294
- }
295
- }
296
- let v = function(e, t, n, r, i) {
297
- let a = Y.createXHR();
298
- for (var o in a.open("POST", n.endpoint, !0), a.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), n.headers) a.setRequestHeader(o, n.headers[o]);
299
- if (n.headersProvider != null) {
300
- let e = n.headersProvider();
301
- for (var o in e) a.setRequestHeader(o, e[o]);
302
- }
303
- return a.onreadystatechange = function() {
304
- if (a.readyState === 4) {
305
- if (a.status === 200) {
306
- let e, t = !1;
307
- try {
308
- e = JSON.parse(a.responseText), t = !0;
309
- } catch {
310
- i(new _(200, `JSON returned from ${r.toString()} endpoint was invalid, yet status code was 200. Data was: ${a.responseText}`), null);
311
- }
312
- t && i(null, e);
313
- } else {
314
- let e = "";
315
- switch (r) {
316
- case d.UserAuthentication:
317
- e = u.buildLogSuffix("authenticationEndpoint");
318
- break;
319
- case d.ChannelAuthorization: e = `Clients must be authorized to join private or presence channels. ${u.buildLogSuffix("authorizationEndpoint")}`;
320
- }
321
- i(new _(a.status, `Unable to retrieve auth string from ${r.toString()} endpoint - received status: ${a.status} from ${n.endpoint}. ${e}`), null);
322
- }
323
- }
324
- }, a.send(t), a;
325
- };
326
- function y(e) {
327
- return ce(oe(e));
328
- }
329
- for (var b = String.fromCharCode, x = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", re = {}, S = 0, ie = x.length; S < ie; S++) re[x.charAt(S)] = S;
330
- var ae = function(e) {
331
- var t = e.charCodeAt(0);
332
- return t < 128 ? e : t < 2048 ? b(192 | t >>> 6) + b(128 | t & 63) : b(224 | t >>> 12 & 15) + b(128 | t >>> 6 & 63) + b(128 | t & 63);
333
- }, oe = function(e) {
334
- return e.replace(/[^\x00-\x7F]/g, ae);
335
- }, se = function(e) {
336
- var t = [
337
- 0,
338
- 2,
339
- 1
340
- ][e.length % 3], n = e.charCodeAt(0) << 16 | (e.length > 1 ? e.charCodeAt(1) : 0) << 8 | (e.length > 2 ? e.charCodeAt(2) : 0);
341
- return [
342
- x.charAt(n >>> 18),
343
- x.charAt(n >>> 12 & 63),
344
- t >= 2 ? "=" : x.charAt(n >>> 6 & 63),
345
- t >= 1 ? "=" : x.charAt(n & 63)
346
- ].join("");
347
- }, ce = typeof window < "u" && window.btoa || function(e) {
348
- return e.replace(/[\s\S]{1,3}/g, se);
349
- };
350
- class le {
351
- constructor(e, t, n, r) {
352
- this.clear = t, this.timer = e(() => {
353
- this.timer &&= r(this.timer);
354
- }, n);
355
- }
356
- isRunning() {
357
- return this.timer !== null;
358
- }
359
- ensureAborted() {
360
- this.timer &&= (this.clear(this.timer), null);
361
- }
362
- }
363
- let ue = le;
364
- function de(e) {
365
- window.clearTimeout(e);
366
- }
367
- function fe(e) {
368
- window.clearInterval(e);
369
- }
370
- class C extends ue {
371
- constructor(e, t) {
372
- super(setTimeout, de, e, function(e) {
373
- return t(), null;
374
- });
375
- }
376
- }
377
- class pe extends ue {
378
- constructor(e, t) {
379
- super(setInterval, fe, e, function(e) {
380
- return t(), e;
381
- });
382
- }
383
- }
384
- let w = {
385
- now() {
386
- return Date.now ? Date.now() : (/* @__PURE__ */ new Date()).valueOf();
387
- },
388
- defer(e) {
389
- return new C(0, e);
390
- },
391
- method(e, ...t) {
392
- var n = Array.prototype.slice.call(arguments, 1);
393
- return function(t) {
394
- return t[e].apply(t, n.concat(arguments));
395
- };
396
- }
397
- };
398
- function T(e, ...t) {
399
- for (var n = 0; n < t.length; n++) {
400
- var r = t[n];
401
- for (var i in r) i !== "__proto__" && i !== "constructor" && i !== "prototype" && (e[i] = r[i] && r[i].constructor && r[i].constructor === Object ? T(e[i] || {}, r[i]) : r[i]);
402
- }
403
- return e;
404
- }
405
- function me() {
406
- for (var e = ["Pusher"], t = 0; t < arguments.length; t++) typeof arguments[t] == "string" ? e.push(arguments[t]) : e.push(k(arguments[t]));
407
- return e.join(" : ");
408
- }
409
- function E(e, t) {
410
- var n = Array.prototype.indexOf;
411
- if (e === null) return -1;
412
- if (n && e.indexOf === n) return e.indexOf(t);
413
- for (var r = 0, i = e.length; r < i; r++) if (e[r] === t) return r;
414
- return -1;
415
- }
416
- function D(e, t) {
417
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t(e[n], n, e);
418
- }
419
- function he(e) {
420
- var t = [];
421
- return D(e, function(e, n) {
422
- t.push(n);
423
- }), t;
424
- }
425
- function ge(e) {
426
- var t = [];
427
- return D(e, function(e) {
428
- t.push(e);
429
- }), t;
430
- }
431
- function O(e, t, n) {
432
- for (var r = 0; r < e.length; r++) t.call(n || window, e[r], r, e);
433
- }
434
- function _e(e, t) {
435
- for (var n = [], r = 0; r < e.length; r++) n.push(t(e[r], r, e, n));
436
- return n;
437
- }
438
- function ve(e, t) {
439
- var n = {};
440
- return D(e, function(e, r) {
441
- n[r] = t(e);
442
- }), n;
443
- }
444
- function ye(e, t) {
445
- t ||= function(e) {
446
- return !!e;
447
- };
448
- for (var n = [], r = 0; r < e.length; r++) t(e[r], r, e, n) && n.push(e[r]);
449
- return n;
450
- }
451
- function be(e, t) {
452
- var n = {};
453
- return D(e, function(r, i) {
454
- (t && t(r, i, e, n) || r) && (n[i] = r);
455
- }), n;
456
- }
457
- function xe(e) {
458
- var t = [];
459
- return D(e, function(e, n) {
460
- t.push([n, e]);
461
- }), t;
462
- }
463
- function Se(e, t) {
464
- for (var n = 0; n < e.length; n++) if (t(e[n], n, e)) return !0;
465
- return !1;
466
- }
467
- function Ce(e, t) {
468
- for (var n = 0; n < e.length; n++) if (!t(e[n], n, e)) return !1;
469
- return !0;
470
- }
471
- function we(e) {
472
- return ve(e, function(e) {
473
- return e === null ? "" : (typeof e == "object" && (e = k(e)), encodeURIComponent(y(e.toString())));
474
- });
475
- }
476
- function Te(e) {
477
- return _e(xe(we(be(e, function(e) {
478
- return e !== void 0;
479
- }))), w.method("join", "=")).join("&");
480
- }
481
- function Ee(e) {
482
- var t = [], n = [];
483
- return (function e(r, i) {
484
- var a, o, s;
485
- switch (typeof r) {
486
- case "object":
487
- if (!r) return null;
488
- for (a = 0; a < t.length; a += 1) if (t[a] === r) return { $ref: n[a] };
489
- if (t.push(r), n.push(i), Object.prototype.toString.apply(r) === "[object Array]") for (s = [], a = 0; a < r.length; a += 1) s[a] = e(r[a], i + "[" + a + "]");
490
- else for (o in s = {}, r) Object.prototype.hasOwnProperty.call(r, o) && (s[o] = e(r[o], i + "[" + JSON.stringify(o) + "]"));
491
- return s;
492
- case "number":
493
- case "string":
494
- case "boolean": return r;
495
- }
496
- })(e, "$");
497
- }
498
- function k(e) {
499
- try {
500
- return JSON.stringify(e);
501
- } catch {
502
- return JSON.stringify(Ee(e));
503
- }
504
- }
505
- class De {
506
- constructor() {
507
- this.globalLog = (e) => {
508
- window.console && window.console.log && window.console.log(e);
509
- };
510
- }
511
- debug(...e) {
512
- this.log(this.globalLog, e);
513
- }
514
- warn(...e) {
515
- this.log(this.globalLogWarn, e);
516
- }
517
- error(...e) {
518
- this.log(this.globalLogError, e);
519
- }
520
- globalLogWarn(e) {
521
- window.console && window.console.warn ? window.console.warn(e) : this.globalLog(e);
522
- }
523
- globalLogError(e) {
524
- window.console && window.console.error ? window.console.error(e) : this.globalLogWarn(e);
525
- }
526
- log(e, ...t) {
527
- var n = me.apply(this, arguments);
528
- $.log ? $.log(n) : $.logToConsole && e.bind(this)(n);
529
- }
530
- }
531
- let A = new De(), Oe = function(e, t, n, r, i) {
532
- (n.headers !== void 0 || n.headersProvider != null) && A.warn(`To send headers with the ${r.toString()} request, you must use AJAX, rather than JSONP.`);
533
- var a = e.nextAuthCallbackID.toString();
534
- e.nextAuthCallbackID++;
535
- var o = e.getDocument(), s = o.createElement("script");
536
- e.auth_callbacks[a] = function(e) {
537
- i(null, e);
538
- };
539
- var c = "Pusher.auth_callbacks['" + a + "']";
540
- s.src = n.endpoint + "?callback=" + encodeURIComponent(c) + "&" + t;
541
- var l = o.getElementsByTagName("head")[0] || o.documentElement;
542
- l.insertBefore(s, l.firstChild);
543
- };
544
- class ke {
545
- constructor(e) {
546
- this.src = e;
547
- }
548
- send(e) {
549
- var t = this, n = "Error loading " + t.src;
550
- t.script = document.createElement("script"), t.script.id = e.id, t.script.src = t.src, t.script.type = "text/javascript", t.script.charset = "UTF-8", t.script.addEventListener ? (t.script.onerror = function() {
551
- e.callback(n);
552
- }, t.script.onload = function() {
553
- e.callback(null);
554
- }) : t.script.onreadystatechange = function() {
555
- (t.script.readyState === "loaded" || t.script.readyState === "complete") && e.callback(null);
556
- }, t.script.async === void 0 && document.attachEvent && /opera/i.test(navigator.userAgent) ? (t.errorScript = document.createElement("script"), t.errorScript.id = e.id + "_error", t.errorScript.text = e.name + "('" + n + "');", t.script.async = t.errorScript.async = !1) : t.script.async = !0;
557
- var r = document.getElementsByTagName("head")[0];
558
- r.insertBefore(t.script, r.firstChild), t.errorScript && r.insertBefore(t.errorScript, t.script.nextSibling);
559
- }
560
- cleanup() {
561
- this.script && (this.script.onload = this.script.onerror = null, this.script.onreadystatechange = null), this.script && this.script.parentNode && this.script.parentNode.removeChild(this.script), this.errorScript && this.errorScript.parentNode && this.errorScript.parentNode.removeChild(this.errorScript), this.script = null, this.errorScript = null;
562
- }
563
- }
564
- class Ae {
565
- constructor(e, t) {
566
- this.url = e, this.data = t;
567
- }
568
- send(e) {
569
- if (!this.request) {
570
- var t = Te(this.data), n = this.url + "/" + e.number + "?" + t;
571
- this.request = Y.createScriptRequest(n), this.request.send(e);
572
- }
573
- }
574
- cleanup() {
575
- this.request && this.request.cleanup();
576
- }
577
- }
578
- let je = {
579
- name: "jsonp",
580
- getAgent: function(e, t) {
581
- return function(n, r) {
582
- var a = "http" + (t ? "s" : "") + "://" + (e.host || e.options.host) + e.options.path, o = Y.createJSONPRequest(a, n), s = Y.ScriptReceivers.create(function(t, n) {
583
- i.remove(s), o.cleanup(), n && n.host && (e.host = n.host), r && r(t, n);
584
- });
585
- o.send(s);
586
- };
587
- }
588
- };
589
- function j(e, t, n) {
590
- var r = e + (t.useTLS ? "s" : ""), i = t.useTLS ? t.hostTLS : t.hostNonTLS;
591
- return r + "://" + i + n;
592
- }
593
- function M(e, t) {
594
- return "/app/" + e + ("?protocol=" + a.PROTOCOL + "&client=js&version=" + a.VERSION + (t ? "&" + t : ""));
595
- }
596
- var Me = { getInitial: function(e, t) {
597
- return j("ws", t, (t.httpPath || "") + M(e, "flash=false"));
598
- } }, Ne = { getInitial: function(e, t) {
599
- return j("http", t, (t.httpPath || "/pusher") + M(e));
600
- } }, Pe = {
601
- getInitial: function(e, t) {
602
- return j("http", t, t.httpPath || "/pusher");
603
- },
604
- getPath: function(e, t) {
605
- return M(e);
606
- }
607
- };
608
- class Fe {
609
- constructor() {
610
- this._callbacks = {};
611
- }
612
- get(e) {
613
- return this._callbacks[N(e)];
614
- }
615
- add(e, t, n) {
616
- var r = N(e);
617
- this._callbacks[r] = this._callbacks[r] || [], this._callbacks[r].push({
618
- fn: t,
619
- context: n
620
- });
621
- }
622
- remove(e, t, n) {
623
- if (!e && !t && !n) this._callbacks = {};
624
- else {
625
- var r = e ? [N(e)] : he(this._callbacks);
626
- t || n ? this.removeCallback(r, t, n) : this.removeAllCallbacks(r);
627
- }
628
- }
629
- removeCallback(e, t, n) {
630
- O(e, function(e) {
631
- this._callbacks[e] = ye(this._callbacks[e] || [], function(e) {
632
- return t && t !== e.fn || n && n !== e.context;
633
- }), this._callbacks[e].length === 0 && delete this._callbacks[e];
634
- }, this);
635
- }
636
- removeAllCallbacks(e) {
637
- O(e, function(e) {
638
- delete this._callbacks[e];
639
- }, this);
640
- }
641
- }
642
- function N(e) {
643
- return "_" + e;
644
- }
645
- class P {
646
- constructor(e) {
647
- this.callbacks = new Fe(), this.global_callbacks = [], this.failThrough = e;
648
- }
649
- bind(e, t, n) {
650
- return this.callbacks.add(e, t, n), this;
651
- }
652
- bind_global(e) {
653
- return this.global_callbacks.push(e), this;
654
- }
655
- unbind(e, t, n) {
656
- return this.callbacks.remove(e, t, n), this;
657
- }
658
- unbind_global(e) {
659
- return e ? (this.global_callbacks = ye(this.global_callbacks || [], (t) => t !== e), this) : (this.global_callbacks = [], this);
660
- }
661
- unbind_all() {
662
- return this.unbind(), this.unbind_global(), this;
663
- }
664
- emit(e, t, n) {
665
- for (var r = 0; r < this.global_callbacks.length; r++) this.global_callbacks[r](e, t);
666
- var i = this.callbacks.get(e), a = [];
667
- if (n ? a.push(t, n) : t && a.push(t), i && i.length > 0) for (var r = 0; r < i.length; r++) i[r].fn.apply(i[r].context || window, a);
668
- else this.failThrough && this.failThrough(e, t);
669
- return this;
670
- }
671
- }
672
- class Ie extends P {
673
- constructor(e, t, n, r, i) {
674
- super(), this.initialize = Y.transportConnectionInitializer, this.hooks = e, this.name = t, this.priority = n, this.key = r, this.options = i, this.state = "new", this.timeline = i.timeline, this.activityTimeout = i.activityTimeout, this.id = this.timeline.generateUniqueID();
675
- }
676
- handlesActivityChecks() {
677
- return !!this.hooks.handlesActivityChecks;
678
- }
679
- supportsPing() {
680
- return !!this.hooks.supportsPing;
681
- }
682
- connect() {
683
- if (this.socket || this.state !== "initialized") return !1;
684
- var e = this.hooks.urls.getInitial(this.key, this.options);
685
- try {
686
- this.socket = this.hooks.getSocket(e, this.options);
687
- } catch (e) {
688
- return w.defer(() => {
689
- this.onError(e), this.changeState("closed");
690
- }), !1;
691
- }
692
- return this.bindListeners(), A.debug("Connecting", {
693
- transport: this.name,
694
- url: e
695
- }), this.changeState("connecting"), !0;
696
- }
697
- close() {
698
- return this.socket ? (this.socket.close(), !0) : !1;
699
- }
700
- send(e) {
701
- return this.state === "open" && (w.defer(() => {
702
- this.socket && this.socket.send(e);
703
- }), !0);
704
- }
705
- ping() {
706
- this.state === "open" && this.supportsPing() && this.socket.ping();
707
- }
708
- onOpen() {
709
- this.hooks.beforeOpen && this.hooks.beforeOpen(this.socket, this.hooks.urls.getPath(this.key, this.options)), this.changeState("open"), this.socket.onopen = void 0;
710
- }
711
- onError(e) {
712
- this.emit("error", {
713
- type: "WebSocketError",
714
- error: e
715
- }), this.timeline.error(this.buildTimelineMessage({ error: e.toString() }));
716
- }
717
- onClose(e) {
718
- e ? this.changeState("closed", {
719
- code: e.code,
720
- reason: e.reason,
721
- wasClean: e.wasClean
722
- }) : this.changeState("closed"), this.unbindListeners(), this.socket = void 0;
723
- }
724
- onMessage(e) {
725
- this.emit("message", e);
726
- }
727
- onActivity() {
728
- this.emit("activity");
729
- }
730
- bindListeners() {
731
- this.socket.onopen = () => {
732
- this.onOpen();
733
- }, this.socket.onerror = (e) => {
734
- this.onError(e);
735
- }, this.socket.onclose = (e) => {
736
- this.onClose(e);
737
- }, this.socket.onmessage = (e) => {
738
- this.onMessage(e);
739
- }, this.supportsPing() && (this.socket.onactivity = () => {
740
- this.onActivity();
741
- });
742
- }
743
- unbindListeners() {
744
- this.socket && (this.socket.onopen = void 0, this.socket.onerror = void 0, this.socket.onclose = void 0, this.socket.onmessage = void 0, this.supportsPing() && (this.socket.onactivity = void 0));
745
- }
746
- changeState(e, t) {
747
- this.state = e, this.timeline.info(this.buildTimelineMessage({
748
- state: e,
749
- params: t
750
- })), this.emit(e, t);
751
- }
752
- buildTimelineMessage(e) {
753
- return T({ cid: this.id }, e);
754
- }
755
- }
756
- class F {
757
- constructor(e) {
758
- this.hooks = e;
759
- }
760
- isSupported(e) {
761
- return this.hooks.isSupported(e);
762
- }
763
- createConnection(e, t, n, r) {
764
- return new Ie(this.hooks, e, t, n, r);
765
- }
766
- }
767
- var Le = new F({
768
- urls: Me,
769
- handlesActivityChecks: !1,
770
- supportsPing: !1,
771
- isInitialized: function() {
772
- return !!Y.getWebSocketAPI();
773
- },
774
- isSupported: function() {
775
- return !!Y.getWebSocketAPI();
776
- },
777
- getSocket: function(e) {
778
- return Y.createWebSocket(e);
779
- }
780
- }), Re = {
781
- urls: Ne,
782
- handlesActivityChecks: !1,
783
- supportsPing: !0,
784
- isInitialized: function() {
785
- return !0;
786
- }
787
- }, ze = T({ getSocket: function(e) {
788
- return Y.HTTPFactory.createStreamingSocket(e);
789
- } }, Re), Be = T({ getSocket: function(e) {
790
- return Y.HTTPFactory.createPollingSocket(e);
791
- } }, Re), Ve = { isSupported: function() {
792
- return Y.isXHRSupported();
793
- } };
794
- let I = {
795
- ws: Le,
796
- xhr_streaming: new F(T({}, ze, Ve)),
797
- xhr_polling: new F(T({}, Be, Ve))
798
- };
799
- var He = new F({
800
- file: "sockjs",
801
- urls: Pe,
802
- handlesActivityChecks: !0,
803
- supportsPing: !1,
804
- isSupported: function() {
805
- return !0;
806
- },
807
- isInitialized: function() {
808
- return window.SockJS !== void 0;
809
- },
810
- getSocket: function(e, t) {
811
- return new window.SockJS(e, null, {
812
- js_path: c.getPath("sockjs", { useTLS: t.useTLS }),
813
- ignore_null_origin: t.ignoreNullOrigin
814
- });
815
- },
816
- beforeOpen: function(e, t) {
817
- e.send(JSON.stringify({ path: t }));
818
- }
819
- }), Ue = { isSupported: function(e) {
820
- return Y.isXDRSupported(e.useTLS);
821
- } }, We = new F(T({}, ze, Ue)), Ge = new F(T({}, Be, Ue));
822
- I.xdr_streaming = We, I.xdr_polling = Ge, I.sockjs = He;
823
- let Ke = I;
824
- class qe extends P {
825
- constructor() {
826
- super();
827
- var e = this;
828
- typeof window < "u" && window.addEventListener !== void 0 && (window.addEventListener("online", function() {
829
- e.emit("online");
830
- }, !1), window.addEventListener("offline", function() {
831
- e.emit("offline");
832
- }, !1));
833
- }
834
- isOnline() {
835
- return window.navigator.onLine === void 0 || window.navigator.onLine;
836
- }
837
- }
838
- var Je = new qe();
839
- class Ye {
840
- constructor(e, t, n) {
841
- this.manager = e, this.transport = t, this.minPingDelay = n.minPingDelay, this.maxPingDelay = n.maxPingDelay, this.pingDelay = void 0;
842
- }
843
- createConnection(e, t, n, r) {
844
- r = T({}, r, { activityTimeout: this.pingDelay });
845
- var i = this.transport.createConnection(e, t, n, r), a = null, o = function() {
846
- i.unbind("open", o), i.bind("closed", s), a = w.now();
847
- }, s = (e) => {
848
- if (i.unbind("closed", s), e.code === 1002 || e.code === 1003) this.manager.reportDeath();
849
- else if (!e.wasClean && a) {
850
- var t = w.now() - a;
851
- t < 2 * this.maxPingDelay && (this.manager.reportDeath(), this.pingDelay = Math.max(t / 2, this.minPingDelay));
852
- }
853
- };
854
- return i.bind("open", o), i;
855
- }
856
- isSupported(e) {
857
- return this.manager.isAlive() && this.transport.isSupported(e);
858
- }
859
- }
860
- let Xe = {
861
- decodeMessage: function(e) {
862
- try {
863
- var t = JSON.parse(e.data), n = t.data;
864
- if (typeof n == "string") try {
865
- n = JSON.parse(t.data);
866
- } catch {}
867
- var r = {
868
- event: t.event,
869
- channel: t.channel,
870
- data: n
871
- };
872
- return t.user_id && (r.user_id = t.user_id), r;
873
- } catch (t) {
874
- throw {
875
- type: "MessageParseError",
876
- error: t,
877
- data: e.data
878
- };
879
- }
880
- },
881
- encodeMessage: function(e) {
882
- return JSON.stringify(e);
883
- },
884
- processHandshake: function(e) {
885
- var t = Xe.decodeMessage(e);
886
- if (t.event === "pusher:connection_established") {
887
- if (!t.data.activity_timeout) throw "No activity timeout specified in handshake";
888
- return {
889
- action: "connected",
890
- id: t.data.socket_id,
891
- activityTimeout: t.data.activity_timeout * 1e3
892
- };
893
- }
894
- if (t.event === "pusher:error") return {
895
- action: this.getCloseAction(t.data),
896
- error: this.getCloseError(t.data)
897
- };
898
- throw "Invalid handshake";
899
- },
900
- getCloseAction: function(e) {
901
- return e.code < 4e3 ? e.code >= 1002 && e.code <= 1004 ? "backoff" : null : e.code === 4e3 ? "tls_only" : e.code < 4100 ? "refused" : e.code < 4200 ? "backoff" : e.code < 4300 ? "retry" : "refused";
902
- },
903
- getCloseError: function(e) {
904
- return e.code !== 1e3 && e.code !== 1001 ? {
905
- type: "PusherError",
906
- data: {
907
- code: e.code,
908
- message: e.reason || e.message
909
- }
910
- } : null;
911
- }
912
- }, L = Xe;
913
- class Ze extends P {
914
- constructor(e, t) {
915
- super(), this.id = e, this.transport = t, this.activityTimeout = t.activityTimeout, this.bindListeners();
916
- }
917
- handlesActivityChecks() {
918
- return this.transport.handlesActivityChecks();
919
- }
920
- send(e) {
921
- return this.transport.send(e);
922
- }
923
- send_event(e, t, n) {
924
- var r = {
925
- event: e,
926
- data: t
927
- };
928
- return n && (r.channel = n), A.debug("Event sent", r), this.send(L.encodeMessage(r));
929
- }
930
- ping() {
931
- this.transport.supportsPing() ? this.transport.ping() : this.send_event("pusher:ping", {});
932
- }
933
- close() {
934
- this.transport.close();
935
- }
936
- bindListeners() {
937
- var e = {
938
- message: (e) => {
939
- var t;
940
- try {
941
- t = L.decodeMessage(e);
942
- } catch (t) {
943
- this.emit("error", {
944
- type: "MessageParseError",
945
- error: t,
946
- data: e.data
947
- });
948
- }
949
- if (t !== void 0) {
950
- switch (A.debug("Event recd", t), t.event) {
951
- case "pusher:error":
952
- this.emit("error", {
953
- type: "PusherError",
954
- data: t.data
955
- });
956
- break;
957
- case "pusher:ping":
958
- this.emit("ping");
959
- break;
960
- case "pusher:pong": this.emit("pong");
961
- }
962
- this.emit("message", t);
963
- }
964
- },
965
- activity: () => {
966
- this.emit("activity");
967
- },
968
- error: (e) => {
969
- this.emit("error", e);
970
- },
971
- closed: (e) => {
972
- t(), e && e.code && this.handleCloseEvent(e), this.transport = null, this.emit("closed");
973
- }
974
- }, t = () => {
975
- D(e, (e, t) => {
976
- this.transport.unbind(t, e);
977
- });
978
- };
979
- D(e, (e, t) => {
980
- this.transport.bind(t, e);
981
- });
982
- }
983
- handleCloseEvent(e) {
984
- var t = L.getCloseAction(e), n = L.getCloseError(e);
985
- n && this.emit("error", n), t && this.emit(t, {
986
- action: t,
987
- error: n
988
- });
989
- }
990
- }
991
- class Qe {
992
- constructor(e, t) {
993
- this.transport = e, this.callback = t, this.bindListeners();
994
- }
995
- close() {
996
- this.unbindListeners(), this.transport.close();
997
- }
998
- bindListeners() {
999
- this.onMessage = (e) => {
1000
- this.unbindListeners();
1001
- var t;
1002
- try {
1003
- t = L.processHandshake(e);
1004
- } catch (e) {
1005
- this.finish("error", { error: e }), this.transport.close();
1006
- return;
1007
- }
1008
- t.action === "connected" ? this.finish("connected", {
1009
- connection: new Ze(t.id, this.transport),
1010
- activityTimeout: t.activityTimeout
1011
- }) : (this.finish(t.action, { error: t.error }), this.transport.close());
1012
- }, this.onClosed = (e) => {
1013
- this.unbindListeners();
1014
- var t = L.getCloseAction(e) || "backoff", n = L.getCloseError(e);
1015
- this.finish(t, { error: n });
1016
- }, this.transport.bind("message", this.onMessage), this.transport.bind("closed", this.onClosed);
1017
- }
1018
- unbindListeners() {
1019
- this.transport.unbind("message", this.onMessage), this.transport.unbind("closed", this.onClosed);
1020
- }
1021
- finish(e, t) {
1022
- this.callback(T({
1023
- transport: this.transport,
1024
- action: e
1025
- }, t));
1026
- }
1027
- }
1028
- class $e {
1029
- constructor(e, t) {
1030
- this.timeline = e, this.options = t || {};
1031
- }
1032
- send(e, t) {
1033
- this.timeline.isEmpty() || this.timeline.send(Y.TimelineTransport.getAgent(this, e), t);
1034
- }
1035
- }
1036
- class R extends P {
1037
- constructor(e, t) {
1038
- super(function(t, n) {
1039
- A.debug("No callbacks on " + e + " for " + t);
1040
- }), this.name = e, this.pusher = t, this.subscribed = !1, this.subscriptionPending = !1, this.subscriptionCancelled = !1;
1041
- }
1042
- authorize(e, t) {
1043
- return t(null, { auth: "" });
1044
- }
1045
- trigger(e, t) {
1046
- if (e.indexOf("client-") !== 0) throw new ee("Event '" + e + "' does not start with 'client-'");
1047
- if (!this.subscribed) {
1048
- var n = u.buildLogSuffix("triggeringClientEvents");
1049
- A.warn(`Client event triggered before channel 'subscription_succeeded' event . ${n}`);
1050
- }
1051
- return this.pusher.send_event(e, t, this.name);
1052
- }
1053
- disconnect() {
1054
- this.subscribed = !1, this.subscriptionPending = !1;
1055
- }
1056
- handleEvent(e) {
1057
- var t = e.event, n = e.data;
1058
- t === "pusher_internal:subscription_succeeded" ? this.handleSubscriptionSucceededEvent(e) : t === "pusher_internal:subscription_count" ? this.handleSubscriptionCountEvent(e) : t.indexOf("pusher_internal:") !== 0 && this.emit(t, n, {});
1059
- }
1060
- handleSubscriptionSucceededEvent(e) {
1061
- this.subscriptionPending = !1, this.subscribed = !0, this.subscriptionCancelled ? this.pusher.unsubscribe(this.name) : this.emit("pusher:subscription_succeeded", e.data);
1062
- }
1063
- handleSubscriptionCountEvent(e) {
1064
- e.data.subscription_count && (this.subscriptionCount = e.data.subscription_count), this.emit("pusher:subscription_count", e.data);
1065
- }
1066
- subscribe() {
1067
- this.subscribed || (this.subscriptionPending = !0, this.subscriptionCancelled = !1, this.authorize(this.pusher.connection.socket_id, (e, t) => {
1068
- e ? (this.subscriptionPending = !1, A.error(e.toString()), this.emit("pusher:subscription_error", Object.assign({}, {
1069
- type: "AuthError",
1070
- error: e.message
1071
- }, e instanceof _ ? { status: e.status } : {}))) : this.pusher.send_event("pusher:subscribe", {
1072
- auth: t.auth,
1073
- channel_data: t.channel_data,
1074
- channel: this.name
1075
- });
1076
- }));
1077
- }
1078
- unsubscribe() {
1079
- this.subscribed = !1, this.pusher.send_event("pusher:unsubscribe", { channel: this.name });
1080
- }
1081
- cancelSubscription() {
1082
- this.subscriptionCancelled = !0;
1083
- }
1084
- reinstateSubscription() {
1085
- this.subscriptionCancelled = !1;
1086
- }
1087
- }
1088
- class z extends R {
1089
- authorize(e, t) {
1090
- return this.pusher.config.channelAuthorizer({
1091
- channelName: this.name,
1092
- socketId: e
1093
- }, t);
1094
- }
1095
- }
1096
- class et {
1097
- constructor() {
1098
- this.reset();
1099
- }
1100
- get(e) {
1101
- return Object.prototype.hasOwnProperty.call(this.members, e) ? {
1102
- id: e,
1103
- info: this.members[e]
1104
- } : null;
1105
- }
1106
- each(e) {
1107
- D(this.members, (t, n) => {
1108
- e(this.get(n));
1109
- });
1110
- }
1111
- setMyID(e) {
1112
- this.myID = e;
1113
- }
1114
- onSubscription(e) {
1115
- this.members = e.presence.hash, this.count = e.presence.count, this.me = this.get(this.myID);
1116
- }
1117
- addMember(e) {
1118
- return this.get(e.user_id) === null && this.count++, this.members[e.user_id] = e.user_info, this.get(e.user_id);
1119
- }
1120
- removeMember(e) {
1121
- var t = this.get(e.user_id);
1122
- return t && (delete this.members[e.user_id], this.count--), t;
1123
- }
1124
- reset() {
1125
- this.members = {}, this.count = 0, this.myID = null, this.me = null;
1126
- }
1127
- }
1128
- var tt = function(e, t, n, r) {
1129
- function i(e) {
1130
- return e instanceof n ? e : new n(function(t) {
1131
- t(e);
1132
- });
1133
- }
1134
- return new (n ||= Promise)(function(n, a) {
1135
- function o(e) {
1136
- try {
1137
- c(r.next(e));
1138
- } catch (e) {
1139
- a(e);
1140
- }
1141
- }
1142
- function s(e) {
1143
- try {
1144
- c(r.throw(e));
1145
- } catch (e) {
1146
- a(e);
1147
- }
1148
- }
1149
- function c(e) {
1150
- e.done ? n(e.value) : i(e.value).then(o, s);
1151
- }
1152
- c((r = r.apply(e, t || [])).next());
1153
- });
1154
- };
1155
- class nt extends z {
1156
- constructor(e, t) {
1157
- super(e, t), this.members = new et();
1158
- }
1159
- authorize(e, t) {
1160
- super.authorize(e, (e, n) => tt(this, void 0, void 0, function* () {
1161
- if (!e) {
1162
- if (n = n, n.channel_data != null) {
1163
- var r = JSON.parse(n.channel_data);
1164
- this.members.setMyID(r.user_id);
1165
- } else if (yield this.pusher.user.signinDonePromise, this.pusher.user.user_data != null) this.members.setMyID(this.pusher.user.user_data.id);
1166
- else {
1167
- let e = u.buildLogSuffix("authorizationEndpoint");
1168
- A.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${e}, or the user should be signed in.`), t("Invalid auth response");
1169
- return;
1170
- }
1171
- }
1172
- t(e, n);
1173
- }));
1174
- }
1175
- handleEvent(e) {
1176
- var t = e.event;
1177
- if (t.indexOf("pusher_internal:") === 0) this.handleInternalEvent(e);
1178
- else {
1179
- var n = e.data, r = {};
1180
- e.user_id && (r.user_id = e.user_id), this.emit(t, n, r);
1181
- }
1182
- }
1183
- handleInternalEvent(e) {
1184
- var t = e.event, n = e.data;
1185
- switch (t) {
1186
- case "pusher_internal:subscription_succeeded":
1187
- this.handleSubscriptionSucceededEvent(e);
1188
- break;
1189
- case "pusher_internal:subscription_count":
1190
- this.handleSubscriptionCountEvent(e);
1191
- break;
1192
- case "pusher_internal:member_added":
1193
- var r = this.members.addMember(n);
1194
- this.emit("pusher:member_added", r);
1195
- break;
1196
- case "pusher_internal:member_removed":
1197
- var i = this.members.removeMember(n);
1198
- i && this.emit("pusher:member_removed", i);
1199
- }
1200
- }
1201
- handleSubscriptionSucceededEvent(e) {
1202
- this.subscriptionPending = !1, this.subscribed = !0, this.subscriptionCancelled ? this.pusher.unsubscribe(this.name) : (this.members.onSubscription(e.data), this.emit("pusher:subscription_succeeded", this.members));
1203
- }
1204
- disconnect() {
1205
- this.members.reset(), super.disconnect();
1206
- }
1207
- }
1208
- var rt = n(978), B = n(594);
1209
- class it extends z {
1210
- constructor(e, t, n) {
1211
- super(e, t), this.key = null, this.nacl = n;
1212
- }
1213
- authorize(e, t) {
1214
- super.authorize(e, (e, n) => {
1215
- if (e) {
1216
- t(e, n);
1217
- return;
1218
- }
1219
- let r = n.shared_secret;
1220
- r ? (this.key = (0, B.decode)(r), delete n.shared_secret, t(null, n)) : t(/* @__PURE__ */ Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`), null);
1221
- });
1222
- }
1223
- trigger(e, t) {
1224
- throw new m("Client events are not currently supported for encrypted channels");
1225
- }
1226
- handleEvent(e) {
1227
- var t = e.event, n = e.data;
1228
- t.indexOf("pusher_internal:") === 0 || t.indexOf("pusher:") === 0 ? super.handleEvent(e) : this.handleEncryptedEvent(t, n);
1229
- }
1230
- handleEncryptedEvent(e, t) {
1231
- if (!this.key) {
1232
- A.debug("Received encrypted event before key has been retrieved from the authEndpoint");
1233
- return;
1234
- }
1235
- if (!t.ciphertext || !t.nonce) {
1236
- A.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: " + t);
1237
- return;
1238
- }
1239
- let n = (0, B.decode)(t.ciphertext);
1240
- if (n.length < this.nacl.secretbox.overheadLength) {
1241
- A.error(`Expected encrypted event ciphertext length to be ${this.nacl.secretbox.overheadLength}, got: ${n.length}`);
1242
- return;
1243
- }
1244
- let r = (0, B.decode)(t.nonce);
1245
- if (r.length < this.nacl.secretbox.nonceLength) {
1246
- A.error(`Expected encrypted event nonce length to be ${this.nacl.secretbox.nonceLength}, got: ${r.length}`);
1247
- return;
1248
- }
1249
- let i = this.nacl.secretbox.open(n, r, this.key);
1250
- i === null ? (A.debug("Failed to decrypt an event, probably because it was encrypted with a different key. Fetching a new key from the authEndpoint..."), this.authorize(this.pusher.connection.socket_id, (t, a) => {
1251
- t ? A.error(`Failed to make a request to the authEndpoint: ${a}. Unable to fetch new key, so dropping encrypted event`) : (i = this.nacl.secretbox.open(n, r, this.key), i === null ? A.error("Failed to decrypt event with new key. Dropping encrypted event") : this.emit(e, this.getDataToEmit(i)));
1252
- })) : this.emit(e, this.getDataToEmit(i));
1253
- }
1254
- getDataToEmit(e) {
1255
- let t = (0, rt.D4)(e);
1256
- try {
1257
- return JSON.parse(t);
1258
- } catch {
1259
- return t;
1260
- }
1261
- }
1262
- }
1263
- class at extends P {
1264
- constructor(e, t) {
1265
- super(), this.state = "initialized", this.connection = null, this.key = e, this.options = t, this.timeline = this.options.timeline, this.usingTLS = this.options.useTLS, this.errorCallbacks = this.buildErrorCallbacks(), this.connectionCallbacks = this.buildConnectionCallbacks(this.errorCallbacks), this.handshakeCallbacks = this.buildHandshakeCallbacks(this.errorCallbacks);
1266
- var n = Y.getNetwork();
1267
- n.bind("online", () => {
1268
- this.timeline.info({ netinfo: "online" }), (this.state === "connecting" || this.state === "unavailable") && this.retryIn(0);
1269
- }), n.bind("offline", () => {
1270
- this.timeline.info({ netinfo: "offline" }), this.connection && this.sendActivityCheck();
1271
- }), this.updateStrategy();
1272
- }
1273
- switchCluster(e) {
1274
- this.key = e, this.updateStrategy(), this.retryIn(0);
1275
- }
1276
- connect() {
1277
- this.connection || this.runner || (this.strategy.isSupported() ? (this.updateState("connecting"), this.startConnecting(), this.setUnavailableTimer()) : this.updateState("failed"));
1278
- }
1279
- send(e) {
1280
- return this.connection ? this.connection.send(e) : !1;
1281
- }
1282
- send_event(e, t, n) {
1283
- return this.connection ? this.connection.send_event(e, t, n) : !1;
1284
- }
1285
- disconnect() {
1286
- this.disconnectInternally(), this.updateState("disconnected");
1287
- }
1288
- isUsingTLS() {
1289
- return this.usingTLS;
1290
- }
1291
- startConnecting() {
1292
- var e = (t, n) => {
1293
- t ? this.runner = this.strategy.connect(0, e) : n.action === "error" ? (this.emit("error", {
1294
- type: "HandshakeError",
1295
- error: n.error
1296
- }), this.timeline.error({ handshakeError: n.error })) : (this.abortConnecting(), this.handshakeCallbacks[n.action](n));
1297
- };
1298
- this.runner = this.strategy.connect(0, e);
1299
- }
1300
- abortConnecting() {
1301
- this.runner &&= (this.runner.abort(), null);
1302
- }
1303
- disconnectInternally() {
1304
- this.abortConnecting(), this.clearRetryTimer(), this.clearUnavailableTimer(), this.connection && this.abandonConnection().close();
1305
- }
1306
- updateStrategy() {
1307
- this.strategy = this.options.getStrategy({
1308
- key: this.key,
1309
- timeline: this.timeline,
1310
- useTLS: this.usingTLS
1311
- });
1312
- }
1313
- retryIn(e) {
1314
- this.timeline.info({
1315
- action: "retry",
1316
- delay: e
1317
- }), e > 0 && this.emit("connecting_in", Math.round(e / 1e3)), this.retryTimer = new C(e || 0, () => {
1318
- this.disconnectInternally(), this.connect();
1319
- });
1320
- }
1321
- clearRetryTimer() {
1322
- this.retryTimer &&= (this.retryTimer.ensureAborted(), null);
1323
- }
1324
- setUnavailableTimer() {
1325
- this.unavailableTimer = new C(this.options.unavailableTimeout, () => {
1326
- this.updateState("unavailable");
1327
- });
1328
- }
1329
- clearUnavailableTimer() {
1330
- this.unavailableTimer && this.unavailableTimer.ensureAborted();
1331
- }
1332
- sendActivityCheck() {
1333
- this.stopActivityCheck(), this.connection.ping(), this.activityTimer = new C(this.options.pongTimeout, () => {
1334
- this.timeline.error({ pong_timed_out: this.options.pongTimeout }), this.retryIn(0);
1335
- });
1336
- }
1337
- resetActivityCheck() {
1338
- this.stopActivityCheck(), this.connection && !this.connection.handlesActivityChecks() && (this.activityTimer = new C(this.activityTimeout, () => {
1339
- this.sendActivityCheck();
1340
- }));
1341
- }
1342
- stopActivityCheck() {
1343
- this.activityTimer && this.activityTimer.ensureAborted();
1344
- }
1345
- buildConnectionCallbacks(e) {
1346
- return T({}, e, {
1347
- message: (e) => {
1348
- this.resetActivityCheck(), this.emit("message", e);
1349
- },
1350
- ping: () => {
1351
- this.send_event("pusher:pong", {});
1352
- },
1353
- activity: () => {
1354
- this.resetActivityCheck();
1355
- },
1356
- error: (e) => {
1357
- this.emit("error", e);
1358
- },
1359
- closed: () => {
1360
- this.abandonConnection(), this.shouldRetry() && this.retryIn(1e3);
1361
- }
1362
- });
1363
- }
1364
- buildHandshakeCallbacks(e) {
1365
- return T({}, e, { connected: (e) => {
1366
- this.activityTimeout = Math.min(this.options.activityTimeout, e.activityTimeout, e.connection.activityTimeout || Infinity), this.clearUnavailableTimer(), this.setConnection(e.connection), this.socket_id = this.connection.id, this.updateState("connected", { socket_id: this.socket_id });
1367
- } });
1368
- }
1369
- buildErrorCallbacks() {
1370
- let e = (e) => (t) => {
1371
- t.error && this.emit("error", {
1372
- type: "WebSocketError",
1373
- error: t.error
1374
- }), e(t);
1375
- };
1376
- return {
1377
- tls_only: e(() => {
1378
- this.usingTLS = !0, this.updateStrategy(), this.retryIn(0);
1379
- }),
1380
- refused: e(() => {
1381
- this.disconnect();
1382
- }),
1383
- backoff: e(() => {
1384
- this.retryIn(1e3);
1385
- }),
1386
- retry: e(() => {
1387
- this.retryIn(0);
1388
- })
1389
- };
1390
- }
1391
- setConnection(e) {
1392
- for (var t in this.connection = e, this.connectionCallbacks) this.connection.bind(t, this.connectionCallbacks[t]);
1393
- this.resetActivityCheck();
1394
- }
1395
- abandonConnection() {
1396
- if (this.connection) {
1397
- for (var e in this.stopActivityCheck(), this.connectionCallbacks) this.connection.unbind(e, this.connectionCallbacks[e]);
1398
- var t = this.connection;
1399
- return this.connection = null, t;
1400
- }
1401
- }
1402
- updateState(e, t) {
1403
- var n = this.state;
1404
- if (this.state = e, n !== e) {
1405
- var r = e;
1406
- r === "connected" && (r += " with new socket ID " + t.socket_id), A.debug("State changed", n + " -> " + r), this.timeline.info({
1407
- state: e,
1408
- params: t
1409
- }), this.emit("state_change", {
1410
- previous: n,
1411
- current: e
1412
- }), this.emit(e, t);
1413
- }
1414
- }
1415
- shouldRetry() {
1416
- return this.state === "connecting" || this.state === "connected";
1417
- }
1418
- }
1419
- class ot {
1420
- constructor() {
1421
- this.channels = {};
1422
- }
1423
- add(e, t) {
1424
- return this.channels[e] || (this.channels[e] = st(e, t)), this.channels[e];
1425
- }
1426
- all() {
1427
- return ge(this.channels);
1428
- }
1429
- find(e) {
1430
- return this.channels[e];
1431
- }
1432
- remove(e) {
1433
- var t = this.channels[e];
1434
- return delete this.channels[e], t;
1435
- }
1436
- disconnect() {
1437
- D(this.channels, function(e) {
1438
- e.disconnect();
1439
- });
1440
- }
1441
- }
1442
- function st(e, t) {
1443
- if (e.indexOf("private-encrypted-") === 0) {
1444
- if (t.config.nacl) return V.createEncryptedChannel(e, t, t.config.nacl);
1445
- let n = u.buildLogSuffix("encryptedChannelSupport");
1446
- throw new m(`Tried to subscribe to a private-encrypted- channel but no nacl implementation available. ${n}`);
1447
- }
1448
- if (e.indexOf("private-") === 0) return V.createPrivateChannel(e, t);
1449
- if (e.indexOf("presence-") === 0) return V.createPresenceChannel(e, t);
1450
- if (e.indexOf("#") === 0) throw new te("Cannot create a channel with name \"" + e + "\".");
1451
- return V.createChannel(e, t);
1452
- }
1453
- let V = {
1454
- createChannels() {
1455
- return new ot();
1456
- },
1457
- createConnectionManager(e, t) {
1458
- return new at(e, t);
1459
- },
1460
- createChannel(e, t) {
1461
- return new R(e, t);
1462
- },
1463
- createPrivateChannel(e, t) {
1464
- return new z(e, t);
1465
- },
1466
- createPresenceChannel(e, t) {
1467
- return new nt(e, t);
1468
- },
1469
- createEncryptedChannel(e, t, n) {
1470
- return new it(e, t, n);
1471
- },
1472
- createTimelineSender(e, t) {
1473
- return new $e(e, t);
1474
- },
1475
- createHandshake(e, t) {
1476
- return new Qe(e, t);
1477
- },
1478
- createAssistantToTheTransportManager(e, t, n) {
1479
- return new Ye(e, t, n);
1480
- }
1481
- };
1482
- class ct {
1483
- constructor(e) {
1484
- this.options = e || {}, this.livesLeft = this.options.lives || Infinity;
1485
- }
1486
- getAssistant(e) {
1487
- return V.createAssistantToTheTransportManager(this, e, {
1488
- minPingDelay: this.options.minPingDelay,
1489
- maxPingDelay: this.options.maxPingDelay
1490
- });
1491
- }
1492
- isAlive() {
1493
- return this.livesLeft > 0;
1494
- }
1495
- reportDeath() {
1496
- --this.livesLeft;
1497
- }
1498
- }
1499
- class H {
1500
- constructor(e, t) {
1501
- this.strategies = e, this.loop = !!t.loop, this.failFast = !!t.failFast, this.timeout = t.timeout, this.timeoutLimit = t.timeoutLimit;
1502
- }
1503
- isSupported() {
1504
- return Se(this.strategies, w.method("isSupported"));
1505
- }
1506
- connect(e, t) {
1507
- var n = this.strategies, r = 0, i = this.timeout, a = null, o = (s, c) => {
1508
- c ? t(null, c) : (r += 1, this.loop && (r %= n.length), r < n.length ? (i && (i *= 2, this.timeoutLimit && (i = Math.min(i, this.timeoutLimit))), a = this.tryStrategy(n[r], e, {
1509
- timeout: i,
1510
- failFast: this.failFast
1511
- }, o)) : t(!0));
1512
- };
1513
- return a = this.tryStrategy(n[r], e, {
1514
- timeout: i,
1515
- failFast: this.failFast
1516
- }, o), {
1517
- abort: function() {
1518
- a.abort();
1519
- },
1520
- forceMinPriority: function(t) {
1521
- e = t, a && a.forceMinPriority(t);
1522
- }
1523
- };
1524
- }
1525
- tryStrategy(e, t, n, r) {
1526
- var i = null, a = null;
1527
- return n.timeout > 0 && (i = new C(n.timeout, function() {
1528
- a.abort(), r(!0);
1529
- })), a = e.connect(t, function(e, t) {
1530
- e && i && i.isRunning() && !n.failFast || (i && i.ensureAborted(), r(e, t));
1531
- }), {
1532
- abort: function() {
1533
- i && i.ensureAborted(), a.abort();
1534
- },
1535
- forceMinPriority: function(e) {
1536
- a.forceMinPriority(e);
1537
- }
1538
- };
1539
- }
1540
- }
1541
- class U {
1542
- constructor(e) {
1543
- this.strategies = e;
1544
- }
1545
- isSupported() {
1546
- return Se(this.strategies, w.method("isSupported"));
1547
- }
1548
- connect(e, t) {
1549
- return lt(this.strategies, e, function(e, n) {
1550
- return function(r, i) {
1551
- n[e].error = r, r ? ut(n) && t(!0) : (O(n, function(e) {
1552
- e.forceMinPriority(i.transport.priority);
1553
- }), t(null, i));
1554
- };
1555
- });
1556
- }
1557
- }
1558
- function lt(e, t, n) {
1559
- var r = _e(e, function(e, r, i, a) {
1560
- return e.connect(t, n(r, a));
1561
- });
1562
- return {
1563
- abort: function() {
1564
- O(r, dt);
1565
- },
1566
- forceMinPriority: function(e) {
1567
- O(r, function(t) {
1568
- t.forceMinPriority(e);
1569
- });
1570
- }
1571
- };
1572
- }
1573
- function ut(e) {
1574
- return Ce(e, function(e) {
1575
- return !!e.error;
1576
- });
1577
- }
1578
- function dt(e) {
1579
- !e.error && !e.aborted && (e.abort(), e.aborted = !0);
1580
- }
1581
- class ft {
1582
- constructor(e, t, n) {
1583
- this.strategy = e, this.transports = t, this.ttl = n.ttl || 18e5, this.usingTLS = n.useTLS, this.timeline = n.timeline;
1584
- }
1585
- isSupported() {
1586
- return this.strategy.isSupported();
1587
- }
1588
- connect(e, t) {
1589
- var n = this.usingTLS, r = pt(n), i = r && r.cacheSkipCount ? r.cacheSkipCount : 0, a = [this.strategy];
1590
- if (r && r.timestamp + this.ttl >= w.now()) {
1591
- var o = this.transports[r.transport];
1592
- o && (["ws", "wss"].includes(r.transport) || i > 3 ? (this.timeline.info({
1593
- cached: !0,
1594
- transport: r.transport,
1595
- latency: r.latency
1596
- }), a.push(new H([o], {
1597
- timeout: r.latency * 2 + 1e3,
1598
- failFast: !0
1599
- }))) : i++);
1600
- }
1601
- var s = w.now(), c = a.pop().connect(e, function r(o, l) {
1602
- o ? (ht(n), a.length > 0 ? (s = w.now(), c = a.pop().connect(e, r)) : t(o)) : (mt(n, l.transport.name, w.now() - s, i), t(null, l));
1603
- });
1604
- return {
1605
- abort: function() {
1606
- c.abort();
1607
- },
1608
- forceMinPriority: function(t) {
1609
- e = t, c && c.forceMinPriority(t);
1610
- }
1611
- };
1612
- }
1613
- }
1614
- function W(e) {
1615
- return "pusherTransport" + (e ? "TLS" : "NonTLS");
1616
- }
1617
- function pt(e) {
1618
- var t = Y.getLocalStorage();
1619
- if (t) try {
1620
- var n = t[W(e)];
1621
- if (n) return JSON.parse(n);
1622
- } catch {
1623
- ht(e);
1624
- }
1625
- return null;
1626
- }
1627
- function mt(e, t, n, r) {
1628
- var i = Y.getLocalStorage();
1629
- if (i) try {
1630
- i[W(e)] = k({
1631
- timestamp: w.now(),
1632
- transport: t,
1633
- latency: n,
1634
- cacheSkipCount: r
1635
- });
1636
- } catch {}
1637
- }
1638
- function ht(e) {
1639
- var t = Y.getLocalStorage();
1640
- if (t) try {
1641
- delete t[W(e)];
1642
- } catch {}
1643
- }
1644
- class G {
1645
- constructor(e, { delay: t }) {
1646
- this.strategy = e, this.options = { delay: t };
1647
- }
1648
- isSupported() {
1649
- return this.strategy.isSupported();
1650
- }
1651
- connect(e, t) {
1652
- var n = this.strategy, r, i = new C(this.options.delay, function() {
1653
- r = n.connect(e, t);
1654
- });
1655
- return {
1656
- abort: function() {
1657
- i.ensureAborted(), r && r.abort();
1658
- },
1659
- forceMinPriority: function(t) {
1660
- e = t, r && r.forceMinPriority(t);
1661
- }
1662
- };
1663
- }
1664
- }
1665
- class K {
1666
- constructor(e, t, n) {
1667
- this.test = e, this.trueBranch = t, this.falseBranch = n;
1668
- }
1669
- isSupported() {
1670
- return (this.test() ? this.trueBranch : this.falseBranch).isSupported();
1671
- }
1672
- connect(e, t) {
1673
- return (this.test() ? this.trueBranch : this.falseBranch).connect(e, t);
1674
- }
1675
- }
1676
- class gt {
1677
- constructor(e) {
1678
- this.strategy = e;
1679
- }
1680
- isSupported() {
1681
- return this.strategy.isSupported();
1682
- }
1683
- connect(e, t) {
1684
- var n = this.strategy.connect(e, function(e, r) {
1685
- r && n.abort(), t(e, r);
1686
- });
1687
- return n;
1688
- }
1689
- }
1690
- function q(e) {
1691
- return function() {
1692
- return e.isSupported();
1693
- };
1694
- }
1695
- let _t = function(e, t, n) {
1696
- var r = {};
1697
- function i(t, i, a, o, s) {
1698
- var c = n(e, t, i, a, o, s);
1699
- return r[t] = c, c;
1700
- }
1701
- var a = Object.assign({}, t, {
1702
- hostNonTLS: e.wsHost + ":" + e.wsPort,
1703
- hostTLS: e.wsHost + ":" + e.wssPort,
1704
- httpPath: e.wsPath
1705
- }), o = Object.assign({}, a, { useTLS: !0 }), s = Object.assign({}, t, {
1706
- hostNonTLS: e.httpHost + ":" + e.httpPort,
1707
- hostTLS: e.httpHost + ":" + e.httpsPort,
1708
- httpPath: e.httpPath
1709
- }), c = {
1710
- loop: !0,
1711
- timeout: 15e3,
1712
- timeoutLimit: 6e4
1713
- }, l = new ct({
1714
- minPingDelay: 1e4,
1715
- maxPingDelay: e.activityTimeout
1716
- }), u = new ct({
1717
- lives: 2,
1718
- minPingDelay: 1e4,
1719
- maxPingDelay: e.activityTimeout
1720
- }), d = i("ws", "ws", 3, a, l), ee = i("wss", "ws", 3, o, l), te = i("sockjs", "sockjs", 1, s), f = i("xhr_streaming", "xhr_streaming", 1, s, u), ne = i("xdr_streaming", "xdr_streaming", 1, s, u), p = i("xhr_polling", "xhr_polling", 1, s), m = i("xdr_polling", "xdr_polling", 1, s), h = new H([d], c), g = new H([ee], c), _ = new H([te], c), v = new H([new K(q(f), f, ne)], c), y = new H([new K(q(p), p, m)], c), b = new H([new K(q(v), new U([v, new G(y, { delay: 4e3 })]), y)], c), x = new K(q(b), b, _), re = t.useTLS ? new U([h, new G(x, { delay: 2e3 })]) : new U([
1721
- h,
1722
- new G(g, { delay: 2e3 }),
1723
- new G(x, { delay: 5e3 })
1724
- ]);
1725
- return new ft(new gt(new K(q(d), re, x)), r, {
1726
- ttl: 18e5,
1727
- timeline: t.timeline,
1728
- useTLS: t.useTLS
1729
- });
1730
- };
1731
- function vt() {
1732
- var e = this;
1733
- e.timeline.info(e.buildTimelineMessage({ transport: e.name + (e.options.useTLS ? "s" : "") })), e.hooks.isInitialized() ? e.changeState("initialized") : e.hooks.file ? (e.changeState("initializing"), c.load(e.hooks.file, { useTLS: e.options.useTLS }, function(t, n) {
1734
- e.hooks.isInitialized() ? (e.changeState("initialized"), n(!0)) : (t && e.onError(t), e.onClose(), n(!1));
1735
- })) : e.onClose();
1736
- }
1737
- let yt = {
1738
- getRequest: function(e) {
1739
- var t = new window.XDomainRequest();
1740
- return t.ontimeout = function() {
1741
- e.emit("error", new f()), e.close();
1742
- }, t.onerror = function(t) {
1743
- e.emit("error", t), e.close();
1744
- }, t.onprogress = function() {
1745
- t.responseText && t.responseText.length > 0 && e.onChunk(200, t.responseText);
1746
- }, t.onload = function() {
1747
- t.responseText && t.responseText.length > 0 && e.onChunk(200, t.responseText), e.emit("finished", 200), e.close();
1748
- }, t;
1749
- },
1750
- abortRequest: function(e) {
1751
- e.ontimeout = e.onerror = e.onprogress = e.onload = null, e.abort();
1752
- }
1753
- };
1754
- class bt extends P {
1755
- constructor(e, t, n) {
1756
- super(), this.hooks = e, this.method = t, this.url = n;
1757
- }
1758
- start(e) {
1759
- this.position = 0, this.xhr = this.hooks.getRequest(this), this.unloader = () => {
1760
- this.close();
1761
- }, Y.addUnloadListener(this.unloader), this.xhr.open(this.method, this.url, !0), this.xhr.setRequestHeader && this.xhr.setRequestHeader("Content-Type", "application/json"), this.xhr.send(e);
1762
- }
1763
- close() {
1764
- this.unloader &&= (Y.removeUnloadListener(this.unloader), null), this.xhr &&= (this.hooks.abortRequest(this.xhr), null);
1765
- }
1766
- onChunk(e, t) {
1767
- for (;;) {
1768
- var n = this.advanceBuffer(t);
1769
- if (n) this.emit("chunk", {
1770
- status: e,
1771
- data: n
1772
- });
1773
- else break;
1774
- }
1775
- this.isBufferTooLong(t) && this.emit("buffer_too_long");
1776
- }
1777
- advanceBuffer(e) {
1778
- var t = e.slice(this.position), n = t.indexOf("\n");
1779
- return n === -1 ? null : (this.position += n + 1, t.slice(0, n));
1780
- }
1781
- isBufferTooLong(e) {
1782
- return this.position === e.length && e.length > 262144;
1783
- }
1784
- }
1785
- var xt;
1786
- (function(e) {
1787
- e[e.CONNECTING = 0] = "CONNECTING", e[e.OPEN = 1] = "OPEN", e[e.CLOSED = 3] = "CLOSED";
1788
- })(xt ||= {});
1789
- let J = xt;
1790
- var St = 1;
1791
- class Ct {
1792
- constructor(e, t) {
1793
- this.hooks = e, this.session = Ot(1e3) + "/" + kt(8), this.location = wt(t), this.readyState = J.CONNECTING, this.openStream();
1794
- }
1795
- send(e) {
1796
- return this.sendRaw(JSON.stringify([e]));
1797
- }
1798
- ping() {
1799
- this.hooks.sendHeartbeat(this);
1800
- }
1801
- close(e, t) {
1802
- this.onClose(e, t, !0);
1803
- }
1804
- sendRaw(e) {
1805
- if (this.readyState === J.OPEN) try {
1806
- return Y.createSocketRequest("POST", Et(Tt(this.location, this.session))).start(e), !0;
1807
- } catch {
1808
- return !1;
1809
- }
1810
- return !1;
1811
- }
1812
- reconnect() {
1813
- this.closeStream(), this.openStream();
1814
- }
1815
- onClose(e, t, n) {
1816
- this.closeStream(), this.readyState = J.CLOSED, this.onclose && this.onclose({
1817
- code: e,
1818
- reason: t,
1819
- wasClean: n
1820
- });
1821
- }
1822
- onChunk(e) {
1823
- if (e.status === 200) {
1824
- this.readyState === J.OPEN && this.onActivity();
1825
- var t;
1826
- switch (e.data.slice(0, 1)) {
1827
- case "o":
1828
- t = JSON.parse(e.data.slice(1) || "{}"), this.onOpen(t);
1829
- break;
1830
- case "a":
1831
- t = JSON.parse(e.data.slice(1) || "[]");
1832
- for (var n = 0; n < t.length; n++) this.onEvent(t[n]);
1833
- break;
1834
- case "m":
1835
- t = JSON.parse(e.data.slice(1) || "null"), this.onEvent(t);
1836
- break;
1837
- case "h":
1838
- this.hooks.onHeartbeat(this);
1839
- break;
1840
- case "c": t = JSON.parse(e.data.slice(1) || "[]"), this.onClose(t[0], t[1], !0);
1841
- }
1842
- }
1843
- }
1844
- onOpen(e) {
1845
- this.readyState === J.CONNECTING ? (e && e.hostname && (this.location.base = Dt(this.location.base, e.hostname)), this.readyState = J.OPEN, this.onopen && this.onopen()) : this.onClose(1006, "Server lost session", !0);
1846
- }
1847
- onEvent(e) {
1848
- this.readyState === J.OPEN && this.onmessage && this.onmessage({ data: e });
1849
- }
1850
- onActivity() {
1851
- this.onactivity && this.onactivity();
1852
- }
1853
- onError(e) {
1854
- this.onerror && this.onerror(e);
1855
- }
1856
- openStream() {
1857
- this.stream = Y.createSocketRequest("POST", Et(this.hooks.getReceiveURL(this.location, this.session))), this.stream.bind("chunk", (e) => {
1858
- this.onChunk(e);
1859
- }), this.stream.bind("finished", (e) => {
1860
- this.hooks.onFinished(this, e);
1861
- }), this.stream.bind("buffer_too_long", () => {
1862
- this.reconnect();
1863
- });
1864
- try {
1865
- this.stream.start();
1866
- } catch (e) {
1867
- w.defer(() => {
1868
- this.onError(e), this.onClose(1006, "Could not start streaming", !1);
1869
- });
1870
- }
1871
- }
1872
- closeStream() {
1873
- this.stream &&= (this.stream.unbind_all(), this.stream.close(), null);
1874
- }
1875
- }
1876
- function wt(e) {
1877
- var t = /([^\?]*)\/*(\??.*)/.exec(e);
1878
- return {
1879
- base: t[1],
1880
- queryString: t[2]
1881
- };
1882
- }
1883
- function Tt(e, t) {
1884
- return e.base + "/" + t + "/xhr_send";
1885
- }
1886
- function Et(e) {
1887
- return e + (e.indexOf("?") === -1 ? "?" : "&") + "t=" + +/* @__PURE__ */ new Date() + "&n=" + St++;
1888
- }
1889
- function Dt(e, t) {
1890
- var n = /(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(e);
1891
- return n[1] + t + n[3];
1892
- }
1893
- function Ot(e) {
1894
- return Y.randomInt(e);
1895
- }
1896
- function kt(e) {
1897
- for (var t = [], n = 0; n < e; n++) t.push(Ot(32).toString(32));
1898
- return t.join("");
1899
- }
1900
- let At = Ct, jt = {
1901
- getReceiveURL: function(e, t) {
1902
- return e.base + "/" + t + "/xhr_streaming" + e.queryString;
1903
- },
1904
- onHeartbeat: function(e) {
1905
- e.sendRaw("[]");
1906
- },
1907
- sendHeartbeat: function(e) {
1908
- e.sendRaw("[]");
1909
- },
1910
- onFinished: function(e, t) {
1911
- e.onClose(1006, "Connection interrupted (" + t + ")", !1);
1912
- }
1913
- }, Mt = {
1914
- getReceiveURL: function(e, t) {
1915
- return e.base + "/" + t + "/xhr" + e.queryString;
1916
- },
1917
- onHeartbeat: function() {},
1918
- sendHeartbeat: function(e) {
1919
- e.sendRaw("[]");
1920
- },
1921
- onFinished: function(e, t) {
1922
- t === 200 ? e.reconnect() : e.onClose(1006, "Connection interrupted (" + t + ")", !1);
1923
- }
1924
- }, Nt = {
1925
- getRequest: function(e) {
1926
- var t = new (Y.getXHRAPI())();
1927
- return t.onreadystatechange = t.onprogress = function() {
1928
- switch (t.readyState) {
1929
- case 3:
1930
- t.responseText && t.responseText.length > 0 && e.onChunk(t.status, t.responseText);
1931
- break;
1932
- case 4: t.responseText && t.responseText.length > 0 && e.onChunk(t.status, t.responseText), e.emit("finished", t.status), e.close();
1933
- }
1934
- }, t;
1935
- },
1936
- abortRequest: function(e) {
1937
- e.onreadystatechange = null, e.abort();
1938
- }
1939
- }, Pt = {
1940
- createStreamingSocket(e) {
1941
- return this.createSocket(jt, e);
1942
- },
1943
- createPollingSocket(e) {
1944
- return this.createSocket(Mt, e);
1945
- },
1946
- createSocket(e, t) {
1947
- return new At(e, t);
1948
- },
1949
- createXHR(e, t) {
1950
- return this.createRequest(Nt, e, t);
1951
- },
1952
- createRequest(e, t, n) {
1953
- return new bt(e, t, n);
1954
- }
1955
- };
1956
- Pt.createXDR = function(e, t) {
1957
- return this.createRequest(yt, e, t);
1958
- };
1959
- let Y = {
1960
- nextAuthCallbackID: 1,
1961
- auth_callbacks: {},
1962
- ScriptReceivers: i,
1963
- DependenciesReceivers: s,
1964
- getDefaultStrategy: _t,
1965
- Transports: Ke,
1966
- transportConnectionInitializer: vt,
1967
- HTTPFactory: Pt,
1968
- TimelineTransport: je,
1969
- getXHRAPI() {
1970
- return window.XMLHttpRequest;
1971
- },
1972
- getWebSocketAPI() {
1973
- return window.WebSocket || window.MozWebSocket;
1974
- },
1975
- setup(e) {
1976
- if (typeof window < "u") {
1977
- window.Pusher = e;
1978
- var t = () => {
1979
- this.onDocumentBody(e.ready);
1980
- };
1981
- window.JSON ? t() : c.load("json2", {}, t);
1982
- }
1983
- },
1984
- getDocument() {
1985
- return document;
1986
- },
1987
- getProtocol() {
1988
- return this.getDocument().location.protocol;
1989
- },
1990
- getAuthorizers() {
1991
- return {
1992
- ajax: v,
1993
- jsonp: Oe
1994
- };
1995
- },
1996
- onDocumentBody(e) {
1997
- document.body ? e() : setTimeout(() => {
1998
- this.onDocumentBody(e);
1999
- }, 0);
2000
- },
2001
- createJSONPRequest(e, t) {
2002
- return new Ae(e, t);
2003
- },
2004
- createScriptRequest(e) {
2005
- return new ke(e);
2006
- },
2007
- getLocalStorage() {
2008
- try {
2009
- return window.localStorage;
2010
- } catch {
2011
- return;
2012
- }
2013
- },
2014
- createXHR() {
2015
- return this.getXHRAPI() ? this.createXMLHttpRequest() : this.createMicrosoftXHR();
2016
- },
2017
- createXMLHttpRequest() {
2018
- return new (this.getXHRAPI())();
2019
- },
2020
- createMicrosoftXHR() {
2021
- return new ActiveXObject("Microsoft.XMLHTTP");
2022
- },
2023
- getNetwork() {
2024
- return Je;
2025
- },
2026
- createWebSocket(e) {
2027
- return new (this.getWebSocketAPI())(e);
2028
- },
2029
- createSocketRequest(e, t) {
2030
- if (this.isXHRSupported()) return this.HTTPFactory.createXHR(e, t);
2031
- if (this.isXDRSupported(t.indexOf("https:") === 0)) return this.HTTPFactory.createXDR(e, t);
2032
- throw "Cross-origin HTTP requests are not supported";
2033
- },
2034
- isXHRSupported() {
2035
- var e = this.getXHRAPI();
2036
- return !!e && new e().withCredentials !== void 0;
2037
- },
2038
- isXDRSupported(e) {
2039
- var t = e ? "https:" : "http:", n = this.getProtocol();
2040
- return !!window.XDomainRequest && n === t;
2041
- },
2042
- addUnloadListener(e) {
2043
- window.addEventListener === void 0 ? window.attachEvent !== void 0 && window.attachEvent("onunload", e) : window.addEventListener("pagehide", e, !1);
2044
- },
2045
- removeUnloadListener(e) {
2046
- window.addEventListener === void 0 ? window.detachEvent !== void 0 && window.detachEvent("onunload", e) : window.removeEventListener("pagehide", e, !1);
2047
- },
2048
- randomInt(e) {
2049
- let t = window.crypto || window.msCrypto, n = Math.floor(2 ** 32 / e) * e, r;
2050
- do
2051
- r = t.getRandomValues(/* @__PURE__ */ new Uint32Array(1))[0];
2052
- while (r >= n);
2053
- return r % e;
2054
- }
2055
- };
2056
- var X;
2057
- (function(e) {
2058
- e[e.ERROR = 3] = "ERROR", e[e.INFO = 6] = "INFO", e[e.DEBUG = 7] = "DEBUG";
2059
- })(X ||= {});
2060
- let Z = X;
2061
- class Ft {
2062
- constructor(e, t, n) {
2063
- this.key = e, this.session = t, this.events = [], this.options = n || {}, this.sent = 0, this.uniqueID = 0;
2064
- }
2065
- log(e, t) {
2066
- e <= this.options.level && (this.events.push(T({}, t, { timestamp: w.now() })), this.options.limit && this.events.length > this.options.limit && this.events.shift());
2067
- }
2068
- error(e) {
2069
- this.log(Z.ERROR, e);
2070
- }
2071
- info(e) {
2072
- this.log(Z.INFO, e);
2073
- }
2074
- debug(e) {
2075
- this.log(Z.DEBUG, e);
2076
- }
2077
- isEmpty() {
2078
- return this.events.length === 0;
2079
- }
2080
- send(e, t) {
2081
- var n = T({
2082
- session: this.session,
2083
- bundle: this.sent + 1,
2084
- key: this.key,
2085
- lib: "js",
2086
- version: this.options.version,
2087
- cluster: this.options.cluster,
2088
- features: this.options.features,
2089
- timeline: this.events
2090
- }, this.options.params);
2091
- return this.events = [], e(n, (e, n) => {
2092
- e || this.sent++, t && t(e, n);
2093
- }), !0;
2094
- }
2095
- generateUniqueID() {
2096
- return this.uniqueID++, this.uniqueID;
2097
- }
2098
- }
2099
- class It {
2100
- constructor(e, t, n, r) {
2101
- this.name = e, this.priority = t, this.transport = n, this.options = r || {};
2102
- }
2103
- isSupported() {
2104
- return this.transport.isSupported({ useTLS: this.options.useTLS });
2105
- }
2106
- connect(e, t) {
2107
- if (!this.isSupported()) return Lt(new g(), t);
2108
- if (this.priority < e) return Lt(new ne(), t);
2109
- var n = !1, r = this.transport.createConnection(this.name, this.priority, this.options.key, this.options), i = null, a = function() {
2110
- r.unbind("initialized", a), r.connect();
2111
- }, o = function() {
2112
- i = V.createHandshake(r, function(e) {
2113
- n = !0, l(), t(null, e);
2114
- });
2115
- }, s = function(e) {
2116
- l(), t(e);
2117
- }, c = function() {
2118
- l();
2119
- var e = k(r);
2120
- t(new p(e));
2121
- }, l = function() {
2122
- r.unbind("initialized", a), r.unbind("open", o), r.unbind("error", s), r.unbind("closed", c);
2123
- };
2124
- return r.bind("initialized", a), r.bind("open", o), r.bind("error", s), r.bind("closed", c), r.initialize(), {
2125
- abort: () => {
2126
- n || (l(), i ? i.close() : r.close());
2127
- },
2128
- forceMinPriority: (e) => {
2129
- n || this.priority < e && (i ? i.close() : r.close());
2130
- }
2131
- };
2132
- }
2133
- }
2134
- function Lt(e, t) {
2135
- return w.defer(function() {
2136
- t(e);
2137
- }), {
2138
- abort: function() {},
2139
- forceMinPriority: function() {}
2140
- };
2141
- }
2142
- let { Transports: Rt } = Y;
2143
- var zt = function(e, t, n, r, i, a) {
2144
- var o = Rt[n];
2145
- if (!o) throw new h(n);
2146
- var s = (!e.enabledTransports || E(e.enabledTransports, t) !== -1) && (!e.disabledTransports || E(e.disabledTransports, t) === -1), c;
2147
- return s ? (i = Object.assign({ ignoreNullOrigin: e.ignoreNullOrigin }, i), c = new It(t, r, a ? a.getAssistant(o) : o, i)) : c = Bt, c;
2148
- }, Bt = {
2149
- isSupported: function() {
2150
- return !1;
2151
- },
2152
- connect: function(e, t) {
2153
- var n = w.defer(function() {
2154
- t(new g());
2155
- });
2156
- return {
2157
- abort: function() {
2158
- n.ensureAborted();
2159
- },
2160
- forceMinPriority: function() {}
2161
- };
2162
- }
2163
- };
2164
- function Vt(e) {
2165
- if (e == null) throw "You must pass an options object";
2166
- if (e.cluster == null) throw "Options object must provide a cluster";
2167
- "disableStats" in e && A.warn("The disableStats option is deprecated in favor of enableStats");
2168
- }
2169
- let Ht = (e, t) => {
2170
- var n = "socket_id=" + encodeURIComponent(e.socketId);
2171
- for (var r in t.params) n += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(t.params[r]);
2172
- if (t.paramsProvider != null) {
2173
- let e = t.paramsProvider();
2174
- for (var r in e) n += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(e[r]);
2175
- }
2176
- return n;
2177
- }, Ut = (e) => {
2178
- if (Y.getAuthorizers()[e.transport] === void 0) throw `'${e.transport}' is not a recognized auth transport`;
2179
- return (t, n) => {
2180
- let r = Ht(t, e);
2181
- Y.getAuthorizers()[e.transport](Y, r, e, d.UserAuthentication, n);
2182
- };
2183
- }, Wt = (e, t) => {
2184
- var n = "socket_id=" + encodeURIComponent(e.socketId);
2185
- for (var r in n += "&channel_name=" + encodeURIComponent(e.channelName), t.params) n += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(t.params[r]);
2186
- if (t.paramsProvider != null) {
2187
- let e = t.paramsProvider();
2188
- for (var r in e) n += "&" + encodeURIComponent(r) + "=" + encodeURIComponent(e[r]);
2189
- }
2190
- return n;
2191
- }, Gt = (e) => {
2192
- if (Y.getAuthorizers()[e.transport] === void 0) throw `'${e.transport}' is not a recognized auth transport`;
2193
- return (t, n) => {
2194
- let r = Wt(t, e);
2195
- Y.getAuthorizers()[e.transport](Y, r, e, d.ChannelAuthorization, n);
2196
- };
2197
- }, Kt = (e, t, n) => {
2198
- let r = {
2199
- authTransport: t.transport,
2200
- authEndpoint: t.endpoint,
2201
- auth: {
2202
- params: t.params,
2203
- headers: t.headers
2204
- }
2205
- };
2206
- return (t, i) => {
2207
- n(e.channel(t.channelName), r).authorize(t.socketId, i);
2208
- };
2209
- };
2210
- function qt(e, t) {
2211
- let n = {
2212
- activityTimeout: e.activityTimeout || a.activityTimeout,
2213
- cluster: e.cluster,
2214
- httpPath: e.httpPath || a.httpPath,
2215
- httpPort: e.httpPort || a.httpPort,
2216
- httpsPort: e.httpsPort || a.httpsPort,
2217
- pongTimeout: e.pongTimeout || a.pongTimeout,
2218
- statsHost: e.statsHost || a.stats_host,
2219
- unavailableTimeout: e.unavailableTimeout || a.unavailableTimeout,
2220
- wsPath: e.wsPath || a.wsPath,
2221
- wsPort: e.wsPort || a.wsPort,
2222
- wssPort: e.wssPort || a.wssPort,
2223
- enableStats: Qt(e),
2224
- httpHost: Jt(e),
2225
- useTLS: Zt(e),
2226
- wsHost: Yt(e),
2227
- userAuthenticator: en(e),
2228
- channelAuthorizer: nn(e, t)
2229
- };
2230
- return "disabledTransports" in e && (n.disabledTransports = e.disabledTransports), "enabledTransports" in e && (n.enabledTransports = e.enabledTransports), "ignoreNullOrigin" in e && (n.ignoreNullOrigin = e.ignoreNullOrigin), "timelineParams" in e && (n.timelineParams = e.timelineParams), "nacl" in e && (n.nacl = e.nacl), n;
2231
- }
2232
- function Jt(e) {
2233
- return e.httpHost ? e.httpHost : e.cluster ? `sockjs-${e.cluster}.pusher.com` : a.httpHost;
2234
- }
2235
- function Yt(e) {
2236
- return e.wsHost ? e.wsHost : Xt(e.cluster);
2237
- }
2238
- function Xt(e) {
2239
- return `ws-${e}.pusher.com`;
2240
- }
2241
- function Zt(e) {
2242
- return Y.getProtocol() === "https:" || e.forceTLS !== !1;
2243
- }
2244
- function Qt(e) {
2245
- return "enableStats" in e ? e.enableStats : "disableStats" in e && !e.disableStats;
2246
- }
2247
- let $t = (e) => "customHandler" in e && e.customHandler != null;
2248
- function en(e) {
2249
- let t = Object.assign(Object.assign({}, a.userAuthentication), e.userAuthentication);
2250
- return $t(t) ? t.customHandler : Ut(t);
2251
- }
2252
- function tn(e, t) {
2253
- let n;
2254
- return "channelAuthorization" in e ? n = Object.assign(Object.assign({}, a.channelAuthorization), e.channelAuthorization) : (n = {
2255
- transport: e.authTransport || a.authTransport,
2256
- endpoint: e.authEndpoint || a.authEndpoint
2257
- }, "auth" in e && ("params" in e.auth && (n.params = e.auth.params), "headers" in e.auth && (n.headers = e.auth.headers)), "authorizer" in e && (n.customHandler = Kt(t, n, e.authorizer))), n;
2258
- }
2259
- function nn(e, t) {
2260
- let n = tn(e, t);
2261
- return $t(n) ? n.customHandler : Gt(n);
2262
- }
2263
- class rn extends P {
2264
- constructor(e) {
2265
- super(function(e, t) {
2266
- A.debug(`No callbacks on watchlist events for ${e}`);
2267
- }), this.pusher = e, this.bindWatchlistInternalEvent();
2268
- }
2269
- handleEvent(e) {
2270
- e.data.events.forEach((e) => {
2271
- this.emit(e.name, e);
2272
- });
2273
- }
2274
- bindWatchlistInternalEvent() {
2275
- this.pusher.connection.bind("message", (e) => {
2276
- e.event === "pusher_internal:watchlist_events" && this.handleEvent(e);
2277
- });
2278
- }
2279
- }
2280
- function an() {
2281
- let e, t;
2282
- return {
2283
- promise: new Promise((n, r) => {
2284
- e = n, t = r;
2285
- }),
2286
- resolve: e,
2287
- reject: t
2288
- };
2289
- }
2290
- let on = an;
2291
- class sn extends P {
2292
- constructor(e) {
2293
- super(function(e, t) {
2294
- A.debug("No callbacks on user for " + e);
2295
- }), this.signin_requested = !1, this.user_data = null, this.serverToUserChannel = null, this.signinDonePromise = null, this._signinDoneResolve = null, this._onAuthorize = (e, t) => {
2296
- e ? (A.warn(`Error during signin: ${e}`), this.emit("pusher:signin_error", Object.assign({}, {
2297
- type: "AuthError",
2298
- error: e.message
2299
- }, e instanceof _ ? { status: e.status } : {})), this._cleanup()) : this.pusher.send_event("pusher:signin", {
2300
- auth: t.auth,
2301
- user_data: t.user_data
2302
- });
2303
- }, this.pusher = e, this.pusher.connection.bind("state_change", ({ previous: e, current: t }) => {
2304
- e !== "connected" && t === "connected" && this._signin(), e === "connected" && t !== "connected" && (this._cleanup(), this._newSigninPromiseIfNeeded());
2305
- }), this.watchlist = new rn(e), this.pusher.connection.bind("message", (e) => {
2306
- e.event === "pusher:signin_success" && this._onSigninSuccess(e.data), this.serverToUserChannel && this.serverToUserChannel.name === e.channel && this.serverToUserChannel.handleEvent(e);
2307
- });
2308
- }
2309
- signin() {
2310
- this.signin_requested || (this.signin_requested = !0, this._signin());
2311
- }
2312
- _signin() {
2313
- this.signin_requested && (this._newSigninPromiseIfNeeded(), this.pusher.connection.state === "connected" && this.pusher.config.userAuthenticator({ socketId: this.pusher.connection.socket_id }, this._onAuthorize));
2314
- }
2315
- _onSigninSuccess(e) {
2316
- try {
2317
- this.user_data = JSON.parse(e.user_data);
2318
- } catch {
2319
- A.error(`Failed parsing user data after signin: ${e.user_data}`), this._cleanup();
2320
- return;
2321
- }
2322
- typeof this.user_data.id != "string" || this.user_data.id === "" ? (A.error(`user_data doesn't contain an id. user_data: ${this.user_data}`), this._cleanup()) : (this._signinDoneResolve(), this._subscribeChannels());
2323
- }
2324
- _subscribeChannels() {
2325
- let e = (e) => {
2326
- e.subscriptionPending && e.subscriptionCancelled ? e.reinstateSubscription() : !e.subscriptionPending && this.pusher.connection.state === "connected" && e.subscribe();
2327
- };
2328
- this.serverToUserChannel = new R(`#server-to-user-${this.user_data.id}`, this.pusher), this.serverToUserChannel.bind_global((e, t) => {
2329
- e.indexOf("pusher_internal:") !== 0 && e.indexOf("pusher:") !== 0 && this.emit(e, t);
2330
- }), e(this.serverToUserChannel);
2331
- }
2332
- _cleanup() {
2333
- this.user_data = null, this.serverToUserChannel &&= (this.serverToUserChannel.unbind_all(), this.serverToUserChannel.disconnect(), null), this.signin_requested && this._signinDoneResolve();
2334
- }
2335
- _newSigninPromiseIfNeeded() {
2336
- if (!this.signin_requested || this.signinDonePromise && !this.signinDonePromise.done) return;
2337
- let { promise: e, resolve: t, reject: n } = on();
2338
- e.done = !1;
2339
- let r = () => {
2340
- e.done = !0;
2341
- };
2342
- e.then(r).catch(r), this.signinDonePromise = e, this._signinDoneResolve = t;
2343
- }
2344
- }
2345
- class Q {
2346
- static ready() {
2347
- Q.isReady = !0;
2348
- for (var e = 0, t = Q.instances.length; e < t; e++) Q.instances[e].connect();
2349
- }
2350
- static getClientFeatures() {
2351
- return he(be({ ws: Y.Transports.ws }, function(e) {
2352
- return e.isSupported({});
2353
- }));
2354
- }
2355
- constructor(e, t) {
2356
- cn(e), Vt(t), this.key = e, this.options = t, this.config = qt(this.options, this), this.channels = V.createChannels(), this.global_emitter = new P(), this.sessionID = Y.randomInt(1e9), this.timeline = new Ft(this.key, this.sessionID, {
2357
- cluster: this.config.cluster,
2358
- features: Q.getClientFeatures(),
2359
- params: this.config.timelineParams || {},
2360
- limit: 50,
2361
- level: Z.INFO,
2362
- version: a.VERSION
2363
- }), this.config.enableStats && (this.timelineSender = V.createTimelineSender(this.timeline, {
2364
- host: this.config.statsHost,
2365
- path: "/timeline/v2/" + Y.TimelineTransport.name
2366
- }));
2367
- var n = (e) => Y.getDefaultStrategy(this.config, e, zt);
2368
- this.connection = V.createConnectionManager(this.key, {
2369
- getStrategy: n,
2370
- timeline: this.timeline,
2371
- activityTimeout: this.config.activityTimeout,
2372
- pongTimeout: this.config.pongTimeout,
2373
- unavailableTimeout: this.config.unavailableTimeout,
2374
- useTLS: !!this.config.useTLS
2375
- }), this.connection.bind("connected", () => {
2376
- this.subscribeAll(), this.timelineSender && this.timelineSender.send(this.connection.isUsingTLS());
2377
- }), this.connection.bind("message", (e) => {
2378
- var t = e.event.indexOf("pusher_internal:") === 0;
2379
- if (e.channel) {
2380
- var n = this.channel(e.channel);
2381
- n && n.handleEvent(e);
2382
- }
2383
- t || this.global_emitter.emit(e.event, e.data);
2384
- }), this.connection.bind("connecting", () => {
2385
- this.channels.disconnect();
2386
- }), this.connection.bind("disconnected", () => {
2387
- this.channels.disconnect();
2388
- }), this.connection.bind("error", (e) => {
2389
- A.warn(e);
2390
- }), Q.instances.push(this), this.timeline.info({ instances: Q.instances.length }), this.user = new sn(this), Q.isReady && this.connect();
2391
- }
2392
- switchCluster(e) {
2393
- let { appKey: t, cluster: n } = e;
2394
- this.key = t, this.options = Object.assign(Object.assign({}, this.options), { cluster: n }), this.config = qt(this.options, this), this.connection.switchCluster(this.key);
2395
- }
2396
- channel(e) {
2397
- return this.channels.find(e);
2398
- }
2399
- allChannels() {
2400
- return this.channels.all();
2401
- }
2402
- connect() {
2403
- if (this.connection.connect(), this.timelineSender && !this.timelineSenderTimer) {
2404
- var e = this.connection.isUsingTLS(), t = this.timelineSender;
2405
- this.timelineSenderTimer = new pe(6e4, function() {
2406
- t.send(e);
2407
- });
2408
- }
2409
- }
2410
- disconnect() {
2411
- this.connection.disconnect(), this.timelineSenderTimer &&= (this.timelineSenderTimer.ensureAborted(), null);
2412
- }
2413
- bind(e, t, n) {
2414
- return this.global_emitter.bind(e, t, n), this;
2415
- }
2416
- unbind(e, t, n) {
2417
- return this.global_emitter.unbind(e, t, n), this;
2418
- }
2419
- bind_global(e) {
2420
- return this.global_emitter.bind_global(e), this;
2421
- }
2422
- unbind_global(e) {
2423
- return this.global_emitter.unbind_global(e), this;
2424
- }
2425
- unbind_all(e) {
2426
- return this.global_emitter.unbind_all(), this;
2427
- }
2428
- subscribeAll() {
2429
- for (var e in this.channels.channels) this.channels.channels.hasOwnProperty(e) && this.subscribe(e);
2430
- }
2431
- subscribe(e) {
2432
- var t = this.channels.add(e, this);
2433
- return t.subscriptionPending && t.subscriptionCancelled ? t.reinstateSubscription() : !t.subscriptionPending && this.connection.state === "connected" && t.subscribe(), t;
2434
- }
2435
- unsubscribe(e) {
2436
- var t = this.channels.find(e);
2437
- t && t.subscriptionPending ? t.cancelSubscription() : (t = this.channels.remove(e), t && t.subscribed && t.unsubscribe());
2438
- }
2439
- send_event(e, t, n) {
2440
- return this.connection.send_event(e, t, n);
2441
- }
2442
- shouldUseTLS() {
2443
- return this.config.useTLS;
2444
- }
2445
- signin() {
2446
- this.user.signin();
2447
- }
2448
- }
2449
- Q.instances = [], Q.isReady = !1, Q.logToConsole = !1, Q.Runtime = Y, Q.ScriptReceivers = Y.ScriptReceivers, Q.DependenciesReceivers = Y.DependenciesReceivers, Q.auth_callbacks = Y.auth_callbacks;
2450
- let $ = Q;
2451
- function cn(e) {
2452
- if (e == null) throw "You must pass your app key when you instantiate Pusher.";
2453
- }
2454
- Y.setup(Q);
2455
- }
2456
- }, t = {};
2457
- function n(r) {
2458
- var i = t[r];
2459
- if (i !== void 0) return i.exports;
2460
- var a = t[r] = { exports: {} };
2461
- return e[r].call(a.exports, a, a.exports, n), a.exports;
2462
- }
2463
- return n.d = (e, t) => {
2464
- for (var r in t) n.o(t, r) && !n.o(e, r) && Object.defineProperty(e, r, {
2465
- enumerable: !0,
2466
- get: t[r]
2467
- });
2468
- }, n.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), n(721);
2469
- })());
2470
- }));
2471
- export { t };
2472
-
2473
- //# sourceMappingURL=pusher-x9rNqzon.js.map