@thoughtspot/visual-embed-sdk 1.40.1-alpha.1 → 1.41.0-pre-render-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 (150) hide show
  1. package/cjs/package.json +5 -4
  2. package/cjs/src/css-variables.d.ts +316 -0
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js +8 -0
  6. package/cjs/src/embed/app.js.map +1 -1
  7. package/cjs/src/embed/app.spec.js +12 -2
  8. package/cjs/src/embed/app.spec.js.map +1 -1
  9. package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
  10. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  11. package/cjs/src/embed/bodyless-conversation.js +7 -3
  12. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  13. package/cjs/src/embed/conversation.d.ts +64 -2
  14. package/cjs/src/embed/conversation.d.ts.map +1 -1
  15. package/cjs/src/embed/conversation.js +16 -3
  16. package/cjs/src/embed/conversation.js.map +1 -1
  17. package/cjs/src/embed/conversation.spec.js +102 -0
  18. package/cjs/src/embed/conversation.spec.js.map +1 -1
  19. package/cjs/src/embed/liveboard.d.ts +12 -2
  20. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  21. package/cjs/src/embed/liveboard.js +48 -18
  22. package/cjs/src/embed/liveboard.js.map +1 -1
  23. package/cjs/src/embed/liveboard.spec.js +211 -5
  24. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  25. package/cjs/src/embed/sage.d.ts +1 -0
  26. package/cjs/src/embed/sage.d.ts.map +1 -1
  27. package/cjs/src/embed/sage.js +10 -6
  28. package/cjs/src/embed/sage.js.map +1 -1
  29. package/cjs/src/embed/search-bar.d.ts +1 -0
  30. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  31. package/cjs/src/embed/search-bar.js +11 -7
  32. package/cjs/src/embed/search-bar.js.map +1 -1
  33. package/cjs/src/embed/search.d.ts +1 -0
  34. package/cjs/src/embed/search.d.ts.map +1 -1
  35. package/cjs/src/embed/search.js +7 -8
  36. package/cjs/src/embed/search.js.map +1 -1
  37. package/cjs/src/embed/ts-embed.d.ts +24 -7
  38. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  39. package/cjs/src/embed/ts-embed.js +87 -57
  40. package/cjs/src/embed/ts-embed.js.map +1 -1
  41. package/cjs/src/embed/ts-embed.spec.js +173 -1
  42. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  43. package/cjs/src/types.d.ts +152 -44
  44. package/cjs/src/types.d.ts.map +1 -1
  45. package/cjs/src/types.js +139 -42
  46. package/cjs/src/types.js.map +1 -1
  47. package/cjs/src/utils/liveboardService/liveboardService.d.ts +21 -6
  48. package/cjs/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
  49. package/cjs/src/utils/liveboardService/liveboardService.js +21 -6
  50. package/cjs/src/utils/liveboardService/liveboardService.js.map +1 -1
  51. package/dist/index-BDlM0f0T.js +7371 -0
  52. package/dist/index-k7pkZMhx.js +7371 -0
  53. package/dist/src/css-variables.d.ts +316 -0
  54. package/dist/src/css-variables.d.ts.map +1 -1
  55. package/dist/src/embed/app.d.ts.map +1 -1
  56. package/dist/src/embed/bodyless-conversation.d.ts +5 -0
  57. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  58. package/dist/src/embed/conversation.d.ts +64 -2
  59. package/dist/src/embed/conversation.d.ts.map +1 -1
  60. package/dist/src/embed/liveboard.d.ts +11 -0
  61. package/dist/src/embed/liveboard.d.ts.map +1 -1
  62. package/dist/src/embed/sage.d.ts +1 -0
  63. package/dist/src/embed/sage.d.ts.map +1 -1
  64. package/dist/src/embed/search-bar.d.ts +1 -0
  65. package/dist/src/embed/search-bar.d.ts.map +1 -1
  66. package/dist/src/embed/search.d.ts +1 -0
  67. package/dist/src/embed/search.d.ts.map +1 -1
  68. package/dist/src/embed/ts-embed.d.ts +24 -0
  69. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  70. package/dist/src/react/index.d.ts +2 -0
  71. package/dist/src/react/index.d.ts.map +1 -1
  72. package/dist/src/types.d.ts +351 -30
  73. package/dist/src/types.d.ts.map +1 -1
  74. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  75. package/dist/src/utils/liveboardService/liveboardService.d.ts +21 -6
  76. package/dist/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
  77. package/dist/tsembed-react.es.js +551 -80
  78. package/dist/tsembed-react.js +550 -79
  79. package/dist/tsembed.es.js +572 -86
  80. package/dist/tsembed.js +571 -85
  81. package/dist/visual-embed-sdk-react-full.d.ts +787 -37
  82. package/dist/visual-embed-sdk-react.d.ts +787 -37
  83. package/dist/visual-embed-sdk.d.ts +785 -37
  84. package/lib/package.json +5 -4
  85. package/lib/src/css-variables.d.ts +316 -0
  86. package/lib/src/css-variables.d.ts.map +1 -1
  87. package/lib/src/embed/app.d.ts.map +1 -1
  88. package/lib/src/embed/app.js +8 -0
  89. package/lib/src/embed/app.js.map +1 -1
  90. package/lib/src/embed/app.spec.js +12 -2
  91. package/lib/src/embed/app.spec.js.map +1 -1
  92. package/lib/src/embed/bodyless-conversation.d.ts +1 -0
  93. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  94. package/lib/src/embed/bodyless-conversation.js +7 -3
  95. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  96. package/lib/src/embed/conversation.d.ts +64 -2
  97. package/lib/src/embed/conversation.d.ts.map +1 -1
  98. package/lib/src/embed/conversation.js +17 -4
  99. package/lib/src/embed/conversation.js.map +1 -1
  100. package/lib/src/embed/conversation.spec.js +104 -2
  101. package/lib/src/embed/conversation.spec.js.map +1 -1
  102. package/lib/src/embed/liveboard.d.ts +12 -2
  103. package/lib/src/embed/liveboard.d.ts.map +1 -1
  104. package/lib/src/embed/liveboard.js +48 -18
  105. package/lib/src/embed/liveboard.js.map +1 -1
  106. package/lib/src/embed/liveboard.spec.js +211 -5
  107. package/lib/src/embed/liveboard.spec.js.map +1 -1
  108. package/lib/src/embed/sage.d.ts +1 -0
  109. package/lib/src/embed/sage.d.ts.map +1 -1
  110. package/lib/src/embed/sage.js +10 -6
  111. package/lib/src/embed/sage.js.map +1 -1
  112. package/lib/src/embed/search-bar.d.ts +1 -0
  113. package/lib/src/embed/search-bar.d.ts.map +1 -1
  114. package/lib/src/embed/search-bar.js +11 -7
  115. package/lib/src/embed/search-bar.js.map +1 -1
  116. package/lib/src/embed/search.d.ts +1 -0
  117. package/lib/src/embed/search.d.ts.map +1 -1
  118. package/lib/src/embed/search.js +7 -8
  119. package/lib/src/embed/search.js.map +1 -1
  120. package/lib/src/embed/ts-embed.d.ts +24 -7
  121. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  122. package/lib/src/embed/ts-embed.js +87 -57
  123. package/lib/src/embed/ts-embed.js.map +1 -1
  124. package/lib/src/embed/ts-embed.spec.js +173 -1
  125. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  126. package/lib/src/types.d.ts +152 -44
  127. package/lib/src/types.d.ts.map +1 -1
  128. package/lib/src/types.js +139 -42
  129. package/lib/src/types.js.map +1 -1
  130. package/lib/src/utils/liveboardService/liveboardService.d.ts +21 -6
  131. package/lib/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
  132. package/lib/src/utils/liveboardService/liveboardService.js +21 -6
  133. package/lib/src/utils/liveboardService/liveboardService.js.map +1 -1
  134. package/lib/src/visual-embed-sdk.d.ts +786 -38
  135. package/package.json +6 -4
  136. package/src/css-variables.ts +396 -1
  137. package/src/embed/app.spec.ts +17 -2
  138. package/src/embed/app.ts +8 -0
  139. package/src/embed/bodyless-conversation.ts +8 -3
  140. package/src/embed/conversation.spec.ts +131 -5
  141. package/src/embed/conversation.ts +102 -12
  142. package/src/embed/liveboard.spec.ts +264 -5
  143. package/src/embed/liveboard.ts +55 -20
  144. package/src/embed/sage.ts +12 -7
  145. package/src/embed/search-bar.tsx +14 -7
  146. package/src/embed/search.ts +18 -7
  147. package/src/embed/ts-embed.spec.ts +345 -113
  148. package/src/embed/ts-embed.ts +97 -67
  149. package/src/types.ts +199 -91
  150. package/src/utils/liveboardService/liveboardService.ts +21 -6
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.41.0-pre-render-1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -1502,7 +1502,7 @@
1502
1502
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1503
1503
  * @example
1504
1504
  *```js
1505
- * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1505
+ * liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
1506
1506
  * console.log('Liveboard details', payload);
1507
1507
  * })
1508
1508
  *```
@@ -1876,6 +1876,95 @@
1876
1876
  * @hidden
1877
1877
  */
1878
1878
  EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1879
+ /**
1880
+ * Emitted when Spotter response is text data
1881
+ * @example
1882
+ * ```js
1883
+ * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1884
+ * console.log('payload', payload);
1885
+ * })
1886
+ *```
1887
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1888
+ */
1889
+ EmbedEvent["SpotterData"] = "SpotterData";
1890
+ /**
1891
+ * Emitted when user opens up the worksheet preview modal in Spotter embed.
1892
+ * @example
1893
+ * ```js
1894
+ * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1895
+ * console.log('payload', payload);
1896
+ * })
1897
+ *```
1898
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1899
+ */
1900
+ EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1901
+ /**
1902
+ * Emitted when the Spotter query is triggered in Spotter embed.
1903
+ * @example
1904
+ * ```js
1905
+ * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1906
+ * console.log('payload', payload);
1907
+ * })
1908
+ *```
1909
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1910
+ */
1911
+ EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1912
+ /**
1913
+ * Emitted when the last Spotter query is edited in Spotter embed.
1914
+ * @example
1915
+ * ```js
1916
+ * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1917
+ * console.log('payload', payload);
1918
+ * })
1919
+ *```
1920
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1921
+ */
1922
+ EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1923
+ /**
1924
+ * Emitted when the last Spotter query is deleted in Spotter embed.
1925
+ * @example
1926
+ * ```js
1927
+ * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1928
+ * console.log('payload', payload);
1929
+ * })
1930
+ *```
1931
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1932
+ */
1933
+ EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1934
+ /**
1935
+ * Emitted when the coversation is reset in spotter embed.
1936
+ * @example
1937
+ * ```js
1938
+ * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1939
+ * console.log('payload', payload);
1940
+ * })
1941
+ *```
1942
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1943
+ */
1944
+ EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1945
+ /**
1946
+ * Emitted when the *Spotter* is initialized.
1947
+ * @example
1948
+ * ```js
1949
+ * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1950
+ * console.log('payload', payload);
1951
+ * })
1952
+ *```
1953
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1954
+ */
1955
+ EmbedEvent["SpotterInit"] = "spotterInit";
1956
+ /**
1957
+ * @hidden
1958
+ * Triggers when the embed listener is ready to receive events.
1959
+ * This is used to trigger events after the embed container is loaded.
1960
+ * @example
1961
+ * ```js
1962
+ * liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
1963
+ * console.log('EmbedListenerReady');
1964
+ * })
1965
+ * ```
1966
+ */
1967
+ EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
1879
1968
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
1880
1969
  /**
1881
1970
  * Event types that can be triggered by the host application
@@ -1893,7 +1982,7 @@
1893
1982
  * // create the liveboard embed.
1894
1983
  *
1895
1984
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1896
- * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1985
+ * { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
1897
1986
  * ]);
1898
1987
  * ```
1899
1988
  * @example
@@ -1965,6 +2054,7 @@
1965
2054
  * done automatically on the most popular column.
1966
2055
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1967
2056
  * in case of a Liveboard.
2057
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
1968
2058
  * @example
1969
2059
  * ```js
1970
2060
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -2103,12 +2193,12 @@
2103
2193
  * Works with Search and Liveboard embed.
2104
2194
  * @param - { columnId: string,
2105
2195
  * name: string,
2106
- * type: INT64/CHAR/DATE,
2107
- * dataType: ATTRIBUTE/MEASURE }
2196
+ * type: ATTRIBUTE/MEASURE,
2197
+ * dataType: INT64/CHAR/DATE }
2108
2198
  * @example
2109
2199
  * ```js
2110
2200
  * searchEmbed.trigger(HostEvent.OpenFilter,
2111
- * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
2201
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
2112
2202
  * ```
2113
2203
  * @example
2114
2204
  * ```js
@@ -2166,6 +2256,7 @@
2166
2256
  * @param
2167
2257
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
2168
2258
  * Optional when pinning a new chart or table generated from a Search query.
2259
+ * **Required** in Spotter Embed.
2169
2260
  * @param
2170
2261
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
2171
2262
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -2213,6 +2304,12 @@
2213
2304
  * ```js
2214
2305
  * appEmbed.trigger(HostEvent.Pin)
2215
2306
  * ```
2307
+ * @example
2308
+ * ```js
2309
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2310
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2311
+ * });
2312
+ * ```
2216
2313
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2217
2314
  */
2218
2315
  HostEvent["Pin"] = "pin";
@@ -2277,12 +2374,21 @@
2277
2374
  * Trigger the **Download PDF** action on an embedded Liveboard,
2278
2375
  * visualization or Answer.
2279
2376
  *
2377
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2378
+ *
2280
2379
  * **NOTE**: The **Download** > **PDF** action is available on
2281
2380
  * visualizations and Answers if the data is in tabular format.
2282
2381
  * @example
2283
2382
  * ```js
2284
2383
  * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
2285
2384
  * ```
2385
+ * @example
2386
+ * ```js
2387
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2388
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2389
+ * });
2390
+ * ```
2391
+ *
2286
2392
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2287
2393
  */
2288
2394
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
@@ -2306,6 +2412,12 @@
2306
2412
  * ```js
2307
2413
  * searchEmbed.trigger(HostEvent.MakeACopy)
2308
2414
  * ```
2415
+ * @example
2416
+ * ```js
2417
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2418
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2419
+ * });
2420
+ * ```
2309
2421
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2310
2422
  */
2311
2423
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2378,6 +2490,8 @@
2378
2490
  * This event is not supported in visualization embed and search embed.
2379
2491
  * @param - object - To trigger the action for a specific visualization
2380
2492
  * in Liveboard embed, pass in `vizId` as a key.
2493
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2494
+ *
2381
2495
  * @example
2382
2496
  * ```js
2383
2497
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2386,6 +2500,18 @@
2386
2500
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2387
2501
  * '730496d6-6903-4601-937e-2c691821af3c'})
2388
2502
  * ```
2503
+ * @example
2504
+ * ```js
2505
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2506
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2507
+ * });
2508
+ * ```
2509
+ * @example
2510
+ * ```js
2511
+ * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2512
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2513
+ * });
2514
+ * ```
2389
2515
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2390
2516
  */
2391
2517
  HostEvent["Edit"] = "edit";
@@ -2433,6 +2559,16 @@
2433
2559
  * );
2434
2560
  * })
2435
2561
  * ```
2562
+ * @example
2563
+ * ```js
2564
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2565
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2566
+ * }).then((tml) => {
2567
+ * console.log(
2568
+ * tml.answer.search_query // TML representation of the search query
2569
+ * );
2570
+ * })
2571
+ * ```
2436
2572
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2437
2573
  * @important
2438
2574
  */
@@ -2496,6 +2632,7 @@
2496
2632
  /**
2497
2633
  * Trigger the **Download** action on charts in
2498
2634
  * the embedded view.
2635
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2499
2636
  * @example
2500
2637
  * ```js
2501
2638
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2504,6 +2641,11 @@
2504
2641
  * ```js
2505
2642
  * embed.trigger(HostEvent.Download)
2506
2643
  * ```
2644
+ * ```js
2645
+ * spotterEmbed.trigger(HostEvent.Download, {
2646
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2647
+ * });
2648
+ * ```
2507
2649
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2508
2650
  * Use {@link DownloadAsPng}
2509
2651
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2520,13 +2662,19 @@
2520
2662
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2521
2663
  *
2522
2664
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2665
+ *
2666
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2667
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2668
+ * })
2523
2669
  * ```
2670
+ *
2524
2671
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2525
2672
  */
2526
2673
  HostEvent["DownloadAsPng"] = "downloadAsPng";
2527
2674
  /**
2528
2675
  * Trigger the **Download** > **CSV** action on tables in
2529
2676
  * the embedded view.
2677
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2530
2678
  * @example
2531
2679
  * ```js
2532
2680
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2538,12 +2686,18 @@
2538
2686
  * ```js
2539
2687
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2540
2688
  * ```
2689
+ * ```js
2690
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2691
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2692
+ * })
2693
+ * ```
2541
2694
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2542
2695
  */
2543
2696
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
2544
2697
  /**
2545
2698
  * Trigger the **Download** > **XLSX** action on tables
2546
2699
  * in the embedded view.
2700
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2547
2701
  * @example
2548
2702
  * ```js
2549
2703
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2555,6 +2709,11 @@
2555
2709
  * ```js
2556
2710
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2557
2711
  * ```
2712
+ * ```js
2713
+ * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2714
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2715
+ * })
2716
+ * ```
2558
2717
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2559
2718
  */
2560
2719
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2574,6 +2733,7 @@
2574
2733
  /**
2575
2734
  * Trigger the **Save** action on a Liveboard or Answer.
2576
2735
  * Saves the changes.
2736
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2577
2737
  * @example
2578
2738
  * ```js
2579
2739
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2581,6 +2741,11 @@
2581
2741
  * ```js
2582
2742
  * searchEmbed.trigger(HostEvent.Save)
2583
2743
  * ```
2744
+ * ```js
2745
+ * spotterEmbed.trigger(HostEvent.Save, {
2746
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2747
+ * })
2748
+ * ```
2584
2749
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2585
2750
  */
2586
2751
  HostEvent["Save"] = "save";
@@ -2864,7 +3029,7 @@
2864
3029
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2865
3030
  /**
2866
3031
  * Triggers an action to update Parameter values on embedded
2867
- * Answers and Liveboard.
3032
+ * Answers, Liveboard and Spotter answer in Edit mode.
2868
3033
  *
2869
3034
  * @example
2870
3035
  * ```js
@@ -2878,11 +3043,19 @@
2878
3043
  HostEvent["UpdateParameters"] = "UpdateParameters";
2879
3044
  /**
2880
3045
  * Triggers GetParameters to fetch the runtime Parameters.
3046
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2881
3047
  * ```js
2882
3048
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
2883
3049
  * console.log('parameters', parameter);
2884
3050
  * });
2885
3051
  *```
3052
+ *```js
3053
+ * spotterEmbed.trigger(HostEvent.GetParameters, {
3054
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3055
+ * }).then((parameter) => {
3056
+ * console.log('parameters', parameter);
3057
+ * });
3058
+ *```
2886
3059
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2887
3060
  */
2888
3061
  HostEvent["GetParameters"] = "GetParameters";
@@ -2914,7 +3087,7 @@
2914
3087
  * @param - optional attributes to set Answer properties.
2915
3088
  * `name` - Name string for the Answer.
2916
3089
  * `description` - Description text for the Answer.
2917
- *
3090
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2918
3091
  * @example
2919
3092
  * ```js
2920
3093
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -2922,6 +3095,14 @@
2922
3095
  * description: "Total sales by states in MidWest"
2923
3096
  * });
2924
3097
  * ```
3098
+ * @example
3099
+ * ```js
3100
+ * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
3101
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c',
3102
+ * name: "Sales by states",
3103
+ * description: "Total sales by states in MidWest"
3104
+ * });
3105
+ * ```
2925
3106
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2926
3107
  */
2927
3108
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2950,6 +3131,70 @@
2950
3131
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2951
3132
  */
2952
3133
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
3134
+ /**
3135
+ * Triggers a search operation with the search tokens specified in
3136
+ * the search query string in spotter embed.
3137
+ * @param - `query`: Text string in Natural Language format
3138
+ * @param - `executeSearch`: Boolean to execute search and update search query
3139
+ * @example
3140
+ * ```js
3141
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
3142
+ * query: 'revenue per year',
3143
+ * executeSearch: true,
3144
+ * })
3145
+ * ```
3146
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3147
+ */
3148
+ HostEvent["SpotterSearch"] = "SpotterSearch";
3149
+ /**
3150
+ * Edits the last prompt in spotter embed.
3151
+ * @param - `query`: Text string
3152
+ * @example
3153
+ * ```js
3154
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
3155
+ * ```
3156
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3157
+ */
3158
+ HostEvent["EditLastPrompt"] = "EditLastPrompt";
3159
+ /**
3160
+ * Opens the Worksheet preview modal in Spotter Embed.
3161
+ * @example
3162
+ * ```js
3163
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
3164
+ * ```
3165
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3166
+ */
3167
+ HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3168
+ /**
3169
+ * Resets the Spotter Embed Conversation.
3170
+ * @example
3171
+ * ```js
3172
+ * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
3173
+ * ```
3174
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3175
+ */
3176
+ HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
3177
+ /**
3178
+ * Deletes the last prompt in spotter embed.
3179
+ * @example
3180
+ * ```js
3181
+ * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
3182
+ * ```
3183
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3184
+ */
3185
+ HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3186
+ /**
3187
+ * Toggle the visualization to chart or table view.
3188
+ * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
3189
+ * @example
3190
+ * ```js
3191
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3192
+ * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
3193
+ * });
3194
+ *```
3195
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3196
+ */
3197
+ HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2953
3198
  /**
2954
3199
  * @hidden
2955
3200
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -2973,6 +3218,27 @@
2973
3218
  * @hidden
2974
3219
  */
2975
3220
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3221
+ /**
3222
+ * Trigger the *Ask Spotter* action for visualizations
3223
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3224
+ * @example
3225
+ * ```js
3226
+ * spotterEmbed.trigger(HostEvent.AskSpotter,
3227
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
3228
+ * ```
3229
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3230
+ */
3231
+ HostEvent["AskSpotter"] = "AskSpotter";
3232
+ /**
3233
+ * @hidden
3234
+ * Triggers the update of the embed params.
3235
+ *
3236
+ * @example
3237
+ * ```js
3238
+ * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
3239
+ * ```
3240
+ */
3241
+ HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
2976
3242
  })(exports.HostEvent || (exports.HostEvent = {}));
2977
3243
  /**
2978
3244
  * The different visual modes that the data sources panel within
@@ -3272,27 +3538,27 @@
3272
3538
  */
3273
3539
  Action["ConfigureFilter"] = "configureFilter";
3274
3540
  /**
3275
- * The **Collapse data sources** icon on the Search page.
3276
- * Collapses the panel showing data sources.
3277
- *
3278
- * @example
3279
- * ```js
3280
- * disabledActions: [Action.CollapseDataPanel]
3281
- * ```
3282
- * @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
3283
- */
3541
+ * The **Collapse data sources** icon on the Search page.
3542
+ * Collapses the panel showing data sources.
3543
+ *
3544
+ * @example
3545
+ * ```js
3546
+ * disabledActions: [Action.CollapseDataPanel]
3547
+ * ```
3548
+ * @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
3549
+ */
3284
3550
  Action["CollapseDataSources"] = "collapseDataSources";
3285
3551
  /**
3286
- * The **Collapse data panel** icon on the Search page.
3287
- * Collapses the data panel view.
3288
- *
3289
- * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
3290
- *
3291
- * @example
3292
- * ```js
3293
- * disabledActions: [Action.CollapseDataPanel]
3294
- * ```
3295
- */
3552
+ * The **Collapse data panel** icon on the Search page.
3553
+ * Collapses the data panel view.
3554
+ *
3555
+ * @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
3556
+ *
3557
+ * @example
3558
+ * ```js
3559
+ * disabledActions: [Action.CollapseDataPanel]
3560
+ * ```
3561
+ */
3296
3562
  Action["CollapseDataPanel"] = "collapseDataPanel";
3297
3563
  /**
3298
3564
  * The **Choose sources** button on Search page.
@@ -3988,6 +4254,17 @@
3988
4254
  * @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
3989
4255
  */
3990
4256
  Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
4257
+ /**
4258
+ * Action ID to hide or disable Iterative Change Analysis option
4259
+ * on contextual change analysis Inisght charts context menu
4260
+ *
4261
+ * @example
4262
+ * ```js
4263
+ * disabledActions: [Action.EnableIterativeChangeAnalysis]
4264
+ * ```
4265
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
4266
+ */
4267
+ Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
3991
4268
  /**
3992
4269
  * Action ID to hide or disable Natural Language Search query.
3993
4270
  *
@@ -4357,6 +4634,39 @@
4357
4634
  * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
4358
4635
  */
4359
4636
  Action["InConversationTraining"] = "InConversationTraining";
4637
+ /**
4638
+ * Action ID to hide the warnings banner in
4639
+ * Spotter results. It's an EA feature and
4640
+ * handled by LD.
4641
+ * @example
4642
+ * ```js
4643
+ * hiddenAction: [Action.SpotterWarningsBanner]
4644
+ * ```
4645
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4646
+ */
4647
+ Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
4648
+ /**
4649
+ * Action ID to hide the warnings border on the knowledge
4650
+ * card in Spotter results. It's an EA feature and
4651
+ * handled by LD.
4652
+ * @example
4653
+ * ```js
4654
+ * hiddenAction: [Action.SpotterWarningsOnTokens]
4655
+ * ```
4656
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4657
+ */
4658
+ Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
4659
+ /**
4660
+ * Action ID to disable the click event handler on knowledge
4661
+ * card in Spotter results. It's an EA feature and
4662
+ * handled by LD.
4663
+ * @example
4664
+ * ```js
4665
+ * hiddenAction: [Action.SpotterTokenQuickEdit]
4666
+ * ```
4667
+ * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4668
+ */
4669
+ Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
4360
4670
  })(exports.Action || (exports.Action = {}));
4361
4671
  exports.PrefetchFeatures = void 0;
4362
4672
  (function (PrefetchFeatures) {
@@ -15614,7 +15924,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15614
15924
  return e;
15615
15925
  }
15616
15926
 
15617
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-alpha.3";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$1={".":{"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$1,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};
15927
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0-pre-render-1";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$1={".":{"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":"^11.2.0","@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",ajv:"^8.17.1",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":"^2.0.0",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$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 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};
15618
15928
 
15619
15929
  /**
15620
15930
  * Reloads the ThoughtSpot iframe.
@@ -15866,7 +16176,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15866
16176
  this.updateAuthToken = async (_, responder) => {
15867
16177
  const { authType } = this.embedConfig;
15868
16178
  let { autoLogin } = this.embedConfig;
15869
- // Default autoLogin: true for cookieless if undefined/null, otherwise false
16179
+ // Default autoLogin: true for cookieless if undefined/null, otherwise
16180
+ // false
15870
16181
  autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === exports.AuthType.TrustedAuthTokenCookieless);
15871
16182
  if (autoLogin && authType === exports.AuthType.TrustedAuthTokenCookieless) {
15872
16183
  try {
@@ -15917,8 +16228,42 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15917
16228
  this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
15918
16229
  this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
15919
16230
  this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
16231
+ const embedListenerReadyHandler = this.createEmbedContainerHandler(exports.EmbedEvent.EmbedListenerReady);
16232
+ this.on(exports.EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
16233
+ const authInitHandler = this.createEmbedContainerHandler(exports.EmbedEvent.AuthInit);
16234
+ this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
15920
16235
  };
15921
16236
  this.showPreRenderByDefault = false;
16237
+ /**
16238
+ * @hidden
16239
+ * Internal state to track if the embed container is loaded.
16240
+ * This is used to trigger events after the embed container is loaded.
16241
+ */
16242
+ this.isEmbedContainerLoaded = false;
16243
+ /**
16244
+ * @hidden
16245
+ * Internal state to track the callbacks to be executed after the embed container
16246
+ * is loaded.
16247
+ * This is used to trigger events after the embed container is loaded.
16248
+ */
16249
+ this.embedContainerReadyCallbacks = [];
16250
+ this.createEmbedContainerHandler = (source) => () => {
16251
+ const processEmbedContainerReady = () => {
16252
+ logger$3.debug('processEmbedContainerReady');
16253
+ this.isEmbedContainerLoaded = true;
16254
+ this.executeEmbedContainerReadyCallbacks();
16255
+ };
16256
+ if (source === exports.EmbedEvent.AuthInit) {
16257
+ const AUTH_INIT_FALLBACK_DELAY = 1000;
16258
+ // Wait for 1 second to ensure the embed container is loaded
16259
+ // This is a workaround to ensure the embed container is loaded
16260
+ // this is needed until all clusters have EmbedListenerReady event
16261
+ setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
16262
+ }
16263
+ else if (source === exports.EmbedEvent.EmbedListenerReady) {
16264
+ processEmbedContainerReady();
16265
+ }
16266
+ };
15922
16267
  this.validatePreRenderViewConfig = (viewConfig) => {
15923
16268
  var _a;
15924
16269
  const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
@@ -15952,10 +16297,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15952
16297
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
15953
16298
  ...viewConfig,
15954
16299
  });
16300
+ const embedConfig = getEmbedConfig();
16301
+ this.embedConfig = embedConfig;
15955
16302
  this.hostEventClient = new HostEventClient(this.iFrame);
15956
16303
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
15957
- const embedConfig = getEmbedConfig();
15958
- this.embedConfig = embedConfig;
15959
16304
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
15960
16305
  this.embedConfig.authTriggerContainer = domSelector;
15961
16306
  }
@@ -15988,7 +16333,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15988
16333
  */
15989
16334
  getEventType(event) {
15990
16335
  var _a, _b;
15991
- // eslint-disable-next-line no-underscore-dangle
15992
16336
  return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
15993
16337
  }
15994
16338
  /**
@@ -16141,6 +16485,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16141
16485
  .join('/');
16142
16486
  return `${basePath}#`;
16143
16487
  }
16488
+ getUpdateEmbedParamsObject() {
16489
+ let queryParams = this.getEmbedParamsObject();
16490
+ queryParams = { ...this.viewConfig, ...queryParams };
16491
+ return queryParams;
16492
+ }
16144
16493
  /**
16145
16494
  * Common query params set for all the embed modes.
16146
16495
  * @param queryParams
@@ -16290,9 +16639,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16290
16639
  return path;
16291
16640
  }
16292
16641
  getEmbedParams() {
16293
- const queryParams = this.getBaseQueryParams();
16642
+ const queryParams = this.getEmbedParamsObject();
16294
16643
  return getQueryParamString(queryParams);
16295
16644
  }
16645
+ getEmbedParamsObject() {
16646
+ const params = this.getBaseQueryParams();
16647
+ return params;
16648
+ }
16296
16649
  getRootIframeSrc() {
16297
16650
  const query = this.getEmbedParams();
16298
16651
  return this.getEmbedBasePath(query);
@@ -16391,7 +16744,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16391
16744
  }
16392
16745
  });
16393
16746
  }
16394
- // Setup fullscreen change handler after iframe is loaded and ready
16747
+ // Setup fullscreen change handler after iframe is
16748
+ // loaded and ready
16395
16749
  this.setupFullscreenChangeHandler();
16396
16750
  });
16397
16751
  this.iFrame.addEventListener('error', () => {
@@ -16493,7 +16847,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16493
16847
  const div = document.createElement('div');
16494
16848
  div.innerHTML = child;
16495
16849
  div.id = TS_EMBED_ID;
16496
- // eslint-disable-next-line no-param-reassign
16497
16850
  child = div;
16498
16851
  }
16499
16852
  if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
@@ -16672,6 +17025,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16672
17025
  logger$3.log('Event Port is not defined');
16673
17026
  }
16674
17027
  }
17028
+ getPreRenderObj() {
17029
+ var _a;
17030
+ const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
17031
+ if (embedObj === this) {
17032
+ logger$3.info('embedObj is same as this');
17033
+ }
17034
+ return embedObj;
17035
+ }
17036
+ checkEmbedContainerLoaded() {
17037
+ if (this.isEmbedContainerLoaded)
17038
+ return true;
17039
+ const preRenderObj = this.getPreRenderObj();
17040
+ if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
17041
+ this.isEmbedContainerLoaded = true;
17042
+ }
17043
+ return this.isEmbedContainerLoaded;
17044
+ }
17045
+ executeEmbedContainerReadyCallbacks() {
17046
+ logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
17047
+ this.embedContainerReadyCallbacks.forEach((callback) => {
17048
+ callback === null || callback === void 0 ? void 0 : callback();
17049
+ });
17050
+ this.embedContainerReadyCallbacks = [];
17051
+ }
17052
+ /**
17053
+ * Executes a callback after the embed container is loaded.
17054
+ * @param callback The callback to execute
17055
+ */
17056
+ executeAfterEmbedContainerLoaded(callback) {
17057
+ if (this.checkEmbedContainerLoaded()) {
17058
+ callback === null || callback === void 0 ? void 0 : callback();
17059
+ }
17060
+ else {
17061
+ logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
17062
+ this.embedContainerReadyCallbacks.push(callback);
17063
+ }
17064
+ }
16675
17065
  /**
16676
17066
  * Triggers an event to the embedded app
16677
17067
  * @param {HostEvent} messageType The event type
@@ -16816,7 +17206,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16816
17206
  return this.preRender(true);
16817
17207
  }
16818
17208
  this.validatePreRenderViewConfig(this.viewConfig);
17209
+ logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
17210
+ this.executeAfterEmbedContainerLoaded(() => {
17211
+ this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
17212
+ });
16819
17213
  }
17214
+ this.beforePrerenderVisible();
16820
17215
  if (this.el) {
16821
17216
  this.syncPreRenderStyle();
16822
17217
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -16833,7 +17228,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16833
17228
  this.resizeObserver.observe(this.el);
16834
17229
  }
16835
17230
  }
16836
- this.beforePrerenderVisible();
16837
17231
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
16838
17232
  this.subscribeToEvents();
16839
17233
  // Setup fullscreen change handler for prerendered components
@@ -16926,7 +17320,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16926
17320
  const isFullscreen = !!document.fullscreenElement;
16927
17321
  if (!isFullscreen) {
16928
17322
  logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
16929
- // Only trigger if iframe is available and contentWindow is accessible
17323
+ // Only trigger if iframe is available and contentWindow is
17324
+ // accessible
16930
17325
  if (this.iFrame && this.iFrame.contentWindow) {
16931
17326
  this.trigger(exports.HostEvent.ExitPresentMode);
16932
17327
  }
@@ -16960,7 +17355,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
16960
17355
  * Only for testing purposes.
16961
17356
  * @hidden
16962
17357
  */
16963
- // eslint-disable-next-line camelcase
16964
17358
  this.test__executeCallbacks = this.executeCallbacks;
16965
17359
  this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
16966
17360
  }
@@ -17272,10 +17666,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17272
17666
  else {
17273
17667
  params[Param.DataPanelCustomGroupsAccordionInitialState] = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17274
17668
  }
17669
+ // Set navigation to v2 by default to avoid problems like the app
17670
+ // switcher (9-dot menu) not showing when v3 navigation is turned on
17671
+ // at the cluster level.
17672
+ // To use v3 navigation, we must manually set the discoveryExperience
17673
+ // settings.
17674
+ params[Param.NavigationVersion] = 'v2';
17275
17675
  if (discoveryExperience) {
17276
17676
  // primaryNavbarVersion v3 will enabled the new left navigation
17277
17677
  if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
17278
17678
  params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
17679
+ // Enable the modularHomeExperience when Sliding is enabled.
17680
+ params[Param.ModularHomeExperienceEnabled] = true;
17279
17681
  }
17280
17682
  // homePage v2 will enable the modular home page
17281
17683
  // and it will override the modularHomeExperience value
@@ -17448,7 +17850,7 @@ query GetEurekaVizSnapshots(
17448
17850
  return;
17449
17851
  }
17450
17852
  const previewStyles = `
17451
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
17853
+ <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">
17452
17854
  <style id="ts-preview-style">
17453
17855
  .ts-viz-preview-loader {
17454
17856
  position: absolute;
@@ -17559,6 +17961,16 @@ query GetEurekaVizSnapshots(
17559
17961
  }
17560
17962
  this.setIFrameHeight(frameHeight || this.defaultHeight);
17561
17963
  };
17964
+ /**
17965
+ * @hidden
17966
+ * Internal state to track the current liveboard id.
17967
+ * This is used to navigate to the correct liveboard when the prerender is visible.
17968
+ */
17969
+ this.currentLiveboardState = {
17970
+ liveboardId: this.viewConfig.liveboardId,
17971
+ vizId: this.viewConfig.vizId,
17972
+ activeTabId: this.viewConfig.activeTabId,
17973
+ };
17562
17974
  if (this.viewConfig.fullHeight === true) {
17563
17975
  if (this.viewConfig.vizId) {
17564
17976
  logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
@@ -17575,6 +17987,11 @@ query GetEurekaVizSnapshots(
17575
17987
  * embedded Liveboard or visualization.
17576
17988
  */
17577
17989
  getEmbedParams() {
17990
+ const params = this.getEmbedParamsObject();
17991
+ const queryParams = getQueryParamString(params, true);
17992
+ return queryParams;
17993
+ }
17994
+ getEmbedParamsObject() {
17578
17995
  let params = {};
17579
17996
  params = this.getBaseQueryParams(params);
17580
17997
  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;
@@ -17644,8 +18061,27 @@ query GetEurekaVizSnapshots(
17644
18061
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17645
18062
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17646
18063
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17647
- const queryParams = getQueryParamString(params, true);
17648
- return queryParams;
18064
+ if (oAuthPollingInterval !== undefined) {
18065
+ params[Param.OauthPollingInterval] = oAuthPollingInterval;
18066
+ }
18067
+ if (isForceRedirect) {
18068
+ params[Param.IsForceRedirect] = isForceRedirect;
18069
+ }
18070
+ if (dataSourceId !== undefined) {
18071
+ params[Param.DataSourceId] = dataSourceId;
18072
+ }
18073
+ if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18074
+ params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
18075
+ }
18076
+ params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18077
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
18078
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
18079
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
18080
+ params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
18081
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
18082
+ params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18083
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18084
+ return params;
17649
18085
  }
17650
18086
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
17651
18087
  let suffix = `/embed/viz/${liveboardId}`;
@@ -17707,16 +18143,17 @@ query GetEurekaVizSnapshots(
17707
18143
  }
17708
18144
  }
17709
18145
  beforePrerenderVisible() {
17710
- var _a;
17711
- const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
17712
- if (isUndefined$1(embedObj))
17713
- return;
17714
- const showDifferentLib = this.viewConfig.liveboardId
17715
- && embedObj.viewConfig.liveboardId !== this.viewConfig.liveboardId;
17716
- if (showDifferentLib) {
17717
- const libId = this.viewConfig.liveboardId;
17718
- this.navigateToLiveboard(libId);
17719
- }
18146
+ const embedObj = this.getPreRenderObj();
18147
+ this.executeAfterEmbedContainerLoaded(() => {
18148
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
18149
+ if (embedObj) {
18150
+ embedObj.currentLiveboardState = {
18151
+ liveboardId: this.viewConfig.liveboardId,
18152
+ vizId: this.viewConfig.vizId,
18153
+ activeTabId: this.viewConfig.activeTabId,
18154
+ };
18155
+ }
18156
+ });
17720
18157
  }
17721
18158
  async handleRenderForPrerender() {
17722
18159
  if (isUndefined$1(this.viewConfig.liveboardId)) {
@@ -17886,11 +18323,9 @@ query GetEurekaVizSnapshots(
17886
18323
  const defaultAppInitData = await super.getAppInitData();
17887
18324
  return { ...defaultAppInitData, ...this.getSearchInitData() };
17888
18325
  }
17889
- getEmbedParams() {
18326
+ getEmbedParamsObject() {
17890
18327
  var _a;
17891
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17892
- /* eslint-disable-next-line max-len */
17893
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
18328
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
17894
18329
  const queryParams = this.getBaseQueryParams();
17895
18330
  queryParams[Param.HideActions] = [
17896
18331
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -17923,7 +18358,6 @@ query GetEurekaVizSnapshots(
17923
18358
  queryParams[Param.HideSearchBar] = true;
17924
18359
  }
17925
18360
  if (isOnBeforeGetVizDataInterceptEnabled) {
17926
- /* eslint-disable-next-line max-len */
17927
18361
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17928
18362
  }
17929
18363
  if (!focusSearchBarOnRender) {
@@ -17936,20 +18370,22 @@ query GetEurekaVizSnapshots(
17936
18370
  queryParams[Param.UseLastSelectedDataSource] = false;
17937
18371
  }
17938
18372
  queryParams[Param.searchEmbed] = true;
17939
- /* eslint-disable-next-line max-len */
17940
18373
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
17941
18374
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17942
18375
  if (dataPanelCustomGroupsAccordionInitialState
17943
18376
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
17944
18377
  || dataPanelCustomGroupsAccordionInitialState
17945
18378
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
17946
- /* eslint-disable-next-line max-len */
17947
18379
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17948
18380
  }
17949
18381
  else {
17950
- /* eslint-disable-next-line max-len */
17951
18382
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17952
18383
  }
18384
+ return queryParams;
18385
+ }
18386
+ getEmbedParams() {
18387
+ const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
18388
+ const queryParams = this.getEmbedParamsObject();
17953
18389
  let query = '';
17954
18390
  const queryParamsString = getQueryParamString(queryParams, true);
17955
18391
  if (queryParamsString) {
@@ -18005,15 +18441,9 @@ query GetEurekaVizSnapshots(
18005
18441
  this.embedComponentType = 'SearchBarEmbed';
18006
18442
  this.viewConfig = viewConfig;
18007
18443
  }
18008
- /**
18009
- * Construct the URL of the embedded ThoughtSpot search to be
18010
- * loaded in the iframe
18011
- * @param dataSources A list of data source GUIDs
18012
- */
18013
- getIFrameSrc() {
18444
+ getEmbedParamsObject() {
18014
18445
  var _a;
18015
18446
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
18016
- const path = 'search-bar-embed';
18017
18447
  const queryParams = this.getBaseQueryParams();
18018
18448
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18019
18449
  if (dataSources && dataSources.length) {
@@ -18035,6 +18465,16 @@ query GetEurekaVizSnapshots(
18035
18465
  queryParams[Param.UseLastSelectedDataSource] = false;
18036
18466
  }
18037
18467
  queryParams[Param.searchEmbed] = true;
18468
+ return queryParams;
18469
+ }
18470
+ /**
18471
+ * Construct the URL of the embedded ThoughtSpot search to be
18472
+ * loaded in the iframe
18473
+ * @param dataSources A list of data source GUIDs
18474
+ */
18475
+ getIFrameSrc() {
18476
+ const queryParams = this.getEmbedParamsObject();
18477
+ const path = 'search-bar-embed';
18038
18478
  let query = '';
18039
18479
  const queryParamsString = getQueryParamString(queryParams, true);
18040
18480
  if (queryParamsString) {
@@ -18429,7 +18869,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18429
18869
  return {
18430
18870
  convId: this.conversationId,
18431
18871
  messageId: responses[0].msgId,
18432
- data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18872
+ data: {
18873
+ ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18874
+ convId: this.conversationId,
18875
+ messageId: responses[0].msgId,
18876
+ },
18433
18877
  error: null,
18434
18878
  };
18435
18879
  }
@@ -18453,13 +18897,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18453
18897
  super(container, viewConfig);
18454
18898
  this.viewConfig = viewConfig;
18455
18899
  }
18456
- getIframeSrc() {
18900
+ getEmbedParamsObject() {
18457
18901
  var _a;
18458
- const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18459
- const path = 'conv-assist-answer';
18460
18902
  const queryParams = this.getBaseQueryParams();
18461
18903
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18462
18904
  queryParams[Param.isSpotterAgentEmbed] = true;
18905
+ return queryParams;
18906
+ }
18907
+ getIframeSrc() {
18908
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18909
+ const path = 'conv-assist-answer';
18910
+ const queryParams = this.getEmbedParamsObject();
18463
18911
  let query = '';
18464
18912
  const queryParamsString = getQueryParamString(queryParams, true);
18465
18913
  if (queryParamsString) {
@@ -18470,6 +18918,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18470
18918
  genNo,
18471
18919
  acSessionId,
18472
18920
  acGenNo,
18921
+ convId,
18922
+ messageId,
18473
18923
  });
18474
18924
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18475
18925
  }
@@ -18513,6 +18963,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18513
18963
  const container = document.createElement('div');
18514
18964
  const embed = new ConversationMessage(container, {
18515
18965
  ...this.viewConfig,
18966
+ convId: data.convId,
18967
+ messageId: data.messageId,
18516
18968
  sessionId: data.sessionId,
18517
18969
  genNo: data.genNo,
18518
18970
  acSessionId: data.stateKey.transactionId,
@@ -18533,6 +18985,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18533
18985
  return { error };
18534
18986
  }
18535
18987
  return { data: {
18988
+ convId: data.convId,
18989
+ messageId: data.messageId,
18536
18990
  sessionId: data.sessionId,
18537
18991
  genNo: data.genNo,
18538
18992
  acSessionId: data.stateKey.transactionId,
@@ -18614,9 +19068,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18614
19068
  super(container, viewConfig);
18615
19069
  this.viewConfig = viewConfig;
18616
19070
  }
18617
- getIframeSrc() {
18618
- const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
18619
- const path = 'insights/conv-assist';
19071
+ getEmbedParamsObject() {
19072
+ const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
18620
19073
  if (!worksheetId) {
18621
19074
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
18622
19075
  }
@@ -18637,11 +19090,25 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18637
19090
  if (!isUndefined_1(hideSampleQuestions)) {
18638
19091
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
18639
19092
  }
19093
+ return queryParams;
19094
+ }
19095
+ getIframeSrc() {
19096
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
19097
+ const path = 'insights/conv-assist';
19098
+ const queryParams = this.getEmbedParamsObject();
18640
19099
  let query = '';
18641
19100
  const queryParamsString = getQueryParamString(queryParams, true);
18642
19101
  if (queryParamsString) {
18643
19102
  query = `?${queryParamsString}`;
18644
19103
  }
19104
+ const filterQuery = getFilterQuery(runtimeFilters || []);
19105
+ if (filterQuery && !excludeRuntimeFiltersfromURL) {
19106
+ query += `&${filterQuery}`;
19107
+ }
19108
+ const parameterQuery = getRuntimeParameters(runtimeParameters || []);
19109
+ if (parameterQuery && !excludeRuntimeParametersfromURL) {
19110
+ query += `&${parameterQuery}`;
19111
+ }
18645
19112
  const tsPostHashParams = this.getThoughtSpotPostUrlParams({
18646
19113
  worksheet: worksheetId,
18647
19114
  query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
@@ -18700,12 +19167,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18700
19167
  viewConfig.embedComponentType = 'SageEmbed';
18701
19168
  super(domSelector, viewConfig);
18702
19169
  }
18703
- /**
18704
- * Constructs a map of parameters to be passed on to the
18705
- * embedded Eureka or Sage search page.
18706
- * @returns {string} query string
18707
- */
18708
- getEmbedParams() {
19170
+ getEmbedParamsObject() {
18709
19171
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
18710
19172
  const params = this.getBaseQueryParams();
18711
19173
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -18720,6 +19182,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18720
19182
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
18721
19183
  params[Param.IsProductTour] = !!isProductTour;
18722
19184
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
19185
+ return params;
19186
+ }
19187
+ /**
19188
+ * Constructs a map of parameters to be passed on to the
19189
+ * embedded Eureka or Sage search page.
19190
+ * @returns {string} query string
19191
+ */
19192
+ getEmbedParams() {
19193
+ const params = this.getEmbedParamsObject();
18723
19194
  return getQueryParamString(params, true);
18724
19195
  }
18725
19196
  /**
@@ -19210,16 +19681,31 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
19210
19681
  };
19211
19682
 
19212
19683
  /**
19213
- * Create a liveboard with the given answers
19214
- * @param answers AnswerService[]
19215
- * @param name string
19684
+ * Creates a new Liveboard in ThoughtSpot using the provided AnswerService instances.
19685
+ *
19686
+ * Each answer will be added as a visualization to the newly created Liveboard.
19687
+ *
19688
+ * @param {AnswerService[]} answers - An array of initialized `AnswerService` instances
19689
+ * representing the answers to be added to the Liveboard.
19690
+ * @param {string} name - The name of the Liveboard to create.
19216
19691
  * @returns result Promise
19217
19692
  * @version SDK: 1.33.1 | ThoughtSpot: *
19218
19693
  * @example
19219
19694
  * ```js
19220
- * const lb = createLiveboardWithAnswers([
19221
- * new AnswerService(session, null, 'tshost'),
19222
- * ], "my-liveboard");
19695
+ * import { EmbedEvent, AnswerService } from "@thoughtspot/visual-embed-sdk";
19696
+ *
19697
+ * embed.on(EmbedEvent.Data, async () => {
19698
+ * try {
19699
+ * const answerService = await embed.getAnswerService();
19700
+ * const lb = await createLiveboardWithAnswers(
19701
+ * [answerService],
19702
+ * "My Liveboard"
19703
+ * );
19704
+ * console.log("Liveboard created:", lb);
19705
+ * } catch (err) {
19706
+ * console.error("Failed to create liveboard:", err);
19707
+ * }
19708
+ * });
19223
19709
  * ```
19224
19710
  */
19225
19711
  const createLiveboardWithAnswers = async (answers, name) => {