@thoughtspot/visual-embed-sdk 1.39.2 → 1.40.0

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 (173) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.spec.js +9 -0
  3. package/cjs/src/config.spec.js.map +1 -1
  4. package/cjs/src/embed/app.d.ts +75 -15
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +69 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +378 -15
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +23 -7
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +31 -5
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  15. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.spec.js +28 -0
  17. package/cjs/src/embed/conversation.spec.js.map +1 -1
  18. package/cjs/src/embed/embedConfig.d.ts +9 -7
  19. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  20. package/cjs/src/embed/embedConfig.js +9 -7
  21. package/cjs/src/embed/embedConfig.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -17
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +48 -4
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +218 -11
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/errors.d.ts +1 -0
  29. package/cjs/src/errors.d.ts.map +1 -1
  30. package/cjs/src/errors.js +1 -0
  31. package/cjs/src/errors.js.map +1 -1
  32. package/cjs/src/index.d.ts +2 -2
  33. package/cjs/src/index.d.ts.map +1 -1
  34. package/cjs/src/index.js +2 -1
  35. package/cjs/src/index.js.map +1 -1
  36. package/cjs/src/react/all-types-export.d.ts +1 -1
  37. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  38. package/cjs/src/react/all-types-export.js +3 -2
  39. package/cjs/src/react/all-types-export.js.map +1 -1
  40. package/cjs/src/react/index.d.ts +73 -20
  41. package/cjs/src/react/index.d.ts.map +1 -1
  42. package/cjs/src/react/index.js +79 -42
  43. package/cjs/src/react/index.js.map +1 -1
  44. package/cjs/src/react/index.spec.js +438 -100
  45. package/cjs/src/react/index.spec.js.map +1 -1
  46. package/cjs/src/types.d.ts +331 -13
  47. package/cjs/src/types.d.ts.map +1 -1
  48. package/cjs/src/types.js +296 -8
  49. package/cjs/src/types.js.map +1 -1
  50. package/cjs/src/utils/global-styles.js +1 -1
  51. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  52. package/cjs/src/utils/graphql/nlsService/conversation-service.js +7 -1
  53. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  54. package/cjs/src/utils/processTrigger.js +2 -1
  55. package/cjs/src/utils/processTrigger.js.map +1 -1
  56. package/cjs/src/utils.d.ts +6 -0
  57. package/cjs/src/utils.d.ts.map +1 -1
  58. package/cjs/src/utils.js +23 -3
  59. package/cjs/src/utils.js.map +1 -1
  60. package/cjs/src/utils.spec.js +237 -1
  61. package/cjs/src/utils.spec.js.map +1 -1
  62. package/dist/{index-CmEQfuE3.js → index-CAEHQGLc.js} +1 -1
  63. package/dist/src/embed/app.d.ts +75 -15
  64. package/dist/src/embed/app.d.ts.map +1 -1
  65. package/dist/src/embed/bodyless-conversation.d.ts +23 -7
  66. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  67. package/dist/src/embed/embedConfig.d.ts +9 -7
  68. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  69. package/dist/src/embed/liveboard.d.ts +56 -17
  70. package/dist/src/embed/liveboard.d.ts.map +1 -1
  71. package/dist/src/errors.d.ts +1 -0
  72. package/dist/src/errors.d.ts.map +1 -1
  73. package/dist/src/index.d.ts +2 -2
  74. package/dist/src/index.d.ts.map +1 -1
  75. package/dist/src/react/all-types-export.d.ts +1 -1
  76. package/dist/src/react/all-types-export.d.ts.map +1 -1
  77. package/dist/src/react/index.d.ts +73 -20
  78. package/dist/src/react/index.d.ts.map +1 -1
  79. package/dist/src/types.d.ts +331 -13
  80. package/dist/src/types.d.ts.map +1 -1
  81. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  82. package/dist/src/utils.d.ts +6 -0
  83. package/dist/src/utils.d.ts.map +1 -1
  84. package/dist/tsembed-react.es.js +568 -87
  85. package/dist/tsembed-react.js +568 -85
  86. package/dist/tsembed.es.js +486 -40
  87. package/dist/tsembed.js +484 -38
  88. package/dist/visual-embed-sdk-react-full.d.ts +545 -79
  89. package/dist/visual-embed-sdk-react.d.ts +545 -79
  90. package/dist/visual-embed-sdk.d.ts +473 -60
  91. package/lib/package.json +1 -1
  92. package/lib/src/config.spec.js +9 -0
  93. package/lib/src/config.spec.js.map +1 -1
  94. package/lib/src/embed/app.d.ts +75 -15
  95. package/lib/src/embed/app.d.ts.map +1 -1
  96. package/lib/src/embed/app.js +69 -9
  97. package/lib/src/embed/app.js.map +1 -1
  98. package/lib/src/embed/app.spec.js +380 -17
  99. package/lib/src/embed/app.spec.js.map +1 -1
  100. package/lib/src/embed/bodyless-conversation.d.ts +23 -7
  101. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  102. package/lib/src/embed/bodyless-conversation.js +30 -5
  103. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  104. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  105. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  106. package/lib/src/embed/conversation.spec.js +30 -2
  107. package/lib/src/embed/conversation.spec.js.map +1 -1
  108. package/lib/src/embed/embedConfig.d.ts +9 -7
  109. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  110. package/lib/src/embed/embedConfig.js +9 -7
  111. package/lib/src/embed/embedConfig.js.map +1 -1
  112. package/lib/src/embed/liveboard.d.ts +56 -17
  113. package/lib/src/embed/liveboard.d.ts.map +1 -1
  114. package/lib/src/embed/liveboard.js +49 -5
  115. package/lib/src/embed/liveboard.js.map +1 -1
  116. package/lib/src/embed/liveboard.spec.js +218 -11
  117. package/lib/src/embed/liveboard.spec.js.map +1 -1
  118. package/lib/src/errors.d.ts +1 -0
  119. package/lib/src/errors.d.ts.map +1 -1
  120. package/lib/src/errors.js +1 -0
  121. package/lib/src/errors.js.map +1 -1
  122. package/lib/src/index.d.ts +2 -2
  123. package/lib/src/index.d.ts.map +1 -1
  124. package/lib/src/index.js +2 -2
  125. package/lib/src/index.js.map +1 -1
  126. package/lib/src/react/all-types-export.d.ts +1 -1
  127. package/lib/src/react/all-types-export.d.ts.map +1 -1
  128. package/lib/src/react/all-types-export.js +1 -1
  129. package/lib/src/react/all-types-export.js.map +1 -1
  130. package/lib/src/react/index.d.ts +73 -20
  131. package/lib/src/react/index.d.ts.map +1 -1
  132. package/lib/src/react/index.js +79 -43
  133. package/lib/src/react/index.js.map +1 -1
  134. package/lib/src/react/index.spec.js +441 -103
  135. package/lib/src/react/index.spec.js.map +1 -1
  136. package/lib/src/types.d.ts +331 -13
  137. package/lib/src/types.d.ts.map +1 -1
  138. package/lib/src/types.js +296 -8
  139. package/lib/src/types.js.map +1 -1
  140. package/lib/src/utils/global-styles.js +1 -1
  141. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  142. package/lib/src/utils/graphql/nlsService/conversation-service.js +7 -1
  143. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  144. package/lib/src/utils/processTrigger.js +2 -1
  145. package/lib/src/utils/processTrigger.js.map +1 -1
  146. package/lib/src/utils.d.ts +6 -0
  147. package/lib/src/utils.d.ts.map +1 -1
  148. package/lib/src/utils.js +21 -2
  149. package/lib/src/utils.js.map +1 -1
  150. package/lib/src/utils.spec.js +238 -2
  151. package/lib/src/utils.spec.js.map +1 -1
  152. package/lib/src/visual-embed-sdk.d.ts +474 -61
  153. package/package.json +1 -1
  154. package/src/config.spec.ts +11 -0
  155. package/src/embed/app.spec.ts +486 -30
  156. package/src/embed/app.ts +133 -27
  157. package/src/embed/bodyless-conversation.spec.ts +9 -203
  158. package/src/embed/bodyless-conversation.ts +34 -10
  159. package/src/embed/conversation.spec.ts +40 -2
  160. package/src/embed/embedConfig.ts +10 -8
  161. package/src/embed/liveboard.spec.ts +259 -5
  162. package/src/embed/liveboard.ts +98 -27
  163. package/src/errors.ts +1 -0
  164. package/src/index.ts +2 -0
  165. package/src/react/all-types-export.ts +2 -1
  166. package/src/react/index.spec.tsx +558 -157
  167. package/src/react/index.tsx +117 -51
  168. package/src/types.ts +368 -50
  169. package/src/utils/global-styles.ts +1 -1
  170. package/src/utils/graphql/nlsService/conversation-service.ts +7 -1
  171. package/src/utils/processTrigger.ts +1 -1
  172. package/src/utils.spec.ts +279 -2
  173. package/src/utils.ts +28 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.40.0 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -278,7 +278,6 @@ const getOperationNameFromQuery = (query) => {
278
278
  function removeTypename(obj) {
279
279
  if (!obj || typeof obj !== 'object')
280
280
  return obj;
281
- // eslint-disable-next-line no-restricted-syntax
282
281
  for (const key in obj) {
283
282
  if (key === '__typename') {
284
283
  delete obj[key];
@@ -307,7 +306,11 @@ const setStyleProperties = (element, styleProperties) => {
307
306
  if (!(element === null || element === void 0 ? void 0 : element.style))
308
307
  return;
309
308
  Object.keys(styleProperties).forEach((styleProperty) => {
310
- element.style[styleProperty] = styleProperties[styleProperty].toString();
309
+ const styleKey = styleProperty;
310
+ const value = styleProperties[styleKey];
311
+ if (value !== undefined) {
312
+ element.style[styleKey] = value.toString();
313
+ }
311
314
  });
312
315
  };
313
316
  /**
@@ -435,6 +438,22 @@ const handleExitPresentMode = async () => {
435
438
  }
436
439
  }
437
440
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
441
+ };
442
+ const calculateVisibleElementData = (element) => {
443
+ const rect = element.getBoundingClientRect();
444
+ const windowHeight = window.innerHeight;
445
+ const windowWidth = window.innerWidth;
446
+ const frameRelativeTop = Math.max(rect.top, 0);
447
+ const frameRelativeLeft = Math.max(rect.left, 0);
448
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
449
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
450
+ const data = {
451
+ top: Math.max(0, rect.top * -1),
452
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
453
+ left: Math.max(0, rect.left * -1),
454
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
455
+ };
456
+ return data;
438
457
  };
439
458
 
440
459
  /**
@@ -653,6 +672,12 @@ var HomeLeftNavItem;
653
672
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
654
673
  */
655
674
  HomeLeftNavItem["Spotter"] = "spotter";
675
+ /**
676
+ * Favorites option in the insights left navigation,
677
+ * available when new navigation V3 is enabled.
678
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
679
+ */
680
+ HomeLeftNavItem["Favorites"] = "favorites";
656
681
  })(HomeLeftNavItem || (HomeLeftNavItem = {}));
657
682
  /**
658
683
  * A map of the supported runtime filter operations
@@ -1471,7 +1496,7 @@ var EmbedEvent;
1471
1496
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1472
1497
  * @example
1473
1498
  *```js
1474
- * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1499
+ * liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
1475
1500
  * console.log('Liveboard details', payload);
1476
1501
  * })
1477
1502
  *```
@@ -1839,6 +1864,89 @@ var EmbedEvent;
1839
1864
  * @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
1840
1865
  */
1841
1866
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1867
+ /**
1868
+ * Emitted when a user requests the full height lazy load data.
1869
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1870
+ * @hidden
1871
+ */
1872
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1873
+ /**
1874
+ * Emitted when Spotter response is text data
1875
+ * @example
1876
+ * ```js
1877
+ * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1878
+ * console.log('payload', payload);
1879
+ * })
1880
+ *```
1881
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1882
+ */
1883
+ EmbedEvent["SpotterData"] = "SpotterData";
1884
+ /**
1885
+ * Emitted when user opens up the worksheet preview modal in Spotter embed.
1886
+ * @example
1887
+ * ```js
1888
+ * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1889
+ * console.log('payload', payload);
1890
+ * })
1891
+ *```
1892
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1893
+ */
1894
+ EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1895
+ /**
1896
+ * Emitted when the Spotter query is triggered in Spotter embed.
1897
+ * @example
1898
+ * ```js
1899
+ * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1900
+ * console.log('payload', payload);
1901
+ * })
1902
+ *```
1903
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1904
+ */
1905
+ EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1906
+ /**
1907
+ * Emitted when the last Spotter query is edited in Spotter embed.
1908
+ * @example
1909
+ * ```js
1910
+ * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1911
+ * console.log('payload', payload);
1912
+ * })
1913
+ *```
1914
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1915
+ */
1916
+ EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1917
+ /**
1918
+ * Emitted when the last Spotter query is deleted in Spotter embed.
1919
+ * @example
1920
+ * ```js
1921
+ * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1922
+ * console.log('payload', payload);
1923
+ * })
1924
+ *```
1925
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1926
+ */
1927
+ EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1928
+ /**
1929
+ * Emitted when the coversation is reset in spotter embed.
1930
+ * @example
1931
+ * ```js
1932
+ * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1933
+ * console.log('payload', payload);
1934
+ * })
1935
+ *```
1936
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1937
+ */
1938
+ EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1939
+ /**
1940
+ * Emitted when the *Spotter* is initialized.
1941
+ * @example
1942
+ * ```js
1943
+ * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1944
+ * console.log('payload', payload);
1945
+ * })
1946
+ *```
1947
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1948
+ */
1949
+ EmbedEvent["SpotterInit"] = "spotterInit";
1842
1950
  })(EmbedEvent || (EmbedEvent = {}));
1843
1951
  /**
1844
1952
  * Event types that can be triggered by the host application
@@ -1856,7 +1964,7 @@ var EmbedEvent;
1856
1964
  * // create the liveboard embed.
1857
1965
  *
1858
1966
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1859
- * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1967
+ * { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
1860
1968
  * ]);
1861
1969
  * ```
1862
1970
  * @example
@@ -1928,6 +2036,7 @@ var HostEvent;
1928
2036
  * done automatically on the most popular column.
1929
2037
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1930
2038
  * in case of a Liveboard.
2039
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
1931
2040
  * @example
1932
2041
  * ```js
1933
2042
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -2066,12 +2175,12 @@ var HostEvent;
2066
2175
  * Works with Search and Liveboard embed.
2067
2176
  * @param - { columnId: string,
2068
2177
  * name: string,
2069
- * type: INT64/CHAR/DATE,
2070
- * dataType: ATTRIBUTE/MEASURE }
2178
+ * type: ATTRIBUTE/MEASURE,
2179
+ * dataType: INT64/CHAR/DATE }
2071
2180
  * @example
2072
2181
  * ```js
2073
2182
  * searchEmbed.trigger(HostEvent.OpenFilter,
2074
- * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
2183
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
2075
2184
  * ```
2076
2185
  * @example
2077
2186
  * ```js
@@ -2129,6 +2238,7 @@ var HostEvent;
2129
2238
  * @param
2130
2239
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
2131
2240
  * Optional when pinning a new chart or table generated from a Search query.
2241
+ * **Required** in Spotter Embed.
2132
2242
  * @param
2133
2243
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
2134
2244
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -2176,6 +2286,12 @@ var HostEvent;
2176
2286
  * ```js
2177
2287
  * appEmbed.trigger(HostEvent.Pin)
2178
2288
  * ```
2289
+ * @example
2290
+ * ```js
2291
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2292
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2293
+ * });
2294
+ * ```
2179
2295
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2180
2296
  */
2181
2297
  HostEvent["Pin"] = "pin";
@@ -2240,12 +2356,21 @@ var HostEvent;
2240
2356
  * Trigger the **Download PDF** action on an embedded Liveboard,
2241
2357
  * visualization or Answer.
2242
2358
  *
2359
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2360
+ *
2243
2361
  * **NOTE**: The **Download** > **PDF** action is available on
2244
2362
  * visualizations and Answers if the data is in tabular format.
2245
2363
  * @example
2246
2364
  * ```js
2247
2365
  * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
2248
2366
  * ```
2367
+ * @example
2368
+ * ```js
2369
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2370
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2371
+ * });
2372
+ * ```
2373
+ *
2249
2374
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2250
2375
  */
2251
2376
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
@@ -2269,6 +2394,12 @@ var HostEvent;
2269
2394
  * ```js
2270
2395
  * searchEmbed.trigger(HostEvent.MakeACopy)
2271
2396
  * ```
2397
+ * @example
2398
+ * ```js
2399
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2400
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2401
+ * });
2402
+ * ```
2272
2403
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2273
2404
  */
2274
2405
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2341,6 +2472,8 @@ var HostEvent;
2341
2472
  * This event is not supported in visualization embed and search embed.
2342
2473
  * @param - object - To trigger the action for a specific visualization
2343
2474
  * in Liveboard embed, pass in `vizId` as a key.
2475
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2476
+ *
2344
2477
  * @example
2345
2478
  * ```js
2346
2479
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2349,6 +2482,18 @@ var HostEvent;
2349
2482
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2350
2483
  * '730496d6-6903-4601-937e-2c691821af3c'})
2351
2484
  * ```
2485
+ * @example
2486
+ * ```js
2487
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2488
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2489
+ * });
2490
+ * ```
2491
+ * @example
2492
+ * ```js
2493
+ * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2494
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2495
+ * });
2496
+ * ```
2352
2497
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2353
2498
  */
2354
2499
  HostEvent["Edit"] = "edit";
@@ -2396,6 +2541,16 @@ var HostEvent;
2396
2541
  * );
2397
2542
  * })
2398
2543
  * ```
2544
+ * @example
2545
+ * ```js
2546
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2547
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2548
+ * }).then((tml) => {
2549
+ * console.log(
2550
+ * tml.answer.search_query // TML representation of the search query
2551
+ * );
2552
+ * })
2553
+ * ```
2399
2554
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2400
2555
  * @important
2401
2556
  */
@@ -2459,6 +2614,7 @@ var HostEvent;
2459
2614
  /**
2460
2615
  * Trigger the **Download** action on charts in
2461
2616
  * the embedded view.
2617
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2462
2618
  * @example
2463
2619
  * ```js
2464
2620
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2467,6 +2623,11 @@ var HostEvent;
2467
2623
  * ```js
2468
2624
  * embed.trigger(HostEvent.Download)
2469
2625
  * ```
2626
+ * ```js
2627
+ * spotterEmbed.trigger(HostEvent.Download, {
2628
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2629
+ * });
2630
+ * ```
2470
2631
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2471
2632
  * Use {@link DownloadAsPng}
2472
2633
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2483,13 +2644,19 @@ var HostEvent;
2483
2644
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2484
2645
  *
2485
2646
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2647
+ *
2648
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2649
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2650
+ * })
2486
2651
  * ```
2652
+ *
2487
2653
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2488
2654
  */
2489
2655
  HostEvent["DownloadAsPng"] = "downloadAsPng";
2490
2656
  /**
2491
2657
  * Trigger the **Download** > **CSV** action on tables in
2492
2658
  * the embedded view.
2659
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2493
2660
  * @example
2494
2661
  * ```js
2495
2662
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2501,12 +2668,18 @@ var HostEvent;
2501
2668
  * ```js
2502
2669
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2503
2670
  * ```
2671
+ * ```js
2672
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2673
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2674
+ * })
2675
+ * ```
2504
2676
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2505
2677
  */
2506
2678
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
2507
2679
  /**
2508
2680
  * Trigger the **Download** > **XLSX** action on tables
2509
2681
  * in the embedded view.
2682
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2510
2683
  * @example
2511
2684
  * ```js
2512
2685
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2518,6 +2691,11 @@ var HostEvent;
2518
2691
  * ```js
2519
2692
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2520
2693
  * ```
2694
+ * ```js
2695
+ * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2696
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2697
+ * })
2698
+ * ```
2521
2699
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2522
2700
  */
2523
2701
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2537,6 +2715,7 @@ var HostEvent;
2537
2715
  /**
2538
2716
  * Trigger the **Save** action on a Liveboard or Answer.
2539
2717
  * Saves the changes.
2718
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2540
2719
  * @example
2541
2720
  * ```js
2542
2721
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2544,6 +2723,11 @@ var HostEvent;
2544
2723
  * ```js
2545
2724
  * searchEmbed.trigger(HostEvent.Save)
2546
2725
  * ```
2726
+ * ```js
2727
+ * spotterEmbed.trigger(HostEvent.Save, {
2728
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2729
+ * })
2730
+ * ```
2547
2731
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2548
2732
  */
2549
2733
  HostEvent["Save"] = "save";
@@ -2827,7 +3011,7 @@ var HostEvent;
2827
3011
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2828
3012
  /**
2829
3013
  * Triggers an action to update Parameter values on embedded
2830
- * Answers and Liveboard.
3014
+ * Answers, Liveboard and Spotter answer in Edit mode.
2831
3015
  *
2832
3016
  * @example
2833
3017
  * ```js
@@ -2841,11 +3025,19 @@ var HostEvent;
2841
3025
  HostEvent["UpdateParameters"] = "UpdateParameters";
2842
3026
  /**
2843
3027
  * Triggers GetParameters to fetch the runtime Parameters.
3028
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2844
3029
  * ```js
2845
3030
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
2846
3031
  * console.log('parameters', parameter);
2847
3032
  * });
2848
3033
  *```
3034
+ *```js
3035
+ * spotterEmbed.trigger(HostEvent.GetParameters, {
3036
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3037
+ * }).then((parameter) => {
3038
+ * console.log('parameters', parameter);
3039
+ * });
3040
+ *```
2849
3041
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2850
3042
  */
2851
3043
  HostEvent["GetParameters"] = "GetParameters";
@@ -2877,7 +3069,7 @@ var HostEvent;
2877
3069
  * @param - optional attributes to set Answer properties.
2878
3070
  * `name` - Name string for the Answer.
2879
3071
  * `description` - Description text for the Answer.
2880
- *
3072
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2881
3073
  * @example
2882
3074
  * ```js
2883
3075
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -2885,6 +3077,14 @@ var HostEvent;
2885
3077
  * description: "Total sales by states in MidWest"
2886
3078
  * });
2887
3079
  * ```
3080
+ * @example
3081
+ * ```js
3082
+ * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
3083
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c',
3084
+ * name: "Sales by states",
3085
+ * description: "Total sales by states in MidWest"
3086
+ * });
3087
+ * ```
2888
3088
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2889
3089
  */
2890
3090
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2913,6 +3113,70 @@ var HostEvent;
2913
3113
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2914
3114
  */
2915
3115
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
3116
+ /**
3117
+ * Triggers a search operation with the search tokens specified in
3118
+ * the search query string in spotter embed.
3119
+ * @param - `query`: Text string in Natural Language format
3120
+ * @param - `executeSearch`: Boolean to execute search and update search query
3121
+ * @example
3122
+ * ```js
3123
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
3124
+ * query: 'revenue per year',
3125
+ * executeSearch: true,
3126
+ * })
3127
+ * ```
3128
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3129
+ */
3130
+ HostEvent["SpotterSearch"] = "SpotterSearch";
3131
+ /**
3132
+ * Edits the last prompt in spotter embed.
3133
+ * @param - `query`: Text string
3134
+ * @example
3135
+ * ```js
3136
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
3137
+ * ```
3138
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3139
+ */
3140
+ HostEvent["EditLastPrompt"] = "EditLastPrompt";
3141
+ /**
3142
+ * Opens the Worksheet preview modal in Spotter Embed.
3143
+ * @example
3144
+ * ```js
3145
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
3146
+ * ```
3147
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3148
+ */
3149
+ HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3150
+ /**
3151
+ * Resets the Spotter Embed Conversation.
3152
+ * @example
3153
+ * ```js
3154
+ * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
3155
+ * ```
3156
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3157
+ */
3158
+ HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
3159
+ /**
3160
+ * Deletes the last prompt in spotter embed.
3161
+ * @example
3162
+ * ```js
3163
+ * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
3164
+ * ```
3165
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3166
+ */
3167
+ HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3168
+ /**
3169
+ * Toggle the visualization to chart or table view.
3170
+ * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
3171
+ * @example
3172
+ * ```js
3173
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3174
+ * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
3175
+ * });
3176
+ *```
3177
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3178
+ */
3179
+ HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2916
3180
  /**
2917
3181
  * @hidden
2918
3182
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -2923,6 +3187,30 @@ var HostEvent;
2923
3187
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2924
3188
  */
2925
3189
  HostEvent["ExitPresentMode"] = "exitPresentMode";
3190
+ /**
3191
+ * Triggers the full height lazy load data.
3192
+ * @example
3193
+ * ```js
3194
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
3195
+ * console.log(payload);
3196
+ * });
3197
+ * ```
3198
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
3199
+ *
3200
+ * @hidden
3201
+ */
3202
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3203
+ /**
3204
+ * Trigger the *Ask Spotter* action for visualizations
3205
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3206
+ * @example
3207
+ * ```js
3208
+ * spotterEmbed.trigger(HostEvent.AskSpotter,
3209
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
3210
+ * ```
3211
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3212
+ */
3213
+ HostEvent["AskSpotter"] = "AskSpotter";
2926
3214
  })(HostEvent || (HostEvent = {}));
2927
3215
  /**
2928
3216
  * The different visual modes that the data sources panel within
@@ -3028,6 +3316,7 @@ var Param;
3028
3316
  Param["Query"] = "query";
3029
3317
  Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
3030
3318
  Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
3319
+ Param["ListPageVersion"] = "listpageVersion";
3031
3320
  Param["PendoTrackingKey"] = "additionalPendoKey";
3032
3321
  Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
3033
3322
  Param["IsProductTour"] = "isProductTour";
@@ -3062,10 +3351,12 @@ var Param;
3062
3351
  Param["DataSourceId"] = "dataSourceId";
3063
3352
  Param["preAuthCache"] = "preAuthCache";
3064
3353
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
3065
- Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3354
+ Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
3066
3355
  Param["PrimaryAction"] = "primaryAction";
3067
3356
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3068
3357
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3358
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3359
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3069
3360
  })(Param || (Param = {}));
3070
3361
  /**
3071
3362
  * ThoughtSpot application pages include actions and menu commands
@@ -4288,6 +4579,22 @@ var Action;
4288
4579
  * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
4289
4580
  */
4290
4581
  Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
4582
+ /**
4583
+ * Action ID for hide or disable the
4584
+ * Spotter in conversation training widget.
4585
+ * The Add to Coaching feature is currently in beta
4586
+ * and is disabled by default on embed deployments.
4587
+ * To enable this feature on your instance,
4588
+ * contact ThoughtSpot Support.
4589
+ * @example
4590
+ * ```js
4591
+ * hiddenAction: [Action.InConversationTraining]
4592
+ * disabledActions: [Action.InConversationTraining]
4593
+ *
4594
+ * ```
4595
+ * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
4596
+ */
4597
+ Action["InConversationTraining"] = "InConversationTraining";
4291
4598
  })(Action || (Action = {}));
4292
4599
  var PrefetchFeatures;
4293
4600
  (function (PrefetchFeatures) {
@@ -6754,6 +7061,7 @@ const ERROR_MESSAGE = {
6754
7061
  CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
6755
7062
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
6756
7063
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7064
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
6757
7065
  };
6758
7066
 
6759
7067
  const EndPoints = {
@@ -6961,13 +7269,14 @@ const configKey = 'embedConfig';
6961
7269
  *
6962
7270
  * @example
6963
7271
  * ```js
7272
+ * import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
7273
+ * // Call the getInitConfig method to retrieve the embed configuration
6964
7274
  * const config = getInitConfig();
7275
+ * // Log the configuration settings
6965
7276
  * console.log(config);
6966
7277
  * ```
6967
- * @example
6968
- *
6969
- * Returns the `EmbedConfig` object, which
6970
- * contains the configuration settings used to
7278
+ * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
7279
+ * object, which contains the configuration settings used to
6971
7280
  * initialize the SDK, including the following:
6972
7281
  *
6973
7282
  * - `thoughtSpotHost` - ThoughtSpot host URL
@@ -6976,9 +7285,10 @@ const configKey = 'embedConfig';
6976
7285
  * - `customizations` - Style, text, and icon customization settings
6977
7286
  * that were applied during the SDK initialization.
6978
7287
  *
6979
- * For a comprehensive list of embed configuration settings,
6980
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
7288
+ * The following JSON output shows the embed configuration
7289
+ * settings returned from the code in the previous example:
6981
7290
  *
7291
+ * @example
6982
7292
  * ```json
6983
7293
  * {
6984
7294
  * "thoughtSpotHost": "https://{ThoughtSpot-Host}",
@@ -7000,7 +7310,7 @@ const configKey = 'embedConfig';
7000
7310
  * "authTriggerContainer": "#your-own-div"
7001
7311
  * }
7002
7312
  * ```
7003
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.cl, and later
7313
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
7004
7314
  * @group Global methods
7005
7315
  */
7006
7316
  const getEmbedConfig = () => getValueFromWindow(configKey) || {};
@@ -7642,7 +7952,7 @@ class AnswerService {
7642
7952
  async getTML() {
7643
7953
  const { object } = await this.executeQuery(getAnswerTML, {});
7644
7954
  const edoc = object[0].edoc;
7645
- const YAML = await import('./index-CmEQfuE3.js');
7955
+ const YAML = await import('./index-CAEHQGLc.js');
7646
7956
  const parsedDoc = YAML.parse(edoc);
7647
7957
  return {
7648
7958
  answer: {
@@ -15542,7 +15852,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15542
15852
  return e;
15543
15853
  }
15544
15854
 
15545
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15855
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15546
15856
 
15547
15857
  /**
15548
15858
  * Reloads the ThoughtSpot iframe.
@@ -15565,7 +15875,8 @@ const reload = (iFrame) => {
15565
15875
  * @param channel
15566
15876
  */
15567
15877
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15568
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15878
+ var _a;
15879
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15569
15880
  }
15570
15881
  const TRIGGER_TIMEOUT = 30000;
15571
15882
  /**
@@ -16950,7 +17261,6 @@ class V1Embed extends TsEmbed {
16950
17261
  /**
16951
17262
  * Pages within the ThoughtSpot app that can be embedded.
16952
17263
  */
16953
- // eslint-disable-next-line no-shadow
16954
17264
  var Page;
16955
17265
  (function (Page) {
16956
17266
  /**
@@ -17036,16 +17346,46 @@ var HomePage;
17036
17346
  */
17037
17347
  HomePage["Modular"] = "v2";
17038
17348
  })(HomePage || (HomePage = {}));
17349
+ /**
17350
+ * Define the version of the list page
17351
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
17352
+ */
17353
+ var ListPage;
17354
+ (function (ListPage) {
17355
+ /**
17356
+ * List (v2) is the traditional List Experience.
17357
+ * It serves as the foundational version of the list page.
17358
+ */
17359
+ ListPage["List"] = "v2";
17360
+ /**
17361
+ * ListWithUXChanges (v3) introduces the new updated list page with UX changes.
17362
+ */
17363
+ ListPage["ListWithUXChanges"] = "v3";
17364
+ })(ListPage || (ListPage = {}));
17039
17365
  /**
17040
17366
  * Embeds full ThoughtSpot experience in a host application.
17041
17367
  * @group Embed components
17042
17368
  */
17043
17369
  class AppEmbed extends V1Embed {
17044
- // eslint-disable-next-line no-useless-constructor
17045
17370
  constructor(domSelector, viewConfig) {
17046
17371
  viewConfig.embedComponentType = 'AppEmbed';
17047
17372
  super(domSelector, viewConfig);
17048
17373
  this.defaultHeight = '100%';
17374
+ this.sendFullHeightLazyLoadData = () => {
17375
+ const data = calculateVisibleElementData(this.iFrame);
17376
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17377
+ };
17378
+ /**
17379
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17380
+ * It is used to send the visible coordinates data to the host application.
17381
+ * @param data The event payload
17382
+ * @param responder The responder function
17383
+ */
17384
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17385
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17386
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17387
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17388
+ };
17049
17389
  /**
17050
17390
  * Set the iframe height as per the computed height received
17051
17391
  * from the ThoughtSpot app.
@@ -17054,6 +17394,7 @@ class AppEmbed extends V1Embed {
17054
17394
  this.updateIFrameHeight = (data) => {
17055
17395
  var _a;
17056
17396
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17397
+ this.sendFullHeightLazyLoadData();
17057
17398
  };
17058
17399
  this.embedIframeCenter = (data, responder) => {
17059
17400
  const obj = this.getIframeCenter();
@@ -17083,6 +17424,7 @@ class AppEmbed extends V1Embed {
17083
17424
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17084
17425
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17085
17426
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17427
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17086
17428
  }
17087
17429
  }
17088
17430
  /**
@@ -17090,9 +17432,7 @@ class AppEmbed extends V1Embed {
17090
17432
  * embedded Liveboard or visualization.
17091
17433
  */
17092
17434
  getEmbedParams() {
17093
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17094
- /* eslint-disable-next-line max-len */
17095
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17435
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17096
17436
  let params = {};
17097
17437
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17098
17438
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17108,6 +17448,7 @@ class AppEmbed extends V1Embed {
17108
17448
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
17109
17449
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17110
17450
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17451
+ params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
17111
17452
  params = this.getBaseQueryParams(params);
17112
17453
  if (hideObjectSearch) {
17113
17454
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -17120,6 +17461,10 @@ class AppEmbed extends V1Embed {
17120
17461
  }
17121
17462
  if (fullHeight === true) {
17122
17463
  params[Param.fullHeight] = true;
17464
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17465
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17466
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17467
+ }
17123
17468
  }
17124
17469
  if (tag) {
17125
17470
  params[Param.Tag] = tag;
@@ -17140,7 +17485,6 @@ class AppEmbed extends V1Embed {
17140
17485
  params[Param.enableAskSage] = enableAskSage;
17141
17486
  }
17142
17487
  if (isOnBeforeGetVizDataInterceptEnabled) {
17143
- /* eslint-disable-next-line max-len */
17144
17488
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17145
17489
  }
17146
17490
  if (homePageSearchBarMode) {
@@ -17161,11 +17505,9 @@ class AppEmbed extends V1Embed {
17161
17505
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17162
17506
  || dataPanelCustomGroupsAccordionInitialState
17163
17507
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
17164
- /* eslint-disable-next-line max-len */
17165
17508
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17166
17509
  }
17167
17510
  else {
17168
- /* eslint-disable-next-line max-len */
17169
17511
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17170
17512
  }
17171
17513
  if (discoveryExperience) {
@@ -17178,6 +17520,10 @@ class AppEmbed extends V1Embed {
17178
17520
  if (discoveryExperience.homePage === HomePage.Modular) {
17179
17521
  params[Param.ModularHomeExperienceEnabled] = true;
17180
17522
  }
17523
+ // listPageVersion v3 will enable the new list page
17524
+ if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
17525
+ params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
17526
+ }
17181
17527
  }
17182
17528
  const queryParams = getQueryParamString(params, true);
17183
17529
  return queryParams;
@@ -17265,6 +17611,30 @@ class AppEmbed extends V1Embed {
17265
17611
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17266
17612
  }
17267
17613
  }
17614
+ /**
17615
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17616
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17617
+ */
17618
+ destroy() {
17619
+ super.destroy();
17620
+ this.unregisterLazyLoadEvents();
17621
+ }
17622
+ postRender() {
17623
+ this.registerLazyLoadEvents();
17624
+ }
17625
+ registerLazyLoadEvents() {
17626
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17627
+ // TODO: Use passive: true, install modernizr to check for passive
17628
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17629
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17630
+ }
17631
+ }
17632
+ unregisterLazyLoadEvents() {
17633
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17634
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17635
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17636
+ }
17637
+ }
17268
17638
  /**
17269
17639
  * Renders the embedded application pages in the ThoughtSpot app.
17270
17640
  * @param renderOptions An object containing the page ID
@@ -17274,6 +17644,7 @@ class AppEmbed extends V1Embed {
17274
17644
  await super.render();
17275
17645
  const src = this.getIFrameSrc();
17276
17646
  await this.renderV1Embed(src);
17647
+ this.postRender();
17277
17648
  return this;
17278
17649
  }
17279
17650
  }
@@ -17315,7 +17686,7 @@ const addPreviewStylesIfNotPresent = () => {
17315
17686
  return;
17316
17687
  }
17317
17688
  const previewStyles = `
17318
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
17689
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
17319
17690
  <style id="ts-preview-style">
17320
17691
  .ts-viz-preview-loader {
17321
17692
  position: absolute;
@@ -17378,6 +17749,21 @@ class LiveboardEmbed extends V1Embed {
17378
17749
  viewConfig.embedComponentType = 'LiveboardEmbed';
17379
17750
  super(domSelector, viewConfig);
17380
17751
  this.defaultHeight = 500;
17752
+ this.sendFullHeightLazyLoadData = () => {
17753
+ const data = calculateVisibleElementData(this.iFrame);
17754
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17755
+ };
17756
+ /**
17757
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17758
+ * It is used to send the visible coordinates data to the host application.
17759
+ * @param data The event payload
17760
+ * @param responder The responder function
17761
+ */
17762
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17763
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17764
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17765
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17766
+ };
17381
17767
  /**
17382
17768
  * Set the iframe height as per the computed height received
17383
17769
  * from the ThoughtSpot app.
@@ -17385,6 +17771,7 @@ class LiveboardEmbed extends V1Embed {
17385
17771
  */
17386
17772
  this.updateIFrameHeight = (data) => {
17387
17773
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
17774
+ this.sendFullHeightLazyLoadData();
17388
17775
  };
17389
17776
  this.embedIframeCenter = (data, responder) => {
17390
17777
  const obj = this.getIframeCenter();
@@ -17418,6 +17805,7 @@ class LiveboardEmbed extends V1Embed {
17418
17805
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17419
17806
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17420
17807
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17808
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17421
17809
  }
17422
17810
  }
17423
17811
  /**
@@ -17427,11 +17815,15 @@ class LiveboardEmbed extends V1Embed {
17427
17815
  getEmbedParams() {
17428
17816
  let params = {};
17429
17817
  params = this.getBaseQueryParams(params);
17430
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17818
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17431
17819
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
17432
17820
  || this.viewConfig.preventPinboardFilterRemoval;
17433
17821
  if (fullHeight === true) {
17434
17822
  params[Param.fullHeight] = true;
17823
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17824
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17825
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17826
+ }
17435
17827
  }
17436
17828
  if (defaultHeight) {
17437
17829
  this.defaultHeight = defaultHeight;
@@ -17479,9 +17871,6 @@ class LiveboardEmbed extends V1Embed {
17479
17871
  if (dataSourceId !== undefined) {
17480
17872
  params[Param.DataSourceId] = dataSourceId;
17481
17873
  }
17482
- if (coverAndFilterOptionInPDF !== undefined) {
17483
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17484
- }
17485
17874
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17486
17875
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17487
17876
  }
@@ -17492,6 +17881,7 @@ class LiveboardEmbed extends V1Embed {
17492
17881
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17493
17882
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17494
17883
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17884
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17495
17885
  const queryParams = getQueryParamString(params, true);
17496
17886
  return queryParams;
17497
17887
  }
@@ -17589,6 +17979,30 @@ class LiveboardEmbed extends V1Embed {
17589
17979
  }
17590
17980
  return super.trigger(messageType, dataWithVizId);
17591
17981
  }
17982
+ /**
17983
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17984
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17985
+ */
17986
+ destroy() {
17987
+ super.destroy();
17988
+ this.unregisterLazyLoadEvents();
17989
+ }
17990
+ postRender() {
17991
+ this.registerLazyLoadEvents();
17992
+ }
17993
+ registerLazyLoadEvents() {
17994
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17995
+ // TODO: Use passive: true, install modernizr to check for passive
17996
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17997
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17998
+ }
17999
+ }
18000
+ unregisterLazyLoadEvents() {
18001
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18002
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
18003
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
18004
+ }
18005
+ }
17592
18006
  /**
17593
18007
  * Render an embedded ThoughtSpot Liveboard or visualization
17594
18008
  * @param renderOptions An object specifying the Liveboard ID,
@@ -17599,6 +18013,7 @@ class LiveboardEmbed extends V1Embed {
17599
18013
  const src = this.getIFrameSrc();
17600
18014
  await this.renderV1Embed(src);
17601
18015
  this.showPreviewLoader();
18016
+ this.postRender();
17602
18017
  return this;
17603
18018
  }
17604
18019
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18250,7 +18665,13 @@ class Conversation {
18250
18665
  });
18251
18666
  const data = responses[0].data;
18252
18667
  return {
18253
- data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18668
+ convId: this.conversationId,
18669
+ messageId: responses[0].msgId,
18670
+ data: {
18671
+ ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18672
+ convId: this.conversationId,
18673
+ messageId: responses[0].msgId,
18674
+ },
18254
18675
  error: null,
18255
18676
  };
18256
18677
  }
@@ -18276,7 +18697,7 @@ class ConversationMessage extends TsEmbed {
18276
18697
  }
18277
18698
  getIframeSrc() {
18278
18699
  var _a;
18279
- const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18700
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18280
18701
  const path = 'conv-assist-answer';
18281
18702
  const queryParams = this.getBaseQueryParams();
18282
18703
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
@@ -18291,6 +18712,8 @@ class ConversationMessage extends TsEmbed {
18291
18712
  genNo,
18292
18713
  acSessionId,
18293
18714
  acGenNo,
18715
+ convId,
18716
+ messageId,
18294
18717
  });
18295
18718
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18296
18719
  }
@@ -18332,11 +18755,10 @@ class SpotterAgentEmbed {
18332
18755
  return { error };
18333
18756
  }
18334
18757
  const container = document.createElement('div');
18335
- if (this.viewConfig.containerClassName) {
18336
- container.className = this.viewConfig.containerClassName;
18337
- }
18338
18758
  const embed = new ConversationMessage(container, {
18339
18759
  ...this.viewConfig,
18760
+ convId: data.convId,
18761
+ messageId: data.messageId,
18340
18762
  sessionId: data.sessionId,
18341
18763
  genNo: data.genNo,
18342
18764
  acSessionId: data.stateKey.transactionId,
@@ -18345,6 +18767,30 @@ class SpotterAgentEmbed {
18345
18767
  await embed.render();
18346
18768
  return { container, viz: embed };
18347
18769
  }
18770
+ /**
18771
+ * Send a message to the conversation service and return only the data.
18772
+ * @param userMessage - The message to send to the conversation service.
18773
+ * @returns The data from the conversation service.
18774
+ */
18775
+ async sendMessageData(userMessage) {
18776
+ try {
18777
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18778
+ if (error) {
18779
+ return { error };
18780
+ }
18781
+ return { data: {
18782
+ convId: data.convId,
18783
+ messageId: data.messageId,
18784
+ sessionId: data.sessionId,
18785
+ genNo: data.genNo,
18786
+ acSessionId: data.stateKey.transactionId,
18787
+ acGenNo: data.stateKey.generationNumber,
18788
+ } };
18789
+ }
18790
+ catch (error) {
18791
+ return { error: error };
18792
+ }
18793
+ }
18348
18794
  }
18349
18795
  /**
18350
18796
  * Create a conversation embed, which can be integrated inside
@@ -19067,4 +19513,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
19067
19513
  return result;
19068
19514
  };
19069
19515
 
19070
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
19516
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };