@thoughtspot/visual-embed-sdk 1.40.0 → 1.40.1-alpha.2

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 (111) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
  3. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  4. package/cjs/src/embed/bodyless-conversation.js +7 -3
  5. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  6. package/cjs/src/embed/conversation.d.ts +1 -0
  7. package/cjs/src/embed/conversation.d.ts.map +1 -1
  8. package/cjs/src/embed/conversation.js +7 -2
  9. package/cjs/src/embed/conversation.js.map +1 -1
  10. package/cjs/src/embed/liveboard.d.ts +3 -1
  11. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  12. package/cjs/src/embed/liveboard.js +35 -14
  13. package/cjs/src/embed/liveboard.js.map +1 -1
  14. package/cjs/src/embed/liveboard.spec.js +29 -4
  15. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  16. package/cjs/src/embed/sage.d.ts +1 -0
  17. package/cjs/src/embed/sage.d.ts.map +1 -1
  18. package/cjs/src/embed/sage.js +10 -6
  19. package/cjs/src/embed/sage.js.map +1 -1
  20. package/cjs/src/embed/search-bar.d.ts +1 -0
  21. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  22. package/cjs/src/embed/search-bar.js +11 -7
  23. package/cjs/src/embed/search-bar.js.map +1 -1
  24. package/cjs/src/embed/search.d.ts +1 -0
  25. package/cjs/src/embed/search.d.ts.map +1 -1
  26. package/cjs/src/embed/search.js +7 -8
  27. package/cjs/src/embed/search.js.map +1 -1
  28. package/cjs/src/embed/ts-embed.d.ts +9 -0
  29. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.js +65 -10
  31. package/cjs/src/embed/ts-embed.js.map +1 -1
  32. package/cjs/src/types.d.ts +33 -64
  33. package/cjs/src/types.d.ts.map +1 -1
  34. package/cjs/src/types.js +33 -64
  35. package/cjs/src/types.js.map +1 -1
  36. package/dist/{index-CAEHQGLc.js → index-CmEQfuE3.js} +1 -1
  37. package/dist/index-D1pyb7RG.js +7371 -0
  38. package/dist/index-DeFzsyFF.js +7371 -0
  39. package/dist/index-Dpf0rd6w.js +7371 -0
  40. package/dist/index-UuEbsISo.js +7447 -0
  41. package/dist/index-e3Uw3YFO.js +7371 -0
  42. package/dist/index-k7pkZMhx.js +7371 -0
  43. package/dist/src/embed/bodyless-conversation.d.ts +1 -0
  44. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  45. package/dist/src/embed/conversation.d.ts +1 -0
  46. package/dist/src/embed/conversation.d.ts.map +1 -1
  47. package/dist/src/embed/liveboard.d.ts +3 -1
  48. package/dist/src/embed/liveboard.d.ts.map +1 -1
  49. package/dist/src/embed/sage.d.ts +1 -0
  50. package/dist/src/embed/sage.d.ts.map +1 -1
  51. package/dist/src/embed/search-bar.d.ts +1 -0
  52. package/dist/src/embed/search-bar.d.ts.map +1 -1
  53. package/dist/src/embed/search.d.ts +1 -0
  54. package/dist/src/embed/search.d.ts.map +1 -1
  55. package/dist/src/embed/ts-embed.d.ts +9 -0
  56. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  57. package/dist/src/types.d.ts +33 -64
  58. package/dist/src/types.d.ts.map +1 -1
  59. package/dist/tsembed-react.es.js +178 -117
  60. package/dist/tsembed-react.js +177 -116
  61. package/dist/tsembed.es.js +178 -117
  62. package/dist/tsembed.js +177 -116
  63. package/dist/visual-embed-sdk-react-full.d.ts +47 -65
  64. package/dist/visual-embed-sdk-react.d.ts +47 -65
  65. package/dist/visual-embed-sdk.d.ts +47 -65
  66. package/lib/package.json +1 -1
  67. package/lib/src/embed/bodyless-conversation.d.ts +1 -0
  68. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  69. package/lib/src/embed/bodyless-conversation.js +7 -3
  70. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  71. package/lib/src/embed/conversation.d.ts +1 -0
  72. package/lib/src/embed/conversation.d.ts.map +1 -1
  73. package/lib/src/embed/conversation.js +7 -2
  74. package/lib/src/embed/conversation.js.map +1 -1
  75. package/lib/src/embed/liveboard.d.ts +3 -1
  76. package/lib/src/embed/liveboard.d.ts.map +1 -1
  77. package/lib/src/embed/liveboard.js +35 -14
  78. package/lib/src/embed/liveboard.js.map +1 -1
  79. package/lib/src/embed/liveboard.spec.js +29 -4
  80. package/lib/src/embed/liveboard.spec.js.map +1 -1
  81. package/lib/src/embed/sage.d.ts +1 -0
  82. package/lib/src/embed/sage.d.ts.map +1 -1
  83. package/lib/src/embed/sage.js +10 -6
  84. package/lib/src/embed/sage.js.map +1 -1
  85. package/lib/src/embed/search-bar.d.ts +1 -0
  86. package/lib/src/embed/search-bar.d.ts.map +1 -1
  87. package/lib/src/embed/search-bar.js +11 -7
  88. package/lib/src/embed/search-bar.js.map +1 -1
  89. package/lib/src/embed/search.d.ts +1 -0
  90. package/lib/src/embed/search.d.ts.map +1 -1
  91. package/lib/src/embed/search.js +7 -8
  92. package/lib/src/embed/search.js.map +1 -1
  93. package/lib/src/embed/ts-embed.d.ts +9 -0
  94. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  95. package/lib/src/embed/ts-embed.js +65 -10
  96. package/lib/src/embed/ts-embed.js.map +1 -1
  97. package/lib/src/types.d.ts +33 -64
  98. package/lib/src/types.d.ts.map +1 -1
  99. package/lib/src/types.js +33 -64
  100. package/lib/src/types.js.map +1 -1
  101. package/lib/src/visual-embed-sdk.d.ts +47 -65
  102. package/package.json +1 -1
  103. package/src/embed/bodyless-conversation.ts +9 -3
  104. package/src/embed/conversation.ts +13 -2
  105. package/src/embed/liveboard.spec.ts +32 -4
  106. package/src/embed/liveboard.ts +41 -14
  107. package/src/embed/sage.ts +11 -6
  108. package/src/embed/search-bar.tsx +14 -7
  109. package/src/embed/search.ts +18 -7
  110. package/src/embed/ts-embed.ts +90 -24
  111. package/src/types.ts +34 -64
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.40.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.40.1-alpha.2 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -1496,7 +1496,7 @@ var EmbedEvent;
1496
1496
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1497
1497
  * @example
1498
1498
  *```js
1499
- * liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
1499
+ * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1500
1500
  * console.log('Liveboard details', payload);
1501
1501
  * })
1502
1502
  *```
@@ -1871,58 +1871,58 @@ var EmbedEvent;
1871
1871
  */
1872
1872
  EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1873
1873
  /**
1874
- * Emitted when Spotter response is text data
1874
+ * Emitted when spotter response is text data
1875
1875
  * @example
1876
1876
  * ```js
1877
1877
  * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1878
1878
  * console.log('payload', payload);
1879
1879
  * })
1880
1880
  *```
1881
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1881
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1882
1882
  */
1883
1883
  EmbedEvent["SpotterData"] = "SpotterData";
1884
1884
  /**
1885
- * Emitted when user opens up the worksheet preview modal in Spotter embed.
1885
+ * Emitted when user opens up the worksheet preview modal in spotter embed.
1886
1886
  * @example
1887
1887
  * ```js
1888
1888
  * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1889
1889
  * console.log('payload', payload);
1890
1890
  * })
1891
1891
  *```
1892
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1892
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1893
1893
  */
1894
1894
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1895
1895
  /**
1896
- * Emitted when the Spotter query is triggered in Spotter embed.
1896
+ * Emitted when the spotter query is triggered in spotter embed.
1897
1897
  * @example
1898
1898
  * ```js
1899
1899
  * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1900
1900
  * console.log('payload', payload);
1901
1901
  * })
1902
1902
  *```
1903
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1903
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1904
1904
  */
1905
1905
  EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1906
1906
  /**
1907
- * Emitted when the last Spotter query is edited in Spotter embed.
1907
+ * Emitted when the last spotter query is edited in spotter embed.
1908
1908
  * @example
1909
1909
  * ```js
1910
1910
  * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1911
1911
  * console.log('payload', payload);
1912
1912
  * })
1913
1913
  *```
1914
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1914
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1915
1915
  */
1916
1916
  EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1917
1917
  /**
1918
- * Emitted when the last Spotter query is deleted in Spotter embed.
1918
+ * Emitted when the last spotter query is deleted in spotter embed.
1919
1919
  * @example
1920
1920
  * ```js
1921
1921
  * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1922
1922
  * console.log('payload', payload);
1923
1923
  * })
1924
1924
  *```
1925
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1925
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1926
1926
  */
1927
1927
  EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1928
1928
  /**
@@ -1933,7 +1933,7 @@ var EmbedEvent;
1933
1933
  * console.log('payload', payload);
1934
1934
  * })
1935
1935
  *```
1936
- * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1936
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1937
1937
  */
1938
1938
  EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1939
1939
  /**
@@ -1946,7 +1946,7 @@ var EmbedEvent;
1946
1946
  *```
1947
1947
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1948
1948
  */
1949
- EmbedEvent["SpotterInit"] = "spotterInit";
1949
+ EmbedEvent["SpotterInit"] = "SpotterInit";
1950
1950
  })(EmbedEvent || (EmbedEvent = {}));
1951
1951
  /**
1952
1952
  * Event types that can be triggered by the host application
@@ -2036,7 +2036,6 @@ var HostEvent;
2036
2036
  * done automatically on the most popular column.
2037
2037
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
2038
2038
  * in case of a Liveboard.
2039
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2040
2039
  * @example
2041
2040
  * ```js
2042
2041
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -2356,21 +2355,12 @@ var HostEvent;
2356
2355
  * Trigger the **Download PDF** action on an embedded Liveboard,
2357
2356
  * visualization or Answer.
2358
2357
  *
2359
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2360
- *
2361
2358
  * **NOTE**: The **Download** > **PDF** action is available on
2362
2359
  * visualizations and Answers if the data is in tabular format.
2363
2360
  * @example
2364
2361
  * ```js
2365
2362
  * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
2366
2363
  * ```
2367
- * @example
2368
- * ```js
2369
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2370
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2371
- * });
2372
- * ```
2373
- *
2374
2364
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2375
2365
  */
2376
2366
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
@@ -2472,8 +2462,7 @@ var HostEvent;
2472
2462
  * This event is not supported in visualization embed and search embed.
2473
2463
  * @param - object - To trigger the action for a specific visualization
2474
2464
  * 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
- *
2465
+ * **Required** in Spotter embed.
2477
2466
  * @example
2478
2467
  * ```js
2479
2468
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2488,12 +2477,6 @@ var HostEvent;
2488
2477
  * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2489
2478
  * });
2490
2479
  * ```
2491
- * @example
2492
- * ```js
2493
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2494
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2495
- * });
2496
- * ```
2497
2480
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2498
2481
  */
2499
2482
  HostEvent["Edit"] = "edit";
@@ -2614,7 +2597,6 @@ var HostEvent;
2614
2597
  /**
2615
2598
  * Trigger the **Download** action on charts in
2616
2599
  * the embedded view.
2617
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2618
2600
  * @example
2619
2601
  * ```js
2620
2602
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2623,11 +2605,6 @@ var HostEvent;
2623
2605
  * ```js
2624
2606
  * embed.trigger(HostEvent.Download)
2625
2607
  * ```
2626
- * ```js
2627
- * spotterEmbed.trigger(HostEvent.Download, {
2628
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2629
- * });
2630
- * ```
2631
2608
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2632
2609
  * Use {@link DownloadAsPng}
2633
2610
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2656,7 +2633,6 @@ var HostEvent;
2656
2633
  /**
2657
2634
  * Trigger the **Download** > **CSV** action on tables in
2658
2635
  * the embedded view.
2659
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2660
2636
  * @example
2661
2637
  * ```js
2662
2638
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2679,7 +2655,6 @@ var HostEvent;
2679
2655
  /**
2680
2656
  * Trigger the **Download** > **XLSX** action on tables
2681
2657
  * in the embedded view.
2682
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2683
2658
  * @example
2684
2659
  * ```js
2685
2660
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2715,7 +2690,7 @@ var HostEvent;
2715
2690
  /**
2716
2691
  * Trigger the **Save** action on a Liveboard or Answer.
2717
2692
  * Saves the changes.
2718
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2693
+ * @param - `vizId` is required in Spotter Embed.
2719
2694
  * @example
2720
2695
  * ```js
2721
2696
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -3025,7 +3000,6 @@ var HostEvent;
3025
3000
  HostEvent["UpdateParameters"] = "UpdateParameters";
3026
3001
  /**
3027
3002
  * Triggers GetParameters to fetch the runtime Parameters.
3028
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3029
3003
  * ```js
3030
3004
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
3031
3005
  * console.log('parameters', parameter);
@@ -3069,7 +3043,7 @@ var HostEvent;
3069
3043
  * @param - optional attributes to set Answer properties.
3070
3044
  * `name` - Name string for the Answer.
3071
3045
  * `description` - Description text for the Answer.
3072
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3046
+ *
3073
3047
  * @example
3074
3048
  * ```js
3075
3049
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -3077,14 +3051,6 @@ var HostEvent;
3077
3051
  * description: "Total sales by states in MidWest"
3078
3052
  * });
3079
3053
  * ```
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
- * ```
3088
3054
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3089
3055
  */
3090
3056
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -3116,7 +3082,7 @@ var HostEvent;
3116
3082
  /**
3117
3083
  * Triggers a search operation with the search tokens specified in
3118
3084
  * the search query string in spotter embed.
3119
- * @param - `query`: Text string in Natural Language format
3085
+ * @param - `queryString`: Text string in Natural Language format
3120
3086
  * @param - `executeSearch`: Boolean to execute search and update search query
3121
3087
  * @example
3122
3088
  * ```js
@@ -3125,7 +3091,6 @@ var HostEvent;
3125
3091
  * executeSearch: true,
3126
3092
  * })
3127
3093
  * ```
3128
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3129
3094
  */
3130
3095
  HostEvent["SpotterSearch"] = "SpotterSearch";
3131
3096
  /**
@@ -3135,7 +3100,6 @@ var HostEvent;
3135
3100
  * ```js
3136
3101
  * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
3137
3102
  * ```
3138
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3139
3103
  */
3140
3104
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
3141
3105
  /**
@@ -3144,7 +3108,6 @@ var HostEvent;
3144
3108
  * ```js
3145
3109
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
3146
3110
  * ```
3147
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3148
3111
  */
3149
3112
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3150
3113
  /**
@@ -3153,7 +3116,6 @@ var HostEvent;
3153
3116
  * ```js
3154
3117
  * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
3155
3118
  * ```
3156
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3157
3119
  */
3158
3120
  HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
3159
3121
  /**
@@ -3162,19 +3124,17 @@ var HostEvent;
3162
3124
  * ```js
3163
3125
  * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
3164
3126
  * ```
3165
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3166
3127
  */
3167
3128
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3168
3129
  /**
3169
3130
  * 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.
3131
+ * @param - `vizId ` In Spotter Embed, vizId is required.
3171
3132
  * @example
3172
3133
  * ```js
3173
3134
  * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3174
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
3135
+ * vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
3175
3136
  * });
3176
3137
  *```
3177
- * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3178
3138
  */
3179
3139
  HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
3180
3140
  /**
@@ -3201,16 +3161,25 @@ var HostEvent;
3201
3161
  */
3202
3162
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3203
3163
  /**
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.
3164
+ * Trigger the *Ask Sage* action for visualizations
3206
3165
  * @example
3207
3166
  * ```js
3208
- * spotterEmbed.trigger(HostEvent.AskSpotter,
3209
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
3167
+ * liveboardEmbed.trigger(HostEvent.AskSpotter,
3168
+ * {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
3210
3169
  * ```
3211
3170
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3212
3171
  */
3213
- HostEvent["AskSpotter"] = "AskSpotter";
3172
+ HostEvent["AskSpotter"] = "askSpotter";
3173
+ /**
3174
+ * @hidden
3175
+ * Triggers the update of the embed params.
3176
+ *
3177
+ * @example
3178
+ * ```js
3179
+ * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
3180
+ * ```
3181
+ */
3182
+ HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
3214
3183
  })(HostEvent || (HostEvent = {}));
3215
3184
  /**
3216
3185
  * The different visual modes that the data sources panel within
@@ -7952,7 +7921,7 @@ class AnswerService {
7952
7921
  async getTML() {
7953
7922
  const { object } = await this.executeQuery(getAnswerTML, {});
7954
7923
  const edoc = object[0].edoc;
7955
- const YAML = await import('./index-CAEHQGLc.js');
7924
+ const YAML = await import('./index-k7pkZMhx.js');
7956
7925
  const parsedDoc = YAML.parse(edoc);
7957
7926
  return {
7958
7927
  answer: {
@@ -15852,7 +15821,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15852
15821
  return e;
15853
15822
  }
15854
15823
 
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};
15824
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1-alpha.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};
15856
15825
 
15857
15826
  /**
15858
15827
  * Reloads the ThoughtSpot iframe.
@@ -16078,6 +16047,7 @@ class TsEmbed {
16078
16047
  */
16079
16048
  this.fullscreenChangeHandler = null;
16080
16049
  this.subscribedListeners = {};
16050
+ this.isEmbedContainerLoaded = false;
16081
16051
  /**
16082
16052
  * Send Custom style as part of payload of APP_INIT
16083
16053
  * @param _
@@ -16104,7 +16074,8 @@ class TsEmbed {
16104
16074
  this.updateAuthToken = async (_, responder) => {
16105
16075
  const { authType } = this.embedConfig;
16106
16076
  let { autoLogin } = this.embedConfig;
16107
- // Default autoLogin: true for cookieless if undefined/null, otherwise false
16077
+ // Default autoLogin: true for cookieless if undefined/null, otherwise
16078
+ // false
16108
16079
  autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
16109
16080
  if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
16110
16081
  try {
@@ -16148,11 +16119,16 @@ class TsEmbed {
16148
16119
  });
16149
16120
  notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
16150
16121
  };
16122
+ this.pendingEvents = [];
16151
16123
  /**
16152
16124
  * Register APP_INIT event and sendback init payload
16153
16125
  */
16154
16126
  this.registerAppInit = () => {
16155
16127
  this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
16128
+ this.on(EmbedEvent.AuthInit, () => {
16129
+ this.isEmbedContainerLoaded = true;
16130
+ this.executePendingEvents();
16131
+ }, { start: false }, true);
16156
16132
  this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
16157
16133
  this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
16158
16134
  };
@@ -16178,6 +16154,7 @@ class TsEmbed {
16178
16154
  });
16179
16155
  }
16180
16156
  };
16157
+ this.id = Date.now().toString();
16181
16158
  this.el = getDOMNode(domSelector);
16182
16159
  this.eventHandlerMap = new Map();
16183
16160
  this.isError = false;
@@ -16191,9 +16168,9 @@ class TsEmbed {
16191
16168
  ...viewConfig,
16192
16169
  });
16193
16170
  this.hostEventClient = new HostEventClient(this.iFrame);
16171
+ const embedConfig = getEmbedConfig();
16172
+ this.embedConfig = embedConfig;
16194
16173
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
16195
- const embedConfig = getEmbedConfig();
16196
- this.embedConfig = embedConfig;
16197
16174
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
16198
16175
  this.embedConfig.authTriggerContainer = domSelector;
16199
16176
  }
@@ -16226,7 +16203,6 @@ class TsEmbed {
16226
16203
  */
16227
16204
  getEventType(event) {
16228
16205
  var _a, _b;
16229
- // eslint-disable-next-line no-underscore-dangle
16230
16206
  return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
16231
16207
  }
16232
16208
  /**
@@ -16365,6 +16341,43 @@ class TsEmbed {
16365
16341
  async getAppInitData() {
16366
16342
  return this.getDefaultAppInitData();
16367
16343
  }
16344
+ getPreRenderObj() {
16345
+ var _a;
16346
+ const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
16347
+ if (embedObj === this) {
16348
+ logger$3.info('embedObj is same as this');
16349
+ }
16350
+ return embedObj;
16351
+ }
16352
+ checkEmbedContainerLoaded() {
16353
+ if (this.isEmbedContainerLoaded)
16354
+ return true;
16355
+ const preRenderObj = this.getPreRenderObj();
16356
+ if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
16357
+ this.isEmbedContainerLoaded = true;
16358
+ }
16359
+ return this.isEmbedContainerLoaded;
16360
+ }
16361
+ executePendingEvents() {
16362
+ logger$3.debug('executePendingEvents', this.pendingEvents);
16363
+ setTimeout(() => {
16364
+ this.pendingEvents.forEach((event) => {
16365
+ var _a;
16366
+ this.trigger(event.eventType, event.data);
16367
+ (_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
16368
+ });
16369
+ this.pendingEvents = [];
16370
+ }, 1000);
16371
+ }
16372
+ triggerAfterLoad(eventType, data, onEventTriggered) {
16373
+ if (this.checkEmbedContainerLoaded()) {
16374
+ this.trigger(eventType, data);
16375
+ onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
16376
+ }
16377
+ else {
16378
+ this.pendingEvents.push({ eventType, data, onEventTriggered });
16379
+ }
16380
+ }
16368
16381
  /**
16369
16382
  * Constructs the base URL string to load the ThoughtSpot app.
16370
16383
  * @param query
@@ -16379,6 +16392,11 @@ class TsEmbed {
16379
16392
  .join('/');
16380
16393
  return `${basePath}#`;
16381
16394
  }
16395
+ getUpdateEmbedParamsObject() {
16396
+ let queryParams = this.getEmbedParamsObject();
16397
+ queryParams = { ...this.viewConfig, ...queryParams };
16398
+ return queryParams;
16399
+ }
16382
16400
  /**
16383
16401
  * Common query params set for all the embed modes.
16384
16402
  * @param queryParams
@@ -16528,9 +16546,13 @@ class TsEmbed {
16528
16546
  return path;
16529
16547
  }
16530
16548
  getEmbedParams() {
16531
- const queryParams = this.getBaseQueryParams();
16549
+ const queryParams = this.getEmbedParamsObject();
16532
16550
  return getQueryParamString(queryParams);
16533
16551
  }
16552
+ getEmbedParamsObject() {
16553
+ const params = this.getBaseQueryParams();
16554
+ return params;
16555
+ }
16534
16556
  getRootIframeSrc() {
16535
16557
  const query = this.getEmbedParams();
16536
16558
  return this.getEmbedBasePath(query);
@@ -16629,7 +16651,8 @@ class TsEmbed {
16629
16651
  }
16630
16652
  });
16631
16653
  }
16632
- // Setup fullscreen change handler after iframe is loaded and ready
16654
+ // Setup fullscreen change handler after iframe is
16655
+ // loaded and ready
16633
16656
  this.setupFullscreenChangeHandler();
16634
16657
  });
16635
16658
  this.iFrame.addEventListener('error', () => {
@@ -16731,7 +16754,6 @@ class TsEmbed {
16731
16754
  const div = document.createElement('div');
16732
16755
  div.innerHTML = child;
16733
16756
  div.id = TS_EMBED_ID;
16734
- // eslint-disable-next-line no-param-reassign
16735
16757
  child = div;
16736
16758
  }
16737
16759
  if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
@@ -17054,7 +17076,10 @@ class TsEmbed {
17054
17076
  return this.preRender(true);
17055
17077
  }
17056
17078
  this.validatePreRenderViewConfig(this.viewConfig);
17079
+ logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
17080
+ this.triggerAfterLoad(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
17057
17081
  }
17082
+ this.beforePrerenderVisible();
17058
17083
  if (this.el) {
17059
17084
  this.syncPreRenderStyle();
17060
17085
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -17071,7 +17096,6 @@ class TsEmbed {
17071
17096
  this.resizeObserver.observe(this.el);
17072
17097
  }
17073
17098
  }
17074
- this.beforePrerenderVisible();
17075
17099
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
17076
17100
  this.subscribeToEvents();
17077
17101
  // Setup fullscreen change handler for prerendered components
@@ -17164,7 +17188,8 @@ class TsEmbed {
17164
17188
  const isFullscreen = !!document.fullscreenElement;
17165
17189
  if (!isFullscreen) {
17166
17190
  logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
17167
- // Only trigger if iframe is available and contentWindow is accessible
17191
+ // Only trigger if iframe is available and contentWindow is
17192
+ // accessible
17168
17193
  if (this.iFrame && this.iFrame.contentWindow) {
17169
17194
  this.trigger(HostEvent.ExitPresentMode);
17170
17195
  }
@@ -17198,7 +17223,6 @@ class V1Embed extends TsEmbed {
17198
17223
  * Only for testing purposes.
17199
17224
  * @hidden
17200
17225
  */
17201
- // eslint-disable-next-line camelcase
17202
17226
  this.test__executeCallbacks = this.executeCallbacks;
17203
17227
  this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
17204
17228
  }
@@ -17797,6 +17821,7 @@ class LiveboardEmbed extends V1Embed {
17797
17821
  }
17798
17822
  this.setIFrameHeight(frameHeight || this.defaultHeight);
17799
17823
  };
17824
+ this.currentLiveboardId = this.viewConfig.liveboardId;
17800
17825
  if (this.viewConfig.fullHeight === true) {
17801
17826
  if (this.viewConfig.vizId) {
17802
17827
  logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
@@ -17813,6 +17838,11 @@ class LiveboardEmbed extends V1Embed {
17813
17838
  * embedded Liveboard or visualization.
17814
17839
  */
17815
17840
  getEmbedParams() {
17841
+ const params = this.getEmbedParamsObject();
17842
+ const queryParams = getQueryParamString(params, true);
17843
+ return queryParams;
17844
+ }
17845
+ getEmbedParamsObject() {
17816
17846
  let params = {};
17817
17847
  params = this.getBaseQueryParams(params);
17818
17848
  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;
@@ -17882,8 +17912,27 @@ class LiveboardEmbed extends V1Embed {
17882
17912
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17883
17913
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17884
17914
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17885
- const queryParams = getQueryParamString(params, true);
17886
- return queryParams;
17915
+ if (oAuthPollingInterval !== undefined) {
17916
+ params[Param.OauthPollingInterval] = oAuthPollingInterval;
17917
+ }
17918
+ if (isForceRedirect) {
17919
+ params[Param.IsForceRedirect] = isForceRedirect;
17920
+ }
17921
+ if (dataSourceId !== undefined) {
17922
+ params[Param.DataSourceId] = dataSourceId;
17923
+ }
17924
+ if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17925
+ params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17926
+ }
17927
+ params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
17928
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
17929
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
17930
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
17931
+ params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17932
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
17933
+ params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17934
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17935
+ return params;
17887
17936
  }
17888
17937
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
17889
17938
  let suffix = `/embed/viz/${liveboardId}`;
@@ -17945,16 +17994,12 @@ class LiveboardEmbed extends V1Embed {
17945
17994
  }
17946
17995
  }
17947
17996
  beforePrerenderVisible() {
17948
- var _a;
17949
- const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
17950
- if (isUndefined$1(embedObj))
17951
- return;
17952
- const showDifferentLib = this.viewConfig.liveboardId
17953
- && embedObj.viewConfig.liveboardId !== this.viewConfig.liveboardId;
17954
- if (showDifferentLib) {
17955
- const libId = this.viewConfig.liveboardId;
17956
- this.navigateToLiveboard(libId);
17957
- }
17997
+ const embedObj = this.getPreRenderObj();
17998
+ const libId = this.currentLiveboardId;
17999
+ this.navigateToLiveboard(libId, this.viewConfig.vizId, this.viewConfig.activeTabId, () => {
18000
+ if (embedObj)
18001
+ embedObj.currentLiveboardId = libId;
18002
+ });
17958
18003
  }
17959
18004
  async handleRenderForPrerender() {
17960
18005
  if (isUndefined$1(this.viewConfig.liveboardId)) {
@@ -18016,13 +18061,13 @@ class LiveboardEmbed extends V1Embed {
18016
18061
  this.postRender();
18017
18062
  return this;
18018
18063
  }
18019
- navigateToLiveboard(liveboardId, vizId, activeTabId) {
18064
+ navigateToLiveboard(liveboardId, vizId, activeTabId, onNavigateCalled) {
18020
18065
  const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
18021
18066
  this.viewConfig.liveboardId = liveboardId;
18022
18067
  this.viewConfig.activeTabId = activeTabId;
18023
18068
  this.viewConfig.vizId = vizId;
18024
18069
  if (this.isRendered) {
18025
- this.trigger(HostEvent.Navigate, path.substring(1));
18070
+ this.triggerAfterLoad(HostEvent.Navigate, path.substring(1), onNavigateCalled);
18026
18071
  }
18027
18072
  else if (this.viewConfig.preRenderId) {
18028
18073
  this.preRender(true);
@@ -18124,11 +18169,9 @@ class SearchEmbed extends TsEmbed {
18124
18169
  const defaultAppInitData = await super.getAppInitData();
18125
18170
  return { ...defaultAppInitData, ...this.getSearchInitData() };
18126
18171
  }
18127
- getEmbedParams() {
18172
+ getEmbedParamsObject() {
18128
18173
  var _a;
18129
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
18130
- /* eslint-disable-next-line max-len */
18131
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
18174
+ 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;
18132
18175
  const queryParams = this.getBaseQueryParams();
18133
18176
  queryParams[Param.HideActions] = [
18134
18177
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -18161,7 +18204,6 @@ class SearchEmbed extends TsEmbed {
18161
18204
  queryParams[Param.HideSearchBar] = true;
18162
18205
  }
18163
18206
  if (isOnBeforeGetVizDataInterceptEnabled) {
18164
- /* eslint-disable-next-line max-len */
18165
18207
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
18166
18208
  }
18167
18209
  if (!focusSearchBarOnRender) {
@@ -18174,20 +18216,22 @@ class SearchEmbed extends TsEmbed {
18174
18216
  queryParams[Param.UseLastSelectedDataSource] = false;
18175
18217
  }
18176
18218
  queryParams[Param.searchEmbed] = true;
18177
- /* eslint-disable-next-line max-len */
18178
18219
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
18179
18220
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18180
18221
  if (dataPanelCustomGroupsAccordionInitialState
18181
18222
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
18182
18223
  || dataPanelCustomGroupsAccordionInitialState
18183
18224
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
18184
- /* eslint-disable-next-line max-len */
18185
18225
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
18186
18226
  }
18187
18227
  else {
18188
- /* eslint-disable-next-line max-len */
18189
18228
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
18190
18229
  }
18230
+ return queryParams;
18231
+ }
18232
+ getEmbedParams() {
18233
+ const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
18234
+ const queryParams = this.getEmbedParamsObject();
18191
18235
  let query = '';
18192
18236
  const queryParamsString = getQueryParamString(queryParams, true);
18193
18237
  if (queryParamsString) {
@@ -18243,15 +18287,9 @@ class SearchBarEmbed extends TsEmbed {
18243
18287
  this.embedComponentType = 'SearchBarEmbed';
18244
18288
  this.viewConfig = viewConfig;
18245
18289
  }
18246
- /**
18247
- * Construct the URL of the embedded ThoughtSpot search to be
18248
- * loaded in the iframe
18249
- * @param dataSources A list of data source GUIDs
18250
- */
18251
- getIFrameSrc() {
18290
+ getEmbedParamsObject() {
18252
18291
  var _a;
18253
18292
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
18254
- const path = 'search-bar-embed';
18255
18293
  const queryParams = this.getBaseQueryParams();
18256
18294
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18257
18295
  if (dataSources && dataSources.length) {
@@ -18273,6 +18311,16 @@ class SearchBarEmbed extends TsEmbed {
18273
18311
  queryParams[Param.UseLastSelectedDataSource] = false;
18274
18312
  }
18275
18313
  queryParams[Param.searchEmbed] = true;
18314
+ return queryParams;
18315
+ }
18316
+ /**
18317
+ * Construct the URL of the embedded ThoughtSpot search to be
18318
+ * loaded in the iframe
18319
+ * @param dataSources A list of data source GUIDs
18320
+ */
18321
+ getIFrameSrc() {
18322
+ const queryParams = this.getEmbedParamsObject();
18323
+ const path = 'search-bar-embed';
18276
18324
  let query = '';
18277
18325
  const queryParamsString = getQueryParamString(queryParams, true);
18278
18326
  if (queryParamsString) {
@@ -18695,13 +18743,17 @@ class ConversationMessage extends TsEmbed {
18695
18743
  super(container, viewConfig);
18696
18744
  this.viewConfig = viewConfig;
18697
18745
  }
18698
- getIframeSrc() {
18746
+ getEmbedParamsObject() {
18699
18747
  var _a;
18700
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18701
- const path = 'conv-assist-answer';
18702
18748
  const queryParams = this.getBaseQueryParams();
18703
18749
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18704
18750
  queryParams[Param.isSpotterAgentEmbed] = true;
18751
+ return queryParams;
18752
+ }
18753
+ getIframeSrc() {
18754
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18755
+ const path = 'conv-assist-answer';
18756
+ const queryParams = this.getEmbedParamsObject();
18705
18757
  let query = '';
18706
18758
  const queryParamsString = getQueryParamString(queryParams, true);
18707
18759
  if (queryParamsString) {
@@ -18862,9 +18914,8 @@ class SpotterEmbed extends TsEmbed {
18862
18914
  super(container, viewConfig);
18863
18915
  this.viewConfig = viewConfig;
18864
18916
  }
18865
- getIframeSrc() {
18917
+ getEmbedParamsObject() {
18866
18918
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
18867
- const path = 'insights/conv-assist';
18868
18919
  if (!worksheetId) {
18869
18920
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
18870
18921
  }
@@ -18885,6 +18936,12 @@ class SpotterEmbed extends TsEmbed {
18885
18936
  if (!isUndefined_1(hideSampleQuestions)) {
18886
18937
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
18887
18938
  }
18939
+ return queryParams;
18940
+ }
18941
+ getIframeSrc() {
18942
+ const { worksheetId, searchOptions, } = this.viewConfig;
18943
+ const path = 'insights/conv-assist';
18944
+ const queryParams = this.getEmbedParamsObject();
18888
18945
  let query = '';
18889
18946
  const queryParamsString = getQueryParamString(queryParams, true);
18890
18947
  if (queryParamsString) {
@@ -18948,12 +19005,7 @@ class SageEmbed extends V1Embed {
18948
19005
  viewConfig.embedComponentType = 'SageEmbed';
18949
19006
  super(domSelector, viewConfig);
18950
19007
  }
18951
- /**
18952
- * Constructs a map of parameters to be passed on to the
18953
- * embedded Eureka or Sage search page.
18954
- * @returns {string} query string
18955
- */
18956
- getEmbedParams() {
19008
+ getEmbedParamsObject() {
18957
19009
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
18958
19010
  const params = this.getBaseQueryParams();
18959
19011
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -18968,6 +19020,15 @@ class SageEmbed extends V1Embed {
18968
19020
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
18969
19021
  params[Param.IsProductTour] = !!isProductTour;
18970
19022
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
19023
+ return params;
19024
+ }
19025
+ /**
19026
+ * Constructs a map of parameters to be passed on to the
19027
+ * embedded Eureka or Sage search page.
19028
+ * @returns {string} query string
19029
+ */
19030
+ getEmbedParams() {
19031
+ const params = this.getEmbedParamsObject();
18971
19032
  return getQueryParamString(params, true);
18972
19033
  }
18973
19034
  /**