@thoughtspot/visual-embed-sdk 1.41.0 → 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +2 -4
  2. package/cjs/package.json +8 -8
  3. package/cjs/src/authToken.d.ts +1 -0
  4. package/cjs/src/authToken.d.ts.map +1 -1
  5. package/cjs/src/authToken.js +13 -3
  6. package/cjs/src/authToken.js.map +1 -1
  7. package/cjs/src/authToken.spec.js +29 -0
  8. package/cjs/src/authToken.spec.js.map +1 -1
  9. package/cjs/src/css-variables.d.ts +54 -15
  10. package/cjs/src/css-variables.d.ts.map +1 -1
  11. package/cjs/src/embed/app.d.ts +16 -0
  12. package/cjs/src/embed/app.d.ts.map +1 -1
  13. package/cjs/src/embed/app.js +4 -1
  14. package/cjs/src/embed/app.js.map +1 -1
  15. package/cjs/src/embed/app.spec.js +10 -0
  16. package/cjs/src/embed/app.spec.js.map +1 -1
  17. package/cjs/src/embed/bodyless-conversation.d.ts +1 -0
  18. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/bodyless-conversation.js +7 -3
  20. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  21. package/cjs/src/embed/conversation.d.ts +3 -2
  22. package/cjs/src/embed/conversation.d.ts.map +1 -1
  23. package/cjs/src/embed/conversation.js +7 -2
  24. package/cjs/src/embed/conversation.js.map +1 -1
  25. package/cjs/src/embed/liveboard.d.ts +33 -0
  26. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  27. package/cjs/src/embed/liveboard.js +13 -2
  28. package/cjs/src/embed/liveboard.js.map +1 -1
  29. package/cjs/src/embed/liveboard.spec.js +98 -11
  30. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  31. package/cjs/src/embed/sage.d.ts +1 -0
  32. package/cjs/src/embed/sage.d.ts.map +1 -1
  33. package/cjs/src/embed/sage.js +10 -6
  34. package/cjs/src/embed/sage.js.map +1 -1
  35. package/cjs/src/embed/sage.spec.js +20 -10
  36. package/cjs/src/embed/sage.spec.js.map +1 -1
  37. package/cjs/src/embed/search-bar.d.ts +1 -0
  38. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  39. package/cjs/src/embed/search-bar.js +11 -7
  40. package/cjs/src/embed/search-bar.js.map +1 -1
  41. package/cjs/src/embed/search.d.ts +1 -0
  42. package/cjs/src/embed/search.d.ts.map +1 -1
  43. package/cjs/src/embed/search.js +7 -8
  44. package/cjs/src/embed/search.js.map +1 -1
  45. package/cjs/src/embed/search.spec.js +10 -10
  46. package/cjs/src/embed/search.spec.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.d.ts +7 -5
  48. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  49. package/cjs/src/embed/ts-embed.js +26 -9
  50. package/cjs/src/embed/ts-embed.js.map +1 -1
  51. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  52. package/cjs/src/errors.d.ts +1 -0
  53. package/cjs/src/errors.d.ts.map +1 -1
  54. package/cjs/src/errors.js +1 -0
  55. package/cjs/src/errors.js.map +1 -1
  56. package/cjs/src/react/all-types-export.spec.js +1 -1
  57. package/cjs/src/react/all-types-export.spec.js.map +1 -1
  58. package/cjs/src/react/index.d.ts.map +1 -1
  59. package/cjs/src/react/index.js +2 -1
  60. package/cjs/src/react/index.js.map +1 -1
  61. package/cjs/src/react/index.spec.js +1 -1
  62. package/cjs/src/react/index.spec.js.map +1 -1
  63. package/cjs/src/react/util.js.map +1 -1
  64. package/cjs/src/react/util.spec.d.ts +2 -0
  65. package/cjs/src/react/util.spec.d.ts.map +1 -0
  66. package/cjs/src/react/util.spec.js +78 -0
  67. package/cjs/src/react/util.spec.js.map +1 -0
  68. package/cjs/src/types.d.ts +64 -9
  69. package/cjs/src/types.d.ts.map +1 -1
  70. package/cjs/src/types.js +59 -4
  71. package/cjs/src/types.js.map +1 -1
  72. package/cjs/src/utils.d.ts +14 -0
  73. package/cjs/src/utils.d.ts.map +1 -1
  74. package/cjs/src/utils.js +22 -1
  75. package/cjs/src/utils.js.map +1 -1
  76. package/cjs/src/utils.spec.js +10 -0
  77. package/cjs/src/utils.spec.js.map +1 -1
  78. package/dist/{index-B_mxAan8.js → index-BpSohedu.js} +1 -1
  79. package/dist/src/authToken.d.ts +1 -0
  80. package/dist/src/authToken.d.ts.map +1 -1
  81. package/dist/src/css-variables.d.ts +54 -15
  82. package/dist/src/css-variables.d.ts.map +1 -1
  83. package/dist/src/embed/app.d.ts +16 -0
  84. package/dist/src/embed/app.d.ts.map +1 -1
  85. package/dist/src/embed/bodyless-conversation.d.ts +1 -0
  86. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  87. package/dist/src/embed/conversation.d.ts +3 -2
  88. package/dist/src/embed/conversation.d.ts.map +1 -1
  89. package/dist/src/embed/liveboard.d.ts +33 -0
  90. package/dist/src/embed/liveboard.d.ts.map +1 -1
  91. package/dist/src/embed/sage.d.ts +1 -0
  92. package/dist/src/embed/sage.d.ts.map +1 -1
  93. package/dist/src/embed/search-bar.d.ts +1 -0
  94. package/dist/src/embed/search-bar.d.ts.map +1 -1
  95. package/dist/src/embed/search.d.ts +1 -0
  96. package/dist/src/embed/search.d.ts.map +1 -1
  97. package/dist/src/embed/ts-embed.d.ts +7 -5
  98. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  99. package/dist/src/errors.d.ts +1 -0
  100. package/dist/src/errors.d.ts.map +1 -1
  101. package/dist/src/react/index.d.ts.map +1 -1
  102. package/dist/src/react/util.spec.d.ts +2 -0
  103. package/dist/src/react/util.spec.d.ts.map +1 -0
  104. package/dist/src/types.d.ts +64 -9
  105. package/dist/src/types.d.ts.map +1 -1
  106. package/dist/src/utils.d.ts +14 -0
  107. package/dist/src/utils.d.ts.map +1 -1
  108. package/dist/tsembed-react.es.js +180 -47
  109. package/dist/tsembed-react.js +179 -46
  110. package/dist/tsembed.es.js +178 -46
  111. package/dist/tsembed.js +177 -45
  112. package/dist/visual-embed-sdk-react-full.d.ts +9312 -9842
  113. package/dist/visual-embed-sdk-react.d.ts +9184 -9848
  114. package/dist/visual-embed-sdk.d.ts +9351 -9459
  115. package/lib/package.json +8 -8
  116. package/lib/src/authToken.d.ts +1 -0
  117. package/lib/src/authToken.d.ts.map +1 -1
  118. package/lib/src/authToken.js +11 -2
  119. package/lib/src/authToken.js.map +1 -1
  120. package/lib/src/authToken.spec.js +30 -1
  121. package/lib/src/authToken.spec.js.map +1 -1
  122. package/lib/src/css-variables.d.ts +54 -15
  123. package/lib/src/css-variables.d.ts.map +1 -1
  124. package/lib/src/embed/app.d.ts +16 -0
  125. package/lib/src/embed/app.d.ts.map +1 -1
  126. package/lib/src/embed/app.js +4 -1
  127. package/lib/src/embed/app.js.map +1 -1
  128. package/lib/src/embed/app.spec.js +10 -0
  129. package/lib/src/embed/app.spec.js.map +1 -1
  130. package/lib/src/embed/bodyless-conversation.d.ts +1 -0
  131. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  132. package/lib/src/embed/bodyless-conversation.js +7 -3
  133. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  134. package/lib/src/embed/conversation.d.ts +3 -2
  135. package/lib/src/embed/conversation.d.ts.map +1 -1
  136. package/lib/src/embed/conversation.js +7 -2
  137. package/lib/src/embed/conversation.js.map +1 -1
  138. package/lib/src/embed/liveboard.d.ts +33 -0
  139. package/lib/src/embed/liveboard.d.ts.map +1 -1
  140. package/lib/src/embed/liveboard.js +13 -2
  141. package/lib/src/embed/liveboard.js.map +1 -1
  142. package/lib/src/embed/liveboard.spec.js +98 -11
  143. package/lib/src/embed/liveboard.spec.js.map +1 -1
  144. package/lib/src/embed/sage.d.ts +1 -0
  145. package/lib/src/embed/sage.d.ts.map +1 -1
  146. package/lib/src/embed/sage.js +10 -6
  147. package/lib/src/embed/sage.js.map +1 -1
  148. package/lib/src/embed/sage.spec.js +20 -10
  149. package/lib/src/embed/sage.spec.js.map +1 -1
  150. package/lib/src/embed/search-bar.d.ts +1 -0
  151. package/lib/src/embed/search-bar.d.ts.map +1 -1
  152. package/lib/src/embed/search-bar.js +11 -7
  153. package/lib/src/embed/search-bar.js.map +1 -1
  154. package/lib/src/embed/search.d.ts +1 -0
  155. package/lib/src/embed/search.d.ts.map +1 -1
  156. package/lib/src/embed/search.js +7 -8
  157. package/lib/src/embed/search.js.map +1 -1
  158. package/lib/src/embed/search.spec.js +11 -11
  159. package/lib/src/embed/search.spec.js.map +1 -1
  160. package/lib/src/embed/ts-embed.d.ts +7 -5
  161. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  162. package/lib/src/embed/ts-embed.js +26 -9
  163. package/lib/src/embed/ts-embed.js.map +1 -1
  164. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  165. package/lib/src/errors.d.ts +1 -0
  166. package/lib/src/errors.d.ts.map +1 -1
  167. package/lib/src/errors.js +1 -0
  168. package/lib/src/errors.js.map +1 -1
  169. package/lib/src/react/all-types-export.spec.js +1 -1
  170. package/lib/src/react/all-types-export.spec.js.map +1 -1
  171. package/lib/src/react/index.d.ts.map +1 -1
  172. package/lib/src/react/index.js +2 -1
  173. package/lib/src/react/index.js.map +1 -1
  174. package/lib/src/react/index.spec.js +1 -1
  175. package/lib/src/react/index.spec.js.map +1 -1
  176. package/lib/src/react/util.js.map +1 -1
  177. package/lib/src/react/util.spec.d.ts +2 -0
  178. package/lib/src/react/util.spec.d.ts.map +1 -0
  179. package/lib/src/react/util.spec.js +76 -0
  180. package/lib/src/react/util.spec.js.map +1 -0
  181. package/lib/src/types.d.ts +64 -9
  182. package/lib/src/types.d.ts.map +1 -1
  183. package/lib/src/types.js +59 -4
  184. package/lib/src/types.js.map +1 -1
  185. package/lib/src/utils.d.ts +14 -0
  186. package/lib/src/utils.d.ts.map +1 -1
  187. package/lib/src/utils.js +20 -0
  188. package/lib/src/utils.js.map +1 -1
  189. package/lib/src/utils.spec.js +11 -1
  190. package/lib/src/utils.spec.js.map +1 -1
  191. package/package.json +8 -8
  192. package/src/authToken.spec.ts +48 -1
  193. package/src/authToken.ts +13 -2
  194. package/src/css-variables.ts +55 -17
  195. package/src/embed/app.spec.ts +14 -0
  196. package/src/embed/app.ts +23 -1
  197. package/src/embed/bodyless-conversation.ts +8 -3
  198. package/src/embed/conversation.ts +19 -4
  199. package/src/embed/liveboard.spec.ts +126 -14
  200. package/src/embed/liveboard.ts +72 -24
  201. package/src/embed/sage.spec.ts +24 -10
  202. package/src/embed/sage.ts +14 -9
  203. package/src/embed/search-bar.tsx +14 -7
  204. package/src/embed/search.spec.ts +13 -14
  205. package/src/embed/search.ts +19 -8
  206. package/src/embed/ts-embed.spec.ts +1 -1
  207. package/src/embed/ts-embed.ts +35 -13
  208. package/src/errors.ts +1 -0
  209. package/src/react/all-types-export.spec.ts +1 -1
  210. package/src/react/index.spec.tsx +1 -1
  211. package/src/react/index.tsx +4 -2
  212. package/src/react/util.spec.tsx +88 -0
  213. package/src/react/util.ts +3 -3
  214. package/src/types.ts +125 -69
  215. package/src/utils.spec.ts +18 -0
  216. package/src/utils.ts +21 -0
  217. package/lib/src/visual-embed-sdk.d.ts +0 -9705
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.41.0 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.42.0 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -463,6 +463,26 @@ const calculateVisibleElementData = (element) => {
463
463
  width: Math.max(0, frameRelativeRight - frameRelativeLeft),
464
464
  };
465
465
  return data;
466
+ };
467
+ /**
468
+ * Replaces placeholders in a template string with provided values.
469
+ * Placeholders should be in the format {key}.
470
+ * @param template - The template string with placeholders
471
+ * @param values - An object containing key-value pairs to replace placeholders
472
+ * @returns The template string with placeholders replaced
473
+ * @example
474
+ * formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
475
+ * // Returns: 'Hello John, you are 30 years old'
476
+ *
477
+ * formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
478
+ * // Returns: 'Expected string, but received number'
479
+ */
480
+ const formatTemplate = (template, values) => {
481
+ // This regex /\{(\w+)\}/g finds all placeholders in the format {word}
482
+ // and captures the word inside the braces for replacement.
483
+ return template.replace(/\{(\w+)\}/g, (match, key) => {
484
+ return values[key] !== undefined ? String(values[key]) : match;
485
+ });
466
486
  };
467
487
 
468
488
  /**
@@ -2744,21 +2764,42 @@ var HostEvent;
2744
2764
  */
2745
2765
  HostEvent["Share"] = "share";
2746
2766
  /**
2747
- * Trigger the **Save** action on a Liveboard or Answer.
2767
+ * Trigger the **Save** action on a Liveboard, Answer, or Spotter.
2748
2768
  * Saves the changes.
2749
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2769
+ *
2770
+ * @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
2771
+ * It is required and can be retrieved from the data embed event.
2772
+ *
2750
2773
  * @example
2751
2774
  * ```js
2775
+ * // Save changes in a Liveboard
2752
2776
  * liveboardEmbed.trigger(HostEvent.Save)
2753
2777
  * ```
2778
+ *
2754
2779
  * ```js
2780
+ * // Save the current Answer in Search embed
2755
2781
  * searchEmbed.trigger(HostEvent.Save)
2756
2782
  * ```
2783
+ *
2757
2784
  * ```js
2785
+ * // Save an Answer in Spotter (requires vizId)
2758
2786
  * spotterEmbed.trigger(HostEvent.Save, {
2759
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2787
+ * vizId: "730496d6-6903-4601-937e-2c691821af3c"
2760
2788
  * })
2761
2789
  * ```
2790
+ *
2791
+ * ```js
2792
+ * // How to get the vizId in Spotter?
2793
+ *
2794
+ * // You can use the Data event dispatched on each answer creation to get the vizId.
2795
+ * let latestSpotterVizId = '';
2796
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2797
+ * latestSpotterVizId = payload.data.id;
2798
+ * });
2799
+ *
2800
+ * spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
2801
+ * ```
2802
+ *
2762
2803
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2763
2804
  */
2764
2805
  HostEvent["Save"] = "save";
@@ -2896,7 +2937,7 @@ var HostEvent;
2896
2937
  * column: "Date",
2897
2938
  * oper: 'EQ',
2898
2939
  * values: ["2023-07-31"],
2899
- * types: "EXACT_DATE"
2940
+ * type: "EXACT_DATE"
2900
2941
  * }]
2901
2942
  * });
2902
2943
  * ```
@@ -3242,6 +3283,16 @@ var HostEvent;
3242
3283
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3243
3284
  */
3244
3285
  HostEvent["AskSpotter"] = "AskSpotter";
3286
+ /**
3287
+ * @hidden
3288
+ * Triggers the update of the embed params.
3289
+ *
3290
+ * @example
3291
+ * ```js
3292
+ * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
3293
+ * ```
3294
+ */
3295
+ HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
3245
3296
  })(HostEvent || (HostEvent = {}));
3246
3297
  /**
3247
3298
  * The different visual modes that the data sources panel within
@@ -3388,6 +3439,7 @@ var Param;
3388
3439
  Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3389
3440
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3390
3441
  Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3442
+ Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3391
3443
  })(Param || (Param = {}));
3392
3444
  /**
3393
3445
  * ThoughtSpot application pages include actions and menu commands
@@ -4669,6 +4721,29 @@ var Action;
4669
4721
  * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4670
4722
  */
4671
4723
  Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
4724
+ /**
4725
+ * The **PNG screenshot in email** option in the schedule email dialog.
4726
+ * Includes a PNG screenshot in the notification email body.
4727
+ * @example
4728
+ * ```js
4729
+ * disabledActions: [Action.PngScreenshotInEmail]
4730
+ * ```
4731
+ * ```
4732
+ * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4733
+ */
4734
+ Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
4735
+ /**
4736
+ * The **Remove attachment** action in the schedule email dialog.
4737
+ * Removes an attachment from the email configuration.
4738
+ * @example
4739
+ * ```js
4740
+ * disabledActions: [Action.RemoveAttachment]
4741
+ * ```
4742
+ * ```
4743
+ * ```
4744
+ * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4745
+ */
4746
+ Action["RemoveAttachment"] = "removeAttachment";
4672
4747
  })(Action || (Action = {}));
4673
4748
  var PrefetchFeatures;
4674
4749
  (function (PrefetchFeatures) {
@@ -7148,6 +7223,7 @@ const ERROR_MESSAGE = {
7148
7223
  SDK_NOT_INITIALIZED: 'SDK not initialized',
7149
7224
  SESSION_INFO_FAILED: 'Failed to get session information',
7150
7225
  INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
7226
+ INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
7151
7227
  MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
7152
7228
  PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
7153
7229
  SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
@@ -7328,6 +7404,15 @@ async function getAuthenticationToken(embedConfig) {
7328
7404
  return authToken;
7329
7405
  }
7330
7406
  const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
7407
+ // even if token verification is disabled, we will still validate
7408
+ // that the token is a string before proceeding.
7409
+ if (typeof authToken !== 'string') {
7410
+ const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
7411
+ invalidType: typeof authToken,
7412
+ });
7413
+ logger$3.error(errorMessage);
7414
+ throw new Error(errorMessage);
7415
+ }
7331
7416
  const cachedAuthToken = getCacheAuthToken();
7332
7417
  if (embedConfig.disableTokenVerification) {
7333
7418
  logger$3.info('Token verification is disabled. Assuming token is valid.');
@@ -8056,7 +8141,7 @@ class AnswerService {
8056
8141
  async getTML() {
8057
8142
  const { object } = await this.executeQuery(getAnswerTML, {});
8058
8143
  const edoc = object[0].edoc;
8059
- const YAML = await import('./index-B_mxAan8.js');
8144
+ const YAML = await import('./index-BpSohedu.js');
8060
8145
  const parsedDoc = YAML.parse(edoc);
8061
8146
  return {
8062
8147
  answer: {
@@ -17395,7 +17480,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
17395
17480
  return e;
17396
17481
  }
17397
17482
 
17398
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.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 | npx coveralls-next","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-next":"^5.0.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,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};
17483
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.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 tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.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 | npx coveralls-next","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-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",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,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};
17399
17484
 
17400
17485
  /**
17401
17486
  * Reloads the ThoughtSpot iframe.
@@ -17706,10 +17791,10 @@ class TsEmbed {
17706
17791
  };
17707
17792
  this.showPreRenderByDefault = false;
17708
17793
  /**
17709
- * @hidden
17710
- * Internal state to track if the embed container is loaded.
17711
- * This is used to trigger events after the embed container is loaded.
17712
- */
17794
+ * @hidden
17795
+ * Internal state to track if the embed container is loaded.
17796
+ * This is used to trigger events after the embed container is loaded.
17797
+ */
17713
17798
  this.isEmbedContainerLoaded = false;
17714
17799
  /**
17715
17800
  * @hidden
@@ -17768,10 +17853,10 @@ class TsEmbed {
17768
17853
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
17769
17854
  ...viewConfig,
17770
17855
  });
17856
+ const embedConfig = getEmbedConfig();
17857
+ this.embedConfig = embedConfig;
17771
17858
  this.hostEventClient = new HostEventClient(this.iFrame);
17772
17859
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
17773
- const embedConfig = getEmbedConfig();
17774
- this.embedConfig = embedConfig;
17775
17860
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
17776
17861
  this.embedConfig.authTriggerContainer = domSelector;
17777
17862
  }
@@ -17967,6 +18052,11 @@ class TsEmbed {
17967
18052
  .join('/');
17968
18053
  return `${basePath}#`;
17969
18054
  }
18055
+ getUpdateEmbedParamsObject() {
18056
+ let queryParams = this.getEmbedParamsObject();
18057
+ queryParams = { ...this.viewConfig, ...queryParams };
18058
+ return queryParams;
18059
+ }
17970
18060
  /**
17971
18061
  * Common query params set for all the embed modes.
17972
18062
  * @param queryParams
@@ -18116,9 +18206,13 @@ class TsEmbed {
18116
18206
  return path;
18117
18207
  }
18118
18208
  getEmbedParams() {
18119
- const queryParams = this.getBaseQueryParams();
18209
+ const queryParams = this.getEmbedParamsObject();
18120
18210
  return getQueryParamString(queryParams);
18121
18211
  }
18212
+ getEmbedParamsObject() {
18213
+ const params = this.getBaseQueryParams();
18214
+ return params;
18215
+ }
18122
18216
  getRootIframeSrc() {
18123
18217
  const query = this.getEmbedParams();
18124
18218
  return this.getEmbedBasePath(query);
@@ -18589,13 +18683,17 @@ class TsEmbed {
18589
18683
  * Creates the preRender shell
18590
18684
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
18591
18685
  */
18592
- async preRender(showPreRenderByDefault = false) {
18686
+ async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
18593
18687
  if (!this.viewConfig.preRenderId) {
18594
18688
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
18595
18689
  return this;
18596
18690
  }
18597
18691
  this.isPreRendered = true;
18598
18692
  this.showPreRenderByDefault = showPreRenderByDefault;
18693
+ const isAlreadyRendered = this.connectPreRendered();
18694
+ if (isAlreadyRendered && !replaceExistingPreRender) {
18695
+ return this;
18696
+ }
18599
18697
  return this.handleRenderForPrerender();
18600
18698
  }
18601
18699
  /**
@@ -18679,7 +18777,12 @@ class TsEmbed {
18679
18777
  return this.preRender(true);
18680
18778
  }
18681
18779
  this.validatePreRenderViewConfig(this.viewConfig);
18780
+ logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
18781
+ this.executeAfterEmbedContainerLoaded(() => {
18782
+ this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
18783
+ });
18682
18784
  }
18785
+ this.beforePrerenderVisible();
18683
18786
  if (this.el) {
18684
18787
  this.syncPreRenderStyle();
18685
18788
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -18696,7 +18799,6 @@ class TsEmbed {
18696
18799
  this.resizeObserver.observe(this.el);
18697
18800
  }
18698
18801
  }
18699
- this.beforePrerenderVisible();
18700
18802
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
18701
18803
  this.subscribeToEvents();
18702
18804
  // Setup fullscreen change handler for prerendered components
@@ -19062,7 +19164,7 @@ class AppEmbed extends V1Embed {
19062
19164
  * embedded Liveboard or visualization.
19063
19165
  */
19064
19166
  getEmbedParams() {
19065
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
19167
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
19066
19168
  let params = {};
19067
19169
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
19068
19170
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -19127,6 +19229,9 @@ class AppEmbed extends V1Embed {
19127
19229
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
19128
19230
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
19129
19231
  }
19232
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
19233
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19234
+ }
19130
19235
  params[Param.DataPanelV2Enabled] = dataPanelV2;
19131
19236
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
19132
19237
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -19474,9 +19579,14 @@ class LiveboardEmbed extends V1Embed {
19474
19579
  * embedded Liveboard or visualization.
19475
19580
  */
19476
19581
  getEmbedParams() {
19582
+ const params = this.getEmbedParamsObject();
19583
+ const queryParams = getQueryParamString(params, true);
19584
+ return queryParams;
19585
+ }
19586
+ getEmbedParamsObject() {
19477
19587
  let params = {};
19478
19588
  params = this.getBaseQueryParams(params);
19479
- 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, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
19589
+ 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 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
19480
19590
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
19481
19591
  || this.viewConfig.preventPinboardFilterRemoval;
19482
19592
  if (fullHeight === true) {
@@ -19535,6 +19645,12 @@ class LiveboardEmbed extends V1Embed {
19535
19645
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
19536
19646
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
19537
19647
  }
19648
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
19649
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19650
+ }
19651
+ if (showSpotterLimitations !== undefined) {
19652
+ params[Param.ShowSpotterLimitations] = showSpotterLimitations;
19653
+ }
19538
19654
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
19539
19655
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
19540
19656
  params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
@@ -19544,8 +19660,8 @@ class LiveboardEmbed extends V1Embed {
19544
19660
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
19545
19661
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
19546
19662
  params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
19547
- const queryParams = getQueryParamString(params, true);
19548
- return queryParams;
19663
+ getQueryParamString(params, true);
19664
+ return params;
19549
19665
  }
19550
19666
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
19551
19667
  let suffix = `/embed/viz/${liveboardId}`;
@@ -19787,11 +19903,9 @@ class SearchEmbed extends TsEmbed {
19787
19903
  const defaultAppInitData = await super.getAppInitData();
19788
19904
  return { ...defaultAppInitData, ...this.getSearchInitData() };
19789
19905
  }
19790
- getEmbedParams() {
19906
+ getEmbedParamsObject() {
19791
19907
  var _a;
19792
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
19793
- /* eslint-disable-next-line max-len */
19794
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
19908
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
19795
19909
  const queryParams = this.getBaseQueryParams();
19796
19910
  queryParams[Param.HideActions] = [
19797
19911
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -19824,7 +19938,6 @@ class SearchEmbed extends TsEmbed {
19824
19938
  queryParams[Param.HideSearchBar] = true;
19825
19939
  }
19826
19940
  if (isOnBeforeGetVizDataInterceptEnabled) {
19827
- /* eslint-disable-next-line max-len */
19828
19941
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
19829
19942
  }
19830
19943
  if (!focusSearchBarOnRender) {
@@ -19837,20 +19950,22 @@ class SearchEmbed extends TsEmbed {
19837
19950
  queryParams[Param.UseLastSelectedDataSource] = false;
19838
19951
  }
19839
19952
  queryParams[Param.searchEmbed] = true;
19840
- /* eslint-disable-next-line max-len */
19841
19953
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
19842
19954
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
19843
19955
  if (dataPanelCustomGroupsAccordionInitialState
19844
19956
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
19845
19957
  || dataPanelCustomGroupsAccordionInitialState
19846
19958
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
19847
- /* eslint-disable-next-line max-len */
19848
19959
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
19849
19960
  }
19850
19961
  else {
19851
- /* eslint-disable-next-line max-len */
19852
19962
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
19853
19963
  }
19964
+ return queryParams;
19965
+ }
19966
+ getEmbedParams() {
19967
+ const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
19968
+ const queryParams = this.getEmbedParamsObject();
19854
19969
  let query = '';
19855
19970
  const queryParamsString = getQueryParamString(queryParams, true);
19856
19971
  if (queryParamsString) {
@@ -19906,15 +20021,9 @@ class SearchBarEmbed extends TsEmbed {
19906
20021
  this.embedComponentType = 'SearchBarEmbed';
19907
20022
  this.viewConfig = viewConfig;
19908
20023
  }
19909
- /**
19910
- * Construct the URL of the embedded ThoughtSpot search to be
19911
- * loaded in the iframe
19912
- * @param dataSources A list of data source GUIDs
19913
- */
19914
- getIFrameSrc() {
20024
+ getEmbedParamsObject() {
19915
20025
  var _a;
19916
20026
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
19917
- const path = 'search-bar-embed';
19918
20027
  const queryParams = this.getBaseQueryParams();
19919
20028
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
19920
20029
  if (dataSources && dataSources.length) {
@@ -19936,6 +20045,16 @@ class SearchBarEmbed extends TsEmbed {
19936
20045
  queryParams[Param.UseLastSelectedDataSource] = false;
19937
20046
  }
19938
20047
  queryParams[Param.searchEmbed] = true;
20048
+ return queryParams;
20049
+ }
20050
+ /**
20051
+ * Construct the URL of the embedded ThoughtSpot search to be
20052
+ * loaded in the iframe
20053
+ * @param dataSources A list of data source GUIDs
20054
+ */
20055
+ getIFrameSrc() {
20056
+ const queryParams = this.getEmbedParamsObject();
20057
+ const path = 'search-bar-embed';
19939
20058
  let query = '';
19940
20059
  const queryParamsString = getQueryParamString(queryParams, true);
19941
20060
  if (queryParamsString) {
@@ -20358,13 +20477,17 @@ class ConversationMessage extends TsEmbed {
20358
20477
  super(container, viewConfig);
20359
20478
  this.viewConfig = viewConfig;
20360
20479
  }
20361
- getIframeSrc() {
20480
+ getEmbedParamsObject() {
20362
20481
  var _a;
20363
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
20364
- const path = 'conv-assist-answer';
20365
20482
  const queryParams = this.getBaseQueryParams();
20366
20483
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
20367
20484
  queryParams[Param.isSpotterAgentEmbed] = true;
20485
+ return queryParams;
20486
+ }
20487
+ getIframeSrc() {
20488
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
20489
+ const path = 'conv-assist-answer';
20490
+ const queryParams = this.getEmbedParamsObject();
20368
20491
  let query = '';
20369
20492
  const queryParamsString = getQueryParamString(queryParams, true);
20370
20493
  if (queryParamsString) {
@@ -20525,9 +20648,8 @@ class SpotterEmbed extends TsEmbed {
20525
20648
  super(container, viewConfig);
20526
20649
  this.viewConfig = viewConfig;
20527
20650
  }
20528
- getIframeSrc() {
20651
+ getEmbedParamsObject() {
20529
20652
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20530
- const path = 'insights/conv-assist';
20531
20653
  if (!worksheetId) {
20532
20654
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
20533
20655
  }
@@ -20548,6 +20670,12 @@ class SpotterEmbed extends TsEmbed {
20548
20670
  if (!isUndefined_1(hideSampleQuestions)) {
20549
20671
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
20550
20672
  }
20673
+ return queryParams;
20674
+ }
20675
+ getIframeSrc() {
20676
+ const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20677
+ const path = 'insights/conv-assist';
20678
+ const queryParams = this.getEmbedParamsObject();
20551
20679
  let query = '';
20552
20680
  const queryParamsString = getQueryParamString(queryParams, true);
20553
20681
  if (queryParamsString) {
@@ -20619,12 +20747,7 @@ class SageEmbed extends V1Embed {
20619
20747
  viewConfig.embedComponentType = 'SageEmbed';
20620
20748
  super(domSelector, viewConfig);
20621
20749
  }
20622
- /**
20623
- * Constructs a map of parameters to be passed on to the
20624
- * embedded Eureka or Sage search page.
20625
- * @returns {string} query string
20626
- */
20627
- getEmbedParams() {
20750
+ getEmbedParamsObject() {
20628
20751
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
20629
20752
  const params = this.getBaseQueryParams();
20630
20753
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -20639,6 +20762,15 @@ class SageEmbed extends V1Embed {
20639
20762
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
20640
20763
  params[Param.IsProductTour] = !!isProductTour;
20641
20764
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
20765
+ return params;
20766
+ }
20767
+ /**
20768
+ * Constructs a map of parameters to be passed on to the
20769
+ * embedded Eureka or Sage search page.
20770
+ * @returns {string} query string
20771
+ */
20772
+ getEmbedParams() {
20773
+ const params = this.getEmbedParamsObject();
20642
20774
  return getQueryParamString(params, true);
20643
20775
  }
20644
20776
  /**