@thoughtspot/visual-embed-sdk 1.39.1 → 1.39.2-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 (190) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.spec.js +9 -0
  3. package/cjs/src/config.spec.js.map +1 -1
  4. package/cjs/src/embed/app.d.ts +75 -15
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +69 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +374 -12
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +19 -7
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +24 -4
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  15. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.spec.js +28 -0
  17. package/cjs/src/embed/conversation.spec.js.map +1 -1
  18. package/cjs/src/embed/embedConfig.d.ts +9 -7
  19. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  20. package/cjs/src/embed/embedConfig.js +9 -7
  21. package/cjs/src/embed/embedConfig.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -17
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +48 -4
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +215 -11
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/embed/ts-embed.d.ts +5 -0
  29. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  30. package/cjs/src/embed/ts-embed.js +16 -1
  31. package/cjs/src/embed/ts-embed.js.map +1 -1
  32. package/cjs/src/embed/ts-embed.spec.js +164 -0
  33. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  34. package/cjs/src/errors.d.ts +1 -0
  35. package/cjs/src/errors.d.ts.map +1 -1
  36. package/cjs/src/errors.js +1 -0
  37. package/cjs/src/errors.js.map +1 -1
  38. package/cjs/src/index.d.ts +2 -2
  39. package/cjs/src/index.d.ts.map +1 -1
  40. package/cjs/src/index.js +2 -1
  41. package/cjs/src/index.js.map +1 -1
  42. package/cjs/src/react/all-types-export.d.ts +1 -1
  43. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  44. package/cjs/src/react/all-types-export.js +3 -2
  45. package/cjs/src/react/all-types-export.js.map +1 -1
  46. package/cjs/src/react/index.d.ts +71 -20
  47. package/cjs/src/react/index.d.ts.map +1 -1
  48. package/cjs/src/react/index.js +79 -42
  49. package/cjs/src/react/index.js.map +1 -1
  50. package/cjs/src/react/index.spec.js +436 -100
  51. package/cjs/src/react/index.spec.js.map +1 -1
  52. package/cjs/src/types.d.ts +80 -6
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +45 -1
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  57. package/cjs/src/utils/graphql/nlsService/conversation-service.js +2 -0
  58. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  59. package/cjs/src/utils/processTrigger.js +2 -1
  60. package/cjs/src/utils/processTrigger.js.map +1 -1
  61. package/cjs/src/utils.d.ts +6 -0
  62. package/cjs/src/utils.d.ts.map +1 -1
  63. package/cjs/src/utils.js +23 -3
  64. package/cjs/src/utils.js.map +1 -1
  65. package/cjs/src/utils.spec.js +237 -1
  66. package/cjs/src/utils.spec.js.map +1 -1
  67. package/dist/{index-JaFaxrvQ.js → index-CmEQfuE3.js} +1 -1
  68. package/dist/index-DeFzsyFF.js +7371 -0
  69. package/dist/index-Dpf0rd6w.js +7371 -0
  70. package/dist/index-UuEbsISo.js +7447 -0
  71. package/dist/index-e3Uw3YFO.js +7371 -0
  72. package/dist/src/embed/app.d.ts +75 -15
  73. package/dist/src/embed/app.d.ts.map +1 -1
  74. package/dist/src/embed/bodyless-conversation.d.ts +19 -7
  75. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  76. package/dist/src/embed/embedConfig.d.ts +9 -7
  77. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  78. package/dist/src/embed/liveboard.d.ts +56 -17
  79. package/dist/src/embed/liveboard.d.ts.map +1 -1
  80. package/dist/src/embed/ts-embed.d.ts +5 -0
  81. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  82. package/dist/src/errors.d.ts +1 -0
  83. package/dist/src/errors.d.ts.map +1 -1
  84. package/dist/src/index.d.ts +2 -2
  85. package/dist/src/index.d.ts.map +1 -1
  86. package/dist/src/react/all-types-export.d.ts +1 -1
  87. package/dist/src/react/all-types-export.d.ts.map +1 -1
  88. package/dist/src/react/index.d.ts +71 -20
  89. package/dist/src/react/index.d.ts.map +1 -1
  90. package/dist/src/types.d.ts +80 -6
  91. package/dist/src/types.d.ts.map +1 -1
  92. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  93. package/dist/src/utils.d.ts +6 -0
  94. package/dist/src/utils.d.ts.map +1 -1
  95. package/dist/tsembed-react.es.js +320 -78
  96. package/dist/tsembed-react.js +320 -76
  97. package/dist/tsembed.es.js +238 -31
  98. package/dist/tsembed.js +236 -29
  99. package/dist/visual-embed-sdk-react-full.d.ts +288 -72
  100. package/dist/visual-embed-sdk-react.d.ts +288 -72
  101. package/dist/visual-embed-sdk.d.ts +218 -53
  102. package/lib/package.json +1 -1
  103. package/lib/src/config.spec.js +9 -0
  104. package/lib/src/config.spec.js.map +1 -1
  105. package/lib/src/embed/app.d.ts +75 -15
  106. package/lib/src/embed/app.d.ts.map +1 -1
  107. package/lib/src/embed/app.js +69 -9
  108. package/lib/src/embed/app.js.map +1 -1
  109. package/lib/src/embed/app.spec.js +376 -14
  110. package/lib/src/embed/app.spec.js.map +1 -1
  111. package/lib/src/embed/bodyless-conversation.d.ts +19 -7
  112. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  113. package/lib/src/embed/bodyless-conversation.js +23 -4
  114. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  115. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  116. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  117. package/lib/src/embed/conversation.spec.js +30 -2
  118. package/lib/src/embed/conversation.spec.js.map +1 -1
  119. package/lib/src/embed/embedConfig.d.ts +9 -7
  120. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  121. package/lib/src/embed/embedConfig.js +9 -7
  122. package/lib/src/embed/embedConfig.js.map +1 -1
  123. package/lib/src/embed/liveboard.d.ts +56 -17
  124. package/lib/src/embed/liveboard.d.ts.map +1 -1
  125. package/lib/src/embed/liveboard.js +49 -5
  126. package/lib/src/embed/liveboard.js.map +1 -1
  127. package/lib/src/embed/liveboard.spec.js +215 -11
  128. package/lib/src/embed/liveboard.spec.js.map +1 -1
  129. package/lib/src/embed/ts-embed.d.ts +5 -0
  130. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  131. package/lib/src/embed/ts-embed.js +16 -1
  132. package/lib/src/embed/ts-embed.js.map +1 -1
  133. package/lib/src/embed/ts-embed.spec.js +164 -0
  134. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  135. package/lib/src/errors.d.ts +1 -0
  136. package/lib/src/errors.d.ts.map +1 -1
  137. package/lib/src/errors.js +1 -0
  138. package/lib/src/errors.js.map +1 -1
  139. package/lib/src/index.d.ts +2 -2
  140. package/lib/src/index.d.ts.map +1 -1
  141. package/lib/src/index.js +2 -2
  142. package/lib/src/index.js.map +1 -1
  143. package/lib/src/react/all-types-export.d.ts +1 -1
  144. package/lib/src/react/all-types-export.d.ts.map +1 -1
  145. package/lib/src/react/all-types-export.js +1 -1
  146. package/lib/src/react/all-types-export.js.map +1 -1
  147. package/lib/src/react/index.d.ts +71 -20
  148. package/lib/src/react/index.d.ts.map +1 -1
  149. package/lib/src/react/index.js +79 -43
  150. package/lib/src/react/index.js.map +1 -1
  151. package/lib/src/react/index.spec.js +439 -103
  152. package/lib/src/react/index.spec.js.map +1 -1
  153. package/lib/src/types.d.ts +80 -6
  154. package/lib/src/types.d.ts.map +1 -1
  155. package/lib/src/types.js +45 -1
  156. package/lib/src/types.js.map +1 -1
  157. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  158. package/lib/src/utils/graphql/nlsService/conversation-service.js +2 -0
  159. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  160. package/lib/src/utils/processTrigger.js +2 -1
  161. package/lib/src/utils/processTrigger.js.map +1 -1
  162. package/lib/src/utils.d.ts +6 -0
  163. package/lib/src/utils.d.ts.map +1 -1
  164. package/lib/src/utils.js +21 -2
  165. package/lib/src/utils.js.map +1 -1
  166. package/lib/src/utils.spec.js +238 -2
  167. package/lib/src/utils.spec.js.map +1 -1
  168. package/lib/src/visual-embed-sdk.d.ts +219 -54
  169. package/package.json +1 -1
  170. package/src/config.spec.ts +11 -0
  171. package/src/embed/app.spec.ts +479 -26
  172. package/src/embed/app.ts +133 -27
  173. package/src/embed/bodyless-conversation.spec.ts +9 -203
  174. package/src/embed/bodyless-conversation.ts +24 -10
  175. package/src/embed/conversation.spec.ts +40 -2
  176. package/src/embed/embedConfig.ts +10 -8
  177. package/src/embed/liveboard.spec.ts +256 -5
  178. package/src/embed/liveboard.ts +99 -27
  179. package/src/embed/ts-embed.spec.ts +225 -0
  180. package/src/embed/ts-embed.ts +19 -0
  181. package/src/errors.ts +1 -0
  182. package/src/index.ts +2 -0
  183. package/src/react/all-types-export.ts +2 -1
  184. package/src/react/index.spec.tsx +556 -157
  185. package/src/react/index.tsx +117 -51
  186. package/src/types.ts +117 -43
  187. package/src/utils/graphql/nlsService/conversation-service.ts +2 -0
  188. package/src/utils/processTrigger.ts +1 -1
  189. package/src/utils.spec.ts +279 -2
  190. package/src/utils.ts +28 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.2 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -278,7 +278,6 @@ const getOperationNameFromQuery = (query) => {
278
278
  function removeTypename(obj) {
279
279
  if (!obj || typeof obj !== 'object')
280
280
  return obj;
281
- // eslint-disable-next-line no-restricted-syntax
282
281
  for (const key in obj) {
283
282
  if (key === '__typename') {
284
283
  delete obj[key];
@@ -307,7 +306,11 @@ const setStyleProperties = (element, styleProperties) => {
307
306
  if (!(element === null || element === void 0 ? void 0 : element.style))
308
307
  return;
309
308
  Object.keys(styleProperties).forEach((styleProperty) => {
310
- element.style[styleProperty] = styleProperties[styleProperty].toString();
309
+ const styleKey = styleProperty;
310
+ const value = styleProperties[styleKey];
311
+ if (value !== undefined) {
312
+ element.style[styleKey] = value.toString();
313
+ }
311
314
  });
312
315
  };
313
316
  /**
@@ -435,6 +438,22 @@ const handleExitPresentMode = async () => {
435
438
  }
436
439
  }
437
440
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
441
+ };
442
+ const calculateVisibleElementData = (element) => {
443
+ const rect = element.getBoundingClientRect();
444
+ const windowHeight = window.innerHeight;
445
+ const windowWidth = window.innerWidth;
446
+ const frameRelativeTop = Math.max(rect.top, 0);
447
+ const frameRelativeLeft = Math.max(rect.left, 0);
448
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
449
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
450
+ const data = {
451
+ top: Math.max(0, rect.top * -1),
452
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
453
+ left: Math.max(0, rect.left * -1),
454
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
455
+ };
456
+ return data;
438
457
  };
439
458
 
440
459
  /**
@@ -653,6 +672,12 @@ var HomeLeftNavItem;
653
672
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
654
673
  */
655
674
  HomeLeftNavItem["Spotter"] = "spotter";
675
+ /**
676
+ * Favorites option in the insights left navigation,
677
+ * available when new navigation V3 is enabled.
678
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
679
+ */
680
+ HomeLeftNavItem["Favorites"] = "favorites";
656
681
  })(HomeLeftNavItem || (HomeLeftNavItem = {}));
657
682
  /**
658
683
  * A map of the supported runtime filter operations
@@ -1839,6 +1864,12 @@ var EmbedEvent;
1839
1864
  * @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
1840
1865
  */
1841
1866
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1867
+ /**
1868
+ * Emitted when a user requests the full height lazy load data.
1869
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1870
+ * @hidden
1871
+ */
1872
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1842
1873
  })(EmbedEvent || (EmbedEvent = {}));
1843
1874
  /**
1844
1875
  * Event types that can be triggered by the host application
@@ -2923,6 +2954,19 @@ var HostEvent;
2923
2954
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2924
2955
  */
2925
2956
  HostEvent["ExitPresentMode"] = "exitPresentMode";
2957
+ /**
2958
+ * Triggers the full height lazy load data.
2959
+ * @example
2960
+ * ```js
2961
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
2962
+ * console.log(payload);
2963
+ * });
2964
+ * ```
2965
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2966
+ *
2967
+ * @hidden
2968
+ */
2969
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2926
2970
  })(HostEvent || (HostEvent = {}));
2927
2971
  /**
2928
2972
  * The different visual modes that the data sources panel within
@@ -3028,6 +3072,7 @@ var Param;
3028
3072
  Param["Query"] = "query";
3029
3073
  Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
3030
3074
  Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
3075
+ Param["ListPageVersion"] = "listpageVersion";
3031
3076
  Param["PendoTrackingKey"] = "additionalPendoKey";
3032
3077
  Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
3033
3078
  Param["IsProductTour"] = "isProductTour";
@@ -3062,10 +3107,12 @@ var Param;
3062
3107
  Param["DataSourceId"] = "dataSourceId";
3063
3108
  Param["preAuthCache"] = "preAuthCache";
3064
3109
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
3065
- Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3110
+ Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
3066
3111
  Param["PrimaryAction"] = "primaryAction";
3067
3112
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3068
3113
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3114
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3115
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3069
3116
  })(Param || (Param = {}));
3070
3117
  /**
3071
3118
  * ThoughtSpot application pages include actions and menu commands
@@ -4288,6 +4335,22 @@ var Action;
4288
4335
  * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
4289
4336
  */
4290
4337
  Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
4338
+ /**
4339
+ * Action ID for hide or disable the
4340
+ * Spotter in conversation training widget.
4341
+ * The Add to Coaching feature is currently in beta
4342
+ * and is disabled by default on embed deployments.
4343
+ * To enable this feature on your instance,
4344
+ * contact ThoughtSpot Support.
4345
+ * @example
4346
+ * ```js
4347
+ * hiddenAction: [Action.InConversationTraining]
4348
+ * disabledActions: [Action.InConversationTraining]
4349
+ *
4350
+ * ```
4351
+ * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
4352
+ */
4353
+ Action["InConversationTraining"] = "InConversationTraining";
4291
4354
  })(Action || (Action = {}));
4292
4355
  var PrefetchFeatures;
4293
4356
  (function (PrefetchFeatures) {
@@ -6754,6 +6817,7 @@ const ERROR_MESSAGE = {
6754
6817
  CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
6755
6818
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
6756
6819
  RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
6820
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
6757
6821
  };
6758
6822
 
6759
6823
  const EndPoints = {
@@ -6961,13 +7025,14 @@ const configKey = 'embedConfig';
6961
7025
  *
6962
7026
  * @example
6963
7027
  * ```js
7028
+ * import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
7029
+ * // Call the getInitConfig method to retrieve the embed configuration
6964
7030
  * const config = getInitConfig();
7031
+ * // Log the configuration settings
6965
7032
  * console.log(config);
6966
7033
  * ```
6967
- * @example
6968
- *
6969
- * Returns the `EmbedConfig` object, which
6970
- * contains the configuration settings used to
7034
+ * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
7035
+ * object, which contains the configuration settings used to
6971
7036
  * initialize the SDK, including the following:
6972
7037
  *
6973
7038
  * - `thoughtSpotHost` - ThoughtSpot host URL
@@ -6976,9 +7041,10 @@ const configKey = 'embedConfig';
6976
7041
  * - `customizations` - Style, text, and icon customization settings
6977
7042
  * that were applied during the SDK initialization.
6978
7043
  *
6979
- * For a comprehensive list of embed configuration settings,
6980
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
7044
+ * The following JSON output shows the embed configuration
7045
+ * settings returned from the code in the previous example:
6981
7046
  *
7047
+ * @example
6982
7048
  * ```json
6983
7049
  * {
6984
7050
  * "thoughtSpotHost": "https://{ThoughtSpot-Host}",
@@ -7000,7 +7066,7 @@ const configKey = 'embedConfig';
7000
7066
  * "authTriggerContainer": "#your-own-div"
7001
7067
  * }
7002
7068
  * ```
7003
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.cl, and later
7069
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
7004
7070
  * @group Global methods
7005
7071
  */
7006
7072
  const getEmbedConfig = () => getValueFromWindow(configKey) || {};
@@ -7642,7 +7708,7 @@ class AnswerService {
7642
7708
  async getTML() {
7643
7709
  const { object } = await this.executeQuery(getAnswerTML, {});
7644
7710
  const edoc = object[0].edoc;
7645
- const YAML = await import('./index-JaFaxrvQ.js');
7711
+ const YAML = await import('./index-e3Uw3YFO.js');
7646
7712
  const parsedDoc = YAML.parse(edoc);
7647
7713
  return {
7648
7714
  answer: {
@@ -15542,7 +15608,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15542
15608
  return e;
15543
15609
  }
15544
15610
 
15545
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"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};
15611
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-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};
15546
15612
 
15547
15613
  /**
15548
15614
  * Reloads the ThoughtSpot iframe.
@@ -15565,7 +15631,8 @@ const reload = (iFrame) => {
15565
15631
  * @param channel
15566
15632
  */
15567
15633
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15568
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15634
+ var _a;
15635
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15569
15636
  }
15570
15637
  const TRIGGER_TIMEOUT = 30000;
15571
15638
  /**
@@ -15940,10 +16007,25 @@ class TsEmbed {
15940
16007
  // - cached auth info would be for wrong org
15941
16008
  // - info call response changes for each different overrideOrgId
15942
16009
  // 2. disablePreauthCache is explicitly set to true
16010
+ // 3. FullAppEmbed has primary navbar visible since:
16011
+ // - primary navbar requires fresh auth state for navigation
16012
+ // - cached auth may not reflect current user permissions
15943
16013
  const isDisabled = (this.viewConfig.overrideOrgId !== undefined
15944
- || this.embedConfig.disablePreauthCache === true);
16014
+ || this.embedConfig.disablePreauthCache === true
16015
+ || this.isFullAppEmbedWithVisiblePrimaryNavbar());
15945
16016
  return !isDisabled;
15946
16017
  }
16018
+ /**
16019
+ * Checks if current embed is FullAppEmbed with visible primary navbar
16020
+ * @returns boolean
16021
+ */
16022
+ isFullAppEmbedWithVisiblePrimaryNavbar() {
16023
+ const appViewConfig = this.viewConfig;
16024
+ // Check if this is a FullAppEmbed (AppEmbed)
16025
+ // showPrimaryNavbar defaults to true if not explicitly set to false
16026
+ return (appViewConfig.embedComponentType === 'AppEmbed'
16027
+ && appViewConfig.showPrimaryNavbar === true);
16028
+ }
15947
16029
  /**
15948
16030
  * fix for ts7.sep.cl
15949
16031
  * will be removed for ts7.oct.cl
@@ -16935,7 +17017,6 @@ class V1Embed extends TsEmbed {
16935
17017
  /**
16936
17018
  * Pages within the ThoughtSpot app that can be embedded.
16937
17019
  */
16938
- // eslint-disable-next-line no-shadow
16939
17020
  var Page;
16940
17021
  (function (Page) {
16941
17022
  /**
@@ -17021,16 +17102,46 @@ var HomePage;
17021
17102
  */
17022
17103
  HomePage["Modular"] = "v2";
17023
17104
  })(HomePage || (HomePage = {}));
17105
+ /**
17106
+ * Define the version of the list page
17107
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
17108
+ */
17109
+ var ListPage;
17110
+ (function (ListPage) {
17111
+ /**
17112
+ * List (v2) is the traditional List Experience.
17113
+ * It serves as the foundational version of the list page.
17114
+ */
17115
+ ListPage["List"] = "v2";
17116
+ /**
17117
+ * ListWithUXChanges (v3) introduces the new updated list page with UX changes.
17118
+ */
17119
+ ListPage["ListWithUXChanges"] = "v3";
17120
+ })(ListPage || (ListPage = {}));
17024
17121
  /**
17025
17122
  * Embeds full ThoughtSpot experience in a host application.
17026
17123
  * @group Embed components
17027
17124
  */
17028
17125
  class AppEmbed extends V1Embed {
17029
- // eslint-disable-next-line no-useless-constructor
17030
17126
  constructor(domSelector, viewConfig) {
17031
17127
  viewConfig.embedComponentType = 'AppEmbed';
17032
17128
  super(domSelector, viewConfig);
17033
17129
  this.defaultHeight = '100%';
17130
+ this.sendFullHeightLazyLoadData = () => {
17131
+ const data = calculateVisibleElementData(this.iFrame);
17132
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17133
+ };
17134
+ /**
17135
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17136
+ * It is used to send the visible coordinates data to the host application.
17137
+ * @param data The event payload
17138
+ * @param responder The responder function
17139
+ */
17140
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17141
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17142
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17143
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17144
+ };
17034
17145
  /**
17035
17146
  * Set the iframe height as per the computed height received
17036
17147
  * from the ThoughtSpot app.
@@ -17039,6 +17150,7 @@ class AppEmbed extends V1Embed {
17039
17150
  this.updateIFrameHeight = (data) => {
17040
17151
  var _a;
17041
17152
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17153
+ this.sendFullHeightLazyLoadData();
17042
17154
  };
17043
17155
  this.embedIframeCenter = (data, responder) => {
17044
17156
  const obj = this.getIframeCenter();
@@ -17068,6 +17180,7 @@ class AppEmbed extends V1Embed {
17068
17180
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17069
17181
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17070
17182
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17183
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17071
17184
  }
17072
17185
  }
17073
17186
  /**
@@ -17075,9 +17188,7 @@ class AppEmbed extends V1Embed {
17075
17188
  * embedded Liveboard or visualization.
17076
17189
  */
17077
17190
  getEmbedParams() {
17078
- 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,
17079
- /* eslint-disable-next-line max-len */
17080
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17191
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17081
17192
  let params = {};
17082
17193
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17083
17194
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17093,6 +17204,7 @@ class AppEmbed extends V1Embed {
17093
17204
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
17094
17205
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17095
17206
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17207
+ params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
17096
17208
  params = this.getBaseQueryParams(params);
17097
17209
  if (hideObjectSearch) {
17098
17210
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -17105,6 +17217,10 @@ class AppEmbed extends V1Embed {
17105
17217
  }
17106
17218
  if (fullHeight === true) {
17107
17219
  params[Param.fullHeight] = true;
17220
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17221
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17222
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17223
+ }
17108
17224
  }
17109
17225
  if (tag) {
17110
17226
  params[Param.Tag] = tag;
@@ -17125,7 +17241,6 @@ class AppEmbed extends V1Embed {
17125
17241
  params[Param.enableAskSage] = enableAskSage;
17126
17242
  }
17127
17243
  if (isOnBeforeGetVizDataInterceptEnabled) {
17128
- /* eslint-disable-next-line max-len */
17129
17244
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17130
17245
  }
17131
17246
  if (homePageSearchBarMode) {
@@ -17146,11 +17261,9 @@ class AppEmbed extends V1Embed {
17146
17261
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17147
17262
  || dataPanelCustomGroupsAccordionInitialState
17148
17263
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
17149
- /* eslint-disable-next-line max-len */
17150
17264
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17151
17265
  }
17152
17266
  else {
17153
- /* eslint-disable-next-line max-len */
17154
17267
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17155
17268
  }
17156
17269
  if (discoveryExperience) {
@@ -17163,6 +17276,10 @@ class AppEmbed extends V1Embed {
17163
17276
  if (discoveryExperience.homePage === HomePage.Modular) {
17164
17277
  params[Param.ModularHomeExperienceEnabled] = true;
17165
17278
  }
17279
+ // listPageVersion v3 will enable the new list page
17280
+ if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
17281
+ params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
17282
+ }
17166
17283
  }
17167
17284
  const queryParams = getQueryParamString(params, true);
17168
17285
  return queryParams;
@@ -17250,6 +17367,30 @@ class AppEmbed extends V1Embed {
17250
17367
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17251
17368
  }
17252
17369
  }
17370
+ /**
17371
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17372
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17373
+ */
17374
+ destroy() {
17375
+ super.destroy();
17376
+ this.unregisterLazyLoadEvents();
17377
+ }
17378
+ postRender() {
17379
+ this.registerLazyLoadEvents();
17380
+ }
17381
+ registerLazyLoadEvents() {
17382
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17383
+ // TODO: Use passive: true, install modernizr to check for passive
17384
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17385
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
17386
+ }
17387
+ }
17388
+ unregisterLazyLoadEvents() {
17389
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17390
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17391
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17392
+ }
17393
+ }
17253
17394
  /**
17254
17395
  * Renders the embedded application pages in the ThoughtSpot app.
17255
17396
  * @param renderOptions An object containing the page ID
@@ -17259,6 +17400,7 @@ class AppEmbed extends V1Embed {
17259
17400
  await super.render();
17260
17401
  const src = this.getIFrameSrc();
17261
17402
  await this.renderV1Embed(src);
17403
+ this.postRender();
17262
17404
  return this;
17263
17405
  }
17264
17406
  }
@@ -17363,6 +17505,21 @@ class LiveboardEmbed extends V1Embed {
17363
17505
  viewConfig.embedComponentType = 'LiveboardEmbed';
17364
17506
  super(domSelector, viewConfig);
17365
17507
  this.defaultHeight = 500;
17508
+ this.sendFullHeightLazyLoadData = () => {
17509
+ const data = calculateVisibleElementData(this.iFrame);
17510
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17511
+ };
17512
+ /**
17513
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17514
+ * It is used to send the visible coordinates data to the host application.
17515
+ * @param data The event payload
17516
+ * @param responder The responder function
17517
+ */
17518
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17519
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17520
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17521
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17522
+ };
17366
17523
  /**
17367
17524
  * Set the iframe height as per the computed height received
17368
17525
  * from the ThoughtSpot app.
@@ -17370,6 +17527,7 @@ class LiveboardEmbed extends V1Embed {
17370
17527
  */
17371
17528
  this.updateIFrameHeight = (data) => {
17372
17529
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
17530
+ this.sendFullHeightLazyLoadData();
17373
17531
  };
17374
17532
  this.embedIframeCenter = (data, responder) => {
17375
17533
  const obj = this.getIframeCenter();
@@ -17403,6 +17561,7 @@ class LiveboardEmbed extends V1Embed {
17403
17561
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17404
17562
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17405
17563
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17564
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17406
17565
  }
17407
17566
  }
17408
17567
  /**
@@ -17412,11 +17571,15 @@ class LiveboardEmbed extends V1Embed {
17412
17571
  getEmbedParams() {
17413
17572
  let params = {};
17414
17573
  params = this.getBaseQueryParams(params);
17415
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17574
+ 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;
17416
17575
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
17417
17576
  || this.viewConfig.preventPinboardFilterRemoval;
17418
17577
  if (fullHeight === true) {
17419
17578
  params[Param.fullHeight] = true;
17579
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17580
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17581
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17582
+ }
17420
17583
  }
17421
17584
  if (defaultHeight) {
17422
17585
  this.defaultHeight = defaultHeight;
@@ -17464,9 +17627,6 @@ class LiveboardEmbed extends V1Embed {
17464
17627
  if (dataSourceId !== undefined) {
17465
17628
  params[Param.DataSourceId] = dataSourceId;
17466
17629
  }
17467
- if (coverAndFilterOptionInPDF !== undefined) {
17468
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17469
- }
17470
17630
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17471
17631
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17472
17632
  }
@@ -17477,6 +17637,7 @@ class LiveboardEmbed extends V1Embed {
17477
17637
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17478
17638
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17479
17639
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17640
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17480
17641
  const queryParams = getQueryParamString(params, true);
17481
17642
  return queryParams;
17482
17643
  }
@@ -17574,6 +17735,30 @@ class LiveboardEmbed extends V1Embed {
17574
17735
  }
17575
17736
  return super.trigger(messageType, dataWithVizId);
17576
17737
  }
17738
+ /**
17739
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17740
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17741
+ */
17742
+ destroy() {
17743
+ super.destroy();
17744
+ this.unregisterLazyLoadEvents();
17745
+ }
17746
+ postRender() {
17747
+ this.registerLazyLoadEvents();
17748
+ }
17749
+ registerLazyLoadEvents() {
17750
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17751
+ // TODO: Use passive: true, install modernizr to check for passive
17752
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17753
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData);
17754
+ }
17755
+ }
17756
+ unregisterLazyLoadEvents() {
17757
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17758
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17759
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17760
+ }
17761
+ }
17577
17762
  /**
17578
17763
  * Render an embedded ThoughtSpot Liveboard or visualization
17579
17764
  * @param renderOptions An object specifying the Liveboard ID,
@@ -17584,6 +17769,7 @@ class LiveboardEmbed extends V1Embed {
17584
17769
  const src = this.getIFrameSrc();
17585
17770
  await this.renderV1Embed(src);
17586
17771
  this.showPreviewLoader();
17772
+ this.postRender();
17587
17773
  return this;
17588
17774
  }
17589
17775
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18235,6 +18421,8 @@ class Conversation {
18235
18421
  });
18236
18422
  const data = responses[0].data;
18237
18423
  return {
18424
+ convId: this.conversationId,
18425
+ messageId: responses[0].msgId,
18238
18426
  data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18239
18427
  error: null,
18240
18428
  };
@@ -18317,9 +18505,6 @@ class SpotterAgentEmbed {
18317
18505
  return { error };
18318
18506
  }
18319
18507
  const container = document.createElement('div');
18320
- if (this.viewConfig.containerClassName) {
18321
- container.className = this.viewConfig.containerClassName;
18322
- }
18323
18508
  const embed = new ConversationMessage(container, {
18324
18509
  ...this.viewConfig,
18325
18510
  sessionId: data.sessionId,
@@ -18330,6 +18515,28 @@ class SpotterAgentEmbed {
18330
18515
  await embed.render();
18331
18516
  return { container, viz: embed };
18332
18517
  }
18518
+ /**
18519
+ * Send a message to the conversation service and return only the data.
18520
+ * @param userMessage - The message to send to the conversation service.
18521
+ * @returns The data from the conversation service.
18522
+ */
18523
+ async sendMessageData(userMessage) {
18524
+ try {
18525
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18526
+ if (error) {
18527
+ return { error };
18528
+ }
18529
+ return { data: {
18530
+ sessionId: data.sessionId,
18531
+ genNo: data.genNo,
18532
+ acSessionId: data.stateKey.transactionId,
18533
+ acGenNo: data.stateKey.generationNumber,
18534
+ } };
18535
+ }
18536
+ catch (error) {
18537
+ return { error: error };
18538
+ }
18539
+ }
18333
18540
  }
18334
18541
  /**
18335
18542
  * Create a conversation embed, which can be integrated inside
@@ -19052,4 +19259,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
19052
19259
  return result;
19053
19260
  };
19054
19261
 
19055
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
19262
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };