polfan-server-js-client 0.1.99922 → 0.1.99924

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 (153) hide show
  1. package/.gitmodules +3 -3
  2. package/.idea/deployment.xml +1 -8
  3. package/.idea/workspace.xml +153 -0
  4. package/build/index.js +157 -8
  5. package/build/index.js.map +1 -1
  6. package/build/types/AbstractChatClient.d.ts +114 -108
  7. package/build/types/AbstractRestClient.d.ts +21 -21
  8. package/build/types/AuthClient.d.ts +16 -16
  9. package/build/types/EventTarget.d.ts +18 -18
  10. package/build/types/FilesClient.d.ts +15 -15
  11. package/build/types/IndexedObjectCollection.d.ts +56 -56
  12. package/build/types/Permissions.d.ts +77 -69
  13. package/build/types/WebApiChatClient.d.ts +30 -30
  14. package/build/types/WebSocketChatClient.d.ts +38 -38
  15. package/build/types/index.d.ts +9 -9
  16. package/build/types/state-tracker/AsyncUtils.d.ts +15 -15
  17. package/build/types/state-tracker/ChatStateTracker.d.ts +31 -26
  18. package/build/types/state-tracker/EmoticonsManager.d.ts +15 -0
  19. package/build/types/state-tracker/MessagesManager.d.ts +55 -55
  20. package/build/types/state-tracker/PermissionsManager.d.ts +42 -42
  21. package/build/types/state-tracker/RoomMessagesHistory.d.ts +17 -17
  22. package/build/types/state-tracker/RoomsManager.d.ts +53 -53
  23. package/build/types/state-tracker/SpacesManager.d.ts +52 -52
  24. package/build/types/state-tracker/TopicHistoryWindow.d.ts +75 -75
  25. package/build/types/state-tracker/functions.d.ts +2 -2
  26. package/build/types/types/src/index.d.ts +102 -95
  27. package/build/types/types/src/schemes/ChatLocation.d.ts +5 -5
  28. package/build/types/types/src/schemes/Emoticon.d.ts +8 -0
  29. package/build/types/types/src/schemes/Envelope.d.ts +5 -5
  30. package/build/types/types/src/schemes/FollowedTopic.d.ts +6 -6
  31. package/build/types/types/src/schemes/Message.d.ts +13 -13
  32. package/build/types/types/src/schemes/PermissionOverwritesValue.d.ts +4 -4
  33. package/build/types/types/src/schemes/Role.d.ts +6 -6
  34. package/build/types/types/src/schemes/Room.d.ts +16 -16
  35. package/build/types/types/src/schemes/RoomMember.d.ts +7 -7
  36. package/build/types/types/src/schemes/RoomSummary.d.ts +5 -5
  37. package/build/types/types/src/schemes/Space.d.ts +13 -13
  38. package/build/types/types/src/schemes/SpaceMember.d.ts +5 -5
  39. package/build/types/types/src/schemes/SpaceSummary.d.ts +7 -7
  40. package/build/types/types/src/schemes/Topic.d.ts +8 -8
  41. package/build/types/types/src/schemes/User.d.ts +8 -8
  42. package/build/types/types/src/schemes/UserState.d.ts +6 -6
  43. package/build/types/types/src/schemes/commands/Ack.d.ts +5 -5
  44. package/build/types/types/src/schemes/commands/AssignRole.d.ts +6 -6
  45. package/build/types/types/src/schemes/commands/CreateEmoticon.d.ts +5 -0
  46. package/build/types/types/src/schemes/commands/CreateMessage.d.ts +6 -6
  47. package/build/types/types/src/schemes/commands/CreateOwner.d.ts +5 -5
  48. package/build/types/types/src/schemes/commands/CreateRole.d.ts +5 -5
  49. package/build/types/types/src/schemes/commands/CreateRoom.d.ts +8 -8
  50. package/build/types/types/src/schemes/commands/CreateSpace.d.ts +3 -3
  51. package/build/types/types/src/schemes/commands/CreateTopic.d.ts +8 -8
  52. package/build/types/types/src/schemes/commands/DeassignRole.d.ts +6 -6
  53. package/build/types/types/src/schemes/commands/DeleteEmoticon.d.ts +3 -0
  54. package/build/types/types/src/schemes/commands/DeleteOwner.d.ts +5 -5
  55. package/build/types/types/src/schemes/commands/DeleteRole.d.ts +4 -4
  56. package/build/types/types/src/schemes/commands/DeleteRoom.d.ts +3 -3
  57. package/build/types/types/src/schemes/commands/DeleteSpace.d.ts +3 -3
  58. package/build/types/types/src/schemes/commands/DeleteTopic.d.ts +4 -4
  59. package/build/types/types/src/schemes/commands/FollowTopic.d.ts +4 -4
  60. package/build/types/types/src/schemes/commands/GetComputedPermissions.d.ts +4 -4
  61. package/build/types/types/src/schemes/commands/GetDiscoverableSpaces.d.ts +2 -2
  62. package/build/types/types/src/schemes/commands/GetEmoticons.d.ts +3 -0
  63. package/build/types/types/src/schemes/commands/GetFollowedTopics.d.ts +4 -4
  64. package/build/types/types/src/schemes/commands/GetMessages.d.ts +6 -6
  65. package/build/types/types/src/schemes/commands/GetOwners.d.ts +4 -4
  66. package/build/types/types/src/schemes/commands/GetPermissionOverwriteTargets.d.ts +4 -4
  67. package/build/types/types/src/schemes/commands/GetPermissionOverwrites.d.ts +6 -6
  68. package/build/types/types/src/schemes/commands/GetRoomMembers.d.ts +3 -3
  69. package/build/types/types/src/schemes/commands/GetSession.d.ts +2 -2
  70. package/build/types/types/src/schemes/commands/GetSpaceMembers.d.ts +3 -3
  71. package/build/types/types/src/schemes/commands/GetSpaceRooms.d.ts +3 -3
  72. package/build/types/types/src/schemes/commands/GetTopics.d.ts +4 -4
  73. package/build/types/types/src/schemes/commands/JoinRoom.d.ts +3 -3
  74. package/build/types/types/src/schemes/commands/JoinSpace.d.ts +3 -3
  75. package/build/types/types/src/schemes/commands/LeaveRoom.d.ts +3 -3
  76. package/build/types/types/src/schemes/commands/LeaveSpace.d.ts +3 -3
  77. package/build/types/types/src/schemes/commands/SetPermissionOverwrites.d.ts +8 -8
  78. package/build/types/types/src/schemes/commands/UnfollowTopic.d.ts +4 -4
  79. package/build/types/types/src/schemes/commands/UpdateRole.d.ts +7 -7
  80. package/build/types/types/src/schemes/commands/UpdateRoom.d.ts +6 -6
  81. package/build/types/types/src/schemes/commands/UpdateSpace.d.ts +11 -9
  82. package/build/types/types/src/schemes/commands/UpdateTopic.d.ts +5 -5
  83. package/build/types/types/src/schemes/events/Bye.d.ts +3 -3
  84. package/build/types/types/src/schemes/events/ComputedPermissions.d.ts +5 -5
  85. package/build/types/types/src/schemes/events/DiscoverableSpaces.d.ts +4 -4
  86. package/build/types/types/src/schemes/events/EmoticonDeleted.d.ts +4 -0
  87. package/build/types/types/src/schemes/events/Emoticons.d.ts +6 -0
  88. package/build/types/types/src/schemes/events/Error.d.ts +4 -4
  89. package/build/types/types/src/schemes/events/FollowedTopicUpdated.d.ts +4 -4
  90. package/build/types/types/src/schemes/events/FollowedTopics.d.ts +6 -6
  91. package/build/types/types/src/schemes/events/Messages.d.ts +6 -6
  92. package/build/types/types/src/schemes/events/NewEmoticon.d.ts +4 -0
  93. package/build/types/types/src/schemes/events/NewMessage.d.ts +4 -4
  94. package/build/types/types/src/schemes/events/NewRole.d.ts +5 -5
  95. package/build/types/types/src/schemes/events/NewRoom.d.ts +5 -5
  96. package/build/types/types/src/schemes/events/NewTopic.d.ts +5 -5
  97. package/build/types/types/src/schemes/events/Ok.d.ts +2 -2
  98. package/build/types/types/src/schemes/events/Owners.d.ts +8 -8
  99. package/build/types/types/src/schemes/events/PermissionOverwriteTargets.d.ts +10 -10
  100. package/build/types/types/src/schemes/events/PermissionOverwrites.d.ts +8 -8
  101. package/build/types/types/src/schemes/events/PermissionOverwritesUpdated.d.ts +8 -8
  102. package/build/types/types/src/schemes/events/RoleDeleted.d.ts +4 -4
  103. package/build/types/types/src/schemes/events/RoleUpdated.d.ts +5 -5
  104. package/build/types/types/src/schemes/events/RoomDeleted.d.ts +3 -3
  105. package/build/types/types/src/schemes/events/RoomJoined.d.ts +4 -4
  106. package/build/types/types/src/schemes/events/RoomLeft.d.ts +3 -3
  107. package/build/types/types/src/schemes/events/RoomMemberJoined.d.ts +5 -5
  108. package/build/types/types/src/schemes/events/RoomMemberLeft.d.ts +4 -4
  109. package/build/types/types/src/schemes/events/RoomMemberUpdated.d.ts +6 -6
  110. package/build/types/types/src/schemes/events/RoomMembers.d.ts +5 -5
  111. package/build/types/types/src/schemes/events/RoomUpdated.d.ts +4 -4
  112. package/build/types/types/src/schemes/events/Session.d.ts +7 -7
  113. package/build/types/types/src/schemes/events/SpaceDeleted.d.ts +3 -3
  114. package/build/types/types/src/schemes/events/SpaceJoined.d.ts +4 -4
  115. package/build/types/types/src/schemes/events/SpaceLeft.d.ts +3 -3
  116. package/build/types/types/src/schemes/events/SpaceMemberJoined.d.ts +5 -5
  117. package/build/types/types/src/schemes/events/SpaceMemberLeft.d.ts +4 -4
  118. package/build/types/types/src/schemes/events/SpaceMemberUpdated.d.ts +6 -6
  119. package/build/types/types/src/schemes/events/SpaceMembers.d.ts +5 -5
  120. package/build/types/types/src/schemes/events/SpaceRooms.d.ts +5 -5
  121. package/build/types/types/src/schemes/events/SpaceUpdated.d.ts +4 -4
  122. package/build/types/types/src/schemes/events/TopicDeleted.d.ts +4 -4
  123. package/build/types/types/src/schemes/events/TopicFollowed.d.ts +4 -4
  124. package/build/types/types/src/schemes/events/TopicUnfollowed.d.ts +4 -4
  125. package/build/types/types/src/schemes/events/TopicUpdated.d.ts +6 -6
  126. package/build/types/types/src/schemes/events/Topics.d.ts +6 -6
  127. package/build/types/types/src/schemes/events/UserUpdated.d.ts +4 -4
  128. package/jest.config.ts +199 -199
  129. package/package.json +1 -1
  130. package/src/AbstractChatClient.ts +17 -2
  131. package/src/AuthClient.ts +45 -45
  132. package/src/EventTarget.ts +48 -48
  133. package/src/IndexedObjectCollection.ts +225 -225
  134. package/src/Permissions.ts +2 -0
  135. package/src/WebApiChatClient.ts +94 -94
  136. package/src/WebSocketChatClient.ts +131 -131
  137. package/src/index.ts +22 -22
  138. package/src/state-tracker/ChatStateTracker.ts +46 -41
  139. package/src/state-tracker/EmoticonsManager.ts +67 -0
  140. package/src/state-tracker/RoomMessagesHistory.ts +73 -73
  141. package/src/types/src/index.ts +14 -0
  142. package/src/types/src/schemes/Emoticon.ts +9 -0
  143. package/src/types/src/schemes/commands/CreateEmoticon.ts +5 -0
  144. package/src/types/src/schemes/commands/DeleteEmoticon.ts +3 -0
  145. package/src/types/src/schemes/commands/GetEmoticons.ts +3 -0
  146. package/src/types/src/schemes/commands/UpdateSpace.ts +3 -0
  147. package/src/types/src/schemes/events/EmoticonDeleted.ts +4 -0
  148. package/src/types/src/schemes/events/Emoticons.ts +7 -0
  149. package/src/types/src/schemes/events/NewEmoticon.ts +5 -0
  150. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  151. package/.idea/modules.xml +0 -8
  152. package/.idea/php.xml +0 -18
  153. package/.idea/polfan-server-js-client.iml +0 -10
package/.gitmodules CHANGED
@@ -1,3 +1,3 @@
1
- [submodule "src/types"]
2
- path = src/types
3
- url = https://github.com/szado/pserv-ts-types
1
+ [submodule "src/types"]
2
+ path = src/types
3
+ url = https://github.com/szado/pserv-ts-types
@@ -2,14 +2,7 @@
2
2
  <project version="4">
3
3
  <component name="PublishConfigData" remoteFilesAllowedToDisappearOnAutoupload="false">
4
4
  <serverData>
5
- <paths name="a">
6
- <serverdata>
7
- <mappings>
8
- <mapping local="$PROJECT_DIR$" web="/" />
9
- </mappings>
10
- </serverdata>
11
- </paths>
12
- <paths name="sklep.local">
5
+ <paths name="Local or mounted folder">
13
6
  <serverdata>
14
7
  <mappings>
15
8
  <mapping local="$PROJECT_DIR$" web="/" />
@@ -0,0 +1,153 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="AutoImportSettings">
4
+ <option name="autoReloadType" value="SELECTIVE" />
5
+ </component>
6
+ <component name="ChangeListManager">
7
+ <list default="true" id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="Emoticons support" />
8
+ <option name="SHOW_DIALOG" value="false" />
9
+ <option name="HIGHLIGHT_CONFLICTS" value="true" />
10
+ <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
11
+ <option name="LAST_RESOLUTION" value="IGNORE" />
12
+ </component>
13
+ <component name="ComposerSettings">
14
+ <execution />
15
+ </component>
16
+ <component name="Git.Rebase.Settings">
17
+ <option name="NEW_BASE" value="origin/main" />
18
+ </component>
19
+ <component name="Git.Settings">
20
+ <option name="RECENT_BRANCH_BY_REPOSITORY">
21
+ <map>
22
+ <entry key="$PROJECT_DIR$/src/types" value="562c7beff95ea1eaf5c236df978f50a614a146af" />
23
+ </map>
24
+ </option>
25
+ <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
26
+ <option name="ROOT_SYNC" value="DONT_SYNC" />
27
+ </component>
28
+ <component name="ProjectColorInfo"><![CDATA[{
29
+ "associatedIndex": 5
30
+ }]]></component>
31
+ <component name="ProjectId" id="2sDo2WKPRcvk6nDGnMA2OIWpAcR" />
32
+ <component name="ProjectViewState">
33
+ <option name="hideEmptyMiddlePackages" value="true" />
34
+ <option name="showLibraryContents" value="true" />
35
+ </component>
36
+ <component name="PropertiesComponent"><![CDATA[{
37
+ "keyToString": {
38
+ "RunOnceActivity.ShowReadmeOnStart": "true",
39
+ "RunOnceActivity.git.unshallow": "true",
40
+ "git-widget-placeholder": "master",
41
+ "ignore.virus.scanning.warn.message": "true",
42
+ "last_opened_file_path": "//wsl.localhost/Debian/home/jarek/polfan-js-client-library",
43
+ "node.js.detected.package.eslint": "true",
44
+ "node.js.detected.package.tslint": "true",
45
+ "node.js.selected.package.eslint": "(autodetect)",
46
+ "node.js.selected.package.tslint": "(autodetect)",
47
+ "nodejs_package_manager_path": "npm",
48
+ "ts.external.directory.path": "\\\\wsl.localhost\\Debian\\home\\jarek\\polfan-js-client-library\\node_modules\\typescript\\lib",
49
+ "vue.rearranger.settings.migration": "true"
50
+ }
51
+ }]]></component>
52
+ <component name="SharedIndexes">
53
+ <attachedChunks>
54
+ <set>
55
+ <option value="bundled-js-predefined-d6986cc7102b-deb605915726-JavaScript-PS-243.22562.233" />
56
+ <option value="bundled-php-predefined-a98d8de5180a-7980c7aaca61-com.jetbrains.php.sharedIndexes-PS-243.22562.233" />
57
+ </set>
58
+ </attachedChunks>
59
+ </component>
60
+ <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
61
+ <component name="TaskManager">
62
+ <task active="true" id="Default" summary="Default task">
63
+ <changelist id="831dae43-0da1-47fd-a5f7-33dd5eec2992" name="Changes" comment="" />
64
+ <created>1737999300590</created>
65
+ <option name="number" value="Default" />
66
+ <option name="presentableId" value="Default" />
67
+ <updated>1737999300590</updated>
68
+ <workItem from="1737999301306" duration="8376000" />
69
+ </task>
70
+ <task id="LOCAL-00001" summary="Emoticons objects">
71
+ <option name="closed" value="true" />
72
+ <created>1738000298032</created>
73
+ <option name="number" value="00001" />
74
+ <option name="presentableId" value="LOCAL-00001" />
75
+ <option name="project" value="LOCAL" />
76
+ <updated>1738000298032</updated>
77
+ </task>
78
+ <task id="LOCAL-00002" summary="Emoticons objects">
79
+ <option name="closed" value="true" />
80
+ <created>1738000310264</created>
81
+ <option name="number" value="00002" />
82
+ <option name="presentableId" value="LOCAL-00002" />
83
+ <option name="project" value="LOCAL" />
84
+ <updated>1738000310264</updated>
85
+ </task>
86
+ <task id="LOCAL-00003" summary="Emoticons support">
87
+ <option name="closed" value="true" />
88
+ <created>1738002489324</created>
89
+ <option name="number" value="00003" />
90
+ <option name="presentableId" value="LOCAL-00003" />
91
+ <option name="project" value="LOCAL" />
92
+ <updated>1738002489324</updated>
93
+ </task>
94
+ <task id="LOCAL-00004" summary="Emoticons support">
95
+ <option name="closed" value="true" />
96
+ <created>1738002764971</created>
97
+ <option name="number" value="00004" />
98
+ <option name="presentableId" value="LOCAL-00004" />
99
+ <option name="project" value="LOCAL" />
100
+ <updated>1738002764971</updated>
101
+ </task>
102
+ <task id="LOCAL-00005" summary="Emoticons support">
103
+ <option name="closed" value="true" />
104
+ <created>1738002769540</created>
105
+ <option name="number" value="00005" />
106
+ <option name="presentableId" value="LOCAL-00005" />
107
+ <option name="project" value="LOCAL" />
108
+ <updated>1738002769540</updated>
109
+ </task>
110
+ <task id="LOCAL-00006" summary="Emoticons support">
111
+ <option name="closed" value="true" />
112
+ <created>1738002772620</created>
113
+ <option name="number" value="00006" />
114
+ <option name="presentableId" value="LOCAL-00006" />
115
+ <option name="project" value="LOCAL" />
116
+ <updated>1738002772620</updated>
117
+ </task>
118
+ <task id="LOCAL-00007" summary="Emoticons support">
119
+ <option name="closed" value="true" />
120
+ <created>1738002786100</created>
121
+ <option name="number" value="00007" />
122
+ <option name="presentableId" value="LOCAL-00007" />
123
+ <option name="project" value="LOCAL" />
124
+ <updated>1738002786100</updated>
125
+ </task>
126
+ <task id="LOCAL-00008" summary="Emoticons support">
127
+ <option name="closed" value="true" />
128
+ <created>1738002805203</created>
129
+ <option name="number" value="00008" />
130
+ <option name="presentableId" value="LOCAL-00008" />
131
+ <option name="project" value="LOCAL" />
132
+ <updated>1738002805203</updated>
133
+ </task>
134
+ <task id="LOCAL-00009" summary="Emoticons support">
135
+ <option name="closed" value="true" />
136
+ <created>1738005832363</created>
137
+ <option name="number" value="00009" />
138
+ <option name="presentableId" value="LOCAL-00009" />
139
+ <option name="project" value="LOCAL" />
140
+ <updated>1738005832363</updated>
141
+ </task>
142
+ <option name="localTasksCounter" value="10" />
143
+ <servers />
144
+ </component>
145
+ <component name="TypeScriptGeneratedFilesManager">
146
+ <option name="version" value="3" />
147
+ </component>
148
+ <component name="VcsManagerConfiguration">
149
+ <MESSAGE value="Emoticons objects" />
150
+ <MESSAGE value="Emoticons support" />
151
+ <option name="LAST_COMMIT_MESSAGE" value="Emoticons support" />
152
+ </component>
153
+ </project>
package/build/index.js CHANGED
@@ -1271,8 +1271,8 @@ var RoomMessagesHistory = /*#__PURE__*/function () {
1271
1271
  }
1272
1272
  }
1273
1273
 
1274
- /**
1275
- * Returns a history window object for the given topic ID, allowing you to view message history.
1274
+ /**
1275
+ * Returns a history window object for the given topic ID, allowing you to view message history.
1276
1276
  */
1277
1277
  RoomMessagesHistory_createClass(RoomMessagesHistory, [{
1278
1278
  key: "getMessagesWindow",
@@ -3030,6 +3030,14 @@ Permissions_defineProperty(Permissions, "list", {
3030
3030
  ManageSpaceRooms: {
3031
3031
  value: 1 << 12,
3032
3032
  maxLayer: Layer.Space
3033
+ },
3034
+ CreateEmoticons: {
3035
+ value: 1 << 13,
3036
+ maxLayer: Layer.Global
3037
+ },
3038
+ ManageEmoticon: {
3039
+ value: 1 << 14,
3040
+ maxLayer: Layer.Space
3033
3041
  }
3034
3042
  });
3035
3043
  ;// CONCATENATED MODULE: ./src/state-tracker/PermissionsManager.ts
@@ -3656,6 +3664,141 @@ var PermissionsManager = /*#__PURE__*/function (_EventTarget) {
3656
3664
  }]);
3657
3665
  return PermissionsManager;
3658
3666
  }(EventTarget);
3667
+ ;// CONCATENATED MODULE: ./src/state-tracker/EmoticonsManager.ts
3668
+ function EmoticonsManager_typeof(obj) { "@babel/helpers - typeof"; return EmoticonsManager_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, EmoticonsManager_typeof(obj); }
3669
+ function EmoticonsManager_toConsumableArray(arr) { return EmoticonsManager_arrayWithoutHoles(arr) || EmoticonsManager_iterableToArray(arr) || EmoticonsManager_unsupportedIterableToArray(arr) || EmoticonsManager_nonIterableSpread(); }
3670
+ function EmoticonsManager_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3671
+ function EmoticonsManager_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return EmoticonsManager_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return EmoticonsManager_arrayLikeToArray(o, minLen); }
3672
+ function EmoticonsManager_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
3673
+ function EmoticonsManager_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return EmoticonsManager_arrayLikeToArray(arr); }
3674
+ function EmoticonsManager_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
3675
+ function EmoticonsManager_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ EmoticonsManager_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == EmoticonsManager_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
3676
+ function EmoticonsManager_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
3677
+ function EmoticonsManager_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { EmoticonsManager_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { EmoticonsManager_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
3678
+ function EmoticonsManager_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3679
+ function EmoticonsManager_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, EmoticonsManager_toPropertyKey(descriptor.key), descriptor); } }
3680
+ function EmoticonsManager_createClass(Constructor, protoProps, staticProps) { if (protoProps) EmoticonsManager_defineProperties(Constructor.prototype, protoProps); if (staticProps) EmoticonsManager_defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
3681
+ function EmoticonsManager_defineProperty(obj, key, value) { key = EmoticonsManager_toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3682
+ function EmoticonsManager_toPropertyKey(arg) { var key = EmoticonsManager_toPrimitive(arg, "string"); return EmoticonsManager_typeof(key) === "symbol" ? key : String(key); }
3683
+ function EmoticonsManager_toPrimitive(input, hint) { if (EmoticonsManager_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (EmoticonsManager_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
3684
+
3685
+
3686
+ var GLOBAL_KEY = 'global';
3687
+ var EmoticonsManager = /*#__PURE__*/function () {
3688
+ function EmoticonsManager(tracker) {
3689
+ var _this = this;
3690
+ EmoticonsManager_classCallCheck(this, EmoticonsManager);
3691
+ this.tracker = tracker;
3692
+ EmoticonsManager_defineProperty(this, "list", new IndexedCollection());
3693
+ EmoticonsManager_defineProperty(this, "emoticonsPromises", new PromiseRegistry());
3694
+ this.tracker.client.on('Emoticons', function (ev) {
3695
+ return _this.handleEmoticons(ev);
3696
+ });
3697
+ this.tracker.client.on('NewEmoticon', function (ev) {
3698
+ return _this.handleNewEmoticon(ev);
3699
+ });
3700
+ this.tracker.client.on('EmoticonDeleted', function (ev) {
3701
+ return _this.handleEmoticonDeleted(ev);
3702
+ });
3703
+ this.tracker.client.on('SpaceDeleted', function (ev) {
3704
+ return _this.handleSpaceDeleted(ev);
3705
+ });
3706
+ this.tracker.client.on('Session', function () {
3707
+ return _this.handleSession();
3708
+ });
3709
+ }
3710
+ EmoticonsManager_createClass(EmoticonsManager, [{
3711
+ key: "get",
3712
+ value: function () {
3713
+ var _get = EmoticonsManager_asyncToGenerator( /*#__PURE__*/EmoticonsManager_regeneratorRuntime().mark(function _callee2(spaceId) {
3714
+ var _this2 = this;
3715
+ return EmoticonsManager_regeneratorRuntime().wrap(function _callee2$(_context2) {
3716
+ while (1) {
3717
+ switch (_context2.prev = _context2.next) {
3718
+ case 0:
3719
+ if (this.emoticonsPromises.notExist(spaceId)) {
3720
+ this.emoticonsPromises.registerByFunction( /*#__PURE__*/EmoticonsManager_asyncToGenerator( /*#__PURE__*/EmoticonsManager_regeneratorRuntime().mark(function _callee() {
3721
+ var result;
3722
+ return EmoticonsManager_regeneratorRuntime().wrap(function _callee$(_context) {
3723
+ while (1) {
3724
+ switch (_context.prev = _context.next) {
3725
+ case 0:
3726
+ _context.next = 2;
3727
+ return _this2.tracker.client.send('GetEmoticons', {
3728
+ spaceId: spaceId
3729
+ });
3730
+ case 2:
3731
+ result = _context.sent;
3732
+ if (!result.error) {
3733
+ _context.next = 5;
3734
+ break;
3735
+ }
3736
+ throw result.error;
3737
+ case 5:
3738
+ _this2.handleEmoticons(result.data);
3739
+ case 6:
3740
+ case "end":
3741
+ return _context.stop();
3742
+ }
3743
+ }
3744
+ }, _callee);
3745
+ })), spaceId !== null && spaceId !== void 0 ? spaceId : GLOBAL_KEY);
3746
+ }
3747
+ _context2.next = 3;
3748
+ return this.emoticonsPromises.get(spaceId);
3749
+ case 3:
3750
+ return _context2.abrupt("return", this.list.get(spaceId));
3751
+ case 4:
3752
+ case "end":
3753
+ return _context2.stop();
3754
+ }
3755
+ }
3756
+ }, _callee2, this);
3757
+ }));
3758
+ function get(_x) {
3759
+ return _get.apply(this, arguments);
3760
+ }
3761
+ return get;
3762
+ }()
3763
+ }, {
3764
+ key: "handleEmoticons",
3765
+ value: function handleEmoticons(event) {
3766
+ var _event$location$space;
3767
+ var spaceId = (_event$location$space = event.location.spaceId) !== null && _event$location$space !== void 0 ? _event$location$space : GLOBAL_KEY;
3768
+ if (!this.list.has(spaceId)) {
3769
+ this.list.set([spaceId, new ObservableIndexedObjectCollection('id')]);
3770
+ }
3771
+ var collection = this.list.get(spaceId);
3772
+ collection.set.apply(collection, EmoticonsManager_toConsumableArray(event.emoticons));
3773
+ }
3774
+ }, {
3775
+ key: "handleNewEmoticon",
3776
+ value: function handleNewEmoticon(ev) {
3777
+ var _ev$emoticon$spaceId;
3778
+ var collection = this.list.get((_ev$emoticon$spaceId = ev.emoticon.spaceId) !== null && _ev$emoticon$spaceId !== void 0 ? _ev$emoticon$spaceId : GLOBAL_KEY);
3779
+ collection === null || collection === void 0 ? void 0 : collection.set(ev.emoticon);
3780
+ }
3781
+ }, {
3782
+ key: "handleEmoticonDeleted",
3783
+ value: function handleEmoticonDeleted(ev) {
3784
+ var _ev$spaceId;
3785
+ var collection = this.list.get((_ev$spaceId = ev.spaceId) !== null && _ev$spaceId !== void 0 ? _ev$spaceId : GLOBAL_KEY);
3786
+ collection === null || collection === void 0 ? void 0 : collection["delete"](ev.emoticonId);
3787
+ }
3788
+ }, {
3789
+ key: "handleSpaceDeleted",
3790
+ value: function handleSpaceDeleted(event) {
3791
+ this.list["delete"](event.id);
3792
+ }
3793
+ }, {
3794
+ key: "handleSession",
3795
+ value: function handleSession() {
3796
+ this.list.deleteAll();
3797
+ this.emoticonsPromises.forgetAll();
3798
+ }
3799
+ }]);
3800
+ return EmoticonsManager;
3801
+ }();
3659
3802
  ;// CONCATENATED MODULE: ./src/state-tracker/ChatStateTracker.ts
3660
3803
  function ChatStateTracker_typeof(obj) { "@babel/helpers - typeof"; return ChatStateTracker_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, ChatStateTracker_typeof(obj); }
3661
3804
  function ChatStateTracker_regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ ChatStateTracker_regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == ChatStateTracker_typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
@@ -3671,17 +3814,22 @@ function ChatStateTracker_toPrimitive(input, hint) { if (ChatStateTracker_typeof
3671
3814
 
3672
3815
 
3673
3816
 
3817
+
3674
3818
  var ChatStateTracker = /*#__PURE__*/function () {
3675
- /**
3676
- * State of your permissions.
3819
+ /**
3820
+ * State of your permissions.
3677
3821
  */
3678
3822
 
3679
- /**
3680
- * State of the rooms you are in.
3823
+ /**
3824
+ * State of the rooms you are in.
3681
3825
  */
3682
3826
 
3683
- /**
3684
- * State of the spaces you are in.
3827
+ /**
3828
+ * State of the spaces you are in.
3829
+ */
3830
+
3831
+ /**
3832
+ * State of the emoticons (global and space-related).
3685
3833
  */
3686
3834
 
3687
3835
  function ChatStateTracker(client) {
@@ -3691,6 +3839,7 @@ var ChatStateTracker = /*#__PURE__*/function () {
3691
3839
  ChatStateTracker_defineProperty(this, "permissions", new PermissionsManager(this));
3692
3840
  ChatStateTracker_defineProperty(this, "rooms", new RoomsManager(this));
3693
3841
  ChatStateTracker_defineProperty(this, "spaces", new SpacesManager(this));
3842
+ ChatStateTracker_defineProperty(this, "emoticons", new EmoticonsManager(this));
3694
3843
  ChatStateTracker_defineProperty(this, "_me", null);
3695
3844
  ChatStateTracker_defineProperty(this, "deferredSession", new DeferredTask());
3696
3845
  this.client.on('Session', function (ev) {