@thoughtspot/visual-embed-sdk 1.52.0 → 1.52.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 (279) hide show
  1. package/cjs/package.json +9 -1
  2. package/cjs/src/contracts/contracts.spec.d.ts +2 -0
  3. package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
  4. package/cjs/src/contracts/contracts.spec.js +345 -0
  5. package/cjs/src/contracts/contracts.spec.js.map +1 -0
  6. package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
  7. package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
  8. package/cjs/src/contracts/embed-event-payloads.js +3 -0
  9. package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
  10. package/cjs/src/contracts/host-event-contracts.d.ts +378 -0
  11. package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
  12. package/cjs/src/contracts/host-event-contracts.js +3 -0
  13. package/cjs/src/contracts/host-event-contracts.js.map +1 -0
  14. package/cjs/src/contracts/index.d.ts +22 -0
  15. package/cjs/src/contracts/index.d.ts.map +1 -0
  16. package/cjs/src/contracts/index.js +33 -0
  17. package/cjs/src/contracts/index.js.map +1 -0
  18. package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  19. package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  20. package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  21. package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
  22. package/cjs/src/embed/app.d.ts +17 -140
  23. package/cjs/src/embed/app.d.ts.map +1 -1
  24. package/cjs/src/embed/app.js +20 -120
  25. package/cjs/src/embed/app.js.map +1 -1
  26. package/cjs/src/embed/app.spec.js +70 -26
  27. package/cjs/src/embed/app.spec.js.map +1 -1
  28. package/cjs/src/embed/events.spec.js +12 -2
  29. package/cjs/src/embed/events.spec.js.map +1 -1
  30. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  31. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  32. package/cjs/src/embed/hostEventClient/host-event-client.js +23 -18
  33. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  34. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +36 -36
  35. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  36. package/cjs/src/embed/hostEventClient/utils.d.ts +1 -1
  37. package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
  38. package/cjs/src/embed/hostEventClient/utils.js +3 -3
  39. package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
  40. package/cjs/src/embed/liveboard.d.ts +9 -161
  41. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  42. package/cjs/src/embed/liveboard.js +66 -134
  43. package/cjs/src/embed/liveboard.js.map +1 -1
  44. package/cjs/src/embed/liveboard.spec.js +211 -28
  45. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  46. package/cjs/src/embed/search.d.ts +14 -0
  47. package/cjs/src/embed/search.d.ts.map +1 -1
  48. package/cjs/src/embed/search.js +4 -1
  49. package/cjs/src/embed/search.js.map +1 -1
  50. package/cjs/src/embed/search.spec.js +65 -0
  51. package/cjs/src/embed/search.spec.js.map +1 -1
  52. package/cjs/src/embed/ts-embed.d.ts +17 -22
  53. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  54. package/cjs/src/embed/ts-embed.js +82 -56
  55. package/cjs/src/embed/ts-embed.js.map +1 -1
  56. package/cjs/src/embed/ts-embed.spec.js +325 -17
  57. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  58. package/cjs/src/full-height.d.ts +137 -0
  59. package/cjs/src/full-height.d.ts.map +1 -0
  60. package/cjs/src/full-height.js +272 -0
  61. package/cjs/src/full-height.js.map +1 -0
  62. package/cjs/src/full-height.spec.d.ts +2 -0
  63. package/cjs/src/full-height.spec.d.ts.map +1 -0
  64. package/cjs/src/full-height.spec.js +835 -0
  65. package/cjs/src/full-height.spec.js.map +1 -0
  66. package/cjs/src/index.d.ts +4 -3
  67. package/cjs/src/index.d.ts.map +1 -1
  68. package/cjs/src/index.js +3 -3
  69. package/cjs/src/index.js.map +1 -1
  70. package/cjs/src/react/all-types-export.d.ts +1 -1
  71. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  72. package/cjs/src/react/all-types-export.js.map +1 -1
  73. package/cjs/src/react/all-types-export.parity.spec.js +55 -3
  74. package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
  75. package/cjs/src/types.d.ts +540 -3
  76. package/cjs/src/types.d.ts.map +1 -1
  77. package/cjs/src/types.js +326 -1
  78. package/cjs/src/types.js.map +1 -1
  79. package/cjs/src/utils/processTrigger.d.ts +3 -1
  80. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  81. package/cjs/src/utils/processTrigger.js +19 -51
  82. package/cjs/src/utils/processTrigger.js.map +1 -1
  83. package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
  84. package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
  85. package/cjs/src/utils/transport/iframe-transport.js +108 -0
  86. package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
  87. package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  88. package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  89. package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
  90. package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
  91. package/cjs/src/utils.d.ts +18 -0
  92. package/cjs/src/utils.d.ts.map +1 -1
  93. package/cjs/src/utils.js +39 -1
  94. package/cjs/src/utils.js.map +1 -1
  95. package/cjs/src/utils.spec.js +62 -0
  96. package/cjs/src/utils.spec.js.map +1 -1
  97. package/dist/{index-BMppCU63.js → index-C1pmYb5H.js} +1 -1
  98. package/dist/src/contracts/contracts.spec.d.ts +2 -0
  99. package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
  100. package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
  101. package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
  102. package/dist/src/contracts/host-event-contracts.d.ts +378 -0
  103. package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
  104. package/dist/src/contracts/index.d.ts +22 -0
  105. package/dist/src/contracts/index.d.ts.map +1 -0
  106. package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  107. package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  108. package/dist/src/embed/app.d.ts +17 -140
  109. package/dist/src/embed/app.d.ts.map +1 -1
  110. package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  111. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  112. package/dist/src/embed/hostEventClient/utils.d.ts +1 -1
  113. package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
  114. package/dist/src/embed/liveboard.d.ts +9 -161
  115. package/dist/src/embed/liveboard.d.ts.map +1 -1
  116. package/dist/src/embed/search.d.ts +14 -0
  117. package/dist/src/embed/search.d.ts.map +1 -1
  118. package/dist/src/embed/ts-embed.d.ts +17 -22
  119. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  120. package/dist/src/full-height.d.ts +137 -0
  121. package/dist/src/full-height.d.ts.map +1 -0
  122. package/dist/src/full-height.spec.d.ts +2 -0
  123. package/dist/src/full-height.spec.d.ts.map +1 -0
  124. package/dist/src/index.d.ts +4 -3
  125. package/dist/src/index.d.ts.map +1 -1
  126. package/dist/src/react/all-types-export.d.ts +1 -1
  127. package/dist/src/react/all-types-export.d.ts.map +1 -1
  128. package/dist/src/types.d.ts +540 -3
  129. package/dist/src/types.d.ts.map +1 -1
  130. package/dist/src/utils/processTrigger.d.ts +3 -1
  131. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  132. package/dist/src/utils/transport/iframe-transport.d.ts +55 -0
  133. package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
  134. package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  135. package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  136. package/dist/src/utils.d.ts +18 -0
  137. package/dist/src/utils.d.ts.map +1 -1
  138. package/dist/tsembed-react.es.js +925 -363
  139. package/dist/tsembed-react.js +924 -362
  140. package/dist/tsembed.es.js +925 -363
  141. package/dist/tsembed.js +924 -362
  142. package/dist/visual-embed-sdk-react-full.d.ts +1357 -656
  143. package/dist/visual-embed-sdk-react.d.ts +1257 -606
  144. package/dist/visual-embed-sdk.d.ts +1320 -642
  145. package/lib/package.json +9 -1
  146. package/lib/src/contracts/contracts.spec.d.ts +2 -0
  147. package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
  148. package/lib/src/contracts/contracts.spec.js +342 -0
  149. package/lib/src/contracts/contracts.spec.js.map +1 -0
  150. package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
  151. package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
  152. package/lib/src/contracts/embed-event-payloads.js +2 -0
  153. package/lib/src/contracts/embed-event-payloads.js.map +1 -0
  154. package/lib/src/contracts/host-event-contracts.d.ts +378 -0
  155. package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
  156. package/lib/src/contracts/host-event-contracts.js +2 -0
  157. package/lib/src/contracts/host-event-contracts.js.map +1 -0
  158. package/lib/src/contracts/index.d.ts +22 -0
  159. package/lib/src/contracts/index.d.ts.map +1 -0
  160. package/lib/src/contracts/index.js +22 -0
  161. package/lib/src/contracts/index.js.map +1 -0
  162. package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  163. package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  164. package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  165. package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
  166. package/lib/src/embed/app.d.ts +17 -140
  167. package/lib/src/embed/app.d.ts.map +1 -1
  168. package/lib/src/embed/app.js +22 -122
  169. package/lib/src/embed/app.js.map +1 -1
  170. package/lib/src/embed/app.spec.js +70 -26
  171. package/lib/src/embed/app.spec.js.map +1 -1
  172. package/lib/src/embed/events.spec.js +12 -2
  173. package/lib/src/embed/events.spec.js.map +1 -1
  174. package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  175. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  176. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  177. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  178. package/lib/src/embed/hostEventClient/host-event-client.spec.js +1 -1
  179. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  180. package/lib/src/embed/hostEventClient/utils.d.ts +1 -1
  181. package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
  182. package/lib/src/embed/hostEventClient/utils.js +1 -1
  183. package/lib/src/embed/hostEventClient/utils.js.map +1 -1
  184. package/lib/src/embed/liveboard.d.ts +9 -161
  185. package/lib/src/embed/liveboard.d.ts.map +1 -1
  186. package/lib/src/embed/liveboard.js +67 -135
  187. package/lib/src/embed/liveboard.js.map +1 -1
  188. package/lib/src/embed/liveboard.spec.js +211 -28
  189. package/lib/src/embed/liveboard.spec.js.map +1 -1
  190. package/lib/src/embed/search.d.ts +14 -0
  191. package/lib/src/embed/search.d.ts.map +1 -1
  192. package/lib/src/embed/search.js +4 -1
  193. package/lib/src/embed/search.js.map +1 -1
  194. package/lib/src/embed/search.spec.js +65 -0
  195. package/lib/src/embed/search.spec.js.map +1 -1
  196. package/lib/src/embed/ts-embed.d.ts +17 -22
  197. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  198. package/lib/src/embed/ts-embed.js +82 -56
  199. package/lib/src/embed/ts-embed.js.map +1 -1
  200. package/lib/src/embed/ts-embed.spec.js +322 -14
  201. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  202. package/lib/src/full-height.d.ts +137 -0
  203. package/lib/src/full-height.d.ts.map +1 -0
  204. package/lib/src/full-height.js +268 -0
  205. package/lib/src/full-height.js.map +1 -0
  206. package/lib/src/full-height.spec.d.ts +2 -0
  207. package/lib/src/full-height.spec.d.ts.map +1 -0
  208. package/lib/src/full-height.spec.js +833 -0
  209. package/lib/src/full-height.spec.js.map +1 -0
  210. package/lib/src/index.d.ts +4 -3
  211. package/lib/src/index.d.ts.map +1 -1
  212. package/lib/src/index.js +1 -1
  213. package/lib/src/index.js.map +1 -1
  214. package/lib/src/react/all-types-export.d.ts +1 -1
  215. package/lib/src/react/all-types-export.d.ts.map +1 -1
  216. package/lib/src/react/all-types-export.js.map +1 -1
  217. package/lib/src/react/all-types-export.parity.spec.js +55 -3
  218. package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
  219. package/lib/src/types.d.ts +540 -3
  220. package/lib/src/types.d.ts.map +1 -1
  221. package/lib/src/types.js +326 -1
  222. package/lib/src/types.js.map +1 -1
  223. package/lib/src/utils/processTrigger.d.ts +3 -1
  224. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  225. package/lib/src/utils/processTrigger.js +19 -51
  226. package/lib/src/utils/processTrigger.js.map +1 -1
  227. package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
  228. package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
  229. package/lib/src/utils/transport/iframe-transport.js +101 -0
  230. package/lib/src/utils/transport/iframe-transport.js.map +1 -0
  231. package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  232. package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  233. package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
  234. package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
  235. package/lib/src/utils.d.ts +18 -0
  236. package/lib/src/utils.d.ts.map +1 -1
  237. package/lib/src/utils.js +37 -0
  238. package/lib/src/utils.js.map +1 -1
  239. package/lib/src/utils.spec.js +63 -1
  240. package/lib/src/utils.spec.js.map +1 -1
  241. package/lib/src/visual-embed-sdk.d.ts +1320 -642
  242. package/package.json +9 -1
  243. package/src/contracts/contracts.spec.ts +392 -0
  244. package/src/contracts/embed-event-payloads.ts +83 -0
  245. package/src/contracts/host-event-contracts.ts +456 -0
  246. package/src/contracts/index.ts +53 -0
  247. package/src/contracts/ui-passthrough-contracts.ts +301 -0
  248. package/src/embed/app.spec.ts +86 -34
  249. package/src/embed/app.ts +37 -264
  250. package/src/embed/events.spec.ts +14 -2
  251. package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
  252. package/src/embed/hostEventClient/host-event-client.ts +18 -5
  253. package/src/embed/hostEventClient/utils.ts +2 -1
  254. package/src/embed/liveboard.spec.ts +257 -38
  255. package/src/embed/liveboard.ts +75 -296
  256. package/src/embed/search.spec.ts +80 -0
  257. package/src/embed/search.ts +20 -0
  258. package/src/embed/ts-embed.spec.ts +448 -15
  259. package/src/embed/ts-embed.ts +109 -66
  260. package/src/full-height.spec.ts +1008 -0
  261. package/src/full-height.ts +361 -0
  262. package/src/index.ts +93 -5
  263. package/src/react/all-types-export.parity.spec.ts +63 -3
  264. package/src/react/all-types-export.ts +45 -0
  265. package/src/types.ts +540 -1
  266. package/src/utils/processTrigger.ts +28 -58
  267. package/src/utils/transport/iframe-transport.spec.ts +177 -0
  268. package/src/utils/transport/iframe-transport.ts +122 -0
  269. package/src/utils.spec.ts +71 -0
  270. package/src/utils.ts +38 -0
  271. package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
  272. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  273. package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
  274. package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
  275. package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  276. package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
  277. package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  278. package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
  279. package/src/embed/hostEventClient/contracts.ts +0 -262
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.52.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.52.1 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -1043,6 +1043,9 @@ var EmbedEvent;
1043
1043
  EmbedEvent["Download"] = "download";
1044
1044
  /**
1045
1045
  * Emitted when the download action is triggered on an Answer.
1046
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
1047
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
1048
+ * accepts the union now; per-context enforced next release.
1046
1049
  * Use start:true to subscribe to when download is initiated, or end:true to
1047
1050
  * subscribe to when download is completed. Default is end:true.
1048
1051
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
@@ -1059,6 +1062,9 @@ var EmbedEvent;
1059
1062
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
1060
1063
  /**
1061
1064
  * Emitted when the Download as PDF action is triggered on an Answer
1065
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
1066
+ * liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
1067
+ * accepts the union now; per-context enforced next release.
1062
1068
  * Use start:true to subscribe to when download as PDF is initiated, or end:true to
1063
1069
  * subscribe to when download as PDF is completed. Default is end:true.
1064
1070
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1075,6 +1081,9 @@ var EmbedEvent;
1075
1081
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
1076
1082
  /**
1077
1083
  * Emitted when the Download as CSV action is triggered on an Answer.
1084
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
1085
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
1086
+ * accepts the union now; per-context enforced next release.
1078
1087
  * Use start:true to subscribe to when download as CSV is initiated, or end:true to
1079
1088
  * subscribe to when download as CSV is completed. Default is end:true.
1080
1089
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1091,6 +1100,9 @@ var EmbedEvent;
1091
1100
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
1092
1101
  /**
1093
1102
  * Emitted when the Download as XLSX action is triggered on an Answer.
1103
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
1104
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
1105
+ * accepts the union now; per-context enforced next release.
1094
1106
  * Use start:true to subscribe to when download as XLSX is initiated, or end:true to
1095
1107
  * subscribe to when download as XLSX is completed. Default is end:true.
1096
1108
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1369,6 +1381,9 @@ var EmbedEvent;
1369
1381
  EmbedEvent["Schedule"] = "subscription";
1370
1382
  /**
1371
1383
  * Emitted when a user clicks **Edit** on a Liveboard or visualization
1384
+ * Payload varies by context: {@link VizScopedRequest} (Liveboard),
1385
+ * {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
1386
+ * union now; per-context enforced next release.
1372
1387
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1373
1388
  * @example
1374
1389
  * ```js
@@ -2448,6 +2463,7 @@ var HostEvent;
2448
2463
  * the search query string.
2449
2464
  * Supported in `AppEmbed` and `SearchEmbed` deployments.
2450
2465
  * Includes the following properties:
2466
+ * Payload: {@link SearchRequest}.
2451
2467
  * @param - Includes the following keys:
2452
2468
  * - `searchQuery`: Query string with search tokens.
2453
2469
  * - `dataSources`: Data source GUID to search on.
@@ -2475,6 +2491,9 @@ var HostEvent;
2475
2491
  HostEvent["Search"] = "search";
2476
2492
  /**
2477
2493
  * Triggers a drill on certain points of the specified column
2494
+ * Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
2495
+ * ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
2496
+ * enforced next release.
2478
2497
  * Includes the following properties:
2479
2498
  * @param - Includes the following keys:
2480
2499
  * - `points`: An object containing `selectedPoints` and/or `clickedPoint`
@@ -2554,6 +2573,8 @@ var HostEvent;
2554
2573
  HostEvent["Reload"] = "reload";
2555
2574
  /**
2556
2575
  * Get iframe URL for the current embed view.
2576
+ * Payload: none.
2577
+ * Response: {@link GetIframeUrlResponse}.
2557
2578
  * @example
2558
2579
  * ```js
2559
2580
  * const url = embed.trigger(HostEvent.GetIframeUrl);
@@ -2572,6 +2593,7 @@ var HostEvent;
2572
2593
  HostEvent["GetIframeUrl"] = "GetIframeUrl";
2573
2594
  /**
2574
2595
  * Display specific visualizations on a Liveboard.
2596
+ * Payload: `string[]`.
2575
2597
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
2576
2598
  * in this parameter will be hidden.
2577
2599
  * @example
@@ -2594,6 +2616,7 @@ var HostEvent;
2594
2616
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
2595
2617
  /**
2596
2618
  * Set a Liveboard tab as an active tab.
2619
+ * Payload: {@link SetActiveTabRequest}.
2597
2620
  * @param - tabId - string of id of Tab to show
2598
2621
  * @example
2599
2622
  * ```js
@@ -2621,6 +2644,7 @@ var HostEvent;
2621
2644
  * and `AppEmbed` only. In full application embedding, this event updates
2622
2645
  * the runtime filters applied on the Liveboard and saved Answer objects.
2623
2646
  *
2647
+ * Payload: {@link RuntimeFilter}[].
2624
2648
  * @param - Array of {@link RuntimeFilter} objects. Each item includes:
2625
2649
  * - `columnName`: Name of the column to filter on.
2626
2650
  * - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
@@ -2662,6 +2686,7 @@ var HostEvent;
2662
2686
  * Accepts either a plain value or an object with `path`
2663
2687
  * and an optional `replace` flag.
2664
2688
  *
2689
+ * Payload: `string` | `number` | {@link NavigateRequest}.
2665
2690
  * @param data - A string path, a numeric history delta, or an object
2666
2691
  * `{ path: string | number, replace?: boolean }`.
2667
2692
  * - `path` — the route to navigate to, or a history delta such as `1`
@@ -2689,6 +2714,9 @@ var HostEvent;
2689
2714
  /**
2690
2715
  * Open the filter panel for a particular column.
2691
2716
  * Works with Search and Liveboard embed.
2717
+ * Payload: {@link OpenFilterRequest} (the cross-context superset). The
2718
+ * accepted fields vary by context: {@link OpenFilterLiveboardRequest},
2719
+ * {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
2692
2720
  * @param - { columnId: string,
2693
2721
  * name: string,
2694
2722
  * type: ATTRIBUTE/MEASURE,
@@ -2771,6 +2799,7 @@ var HostEvent;
2771
2799
  /**
2772
2800
  * Open the parameter panel for a particular parameter on a Liveboard.
2773
2801
  * Mirrors {@link HostEvent.OpenFilter} for parameters.
2802
+ * Payload: {@link OpenParameterRequest}.
2774
2803
  * @param - Includes the following keys:
2775
2804
  * - `parameter`: An object identifying the parameter to open, for
2776
2805
  * example, `{ parameterId: '<parameter-GUID>' }`.
@@ -2802,6 +2831,7 @@ var HostEvent;
2802
2831
  HostEvent["OpenParameter"] = "openParameter";
2803
2832
  /**
2804
2833
  * Add columns to the current search query.
2834
+ * Payload: `{ columnIds: string[] }`.
2805
2835
  * @param - { columnIds: string[] }
2806
2836
  * @example
2807
2837
  * ```js
@@ -2820,6 +2850,7 @@ var HostEvent;
2820
2850
  HostEvent["AddColumns"] = "addColumns";
2821
2851
  /**
2822
2852
  * Remove a column from the current search query.
2853
+ * Payload: `{ columnId: string }`.
2823
2854
  * @param - { columnId: string }
2824
2855
  * @example
2825
2856
  * ```js
@@ -2844,6 +2875,8 @@ var HostEvent;
2844
2875
  * sorting, toggling of legends, and data drill down.
2845
2876
  * For more information, see
2846
2877
  * link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
2878
+ * Payload: none.
2879
+ * Response: {@link GetExportRequestForCurrentPinboardResponse}.
2847
2880
  * @example
2848
2881
  * ```js
2849
2882
  * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
@@ -2865,6 +2898,8 @@ var HostEvent;
2865
2898
  * requiring additional user input via the *Pin to Liveboard* modal, define
2866
2899
  * the following parameters:
2867
2900
  *
2901
+ * Payload: {@link PinAnswerToLiveboardRequest}.
2902
+ * Response: {@link PinAnswerToLiveboardResponse}.
2868
2903
  * @param - Includes the following keys:
2869
2904
  * - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
2870
2905
  * Liveboard.
@@ -2979,6 +3014,7 @@ var HostEvent;
2979
3014
  HostEvent["LiveboardInfo"] = "pinboardInfo";
2980
3015
  /**
2981
3016
  * Trigger the **Schedule** action on an embedded Liveboard.
3017
+ * Payload: {@link VizScopedRequest}.
2982
3018
  * @example
2983
3019
  * ```js
2984
3020
  * liveboardEmbed.trigger(HostEvent.Schedule)
@@ -2994,6 +3030,7 @@ var HostEvent;
2994
3030
  HostEvent["Schedule"] = "subscription";
2995
3031
  /**
2996
3032
  * Trigger the **Manage schedule** action on an embedded Liveboard
3033
+ * Payload: {@link VizScopedRequest}.
2997
3034
  * @example
2998
3035
  * ```js
2999
3036
  * liveboardEmbed.trigger(HostEvent.SchedulesList)
@@ -3010,6 +3047,7 @@ var HostEvent;
3010
3047
  /**
3011
3048
  * Trigger the **Export TML** action on an embedded Liveboard or
3012
3049
  * Answer.
3050
+ * Payload: {@link VizScopedRequest}.
3013
3051
  * @example
3014
3052
  * ```js
3015
3053
  * liveboardEmbed.trigger(HostEvent.ExportTML)
@@ -3032,6 +3070,7 @@ var HostEvent;
3032
3070
  /**
3033
3071
  * Trigger the **Edit TML** action on an embedded Liveboard or
3034
3072
  * saved Answers in the full application embedding.
3073
+ * Payload: {@link VizScopedRequest}.
3035
3074
  * @example
3036
3075
  * ```js
3037
3076
  * liveboardEmbed.trigger(HostEvent.EditTML)
@@ -3053,6 +3092,7 @@ var HostEvent;
3053
3092
  HostEvent["EditTML"] = "editTSL";
3054
3093
  /**
3055
3094
  * Trigger the **Update TML** action on an embedded Liveboard.
3095
+ * Payload: {@link VizScopedRequest}.
3056
3096
  * @example
3057
3097
  * ```js
3058
3098
  * liveboardEmbed.trigger(HostEvent.UpdateTML)
@@ -3070,6 +3110,7 @@ var HostEvent;
3070
3110
  * Trigger the **Download PDF** action on an embedded Liveboard,
3071
3111
  * visualization or Answer.
3072
3112
  *
3113
+ * Payload: {@link VizScopedRequest} plus optional `liveboardId`.
3073
3114
  * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3074
3115
  *
3075
3116
  * **NOTE**: The **Download** > **PDF** action is available on
@@ -3120,6 +3161,7 @@ var HostEvent;
3120
3161
  /**
3121
3162
  * Trigger the **AI Highlights** action on an embedded Liveboard
3122
3163
  *
3164
+ * Payload: none.
3123
3165
  * @example
3124
3166
  * ```js
3125
3167
  * liveboardEmbed.trigger(HostEvent.AIHighlights)
@@ -3174,6 +3216,9 @@ var HostEvent;
3174
3216
  HostEvent["MakeACopy"] = "makeACopy";
3175
3217
  /**
3176
3218
  * Trigger the **Delete** action for a Liveboard.
3219
+ * Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
3220
+ * required), {@link VizScopedRequest} (Search). trigger() accepts the union
3221
+ * now; per-context enforced next release.
3177
3222
  * @example
3178
3223
  * ```js
3179
3224
  * appEmbed.trigger(HostEvent.Remove)
@@ -3188,6 +3233,7 @@ var HostEvent;
3188
3233
  HostEvent["Remove"] = "delete";
3189
3234
  /**
3190
3235
  * Trigger the **Explore** action on a visualization.
3236
+ * Payload: {@link RequiredVizRequest}.
3191
3237
  * @param - an object with `vizId` as a key
3192
3238
  * @example
3193
3239
  * ```js
@@ -3207,6 +3253,7 @@ var HostEvent;
3207
3253
  /**
3208
3254
  * Trigger the **Create alert** action on a KPI chart
3209
3255
  * in a Liveboard or saved Answer.
3256
+ * Payload: {@link VizScopedRequest}.
3210
3257
  * @param - an object with `vizId` as a key
3211
3258
  * @example
3212
3259
  * ```js
@@ -3238,6 +3285,7 @@ var HostEvent;
3238
3285
  /**
3239
3286
  * Trigger the **Manage alerts** action on a KPI chart
3240
3287
  * in a visualization or saved Answer.
3288
+ * Payload: {@link VizScopedRequest}.
3241
3289
  * @param - an object with `vizId` as a key
3242
3290
  * @example
3243
3291
  * ```js
@@ -3275,6 +3323,7 @@ var HostEvent;
3275
3323
  * on a Liveboard.
3276
3324
  *
3277
3325
  * This event is not supported in visualization embed and search embed.
3326
+ * Payload: {@link VizScopedRequest}.
3278
3327
  * @param - Object parameter. Includes the following keys:
3279
3328
  * - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
3280
3329
  * pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
@@ -3317,6 +3366,7 @@ var HostEvent;
3317
3366
  HostEvent["Edit"] = "edit";
3318
3367
  /**
3319
3368
  * Trigger the **Copy link** action on a Liveboard or visualization
3369
+ * Payload: {@link VizScopedRequest}.
3320
3370
  * @param - object - to trigger the action for a
3321
3371
  * specific visualization in Liveboard embed, pass in `vizId` as a key
3322
3372
  * @example
@@ -3362,6 +3412,7 @@ var HostEvent;
3362
3412
  HostEvent["CopyLink"] = "embedDocument";
3363
3413
  /**
3364
3414
  * Trigger the **Present** action on a Liveboard or visualization
3415
+ * Payload: {@link VizScopedRequest}.
3365
3416
  * @param - object - to trigger the action for a specific visualization
3366
3417
  * in Liveboard embed, pass in `vizId` as a key
3367
3418
  * @example
@@ -3407,6 +3458,8 @@ var HostEvent;
3407
3458
  HostEvent["Present"] = "present";
3408
3459
  /**
3409
3460
  * Get TML for the current search.
3461
+ * Payload: {@link GetTMLRequest}.
3462
+ * Response: `Record<string, any>`.
3410
3463
  * @example
3411
3464
  * ```js
3412
3465
  * searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
@@ -3456,6 +3509,7 @@ var HostEvent;
3456
3509
  * Trigger the **Show underlying data** action on a
3457
3510
  * chart or table.
3458
3511
  *
3512
+ * Payload: {@link VizScopedRequest}.
3459
3513
  * @param - an object with vizId as a key
3460
3514
  * @example
3461
3515
  * ```js
@@ -3489,6 +3543,7 @@ var HostEvent;
3489
3543
  * Trigger the **Delete** action for a visualization
3490
3544
  * in an embedded Liveboard, or a chart or table
3491
3545
  * generated from Search.
3546
+ * Payload: {@link VizScopedRequest}.
3492
3547
  * @param - Liveboard embed takes an object with `vizId` as a key.
3493
3548
  * Can be left empty if embedding Search or visualization.
3494
3549
  * @example
@@ -3517,6 +3572,7 @@ var HostEvent;
3517
3572
  /**
3518
3573
  * Trigger the **SpotIQ analyze** action on a
3519
3574
  * chart or table.
3575
+ * Payload: {@link VizScopedRequest}.
3520
3576
  * @param - Liveboard embed takes `vizId` as a
3521
3577
  * key. Can be left undefined when embedding Search or
3522
3578
  * visualization.
@@ -3579,6 +3635,7 @@ var HostEvent;
3579
3635
  /**
3580
3636
  * Trigger the **Download** > **PNG** action on
3581
3637
  * charts in the embedded view.
3638
+ * Payload: {@link VizScopedRequest}.
3582
3639
  * @example
3583
3640
  * ```js
3584
3641
  * liveboardEmbed.trigger(HostEvent.DownloadAsPng,
@@ -3610,6 +3667,7 @@ var HostEvent;
3610
3667
  /**
3611
3668
  * Trigger the **Download** > **CSV** action on tables in
3612
3669
  * the embedded view.
3670
+ * Payload: {@link VizScopedRequest}.
3613
3671
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
3614
3672
  * @example
3615
3673
  * ```js
@@ -3649,6 +3707,7 @@ var HostEvent;
3649
3707
  /**
3650
3708
  * Trigger the **Download** > **XLSX** action on tables
3651
3709
  * in the embedded view.
3710
+ * Payload: {@link VizScopedRequest}.
3652
3711
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
3653
3712
  * @example
3654
3713
  * ```js
@@ -3688,6 +3747,7 @@ var HostEvent;
3688
3747
  /**
3689
3748
  * Trigger the **Share** action on an embedded
3690
3749
  * Liveboard or Answer.
3750
+ * Payload: {@link VizScopedRequest}.
3691
3751
  * @example
3692
3752
  * ```js
3693
3753
  * liveboardEmbed.trigger(HostEvent.Share)
@@ -3714,6 +3774,7 @@ var HostEvent;
3714
3774
  * Trigger the **Save** action on a Liveboard, Answer, or Spotter.
3715
3775
  * Saves the changes.
3716
3776
  *
3777
+ * Payload: {@link VizScopedRequest}.
3717
3778
  * @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
3718
3779
  * It is required and can be retrieved from the data embed event.
3719
3780
  *
@@ -3765,6 +3826,7 @@ var HostEvent;
3765
3826
  /**
3766
3827
  * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
3767
3828
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
3829
+ * Payload: {@link VizScopedRequest}.
3768
3830
  * @param - an object with `vizId` as a key
3769
3831
  * @example
3770
3832
  * ```js
@@ -3795,6 +3857,7 @@ var HostEvent;
3795
3857
  * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
3796
3858
  * Sends data from an Answer or Liveboard visualization to third-party apps such
3797
3859
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
3860
+ * Payload: {@link VizScopedRequest}.
3798
3861
  * @param - an object with vizId as a key
3799
3862
  * @example
3800
3863
  * ```js
@@ -3825,6 +3888,7 @@ var HostEvent;
3825
3888
  * Trigger the **Manage pipelines** action on an embedded
3826
3889
  * visualization or Answer.
3827
3890
  * Allows users to manage ThoughtSpot Sync pipelines.
3891
+ * Payload: {@link VizScopedRequest}.
3828
3892
  * @param - an object with `vizId` as a key
3829
3893
  * @example
3830
3894
  * ```js
@@ -3853,6 +3917,7 @@ var HostEvent;
3853
3917
  HostEvent["ManagePipelines"] = "manage-pipeline";
3854
3918
  /**
3855
3919
  * Reset search operation on the Search or Answer page.
3920
+ * Payload: none.
3856
3921
  * @example
3857
3922
  * ```js
3858
3923
  * searchEmbed.trigger(HostEvent.ResetSearch)
@@ -3880,6 +3945,8 @@ var HostEvent;
3880
3945
  * whole Liveboard.
3881
3946
  * The `applicability` attribute is available from SDK: 1.53.0 |
3882
3947
  * ThoughtSpot: 26.10.0.cl.
3948
+ * Payload: {@link GetFiltersRequest}.
3949
+ * Response: {@link GetFiltersResponse}.
3883
3950
  * @example
3884
3951
  * ```js
3885
3952
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
@@ -3899,6 +3966,7 @@ var HostEvent;
3899
3966
  HostEvent["GetFilters"] = "getFilters";
3900
3967
  /**
3901
3968
  * Update one or several filters applied on a Liveboard.
3969
+ * Payload: {@link UpdateFiltersRequest}.
3902
3970
  * @param - Includes the following keys:
3903
3971
  * - `filter`: A single filter object containing column name, filter operator, and
3904
3972
  * values.
@@ -4027,6 +4095,8 @@ var HostEvent;
4027
4095
  HostEvent["UpdateFilters"] = "updateFilters";
4028
4096
  /**
4029
4097
  * Get tab details for the current Liveboard.
4098
+ * Payload: none.
4099
+ * Response: {@link GetTabsResponse}.
4030
4100
  * @example
4031
4101
  * ```js
4032
4102
  * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
@@ -4052,6 +4122,8 @@ var HostEvent;
4052
4122
  /**
4053
4123
  * Get group details for the current Liveboard.
4054
4124
  * Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
4125
+ * Payload: none.
4126
+ * Response: {@link GetGroupsResponse}.
4055
4127
  * @example
4056
4128
  * ```js
4057
4129
  * liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
@@ -4076,6 +4148,7 @@ var HostEvent;
4076
4148
  HostEvent["GetGroups"] = "getGroups";
4077
4149
  /**
4078
4150
  * Set the visible tabs on a Liveboard.
4151
+ * Payload: `string[]`.
4079
4152
  * @param - an array of ids of tabs to show, the IDs not passed
4080
4153
  * will be hidden.
4081
4154
  * @example
@@ -4098,6 +4171,7 @@ var HostEvent;
4098
4171
  HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
4099
4172
  /**
4100
4173
  * Set the hidden tabs on a Liveboard.
4174
+ * Payload: `string[]`.
4101
4175
  * @param - an array of the IDs of the tabs to hide.
4102
4176
  * The IDs not passed will be shown.
4103
4177
  * @example
@@ -4126,6 +4200,8 @@ var HostEvent;
4126
4200
  * `getAnswerService()` method on the embed instance to get an AnswerService
4127
4201
  * object that provides a more convenient interface for working with answers.
4128
4202
  *
4203
+ * Payload: {@link GetAnswerSessionRequest}.
4204
+ * Response: {@link GetAnswerSessionResponse}.
4129
4205
  * @example
4130
4206
  * ```js
4131
4207
  * // Preferred way to get an AnswerService
@@ -4153,6 +4229,7 @@ var HostEvent;
4153
4229
  HostEvent["GetAnswerSession"] = "getAnswerSession";
4154
4230
  /**
4155
4231
  * Trigger the *Ask Sage* action for visualizations
4232
+ * Payload: {@link RequiredVizRequest}.
4156
4233
  * @example
4157
4234
  * ```js
4158
4235
  * liveboardEmbed.trigger(HostEvent.AskSage,
@@ -4164,6 +4241,7 @@ var HostEvent;
4164
4241
  /**
4165
4242
  * Trigger cross filter update action on a Liveboard.
4166
4243
  *
4244
+ * Payload: {@link UpdateCrossFilterRequest}.
4167
4245
  * @example
4168
4246
  * ```js
4169
4247
  * liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
@@ -4179,7 +4257,9 @@ var HostEvent;
4179
4257
  HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
4180
4258
  /**
4181
4259
  * Trigger reset action for a personalized Liveboard view.
4182
- * This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
4260
+ * This event is deprecated.
4261
+ * Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
4262
+ * Payload: none.
4183
4263
  * @example
4184
4264
  * ```js
4185
4265
  * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
@@ -4200,6 +4280,7 @@ var HostEvent;
4200
4280
  /**
4201
4281
  * Triggers an action to update Parameter values on embedded
4202
4282
  * Answers, Liveboard, and Spotter answer in Edit mode.
4283
+ * Payload: {@link RuntimeParameter}[].
4203
4284
  * @param - Includes the following keys for each item:
4204
4285
  * - `name`: Name of the parameter.
4205
4286
  * - `value`: The value to set for the parameter.
@@ -4257,6 +4338,8 @@ var HostEvent;
4257
4338
  * whole Liveboard.
4258
4339
  * The `applicability` attribute is available from SDK: 1.53.0 |
4259
4340
  * ThoughtSpot: 26.10.0.cl.
4341
+ * Payload: none.
4342
+ * Response: {@link GetParametersResponse}.
4260
4343
  * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4261
4344
  * ```js
4262
4345
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
@@ -4294,6 +4377,7 @@ var HostEvent;
4294
4377
  * ```js
4295
4378
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
4296
4379
  * ```
4380
+ * Payload: {@link PersonalisedViewRequest} (`viewId` only).
4297
4381
  * @example
4298
4382
  * ```js
4299
4383
  * // Update personalized view from liveboard context
@@ -4326,6 +4410,7 @@ var HostEvent;
4326
4410
  * If neither is provided, the Liveboard resets to the original/default view.
4327
4411
  * When a `viewName` is provided and multiple views share
4328
4412
  * the same name, the first match is selected.
4413
+ * Payload: {@link PersonalisedViewRequest}.
4329
4414
  * @example
4330
4415
  * ```js
4331
4416
  * liveboardEmbed.trigger(
@@ -4369,6 +4454,8 @@ var HostEvent;
4369
4454
  * If no parameters are specified, the save action is
4370
4455
  * triggered with a modal to prompt users to
4371
4456
  * add a name and description for the Answer.
4457
+ * Payload: {@link SaveAnswerRequest}.
4458
+ * Response: {@link SaveAnswerResponse}.
4372
4459
  * @param - Includes the following keys:
4373
4460
  * - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
4374
4461
  * embed.
@@ -4454,6 +4541,7 @@ var HostEvent;
4454
4541
  /**
4455
4542
  * Triggers a search operation with the search tokens specified in
4456
4543
  * the search query string in spotter embed.
4544
+ * Payload: {@link SpotterSearchRequest}.
4457
4545
  * @param - Includes the following keys:
4458
4546
  * - `query`: Text string in Natural Language format.
4459
4547
  * - `executeSearch`: Boolean to execute search and update search query.
@@ -4478,6 +4566,7 @@ var HostEvent;
4478
4566
  HostEvent["SpotterSearch"] = "SpotterSearch";
4479
4567
  /**
4480
4568
  * Edits the last prompt in spotter embed.
4569
+ * Payload: `string`.
4481
4570
  * @param - `query`: Text string
4482
4571
  * @example
4483
4572
  * ```js
@@ -4494,6 +4583,7 @@ var HostEvent;
4494
4583
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
4495
4584
  /**
4496
4585
  * Opens the data source preview modal in Spotter Embed.
4586
+ * Payload: none.
4497
4587
  * @example
4498
4588
  * ```js
4499
4589
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
@@ -4529,6 +4619,7 @@ var HostEvent;
4529
4619
  HostEvent["DataModelInstructions"] = "DataModelInstructions";
4530
4620
  /**
4531
4621
  * Resets the Spotter Embed Conversation.
4622
+ * Payload: none.
4532
4623
  * @example
4533
4624
  * ```js
4534
4625
  * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
@@ -4541,6 +4632,7 @@ var HostEvent;
4541
4632
  * `conversationId` is **mandatory** — you must pass the id of the
4542
4633
  * conversation to share. Also no-op when sharing is disabled
4543
4634
  * (enableShareConversation off) or when already in the read-only shared view.
4635
+ * Payload: {@link ConversationScopedRequest}.
4544
4636
  * @example
4545
4637
  * ```js
4546
4638
  * spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
@@ -4550,6 +4642,7 @@ var HostEvent;
4550
4642
  HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
4551
4643
  /**
4552
4644
  * Closes the Spotter share-conversation modal. No-op if none is open.
4645
+ * Payload: none.
4553
4646
  * @example
4554
4647
  * ```js
4555
4648
  * spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
@@ -4559,6 +4652,7 @@ var HostEvent;
4559
4652
  HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
4560
4653
  /**
4561
4654
  * Exits the read-only shared-conversation view.
4655
+ * Payload: none.
4562
4656
  * @example
4563
4657
  * ```js
4564
4658
  * spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
@@ -4568,6 +4662,7 @@ var HostEvent;
4568
4662
  HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
4569
4663
  /**
4570
4664
  * Deletes the last prompt in spotter embed.
4665
+ * Payload: none.
4571
4666
  * @example
4572
4667
  * ```js
4573
4668
  * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
@@ -4577,6 +4672,7 @@ var HostEvent;
4577
4672
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
4578
4673
  /**
4579
4674
  * Toggle the visualization to chart or table view.
4675
+ * Payload: {@link RequiredVizRequest}.
4580
4676
  * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
4581
4677
  * @example
4582
4678
  * ```js
@@ -4615,6 +4711,7 @@ var HostEvent;
4615
4711
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
4616
4712
  /**
4617
4713
  * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
4714
+ * Payload: {@link RequiredVizRequest}.
4618
4715
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
4619
4716
  * @example
4620
4717
  * ```js
@@ -4676,6 +4773,7 @@ var HostEvent;
4676
4773
  * instance. Contact your admin or ThoughtSpot Support to enable chat history on your
4677
4774
  * instance.
4678
4775
  *
4776
+ * Payload: {@link ConversationScopedRequest}.
4679
4777
  * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
4680
4778
  * @example
4681
4779
  * ```js
@@ -4693,6 +4791,7 @@ var HostEvent;
4693
4791
  * instance. Contact your admin or ThoughtSpot Support to enable chat history on your
4694
4792
  * instance.
4695
4793
  *
4794
+ * Payload: {@link ConversationScopedRequest}.
4696
4795
  * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
4697
4796
  * @example
4698
4797
  * ```js
@@ -4717,6 +4816,7 @@ var HostEvent;
4717
4816
  * Trigger the **Send Test Email** action in the Liveboard schedule modal.
4718
4817
  * Sends a test schedule email to self or all recipients.
4719
4818
  * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
4819
+ * Payload: {@link ScheduleEmailRequest}.
4720
4820
  * @example
4721
4821
  * ```js
4722
4822
  * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
@@ -4735,6 +4835,7 @@ var HostEvent;
4735
4835
  HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
4736
4836
  /**
4737
4837
  * Sends a user message (prompt) to the SpotterViz panel programmatically.
4838
+ * Payload: `{ query: string }`.
4738
4839
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4739
4840
  * @param query - the prompt text to send.
4740
4841
  * @example
@@ -4747,6 +4848,7 @@ var HostEvent;
4747
4848
  HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
4748
4849
  /**
4749
4850
  * Initializes a new SpotterViz conversation.
4851
+ * Payload: none.
4750
4852
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4751
4853
  * @example
4752
4854
  * ```js
@@ -4756,6 +4858,7 @@ var HostEvent;
4756
4858
  HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
4757
4859
  /**
4758
4860
  * Opens the SpotterViz panel.
4861
+ * Payload: none.
4759
4862
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4760
4863
  * @example
4761
4864
  * ```js
@@ -4765,6 +4868,7 @@ var HostEvent;
4765
4868
  HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
4766
4869
  /**
4767
4870
  * Closes the SpotterViz panel.
4871
+ * Payload: none.
4768
4872
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4769
4873
  * @example
4770
4874
  * ```js
@@ -4775,6 +4879,7 @@ var HostEvent;
4775
4879
  /**
4776
4880
  * Clears browser cache and fetches new data for liveboard ChartViz Containers.
4777
4881
  * Requires `enableLiveboardDataCache` to be enabled.
4882
+ * Payload: {@link ScheduleEmailRequest}.
4778
4883
  * @example
4779
4884
  * ```js
4780
4885
  * liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
@@ -4972,6 +5077,7 @@ var Param;
4972
5077
  Param["SpotterDataSources"] = "spotterDataSources";
4973
5078
  Param["AnalystId"] = "analystId";
4974
5079
  Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
5080
+ Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
4975
5081
  })(Param || (Param = {}));
4976
5082
  /**
4977
5083
  * ThoughtSpot application pages include actions and menu commands
@@ -6976,6 +7082,225 @@ var Action;
6976
7082
  * ```
6977
7083
  */
6978
7084
  Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
7085
+ /**
7086
+ * Controls the visibility and disabled state of the "Chart Type" menu item
7087
+ * in Chart Settings V2.
7088
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7089
+ * @example
7090
+ * ```js
7091
+ * {
7092
+ * hiddenActions: [Action.ChartTypeSettings],
7093
+ * disabledActions: [Action.ChartTypeSettings],
7094
+ * }
7095
+ * ```
7096
+ */
7097
+ Action["ChartTypeSettings"] = "CHART_TYPE";
7098
+ /**
7099
+ * Controls the visibility and disabled state of the "Layout" menu item
7100
+ * in Chart Settings V2.
7101
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7102
+ * @example
7103
+ * ```js
7104
+ * {
7105
+ * hiddenActions: [Action.LayoutSettings],
7106
+ * disabledActions: [Action.LayoutSettings],
7107
+ * }
7108
+ * ```
7109
+ */
7110
+ Action["LayoutSettings"] = "LAYOUT";
7111
+ /**
7112
+ * Controls the visibility and disabled state of the "Column" menu item
7113
+ * in Chart Settings V2.
7114
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7115
+ * @example
7116
+ * ```js
7117
+ * {
7118
+ * hiddenActions: [Action.ColumnSettings],
7119
+ * disabledActions: [Action.ColumnSettings],
7120
+ * }
7121
+ * ```
7122
+ */
7123
+ Action["ColumnSettings"] = "COLUMN";
7124
+ /**
7125
+ * Controls the visibility and disabled state of the "Axis" menu item
7126
+ * in Chart Settings V2.
7127
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7128
+ * @example
7129
+ * ```js
7130
+ * {
7131
+ * hiddenActions: [Action.AxisSettings],
7132
+ * disabledActions: [Action.AxisSettings],
7133
+ * }
7134
+ * ```
7135
+ */
7136
+ Action["AxisSettings"] = "AXIS";
7137
+ /**
7138
+ * Controls the visibility and disabled state of the "Data Label" menu item
7139
+ * in Chart Settings V2.
7140
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7141
+ * @example
7142
+ * ```js
7143
+ * {
7144
+ * hiddenActions: [Action.DataLabelSettings],
7145
+ * disabledActions: [Action.DataLabelSettings],
7146
+ * }
7147
+ * ```
7148
+ */
7149
+ Action["DataLabelSettings"] = "DATA_LABEL";
7150
+ /**
7151
+ * Controls the visibility and disabled state of the "Tooltip" menu item
7152
+ * in Chart Settings V2.
7153
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7154
+ * @example
7155
+ * ```js
7156
+ * {
7157
+ * hiddenActions: [Action.TooltipSettings],
7158
+ * disabledActions: [Action.TooltipSettings],
7159
+ * }
7160
+ * ```
7161
+ */
7162
+ Action["TooltipSettings"] = "TOOLTIP";
7163
+ /**
7164
+ * Controls the visibility and disabled state of the "Legend" menu item
7165
+ * in Chart Settings V2.
7166
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7167
+ * @example
7168
+ * ```js
7169
+ * {
7170
+ * hiddenActions: [Action.LegendSettings],
7171
+ * disabledActions: [Action.LegendSettings],
7172
+ * }
7173
+ * ```
7174
+ */
7175
+ Action["LegendSettings"] = "LEGEND";
7176
+ /**
7177
+ * Controls the visibility and disabled state of the "Display" menu item
7178
+ * in Chart Settings V2.
7179
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7180
+ * @example
7181
+ * ```js
7182
+ * {
7183
+ * hiddenActions: [Action.DisplaySettings],
7184
+ * disabledActions: [Action.DisplaySettings],
7185
+ * }
7186
+ * ```
7187
+ */
7188
+ Action["DisplaySettings"] = "DISPLAY";
7189
+ /**
7190
+ * Controls the visibility and disabled state of the "Query Details" menu
7191
+ * item in Chart Settings V2.
7192
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7193
+ * @example
7194
+ * ```js
7195
+ * {
7196
+ * hiddenActions: [Action.QuerySettings],
7197
+ * disabledActions: [Action.QuerySettings],
7198
+ * }
7199
+ * ```
7200
+ */
7201
+ Action["QuerySettings"] = "QUERY_DETAILS";
7202
+ /**
7203
+ * Controls the visibility and disabled state of the "Custom Action" menu
7204
+ * item in Chart Settings V2.
7205
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7206
+ * @example
7207
+ * ```js
7208
+ * {
7209
+ * hiddenActions: [Action.CustomSettings],
7210
+ * disabledActions: [Action.CustomSettings],
7211
+ * }
7212
+ * ```
7213
+ */
7214
+ Action["CustomSettings"] = "CUSTOM_ACTION";
7215
+ /**
7216
+ * Controls the visibility and disabled state of the "Muze AI" menu item
7217
+ * in Chart Settings V2.
7218
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7219
+ * @example
7220
+ * ```js
7221
+ * {
7222
+ * hiddenActions: [Action.MuzeAiSettings],
7223
+ * disabledActions: [Action.MuzeAiSettings],
7224
+ * }
7225
+ * ```
7226
+ */
7227
+ Action["MuzeAiSettings"] = "MUZE_AI";
7228
+ /**
7229
+ * Controls the visibility and disabled state of the "R Analysis" menu item
7230
+ * in Chart Settings V2.
7231
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7232
+ * @example
7233
+ * ```js
7234
+ * {
7235
+ * hiddenActions: [Action.RAnalysisSettings],
7236
+ * disabledActions: [Action.RAnalysisSettings],
7237
+ * }
7238
+ * ```
7239
+ */
7240
+ Action["RAnalysisSettings"] = "R_ANALYSIS";
7241
+ /**
7242
+ * Controls the visibility and disabled state of the "Add to Collection" menu item.
7243
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7244
+ * @example
7245
+ * ```js
7246
+ * {
7247
+ * hiddenActions: [Action.AddToCollection],
7248
+ * disabledActions: [Action.AddToCollection],
7249
+ * }
7250
+ * ```
7251
+ */
7252
+ Action["AddToCollection"] = "addToCollection";
7253
+ /**
7254
+ * Controls the visibility and disabled state of the "Create Collection" button.
7255
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7256
+ * @example
7257
+ * ```js
7258
+ * {
7259
+ * hiddenActions: [Action.CreateCollection],
7260
+ * disabledActions: [Action.CreateCollection],
7261
+ * }
7262
+ * ```
7263
+ */
7264
+ Action["CreateCollection"] = "createCollection";
7265
+ /**
7266
+ * Controls the visibility and disabled state of the "Move" menu item in a
7267
+ * Collection.
7268
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7269
+ * @example
7270
+ * ```js
7271
+ * {
7272
+ * hiddenActions: [Action.MoveToCollection],
7273
+ * disabledActions: [Action.MoveToCollection],
7274
+ * }
7275
+ * ```
7276
+ */
7277
+ Action["MoveToCollection"] = "moveToCollection";
7278
+ /**
7279
+ * Controls the visibility and disabled state of the "Remove" menu item in a
7280
+ * Collection.
7281
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7282
+ * @example
7283
+ * ```js
7284
+ * {
7285
+ * hiddenActions: [Action.RemoveFromCollection],
7286
+ * disabledActions: [Action.RemoveFromCollection],
7287
+ * }
7288
+ * ```
7289
+ */
7290
+ Action["RemoveFromCollection"] = "removeFromCollection";
7291
+ /**
7292
+ * Controls the visibility and disabled state of the "Delete" menu item for a
7293
+ * Collection.
7294
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7295
+ * @example
7296
+ * ```js
7297
+ * {
7298
+ * hiddenActions: [Action.DeleteCollection],
7299
+ * disabledActions: [Action.DeleteCollection],
7300
+ * }
7301
+ * ```
7302
+ */
7303
+ Action["DeleteCollection"] = "deleteCollection";
6979
7304
  })(Action || (Action = {}));
6980
7305
  var PrefetchFeatures;
6981
7306
  (function (PrefetchFeatures) {
@@ -7480,7 +7805,7 @@ var TableContentDensity;
7480
7805
  TableContentDensity["Compact"] = "COMPACT";
7481
7806
  })(TableContentDensity || (TableContentDensity = {}));
7482
7807
 
7483
- var version$1="1.52.0";var pkg = {version:version$1};
7808
+ var version$1="1.52.1";var pkg = {version:version$1};
7484
7809
 
7485
7810
  const { version } = pkg;
7486
7811
 
@@ -8233,6 +8558,43 @@ const setParamIfDefined = (queryParams, param, value, asBoolean = false) => {
8233
8558
  if (value !== undefined) {
8234
8559
  queryParams[param] = asBoolean ? !!value : value;
8235
8560
  }
8561
+ };
8562
+ /**
8563
+ * Calculates the element center for the currently visible viewport of the
8564
+ * element, using the scroll position of the host app, the offsetTop of the
8565
+ * element in the host app, and the viewport height of the tab.
8566
+ *
8567
+ * The returned keys are sent to the ThoughtSpot app over postMessage, so they
8568
+ * are named after the iframe and must not be renamed.
8569
+ * @param element The element to measure
8570
+ * @returns The element center within the visible viewport, the element height,
8571
+ * and the viewport height.
8572
+ */
8573
+ const calculateElementCenter = (element) => {
8574
+ const offsetTopClient = getOffsetTop(element);
8575
+ const scrollTopClient = window.scrollY;
8576
+ const viewPortHeight = window.innerHeight;
8577
+ const iframeHeight = element.offsetHeight;
8578
+ const iframeScrolled = scrollTopClient - offsetTopClient;
8579
+ let iframeVisibleViewPort;
8580
+ let iframeOffset;
8581
+ if (iframeScrolled < 0) {
8582
+ iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
8583
+ iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
8584
+ iframeOffset = 0;
8585
+ }
8586
+ else {
8587
+ iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
8588
+ iframeOffset = iframeScrolled;
8589
+ }
8590
+ const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
8591
+ return {
8592
+ iframeCenter,
8593
+ iframeScrolled,
8594
+ iframeHeight,
8595
+ viewPortHeight,
8596
+ iframeVisibleViewPort,
8597
+ };
8236
8598
  };
8237
8599
 
8238
8600
  /** Used for built-in method references. */
@@ -9143,7 +9505,110 @@ var UIPassthroughEvent;
9143
9505
  UIPassthroughEvent["GetTabs"] = "getTabs";
9144
9506
  UIPassthroughEvent["GetGroups"] = "getGroups";
9145
9507
  UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
9146
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
9508
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
9509
+ // NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
9510
+ // live in the sibling ./host-event-contracts, which layers the
9511
+ // HostEventRequestMap on top of the UI-passthrough mapping above.
9512
+ // The former 2-tier definitions that lived here were superseded and removed.
9513
+
9514
+ /**
9515
+ * Copyright (c) 2026
9516
+ *
9517
+ * Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
9518
+ *
9519
+ * Owns the postMessage/MessageChannel mechanics and origin resolution so
9520
+ * that embed/business logic (ts-embed.ts, hostEventClient) never touches
9521
+ * the wire directly. The wire format is unchanged from the historical
9522
+ * implementation — this layer is a pure structural extraction.
9523
+ */
9524
+ /**
9525
+ * Default time to wait for the app to respond to a request-response
9526
+ * message before giving up and reclaiming the channel.
9527
+ */
9528
+ const MESSAGE_RESPONSE_TIMEOUT = 30000;
9529
+ /**
9530
+ * Single implementation of origin resolution for the embedded app.
9531
+ * Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
9532
+ * or null when it cannot be parsed.
9533
+ * @param thoughtSpotHost
9534
+ */
9535
+ const resolveMessageOrigin = (thoughtSpotHost) => {
9536
+ try {
9537
+ return new URL(thoughtSpotHost).origin;
9538
+ }
9539
+ catch (e) {
9540
+ return null;
9541
+ }
9542
+ };
9543
+ /**
9544
+ * Validates that an inbound window message came from the embedded
9545
+ * ThoughtSpot app: the source window must be the embed iframe's window and,
9546
+ * when the expected origin is resolvable, the message origin must match it.
9547
+ *
9548
+ * Fails open (returns true) on the origin check when the expected origin
9549
+ * cannot be resolved, to avoid breaking unconventional-but-working setups;
9550
+ * a warning is logged on mismatch either way.
9551
+ * @param event The message event received on window.
9552
+ * @param iFrame The embed iframe the message should originate from.
9553
+ * @param thoughtSpotHost The configured ThoughtSpot host.
9554
+ */
9555
+ const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
9556
+ if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
9557
+ return false;
9558
+ }
9559
+ const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
9560
+ if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
9561
+ logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
9562
+ return false;
9563
+ }
9564
+ return true;
9565
+ };
9566
+ /**
9567
+ * Posts a one-way message to the embedded app's iframe, optionally
9568
+ * transferring a MessageChannel port for the response.
9569
+ * @param iFrame
9570
+ * @param message
9571
+ * @param thoughtSpotHost Used as the postMessage targetOrigin.
9572
+ * @param channel
9573
+ */
9574
+ const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
9575
+ var _a;
9576
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
9577
+ };
9578
+ /**
9579
+ * Sends a request-response message to the embedded app over a dedicated
9580
+ * MessageChannel. Resolves with the response payload; rejects when the app
9581
+ * responds with an error; resolves with a timeout Error object when no
9582
+ * response arrives in time (historical behavior, preserved for backward
9583
+ * compatibility).
9584
+ * @param iFrame
9585
+ * @param message
9586
+ * @param thoughtSpotHost
9587
+ * @param timeoutMs
9588
+ */
9589
+ function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
9590
+ return new Promise((res, rej) => {
9591
+ const channel = new MessageChannel();
9592
+ // Close the messageChannel and resolve the promise if timeout.
9593
+ const timeoutId = setTimeout(() => {
9594
+ channel.port1.close();
9595
+ res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
9596
+ }, timeoutMs);
9597
+ channel.port1.onmessage = ({ data: responseData }) => {
9598
+ var _a;
9599
+ clearTimeout(timeoutId);
9600
+ channel.port1.close();
9601
+ const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
9602
+ if (error) {
9603
+ rej(error);
9604
+ }
9605
+ else {
9606
+ res(responseData);
9607
+ }
9608
+ };
9609
+ postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
9610
+ });
9611
+ }
9147
9612
 
9148
9613
  const EndPoints = {
9149
9614
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -10077,7 +10542,7 @@ class AnswerService {
10077
10542
  async getTML() {
10078
10543
  const { object } = await this.executeQuery(getAnswerTML, {});
10079
10544
  const edoc = object[0].edoc;
10080
- const YAML = await import('./index-BMppCU63.js');
10545
+ const YAML = await import('./index-C1pmYb5H.js');
10081
10546
  const parsedDoc = YAML.parse(edoc);
10082
10547
  return {
10083
10548
  answer: {
@@ -20353,23 +20818,11 @@ const reload = (iFrame) => {
20353
20818
  iFrame.src = src;
20354
20819
  }, 100);
20355
20820
  };
20821
+ const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
20356
20822
  /**
20357
- * Post iframe message.
20358
- * @param iFrame
20359
- * @param message
20360
- * @param message.type
20361
- * @param message.data
20362
- * @param message.context
20363
- * @param thoughtSpotHost
20364
- * @param channel
20365
- */
20366
- function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
20367
- var _a;
20368
- return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
20369
- }
20370
- const TRIGGER_TIMEOUT = 30000;
20371
- /**
20372
- *
20823
+ * Processes a host event trigger: handles SDK-local events (Reload,
20824
+ * Present) and forwards everything else to the embedded app over the
20825
+ * iframe transport.
20373
20826
  * @param iFrame
20374
20827
  * @param messageType
20375
20828
  * @param thoughtSpotHost
@@ -20377,42 +20830,22 @@ const TRIGGER_TIMEOUT = 30000;
20377
20830
  * @param context
20378
20831
  */
20379
20832
  function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
20380
- return new Promise((res, rej) => {
20381
- var _a;
20382
- if (messageType === HostEvent.Reload) {
20383
- reload(iFrame);
20384
- return res(null);
20385
- }
20386
- if (messageType === HostEvent.Present) {
20387
- const embedConfig = getEmbedConfig();
20388
- const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
20389
- if (!disableFullscreenPresentation) {
20390
- handlePresentEvent(iFrame);
20391
- }
20392
- else {
20393
- logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
20394
- }
20833
+ var _a;
20834
+ if (messageType === HostEvent.Reload) {
20835
+ reload(iFrame);
20836
+ return Promise.resolve(null);
20837
+ }
20838
+ if (messageType === HostEvent.Present) {
20839
+ const embedConfig = getEmbedConfig();
20840
+ const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
20841
+ if (!disableFullscreenPresentation) {
20842
+ handlePresentEvent(iFrame);
20395
20843
  }
20396
- const channel = new MessageChannel();
20397
- // Close the messageChannel and resolve the promise if timeout.
20398
- const timeoutId = setTimeout(() => {
20399
- channel.port1.close();
20400
- res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
20401
- }, TRIGGER_TIMEOUT);
20402
- channel.port1.onmessage = ({ data: responseData }) => {
20403
- var _a;
20404
- clearTimeout(timeoutId);
20405
- channel.port1.close();
20406
- const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
20407
- if (error) {
20408
- rej(error);
20409
- }
20410
- else {
20411
- res(responseData);
20412
- }
20413
- };
20414
- return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
20415
- });
20844
+ else {
20845
+ logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
20846
+ }
20847
+ }
20848
+ return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
20416
20849
  }
20417
20850
 
20418
20851
  /**
@@ -21121,6 +21554,11 @@ class HostEventClient {
21121
21554
  if (!isValidUpdateFiltersPayload(payload)) {
21122
21555
  throwUpdateFiltersValidationError();
21123
21556
  }
21557
+ // The shared contract accepts both current (columnName/operator) and
21558
+ // legacy (column/oper) filter field names — as does the validation
21559
+ // above and the app at runtime. The UIPassthrough FilterUpdate type
21560
+ // still requires the legacy names; bridge until that contract is
21561
+ // audited.
21124
21562
  return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
21125
21563
  }
21126
21564
  handleUpdateParametersEvent(payload, context) {
@@ -21355,6 +21793,12 @@ const TS_EMBED_ID = '_thoughtspot-embed';
21355
21793
  */
21356
21794
  const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
21357
21795
  const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
21796
+ // The container applies UpdateEmbedParams through React state, so a delivered
21797
+ // post is not the same as the params being in effect.
21798
+ const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
21799
+ // The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
21800
+ // null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
21801
+ const NO_RUNTIME_PARAMS = '&';
21358
21802
  /**
21359
21803
  * The event id map from v2 event names to v1 event id
21360
21804
  * v1 events are the classic embed events implemented in Blink v1
@@ -21381,6 +21825,7 @@ class TsEmbed {
21381
21825
  * The key to store the embed instance in the DOM node
21382
21826
  */
21383
21827
  this.embedNodeKey = '__tsEmbed';
21828
+ this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
21384
21829
  this.isAppInitialized = false;
21385
21830
  /**
21386
21831
  * Should we encode URL Query Params using base64 encoding which ThoughtSpot
@@ -21401,7 +21846,7 @@ class TsEmbed {
21401
21846
  const eventType = this.getEventType(event);
21402
21847
  const eventPort = this.getEventPort(event);
21403
21848
  const eventData = this.formatEventData(event, eventType);
21404
- if (event.source === this.iFrame.contentWindow) {
21849
+ if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
21405
21850
  const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
21406
21851
  if (eventType === EmbedEvent.ApiIntercept) {
21407
21852
  this.handleApiInterceptEvent({ eventData, eventPort });
@@ -21543,7 +21988,7 @@ class TsEmbed {
21543
21988
  this.createEmbedContainerHandler = (source) => () => {
21544
21989
  const processEmbedContainerReady = () => {
21545
21990
  logger$3.debug('processEmbedContainerReady');
21546
- this.isEmbedContainerLoaded = true;
21991
+ this.markEmbedContainerLoaded();
21547
21992
  this.executeEmbedContainerReadyCallbacks();
21548
21993
  };
21549
21994
  if (source === EmbedEvent.AuthInit) {
@@ -21557,6 +22002,9 @@ class TsEmbed {
21557
22002
  processEmbedContainerReady();
21558
22003
  }
21559
22004
  };
22005
+ // Subclasses that navigate the pre-render on show must await this before
22006
+ // triggering Navigate. Resolves even on failure, so navigation is never blocked.
22007
+ this.preRenderParamsApplied = Promise.resolve();
21560
22008
  this.hostElement = getDOMNode(domSelector);
21561
22009
  this.eventHandlerMap = new Map();
21562
22010
  this.isError = false;
@@ -21873,6 +22321,7 @@ class TsEmbed {
21873
22321
  return `${basePath}#`;
21874
22322
  }
21875
22323
  async getUpdateEmbedParamsObject() {
22324
+ var _a, _b;
21876
22325
  const queryParams = this.getEmbedParamsObject();
21877
22326
  // Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
21878
22327
  // them back so the event payload matches a URL load (SCAL-334713).
@@ -21880,7 +22329,16 @@ class TsEmbed {
21880
22329
  queryParams[key] = deserializeParam(queryParams[key]);
21881
22330
  });
21882
22331
  const appInitData = await this.getAppInitData();
21883
- return { ...this.viewConfig, ...queryParams, ...appInitData };
22332
+ return {
22333
+ ...this.viewConfig,
22334
+ ...queryParams,
22335
+ ...appInitData,
22336
+ // A show cycle has no URL to carry these, so the payload always states them
22337
+ // — including "none", which is the case that leaks the previous filters.
22338
+ runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
22339
+ runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
22340
+ || NO_RUNTIME_PARAMS,
22341
+ };
21884
22342
  }
21885
22343
  /**
21886
22344
  * Common query params set for all the embed modes.
@@ -22511,40 +22969,6 @@ class TsEmbed {
22511
22969
  getCompatibleEventType(eventType) {
22512
22970
  return V1EventMap[eventType] || eventType;
22513
22971
  }
22514
- /**
22515
- * Calculates the iframe center for the current visible viewPort
22516
- * of iframe using Scroll position of Host App, offsetTop for iframe
22517
- * in Host app. ViewPort height of the tab.
22518
- * @returns iframe Center in visible viewport,
22519
- * Iframe height,
22520
- * View port height.
22521
- */
22522
- getIframeCenter() {
22523
- const offsetTopClient = getOffsetTop(this.iFrame);
22524
- const scrollTopClient = window.scrollY;
22525
- const viewPortHeight = window.innerHeight;
22526
- const iframeHeight = this.iFrame.offsetHeight;
22527
- const iframeScrolled = scrollTopClient - offsetTopClient;
22528
- let iframeVisibleViewPort;
22529
- let iframeOffset;
22530
- if (iframeScrolled < 0) {
22531
- iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
22532
- iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
22533
- iframeOffset = 0;
22534
- }
22535
- else {
22536
- iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
22537
- iframeOffset = iframeScrolled;
22538
- }
22539
- const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
22540
- return {
22541
- iframeCenter,
22542
- iframeScrolled,
22543
- iframeHeight,
22544
- viewPortHeight,
22545
- iframeVisibleViewPort,
22546
- };
22547
- }
22548
22972
  /**
22549
22973
  * Registers an event listener to trigger an alert when the ThoughtSpot app
22550
22974
  * sends an event of a particular message type to the host application.
@@ -22628,13 +23052,32 @@ class TsEmbed {
22628
23052
  var _a;
22629
23053
  const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
22630
23054
  if (embedObj === this) {
22631
- logger$3.info('embedObj is same as this');
23055
+ logger$3.debug('embedObj is same as this');
22632
23056
  }
22633
23057
  return embedObj;
22634
23058
  }
23059
+ takeOverPreRender() {
23060
+ if (!this.preRenderWrapper)
23061
+ return;
23062
+ this.preRenderWrapper[this.embedNodeKey] = this;
23063
+ }
23064
+ // The flag lives on the wrapper because it describes the iframe: an instance
23065
+ // hidden when the container announced itself would otherwise report false forever.
23066
+ markEmbedContainerLoaded() {
23067
+ this.isEmbedContainerLoaded = true;
23068
+ if (this.preRenderWrapper) {
23069
+ this.preRenderWrapper[this.embedContainerLoadedKey] = true;
23070
+ }
23071
+ }
22635
23072
  checkEmbedContainerLoaded() {
23073
+ var _a;
22636
23074
  if (this.isEmbedContainerLoaded)
22637
23075
  return true;
23076
+ if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
23077
+ this.isEmbedContainerLoaded = true;
23078
+ return true;
23079
+ }
23080
+ // Older builds stamped the flag on the instance, not the wrapper.
22638
23081
  const preRenderObj = this.getPreRenderObj();
22639
23082
  if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
22640
23083
  this.isEmbedContainerLoaded = true;
@@ -22663,8 +23106,12 @@ class TsEmbed {
22663
23106
  }
22664
23107
  /**
22665
23108
  * Triggers an event to the embedded app
23109
+ *
23110
+ * Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
23111
+ * on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
23112
+ * payload is checked strictly against the event contract — update call sites now.
22666
23113
  * @param {HostEvent} messageType The event type
22667
- * @param {any} data The payload to send with the message
23114
+ * @param {TriggerData} data The payload, typed against the event's contract
22668
23115
  * @param {ContextType} context Optional context type to specify the context from which the event is triggered.
22669
23116
  * Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
22670
23117
  * ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
@@ -22681,7 +23128,11 @@ class TsEmbed {
22681
23128
  * ```
22682
23129
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
22683
23130
  */
22684
- async trigger(messageType, data = {}, context) {
23131
+ async trigger(messageType,
23132
+ // Contract shape is the contextual type: payload fields autocomplete
23133
+ // and unknown fields on object literals are flagged. Strict checks
23134
+ // land in SDK 1.54.0 — see TriggerData.
23135
+ data = {}, context) {
22685
23136
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
22686
23137
  if (!this.isRendered) {
22687
23138
  this.handleError({
@@ -22969,20 +23420,27 @@ class TsEmbed {
22969
23420
  // have moved on to UpdateEmbedParams supported clusters
22970
23421
  // this.validatePreRenderViewConfig(this.viewConfig); removed in #517
22971
23422
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
22972
- this.executeAfterEmbedContainerLoaded(async () => {
22973
- try {
22974
- const params = await this.getUpdateEmbedParamsObject();
22975
- this.trigger(HostEvent.UpdateEmbedParams, params);
22976
- }
22977
- catch (error) {
22978
- logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
22979
- this.handleError({
22980
- errorType: ErrorDetailsTypes.API,
22981
- message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
22982
- code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
22983
- error: (error === null || error === void 0 ? void 0 : error.message) || error,
22984
- });
22985
- }
23423
+ // Created synchronously: a queued navigation needs something to await
23424
+ // whether the container is already loaded or not.
23425
+ this.preRenderParamsApplied = new Promise((resolve) => {
23426
+ this.executeAfterEmbedContainerLoaded(async () => {
23427
+ try {
23428
+ const params = await this.getUpdateEmbedParamsObject();
23429
+ this.trigger(HostEvent.UpdateEmbedParams, params);
23430
+ }
23431
+ catch (error) {
23432
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
23433
+ this.handleError({
23434
+ errorType: ErrorDetailsTypes.API,
23435
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
23436
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
23437
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
23438
+ });
23439
+ }
23440
+ finally {
23441
+ setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
23442
+ }
23443
+ });
22986
23444
  });
22987
23445
  }
22988
23446
  /**
@@ -23058,6 +23516,8 @@ class TsEmbed {
23058
23516
  if (this.iFrame) {
23059
23517
  this.setupFullscreenChangeHandler();
23060
23518
  }
23519
+ // Last, so everything above still sees the instance being taken over from.
23520
+ this.takeOverPreRender();
23061
23521
  return this;
23062
23522
  }
23063
23523
  getPreRenderPlaceHolderElement() {
@@ -23260,6 +23720,9 @@ class V1Embed extends TsEmbed {
23260
23720
  * ```
23261
23721
  */
23262
23722
  on(messageType, callback, options = { start: false }) {
23723
+ // Mirror the base TsEmbed.on generic signature so the enriched
23724
+ // EmbedEventPayload (e.g. CustomAction's answerService) flows through
23725
+ // the override too, and the class hierarchy stays assignable.
23263
23726
  const eventType = this.getCompatibleEventType(messageType);
23264
23727
  return super.on(eventType, callback, options);
23265
23728
  }
@@ -23429,7 +23892,7 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
23429
23892
  }
23430
23893
  getEmbedParamsObject() {
23431
23894
  var _a;
23432
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
23895
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
23433
23896
  const queryParams = this.getBaseQueryParams();
23434
23897
  queryParams[Param.HideActions] = [
23435
23898
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -23452,6 +23915,9 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
23452
23915
  if (enableSearchAssist) {
23453
23916
  queryParams[Param.EnableSearchAssist] = true;
23454
23917
  }
23918
+ if (hideAnswerEditPanel !== undefined) {
23919
+ queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
23920
+ }
23455
23921
  if (hideResults) {
23456
23922
  queryParams[Param.HideResult] = true;
23457
23923
  }
@@ -23537,6 +24003,270 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
23537
24003
  }
23538
24004
  };
23539
24005
 
24006
+ /**
24007
+ * Copyright (c) 2025
24008
+ *
24009
+ * Full-height support for the Liveboard and app embeds.
24010
+ * @summary Full height
24011
+ */
24012
+ /**
24013
+ * The height the embed falls back to when the host app has not configured
24014
+ * `minimumHeight` or `defaultHeight`.
24015
+ */
24016
+ const DEFAULT_MINIMUM_HEIGHT = 500;
24017
+ /**
24018
+ * Routes that are part of the Liveboard experience itself. Navigating between
24019
+ * these does not reset the frame height, because the ThoughtSpot app keeps
24020
+ * reporting a height of its own for them.
24021
+ */
24022
+ const LIVEBOARD_RELATED_ROUTES = [
24023
+ '/pinboard/',
24024
+ '/insights/pinboard/',
24025
+ '/schedules/',
24026
+ '/embed/viz/',
24027
+ '/embed/insights/viz/',
24028
+ '/liveboard/',
24029
+ '/insights/liveboard/',
24030
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
24031
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
24032
+ ];
24033
+ /**
24034
+ * Owns every piece of full-height behavior for an embed: the height
24035
+ * negotiation with the ThoughtSpot app, the query parameters that switch the
24036
+ * feature on, and the viewport listeners that drive lazy loading.
24037
+ *
24038
+ * The controller is inert unless `fullHeight` is enabled, so embeds can create
24039
+ * one unconditionally.
24040
+ */
24041
+ class FullHeightController {
24042
+ constructor(viewConfig, host) {
24043
+ this.host = host;
24044
+ this.scrollContainers = [];
24045
+ /**
24046
+ * Sets the frame height to the height reported by the ThoughtSpot app,
24047
+ * never going below the configured minimum.
24048
+ */
24049
+ this.handleEmbedHeight = (payload) => {
24050
+ const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
24051
+ if (!isNaN(height)) {
24052
+ this.host.setFrameHeight(Math.max(height, this.minimumHeight));
24053
+ }
24054
+ this.sendVisibleCoordinates();
24055
+ };
24056
+ /**
24057
+ * Answers the app's request for the center of the visible embed region.
24058
+ */
24059
+ this.handleEmbedIframeCenter = (payload, responder) => {
24060
+ const iframe = this.host.getIframe();
24061
+ if (!iframe) {
24062
+ return;
24063
+ }
24064
+ responder === null || responder === void 0 ? void 0 : responder({
24065
+ type: EmbedEvent.EmbedIframeCenter,
24066
+ data: calculateElementCenter(iframe),
24067
+ });
24068
+ };
24069
+ /**
24070
+ * Answers the app's request for the currently visible embed coordinates.
24071
+ */
24072
+ this.handleRequestVisibleCoordinates = (payload, responder) => {
24073
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
24074
+ responder === null || responder === void 0 ? void 0 : responder({
24075
+ type: EmbedEvent.RequestVisibleEmbedCoordinates,
24076
+ data: this.getVisibleCoordinates(),
24077
+ });
24078
+ };
24079
+ /**
24080
+ * Resets the frame height when the app navigates away from a Liveboard,
24081
+ * since only Liveboard routes report a height of their own.
24082
+ */
24083
+ this.handleRouteChange = (payload) => {
24084
+ var _a, _b;
24085
+ const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
24086
+ if (!currentPath) {
24087
+ return;
24088
+ }
24089
+ if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
24090
+ return;
24091
+ }
24092
+ this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
24093
+ };
24094
+ /**
24095
+ * Pushes the visible embed region to the app so it can decide which
24096
+ * visualizations to load.
24097
+ */
24098
+ this.sendVisibleCoordinates = () => {
24099
+ if (!this.isLazyLoadEnabled) {
24100
+ return;
24101
+ }
24102
+ const coordinates = this.getVisibleCoordinates();
24103
+ if (coordinates) {
24104
+ this.host.trigger(HostEvent.VisibleEmbedCoordinates, coordinates);
24105
+ }
24106
+ };
24107
+ this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
24108
+ this.registerEventHandlers();
24109
+ }
24110
+ /**
24111
+ * The view config the controller runs on: the host app's own config with
24112
+ * the lazy-loading defaults filled in. Read-only, so the only way to change
24113
+ * it is through the setter, which re-resolves the defaults.
24114
+ */
24115
+ get viewConfig() {
24116
+ return this.config;
24117
+ }
24118
+ /**
24119
+ * Replaces the view config the controller runs on and re-resolves the
24120
+ * lazy-loading defaults against it. The config the caller passes is never
24121
+ * written to; the controller keeps a copy of its own.
24122
+ */
24123
+ set viewConfig(viewConfig) {
24124
+ this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
24125
+ }
24126
+ /**
24127
+ * The view config with the lazy-loading settings the embed falls back to
24128
+ * when the host app has not chosen its own.
24129
+ *
24130
+ * Pure by design: it returns a new config rather than writing to the one it
24131
+ * is given, so the host app's object is left untouched.
24132
+ * @param viewConfig The embed's view config
24133
+ * @returns A copy with the defaults filled in, host app choices preserved
24134
+ */
24135
+ static withLazyLoadingDefaults(viewConfig) {
24136
+ return {
24137
+ ...viewConfig,
24138
+ lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
24139
+ ? true
24140
+ : viewConfig.lazyLoadingForFullHeight,
24141
+ enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
24142
+ ? true
24143
+ : viewConfig.enableScrollableContainerLazyLoading,
24144
+ lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
24145
+ ? DEFAULT_LAZY_LOADING_MARGIN
24146
+ : viewConfig.lazyLoadingMargin,
24147
+ };
24148
+ }
24149
+ /**
24150
+ * Whether the host app asked for a full-height embed.
24151
+ */
24152
+ get isEnabled() {
24153
+ return this.config.fullHeight === true;
24154
+ }
24155
+ /**
24156
+ * Whether visualizations should load as they scroll into view, which
24157
+ * requires the SDK to report the visible region of the embed.
24158
+ */
24159
+ get isLazyLoadEnabled() {
24160
+ return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
24161
+ }
24162
+ /**
24163
+ * The floor for the frame height. `defaultHeight` is the deprecated
24164
+ * spelling of `minimumHeight` and is still honored for compatibility.
24165
+ */
24166
+ get minimumHeight() {
24167
+ const { minimumHeight, defaultHeight } = this.config;
24168
+ return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
24169
+ }
24170
+ /**
24171
+ * Registers the embed event handlers the feature depends on. Called from
24172
+ * the constructor, so the handlers are in place before `render`.
24173
+ */
24174
+ registerEventHandlers() {
24175
+ if (!this.isEnabled) {
24176
+ return;
24177
+ }
24178
+ this.host.on(EmbedEvent.RouteChange, this.handleRouteChange);
24179
+ this.host.on(EmbedEvent.EmbedHeight, this.handleEmbedHeight);
24180
+ this.host.on(EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
24181
+ this.host.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
24182
+ }
24183
+ /**
24184
+ * Adds the full-height query parameters to the embed URL params.
24185
+ * @param params The query parameters being built by the embed
24186
+ */
24187
+ addQueryParams(params) {
24188
+ if (!this.isEnabled) {
24189
+ return;
24190
+ }
24191
+ params[Param.fullHeight] = true;
24192
+ if (!this.config.lazyLoadingForFullHeight) {
24193
+ return;
24194
+ }
24195
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
24196
+ if (isValidCssMargin(this.config.lazyLoadingMargin)) {
24197
+ params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
24198
+ }
24199
+ }
24200
+ /**
24201
+ * Attaches the viewport listeners that keep lazy loading in sync. Call this
24202
+ * once the embed has rendered and the iframe exists.
24203
+ */
24204
+ onRender() {
24205
+ this.registerLazyLoadListeners();
24206
+ }
24207
+ /**
24208
+ * Detaches every listener and observer owned by the controller.
24209
+ */
24210
+ destroy() {
24211
+ this.unregisterLazyLoadListeners();
24212
+ }
24213
+ getVisibleCoordinates() {
24214
+ const iframe = this.host.getIframe();
24215
+ if (!iframe) {
24216
+ return null;
24217
+ }
24218
+ return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
24219
+ }
24220
+ registerLazyLoadListeners() {
24221
+ if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
24222
+ return;
24223
+ }
24224
+ // Re-registering is safe: drop whatever a previous render attached.
24225
+ this.unregisterLazyLoadListeners();
24226
+ // TODO: Use passive: true, install modernizr to check for passive
24227
+ window.addEventListener('resize', this.sendVisibleCoordinates);
24228
+ window.addEventListener('scroll', this.sendVisibleCoordinates, true);
24229
+ if (!this.config.enableScrollableContainerLazyLoading) {
24230
+ return;
24231
+ }
24232
+ this.observeScrollableContainers();
24233
+ }
24234
+ /**
24235
+ * Tracks the ancestors that can scroll or clip the embed, so the visible
24236
+ * region stays correct when the embed lives inside its own scroll
24237
+ * container rather than the page.
24238
+ */
24239
+ observeScrollableContainers() {
24240
+ const iFrame = this.host.getIframe();
24241
+ this.scrollContainers = getScrollableAncestors(iFrame);
24242
+ this.scrollContainers.forEach((scrollContainer) => {
24243
+ scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
24244
+ });
24245
+ if (typeof ResizeObserver === 'undefined') {
24246
+ return;
24247
+ }
24248
+ const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
24249
+ this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
24250
+ resizeTargets.forEach((resizeTarget) => {
24251
+ this.resizeObserver.observe(resizeTarget);
24252
+ });
24253
+ }
24254
+ unregisterLazyLoadListeners() {
24255
+ var _a;
24256
+ if (!this.isLazyLoadEnabled) {
24257
+ return;
24258
+ }
24259
+ window.removeEventListener('resize', this.sendVisibleCoordinates);
24260
+ window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
24261
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24262
+ this.resizeObserver = undefined;
24263
+ this.scrollContainers.forEach((scrollContainer) => {
24264
+ scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
24265
+ });
24266
+ this.scrollContainers = [];
24267
+ }
24268
+ }
24269
+
23540
24270
  /**
23541
24271
  * Resolves enablePastConversationsSidebar with
23542
24272
  * spotterSidebarConfig taking precedence over the
@@ -23772,73 +24502,17 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
23772
24502
  constructor(domSelector, viewConfig) {
23773
24503
  viewConfig.embedComponentType = 'AppEmbed';
23774
24504
  super(domSelector, viewConfig);
23775
- this.defaultHeight = 500;
23776
- this.lazyLoadScrollContainers = [];
23777
- this.sendFullHeightLazyLoadData = () => {
23778
- const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
23779
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
23780
- if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
23781
- this.trigger(HostEvent.VisibleEmbedCoordinates, data);
23782
- }
23783
- };
23784
- /**
23785
- * This is a handler for the RequestVisibleEmbedCoordinates event.
23786
- * It is used to send the visible coordinates data to the host application.
23787
- * @param data The event payload
23788
- * @param responder The responder function
23789
- */
23790
- this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
23791
- logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
23792
- const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
23793
- responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
23794
- };
23795
- /**
23796
- * Set the iframe height as per the computed height received
23797
- * from the ThoughtSpot app.
23798
- * @param data The event payload
23799
- */
23800
- this.updateIFrameHeight = (data) => {
23801
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
23802
- this.sendFullHeightLazyLoadData();
23803
- };
23804
- this.embedIframeCenter = (data, responder) => {
23805
- const obj = this.getIframeCenter();
23806
- responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
23807
- };
23808
- this.setIframeHeightForNonEmbedLiveboard = (data) => {
23809
- const { height: frameHeight } = this.viewConfig.frameParams || {};
23810
- const liveboardRelatedRoutes = [
23811
- '/pinboard/',
23812
- '/insights/pinboard/',
23813
- '/schedules/',
23814
- '/embed/viz/',
23815
- '/embed/insights/viz/',
23816
- '/liveboard/',
23817
- '/insights/liveboard/',
23818
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
23819
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
23820
- ];
23821
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
23822
- // Ignore the height reset of the frame, if the navigation is
23823
- // only within the liveboard page.
23824
- return;
23825
- }
23826
- this.setIFrameHeight(frameHeight || this.defaultHeight);
23827
- };
23828
24505
  if (this.viewConfig.fullHeight === true) {
23829
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
23830
- this.viewConfig.lazyLoadingForFullHeight = true;
23831
- }
23832
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
23833
- this.viewConfig.enableScrollableContainerLazyLoading = true;
23834
- }
23835
- if (this.viewConfig.lazyLoadingMargin === undefined) {
23836
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
23837
- }
23838
- this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
23839
- this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
23840
- this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
23841
- this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
24506
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
24507
+ getIframe: () => this.iFrame,
24508
+ setFrameHeight: (height) => this.setIFrameHeight(height),
24509
+ on: (eventType, callback) => {
24510
+ this.on(eventType, callback);
24511
+ },
24512
+ trigger: (hostEvent, data) => {
24513
+ this.trigger(hostEvent, data);
24514
+ },
24515
+ });
23842
24516
  }
23843
24517
  }
23844
24518
  /**
@@ -23869,7 +24543,8 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
23869
24543
  return getQueryParamString(params, true);
23870
24544
  }
23871
24545
  getEmbedParamsObject() {
23872
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, fullHeight, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24546
+ var _a;
24547
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, hideAnswerEditPanel, } = this.viewConfig;
23873
24548
  let params = {};
23874
24549
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
23875
24550
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -23905,6 +24580,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
23905
24580
  if (!isUndefined$1(coverAndFilterOptionInPDF)) {
23906
24581
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
23907
24582
  }
24583
+ if (!isUndefined$1(hideAnswerEditPanel)) {
24584
+ params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
24585
+ }
23908
24586
  params = this.getBaseQueryParams(params);
23909
24587
  if (!isUndefined$1(updatedSpotterChatPrompt)) {
23910
24588
  params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
@@ -23951,15 +24629,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
23951
24629
  if (hideNotification) {
23952
24630
  params[Param.HideNotification] = !!hideNotification;
23953
24631
  }
23954
- if (fullHeight === true) {
23955
- params[Param.fullHeight] = true;
23956
- if (this.viewConfig.lazyLoadingForFullHeight) {
23957
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
23958
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
23959
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
23960
- }
23961
- }
23962
- }
24632
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
23963
24633
  if (tag) {
23964
24634
  params[Param.Tag] = tag;
23965
24635
  }
@@ -24026,7 +24696,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
24026
24696
  if (isContinuousLiveboardPDFEnabled !== undefined) {
24027
24697
  params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
24028
24698
  }
24029
- this.defaultHeight = minimumHeight || this.defaultHeight;
24030
24699
  if (enableLiveboardDataCache !== undefined) {
24031
24700
  params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
24032
24701
  }
@@ -24165,52 +24834,13 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
24165
24834
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
24166
24835
  */
24167
24836
  destroy() {
24837
+ var _a;
24168
24838
  super.destroy();
24169
- this.unregisterLazyLoadEvents();
24839
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
24170
24840
  }
24171
24841
  postRender() {
24172
- this.registerLazyLoadEvents();
24173
- }
24174
- registerLazyLoadEvents() {
24175
- if (!this.iFrame) {
24176
- return;
24177
- }
24178
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24179
- this.unregisterLazyLoadEvents();
24180
- // TODO: Use passive: true, install modernizr to check for passive
24181
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
24182
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24183
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
24184
- return;
24185
- }
24186
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
24187
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24188
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
24189
- });
24190
- if (typeof ResizeObserver !== 'undefined') {
24191
- const resizeTargets = new Set([
24192
- this.iFrame.parentElement,
24193
- ...getEffectiveClippingAncestors(this.iFrame),
24194
- ].filter(Boolean));
24195
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
24196
- resizeTargets.forEach((resizeTarget) => {
24197
- this.lazyLoadResizeObserver.observe(resizeTarget);
24198
- });
24199
- }
24200
- }
24201
- }
24202
- unregisterLazyLoadEvents() {
24203
24842
  var _a;
24204
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24205
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
24206
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24207
- (_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24208
- this.lazyLoadResizeObserver = undefined;
24209
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24210
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
24211
- });
24212
- this.lazyLoadScrollContainers = [];
24213
- }
24843
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
24214
24844
  }
24215
24845
  /**
24216
24846
  * Renders the embedded application pages in the ThoughtSpot app.
@@ -24305,6 +24935,10 @@ const addPreviewStylesIfNotPresent = () => {
24305
24935
  * @summary Liveboard & visualization embed
24306
24936
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
24307
24937
  */
24938
+ // Home unmounts the liveboard container, which is how its state gets cleared. The
24939
+ // settle window gives the container time to do it before we ask for the liveboard back.
24940
+ const HOME_ROUTE = 'home';
24941
+ const HOME_SETTLE_MS = 200;
24308
24942
  /**
24309
24943
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
24310
24944
  * waits for the authentication to complete, so you need not wait for
@@ -24324,59 +24958,6 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
24324
24958
  constructor(domSelector, viewConfig) {
24325
24959
  viewConfig.embedComponentType = 'LiveboardEmbed';
24326
24960
  super(domSelector, viewConfig);
24327
- this.defaultHeight = 500;
24328
- this.lazyLoadScrollContainers = [];
24329
- this.sendFullHeightLazyLoadData = () => {
24330
- const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
24331
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
24332
- if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
24333
- this.trigger(HostEvent.VisibleEmbedCoordinates, data);
24334
- }
24335
- };
24336
- /**
24337
- * This is a handler for the RequestVisibleEmbedCoordinates event.
24338
- * It is used to send the visible coordinates data to the host application.
24339
- * @param data The event payload
24340
- * @param responder The responder function
24341
- */
24342
- this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
24343
- logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
24344
- const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
24345
- responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
24346
- };
24347
- /**
24348
- * Set the iframe height as per the computed height received
24349
- * from the ThoughtSpot app.
24350
- * @param data The event payload
24351
- */
24352
- this.updateIFrameHeight = (data) => {
24353
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
24354
- this.sendFullHeightLazyLoadData();
24355
- };
24356
- this.embedIframeCenter = (data, responder) => {
24357
- const obj = this.getIframeCenter();
24358
- responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
24359
- };
24360
- this.setIframeHeightForNonEmbedLiveboard = (data) => {
24361
- const { height: frameHeight } = this.viewConfig.frameParams || {};
24362
- const liveboardRelatedRoutes = [
24363
- '/pinboard/',
24364
- '/insights/pinboard/',
24365
- '/schedules/',
24366
- '/embed/viz/',
24367
- '/embed/insights/viz/',
24368
- '/liveboard/',
24369
- '/insights/liveboard/',
24370
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
24371
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
24372
- ];
24373
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
24374
- // Ignore the height reset of the frame, if the navigation is
24375
- // only within the liveboard page.
24376
- return;
24377
- }
24378
- this.setIFrameHeight(frameHeight || this.defaultHeight);
24379
- };
24380
24961
  /**
24381
24962
  * @hidden
24382
24963
  * Internal state to track the current liveboard id.
@@ -24390,22 +24971,19 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
24390
24971
  };
24391
24972
  if (this.viewConfig.fullHeight === true) {
24392
24973
  if (this.viewConfig.vizId) {
24393
- logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
24394
- 'Using full height with vizId might lead to unexpected behavior.');
24395
- }
24396
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
24397
- this.viewConfig.lazyLoadingForFullHeight = true;
24398
- }
24399
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
24400
- this.viewConfig.enableScrollableContainerLazyLoading = true;
24974
+ logger$3.warn('Full height is currently only supported for Liveboard embeds.'
24975
+ + 'Using full height with vizId might lead to unexpected behavior.');
24401
24976
  }
24402
- if (this.viewConfig.lazyLoadingMargin === undefined) {
24403
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
24404
- }
24405
- this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
24406
- this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
24407
- this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
24408
- this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
24977
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
24978
+ getIframe: () => this.iFrame,
24979
+ setFrameHeight: (height) => this.setIFrameHeight(height),
24980
+ on: (eventType, callback) => {
24981
+ this.on(eventType, callback);
24982
+ },
24983
+ trigger: (hostEvent, data) => {
24984
+ this.trigger(hostEvent, data);
24985
+ },
24986
+ });
24409
24987
  }
24410
24988
  }
24411
24989
  async getAppInitData() {
@@ -24423,21 +25001,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
24423
25001
  return queryParams;
24424
25002
  }
24425
25003
  getEmbedParamsObject() {
25004
+ var _a;
24426
25005
  let params = {};
24427
25006
  params = this.getBaseQueryParams(params);
24428
- const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
25007
+ const { enableVizTransformations, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24429
25008
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
24430
25009
  || this.viewConfig.preventPinboardFilterRemoval;
24431
- if (fullHeight === true) {
24432
- params[Param.fullHeight] = true;
24433
- if (this.viewConfig.lazyLoadingForFullHeight) {
24434
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
24435
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
24436
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
24437
- }
24438
- }
24439
- }
24440
- this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
25010
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
24441
25011
  if (enableVizTransformations !== undefined) {
24442
25012
  params[Param.EnableVizTransformations] = enableVizTransformations.toString();
24443
25013
  }
@@ -24664,19 +25234,45 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
24664
25234
  }
24665
25235
  beforePrerenderVisible() {
24666
25236
  super.beforePrerenderVisible();
24667
- const embedObj = this.getPreRenderObj();
24668
- this.executeAfterEmbedContainerLoaded(() => {
24669
- this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
24670
- if (embedObj) {
24671
- embedObj.currentLiveboardState = {
24672
- liveboardId: this.viewConfig.liveboardId,
24673
- vizId: this.viewConfig.vizId,
24674
- activeTabId: this.viewConfig.activeTabId,
24675
- personalizedViewId: this.viewConfig.personalizedViewId,
24676
- };
25237
+ // Captured before showPreRender() hands the wrapper over to this instance.
25238
+ // Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
25239
+ const previous = this.getPreRenderObj();
25240
+ const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25241
+ this.executeAfterEmbedContainerLoaded(async () => {
25242
+ // Without this the params callback suspends on its await and Navigate
25243
+ // goes out first, so the container loads with the previous config's filters.
25244
+ await this.preRenderParamsApplied;
25245
+ if (this.isShowingLiveboardRoute(showing)) {
25246
+ // Navigate to the route we are already on is a no-op, so the liveboard
25247
+ // keeps its state. Home unmounts the container, which clears it.
25248
+ this.trigger(HostEvent.Navigate, HOME_ROUTE)
25249
+ .catch((error) => logger$3.warn('Could not route via home', error));
25250
+ // Not awaited above: the container never acks Navigate, so that promise
25251
+ // only settles on the 30s trigger timeout.
25252
+ await new Promise((resolve) => {
25253
+ setTimeout(resolve, HOME_SETTLE_MS);
25254
+ });
24677
25255
  }
25256
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
25257
+ this.currentLiveboardState = {
25258
+ liveboardId: this.viewConfig.liveboardId,
25259
+ vizId: this.viewConfig.vizId,
25260
+ activeTabId: this.viewConfig.activeTabId,
25261
+ personalizedViewId: this.viewConfig.personalizedViewId,
25262
+ };
24678
25263
  });
24679
25264
  }
25265
+ // The whole route, not just the liveboard id: the path is built from the viz, tab
25266
+ // and view too, so a same-liveboard show onto another tab is a real navigation.
25267
+ isShowingLiveboardRoute(showing) {
25268
+ if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
25269
+ return false;
25270
+ const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
25271
+ return showing.liveboardId === liveboardId
25272
+ && showing.vizId === vizId
25273
+ && showing.activeTabId === activeTabId
25274
+ && showing.personalizedViewId === personalizedViewId;
25275
+ }
24680
25276
  async handleRenderForPrerender() {
24681
25277
  if (isUndefined$1(this.viewConfig.liveboardId)) {
24682
25278
  return this.prerenderGeneric();
@@ -24685,11 +25281,16 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
24685
25281
  }
24686
25282
  /**
24687
25283
  * Triggers an event to the embedded app
25284
+ * Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
25285
+ * from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
24688
25286
  * @param {HostEvent} messageType The event type
24689
- * @param {any} data The payload to send with the message
25287
+ * @param {TriggerData} data The payload, typed against the event's contract
24690
25288
  * @returns A promise that resolves with the response from the embedded app
24691
25289
  */
24692
- trigger(messageType, data = {}, context) {
25290
+ trigger(messageType,
25291
+ // Mirror TsEmbed.trigger: contract shape is the contextual type and
25292
+ // unknown fields on object literals are flagged. Strict in SDK 1.54.0.
25293
+ data = {}, context) {
24693
25294
  const dataWithVizId = data;
24694
25295
  if (messageType === HostEvent.SetActiveTab) {
24695
25296
  this.setActiveTab(data);
@@ -24705,52 +25306,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
24705
25306
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
24706
25307
  */
24707
25308
  destroy() {
25309
+ var _a;
24708
25310
  super.destroy();
24709
- this.unregisterLazyLoadEvents();
25311
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
24710
25312
  }
24711
25313
  postRender() {
24712
- this.registerLazyLoadEvents();
24713
- }
24714
- registerLazyLoadEvents() {
24715
- if (!this.iFrame) {
24716
- return;
24717
- }
24718
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24719
- this.unregisterLazyLoadEvents();
24720
- // TODO: Use passive: true, install modernizr to check for passive
24721
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
24722
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24723
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
24724
- return;
24725
- }
24726
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
24727
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24728
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
24729
- });
24730
- if (typeof ResizeObserver !== 'undefined') {
24731
- const resizeTargets = new Set([
24732
- this.iFrame.parentElement,
24733
- ...getEffectiveClippingAncestors(this.iFrame),
24734
- ].filter(Boolean));
24735
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
24736
- resizeTargets.forEach((resizeTarget) => {
24737
- this.lazyLoadResizeObserver.observe(resizeTarget);
24738
- });
24739
- }
24740
- }
24741
- }
24742
- unregisterLazyLoadEvents() {
24743
25314
  var _a;
24744
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24745
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
24746
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24747
- (_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24748
- this.lazyLoadResizeObserver = undefined;
24749
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24750
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
24751
- });
24752
- this.lazyLoadScrollContainers = [];
24753
- }
25315
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
24754
25316
  }
24755
25317
  /**
24756
25318
  * Render an embedded ThoughtSpot Liveboard or visualization