@thoughtspot/visual-embed-sdk 1.33.0-alpha.2 → 1.33.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 (198) hide show
  1. package/cjs/package.json +6 -24
  2. package/cjs/src/css-variables.d.ts +46 -3
  3. package/cjs/src/css-variables.d.ts.map +1 -1
  4. package/cjs/src/embed/app.d.ts +47 -27
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +10 -1
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +32 -0
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/base.d.ts +35 -33
  11. package/cjs/src/embed/base.d.ts.map +1 -1
  12. package/cjs/src/embed/base.js +35 -33
  13. package/cjs/src/embed/base.js.map +1 -1
  14. package/cjs/src/embed/embed.spec.js +0 -19
  15. package/cjs/src/embed/embed.spec.js.map +1 -1
  16. package/cjs/src/embed/liveboard.d.ts +42 -0
  17. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  18. package/cjs/src/embed/liveboard.js +6 -1
  19. package/cjs/src/embed/liveboard.js.map +1 -1
  20. package/cjs/src/embed/liveboard.spec.js +43 -0
  21. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  22. package/cjs/src/embed/search.d.ts +0 -26
  23. package/cjs/src/embed/search.d.ts.map +1 -1
  24. package/cjs/src/embed/search.js.map +1 -1
  25. package/cjs/src/embed/ts-embed.d.ts +0 -1
  26. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  27. package/cjs/src/embed/ts-embed.js +8 -12
  28. package/cjs/src/embed/ts-embed.js.map +1 -1
  29. package/cjs/src/embed/ts-embed.spec.js +0 -9
  30. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  31. package/cjs/src/mixpanel-service.d.ts +4 -0
  32. package/cjs/src/mixpanel-service.d.ts.map +1 -1
  33. package/cjs/src/mixpanel-service.js +4 -0
  34. package/cjs/src/mixpanel-service.js.map +1 -1
  35. package/cjs/src/tokenizedFetch.d.ts.map +1 -1
  36. package/cjs/src/tokenizedFetch.js +5 -1
  37. package/cjs/src/tokenizedFetch.js.map +1 -1
  38. package/cjs/src/types.d.ts +179 -22
  39. package/cjs/src/types.d.ts.map +1 -1
  40. package/cjs/src/types.js +143 -12
  41. package/cjs/src/types.js.map +1 -1
  42. package/cjs/src/utils/authService/authService.spec.js +3 -1
  43. package/cjs/src/utils/authService/authService.spec.js.map +1 -1
  44. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  45. package/cjs/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  46. package/cjs/src/utils/graphql/answerService/answer-queries.js +9 -2
  47. package/cjs/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  48. package/cjs/src/utils/graphql/answerService/answerService.d.ts +15 -0
  49. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  50. package/cjs/src/utils/graphql/answerService/answerService.js +25 -0
  51. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  52. package/cjs/src/utils/graphql/answerService/answerService.spec.js +53 -0
  53. package/cjs/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  54. package/cjs/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  55. package/cjs/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  56. package/cjs/src/utils/graphql/graphql-request.spec.js +36 -0
  57. package/cjs/src/utils/graphql/graphql-request.spec.js.map +1 -0
  58. package/cjs/src/utils/processData.js +2 -2
  59. package/cjs/src/utils/processData.js.map +1 -1
  60. package/cjs/src/utils/processData.spec.js +14 -0
  61. package/cjs/src/utils/processData.spec.js.map +1 -1
  62. package/cjs/src/utils/processTrigger.d.ts +1 -0
  63. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  64. package/cjs/src/utils/processTrigger.js +3 -3
  65. package/cjs/src/utils/processTrigger.js.map +1 -1
  66. package/cjs/src/utils/processTrigger.spec.js +10 -0
  67. package/cjs/src/utils/processTrigger.spec.js.map +1 -1
  68. package/cjs/src/utils.d.ts.map +1 -1
  69. package/cjs/src/utils.js +1 -3
  70. package/cjs/src/utils.js.map +1 -1
  71. package/dist/src/css-variables.d.ts +46 -3
  72. package/dist/src/css-variables.d.ts.map +1 -1
  73. package/dist/src/embed/app.d.ts +47 -27
  74. package/dist/src/embed/app.d.ts.map +1 -1
  75. package/dist/src/embed/base.d.ts +35 -33
  76. package/dist/src/embed/base.d.ts.map +1 -1
  77. package/dist/src/embed/liveboard.d.ts +42 -0
  78. package/dist/src/embed/liveboard.d.ts.map +1 -1
  79. package/dist/src/embed/search.d.ts +0 -26
  80. package/dist/src/embed/search.d.ts.map +1 -1
  81. package/dist/src/embed/ts-embed.d.ts +0 -1
  82. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  83. package/dist/src/mixpanel-service.d.ts +4 -0
  84. package/dist/src/mixpanel-service.d.ts.map +1 -1
  85. package/dist/src/tokenizedFetch.d.ts.map +1 -1
  86. package/dist/src/types.d.ts +179 -22
  87. package/dist/src/types.d.ts.map +1 -1
  88. package/dist/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  89. package/dist/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  90. package/dist/src/utils/graphql/answerService/answerService.d.ts +15 -0
  91. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  92. package/dist/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  93. package/dist/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  94. package/dist/src/utils/processTrigger.d.ts +1 -0
  95. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  96. package/dist/src/utils.d.ts.map +1 -1
  97. package/dist/tsembed-react.es.js +442 -107
  98. package/dist/tsembed-react.js +385 -106
  99. package/dist/tsembed.es.js +477 -140
  100. package/dist/tsembed.js +420 -139
  101. package/dist/visual-embed-sdk-react-full.d.ts +368 -112
  102. package/dist/visual-embed-sdk-react.d.ts +368 -112
  103. package/dist/visual-embed-sdk.d.ts +368 -112
  104. package/lib/package.json +6 -24
  105. package/lib/src/css-variables.d.ts +46 -3
  106. package/lib/src/css-variables.d.ts.map +1 -1
  107. package/lib/src/embed/app.d.ts +47 -27
  108. package/lib/src/embed/app.d.ts.map +1 -1
  109. package/lib/src/embed/app.js +10 -1
  110. package/lib/src/embed/app.js.map +1 -1
  111. package/lib/src/embed/app.spec.js +32 -0
  112. package/lib/src/embed/app.spec.js.map +1 -1
  113. package/lib/src/embed/base.d.ts +35 -33
  114. package/lib/src/embed/base.d.ts.map +1 -1
  115. package/lib/src/embed/base.js +35 -33
  116. package/lib/src/embed/base.js.map +1 -1
  117. package/lib/src/embed/embed.spec.js +0 -19
  118. package/lib/src/embed/embed.spec.js.map +1 -1
  119. package/lib/src/embed/liveboard.d.ts +42 -0
  120. package/lib/src/embed/liveboard.d.ts.map +1 -1
  121. package/lib/src/embed/liveboard.js +6 -1
  122. package/lib/src/embed/liveboard.js.map +1 -1
  123. package/lib/src/embed/liveboard.spec.js +43 -0
  124. package/lib/src/embed/liveboard.spec.js.map +1 -1
  125. package/lib/src/embed/search.d.ts +0 -26
  126. package/lib/src/embed/search.d.ts.map +1 -1
  127. package/lib/src/embed/search.js.map +1 -1
  128. package/lib/src/embed/ts-embed.d.ts +0 -1
  129. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  130. package/lib/src/embed/ts-embed.js +8 -12
  131. package/lib/src/embed/ts-embed.js.map +1 -1
  132. package/lib/src/embed/ts-embed.spec.js +0 -9
  133. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  134. package/lib/src/mixpanel-service.d.ts +4 -0
  135. package/lib/src/mixpanel-service.d.ts.map +1 -1
  136. package/lib/src/mixpanel-service.js +4 -0
  137. package/lib/src/mixpanel-service.js.map +1 -1
  138. package/lib/src/tokenizedFetch.d.ts.map +1 -1
  139. package/lib/src/tokenizedFetch.js +5 -1
  140. package/lib/src/tokenizedFetch.js.map +1 -1
  141. package/lib/src/types.d.ts +179 -22
  142. package/lib/src/types.d.ts.map +1 -1
  143. package/lib/src/types.js +143 -12
  144. package/lib/src/types.js.map +1 -1
  145. package/lib/src/utils/authService/authService.spec.js +3 -1
  146. package/lib/src/utils/authService/authService.spec.js.map +1 -1
  147. package/lib/src/utils/graphql/answerService/answer-queries.d.ts +1 -0
  148. package/lib/src/utils/graphql/answerService/answer-queries.d.ts.map +1 -1
  149. package/lib/src/utils/graphql/answerService/answer-queries.js +8 -1
  150. package/lib/src/utils/graphql/answerService/answer-queries.js.map +1 -1
  151. package/lib/src/utils/graphql/answerService/answerService.d.ts +15 -0
  152. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  153. package/lib/src/utils/graphql/answerService/answerService.js +25 -0
  154. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  155. package/lib/src/utils/graphql/answerService/answerService.spec.js +54 -1
  156. package/lib/src/utils/graphql/answerService/answerService.spec.js.map +1 -1
  157. package/lib/src/utils/graphql/graphql-request.spec.d.ts +2 -0
  158. package/lib/src/utils/graphql/graphql-request.spec.d.ts.map +1 -0
  159. package/lib/src/utils/graphql/graphql-request.spec.js +33 -0
  160. package/lib/src/utils/graphql/graphql-request.spec.js.map +1 -0
  161. package/lib/src/utils/processData.js +2 -2
  162. package/lib/src/utils/processData.js.map +1 -1
  163. package/lib/src/utils/processData.spec.js +14 -0
  164. package/lib/src/utils/processData.spec.js.map +1 -1
  165. package/lib/src/utils/processTrigger.d.ts +1 -0
  166. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  167. package/lib/src/utils/processTrigger.js +1 -1
  168. package/lib/src/utils/processTrigger.js.map +1 -1
  169. package/lib/src/utils/processTrigger.spec.js +10 -0
  170. package/lib/src/utils/processTrigger.spec.js.map +1 -1
  171. package/lib/src/utils.d.ts.map +1 -1
  172. package/lib/src/utils.js +1 -3
  173. package/lib/src/utils.js.map +1 -1
  174. package/lib/src/visual-embed-sdk.d.ts +368 -112
  175. package/package.json +6 -24
  176. package/src/css-variables.ts +49 -3
  177. package/src/embed/app.spec.ts +47 -0
  178. package/src/embed/app.ts +54 -26
  179. package/src/embed/base.ts +35 -33
  180. package/src/embed/embed.spec.ts +0 -22
  181. package/src/embed/liveboard.spec.ts +62 -0
  182. package/src/embed/liveboard.ts +52 -0
  183. package/src/embed/search.ts +0 -26
  184. package/src/embed/ts-embed.spec.ts +0 -11
  185. package/src/embed/ts-embed.ts +9 -12
  186. package/src/mixpanel-service.ts +4 -0
  187. package/src/tokenizedFetch.ts +5 -1
  188. package/src/types.ts +180 -21
  189. package/src/utils/authService/authService.spec.ts +3 -1
  190. package/src/utils/graphql/answerService/answer-queries.ts +9 -1
  191. package/src/utils/graphql/answerService/answerService.spec.ts +69 -0
  192. package/src/utils/graphql/answerService/answerService.ts +35 -0
  193. package/src/utils/graphql/graphql-request.spec.ts +38 -0
  194. package/src/utils/processData.spec.ts +16 -0
  195. package/src/utils/processData.ts +2 -2
  196. package/src/utils/processTrigger.spec.ts +19 -0
  197. package/src/utils/processTrigger.ts +1 -1
  198. package/src/utils.ts +1 -3
@@ -200,7 +200,6 @@ const checkReleaseVersionInBeta = (releaseVersion, suppressBetaWarning) => {
200
200
  };
201
201
  const getCustomisations = (embedConfig, viewConfig) => {
202
202
  var _a, _b, _c, _d;
203
- const customCssUrlFromEmbedConfig = embedConfig.customCssUrl;
204
203
  const customizationsFromViewConfig = viewConfig.customizations;
205
204
  const customizationsFromEmbedConfig = embedConfig.customizations
206
205
  || embedConfig.customisations;
@@ -213,8 +212,7 @@ const getCustomisations = (embedConfig, viewConfig) => {
213
212
  ...(_b = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _b === void 0 ? void 0 : _b.customCSS,
214
213
  },
215
214
  customCSSUrl: ((_c = customizationsFromViewConfig === null || customizationsFromViewConfig === void 0 ? void 0 : customizationsFromViewConfig.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl)
216
- || ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl)
217
- || customCssUrlFromEmbedConfig,
215
+ || ((_d = customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.style) === null || _d === void 0 ? void 0 : _d.customCSSUrl),
218
216
  },
219
217
  content: {
220
218
  ...customizationsFromEmbedConfig === null || customizationsFromEmbedConfig === void 0 ? void 0 : customizationsFromEmbedConfig.content,
@@ -634,6 +632,28 @@ var HomepageModule;
634
632
  * console.log('Drilldown event', drilldown);
635
633
  * }));
636
634
  * ```
635
+ *
636
+ * If you are using React components for embedding, you can register to any
637
+ * events from the `EmbedEvent` list by using the `on<EventName>` convention.
638
+ * For example,`onAlert`, `onCopyToClipboard` and so on.
639
+ *
640
+ * @example
641
+ * ```js
642
+ * // ...
643
+ * const MyComponent = ({ dataSources }) => {
644
+ * const onLoad = () => {
645
+ * console.log(EmbedEvent.Load, {});
646
+ * };
647
+ *
648
+ * return (
649
+ * <SearchEmbed
650
+ * dataSources={dataSources}
651
+ * onLoad = {logEvent("Load")}
652
+ * />
653
+ * );
654
+ * };
655
+ * ```
656
+ *
637
657
  * @group Events
638
658
  */
639
659
  // eslint-disable-next-line no-shadow
@@ -1504,21 +1524,61 @@ var EmbedEvent;
1504
1524
  */
1505
1525
  EmbedEvent["Rename"] = "rename";
1506
1526
  /**
1507
- * Emitted when user wants to intercept the search execution
1527
+ * Emitted if the user wants to intercept the search execution
1528
+ * and implement logic to decide whether to run the search or not
1529
+ *
1530
+ * Prerequisite: Set isOnBeforeGetVizDataInterceptEnabled : true
1531
+ * for this embed event to get emitted.
1508
1532
  *
1509
- * Set IsOnBeforeGetVizDataInterceptEnabled : true to use
1510
- * this embed event
1533
+ * @param: payload
1534
+ * @param: responder
1535
+ * Contains elements that lets developers define whether ThoughtSpot
1536
+ * will run the search or not, and if not, which error message to provide.
1511
1537
  *
1538
+ * execute: When execute returns true, the search will be run.
1539
+ * When execute returns false, the search will not be executed.
1540
+ *
1541
+ * error: Developers can customize the user facing message when execute is
1542
+ * set to false using the error parameter in responder
1543
+ *
1544
+ * @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
1545
+ *
1546
+ * @example
1512
1547
  *```js
1513
- * searchEmbed.on(EmbedEvent.OnBeforeGetVizDataIntercept,
1548
+ * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1514
1549
  * (payload, responder) => {
1515
1550
  * responder({
1516
1551
  * data: {
1517
- * execute: true,
1518
- * }})
1552
+ * execute:false,
1553
+ * error: {
1554
+ * //Provide a custom error message to explain to your end user
1555
+ * //why their search did not run
1556
+ * errorText: "This search query cannot be run.
1557
+ * Please contact your administrator for more details."
1558
+ * }
1559
+ * }})
1560
+ * })
1561
+ * ```
1562
+ *
1563
+ *```js
1564
+ * .on(EmbedEvent.OnBeforeGetVizDataIntercept,
1565
+ * (payload, responder) => {
1566
+ * const query = payload.data.data.answer.search_query
1567
+ * responder({
1568
+ * data: {
1569
+ * // returns true as long as the query does not include
1570
+ * // both the 'sales' AND the 'county' column
1571
+ * execute: !(query.includes("sales")&&query.includes("county")),
1572
+ * error: {
1573
+ * //Provide a custom error message to explain to your end user
1574
+ * // why their search did not run, and which searches are accepted by your custom logic.
1575
+ * errorText: "You can't use this query :" + query + ".
1576
+ * The 'sales' measures can never be used at the 'county' level.
1577
+ * Please try another measure, or remove 'county' from your search."
1578
+ * }
1579
+ * }})
1519
1580
  * })
1520
1581
  *```
1521
- * @version SDK : 1.29.0 | Thoughtspot : 10.2.0.cl
1522
1582
  */
1523
1583
  EmbedEvent["OnBeforeGetVizDataIntercept"] = "onBeforeGetVizDataIntercept";
1524
1584
  /**
@@ -1536,7 +1596,7 @@ var EmbedEvent;
1536
1596
  })(EmbedEvent || (EmbedEvent = {}));
1537
1597
  /**
1538
1598
  * Event types that can be triggered by the host application
1539
- * to the embedded ThoughtSpot app
1599
+ * to the embedded ThoughtSpot app.
1540
1600
  *
1541
1601
  * To trigger an event use the corresponding
1542
1602
  * {@link LiveboardEmbed.trigger} or {@link AppEmbed.trigger} or {@link
@@ -1553,6 +1613,40 @@ var EmbedEvent;
1553
1613
  * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1554
1614
  * ]);
1555
1615
  * ```
1616
+ * @example
1617
+ * If using React components to embed, use the format shown in this example:
1618
+ *
1619
+ * ```js
1620
+ * const selectVizs = () => {
1621
+ * embedRef.current.trigger(HostEvent.SetVisibleVizs, [
1622
+ * "715e4613-c891-4884-be44-aa8d13701c06",
1623
+ * "3f84d633-e325-44b2-be25-c6650e5a49cf"
1624
+ * ]);
1625
+ * };
1626
+ * ```
1627
+ *
1628
+ *
1629
+ * You can also attach an Embed event to a Host event to trigger
1630
+ * a specific action as shown in this example:
1631
+ *
1632
+ * @example
1633
+ * ```js
1634
+ * const EmbeddedComponent = () => {
1635
+ * const embedRef = useRef(null); // import { useRef } from react
1636
+ * const onLiveboardRendered = () => {
1637
+ * embedRef.current.trigger(HostEvent.SetVisibleVizs, ['viz1', 'viz2']);
1638
+ * };
1639
+ *
1640
+ * return (
1641
+ * <LiveboardEmbed
1642
+ * ref={embedRef}
1643
+ * liveboardId="<liveboard-guid>"
1644
+ * onLiveboardRendered={onLiveboardRendered}
1645
+ * />
1646
+ * );
1647
+ * }
1648
+ * ```
1649
+ *
1556
1650
  * @group Events
1557
1651
  */
1558
1652
  // eslint-disable-next-line no-shadow
@@ -1638,6 +1732,15 @@ var HostEvent;
1638
1732
  * @hidden
1639
1733
  */
1640
1734
  HostEvent["Reload"] = "reload";
1735
+ /**
1736
+ * Get current iframe src
1737
+ * @example
1738
+ * ```js
1739
+ * const frameUrl = AppEmbed.trigger(HostEvent.GetIframeUrl)
1740
+ * ```
1741
+ * @version SDK: 1.35.0 | Thoughtspot: 10.4.0.cl
1742
+ */
1743
+ HostEvent["GetIframeUrl"] = "GetIframeUrl";
1641
1744
  /**
1642
1745
  * Display specific visualizations on a Liveboard.
1643
1746
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
@@ -2239,11 +2342,24 @@ var HostEvent;
2239
2342
  * filter: {
2240
2343
  * column: "item type",
2241
2344
  * oper: "IN",
2242
- * values: ["bags","shirts"],
2345
+ * values: ["bags","shirts"]
2243
2346
  * }
2244
2347
  * });
2245
2348
  * ```
2246
2349
  * @example
2350
+ * ```js
2351
+ *
2352
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2353
+ * filter: {
2354
+ * column: "date",
2355
+ * oper: "EQ",
2356
+ * values: ["JULY","2023"],
2357
+ * type: "MONTH_YEAR"
2358
+ * }
2359
+ * });
2360
+ * ```
2361
+ *
2362
+ * @example
2247
2363
  *
2248
2364
  * ```js
2249
2365
  * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
@@ -2260,7 +2376,8 @@ var HostEvent;
2260
2376
  * {
2261
2377
  * column: "Date",
2262
2378
  * oper: 'EQ',
2263
- * values: ["1656680400"]
2379
+ * values: ["2023-07-31"],
2380
+ * types: "EXACT_DATE"
2264
2381
  * }]
2265
2382
  * });
2266
2383
  * ```
@@ -2450,7 +2567,6 @@ var Param;
2450
2567
  Param["ViewPortHeight"] = "viewPortHeight";
2451
2568
  Param["ViewPortWidth"] = "viewPortWidth";
2452
2569
  Param["VisibleActions"] = "visibleAction";
2453
- Param["CustomCSSUrl"] = "customCssUrl";
2454
2570
  Param["DisableLoginRedirect"] = "disableLoginRedirect";
2455
2571
  Param["visibleVizs"] = "pinboardVisibleVizs";
2456
2572
  Param["LiveboardV2Enabled"] = "isPinboardV2Enabled";
@@ -2509,6 +2625,9 @@ var Param;
2509
2625
  Param["FocusSearchBarOnRender"] = "focusSearchBarOnRender";
2510
2626
  Param["DisableRedirectionLinksInNewTab"] = "disableRedirectionLinksInNewTab";
2511
2627
  Param["HomePageSearchBarMode"] = "homePageSearchBarMode";
2628
+ Param["ShowLiveboardVerifiedBadge"] = "showLiveboardVerifiedBadge";
2629
+ Param["ShowLiveboardReverifyBanner"] = "showLiveboardReverifyBanner";
2630
+ Param["LiveboardHeaderV2"] = "isLiveboardHeaderV2Enabled";
2512
2631
  })(Param || (Param = {}));
2513
2632
  /**
2514
2633
  * ThoughtSpot application pages include actions and menu commands
@@ -3432,7 +3551,7 @@ var Action;
3432
3551
  *
3433
3552
  * @version SDK: 1.32.0 | Thoughtspot: 10.1.0.cl
3434
3553
  */
3435
- Action["CreateLiveboard"] = "CreateLiveboard";
3554
+ Action["CreateLiveboard"] = "createLiveboard";
3436
3555
  /**
3437
3556
  * Action ID for to hide Verified Liveboard Banner
3438
3557
  * @example
@@ -3523,6 +3642,16 @@ var Action;
3523
3642
  * @version SDK: 1.34.0 | Thoughtspot: 10.3.0.cl
3524
3643
  */
3525
3644
  Action["UnsubscribeScheduleHomepage"] = "unsubscribeScheduleHomepage";
3645
+ /**
3646
+ * The **Manage Tags** action on Homepage Favourite Module.
3647
+ *
3648
+ * @example
3649
+ * ```js
3650
+ * disabledActions: [Action.ManageTags]
3651
+ * ```
3652
+ * @version SDK : 1.34.0 | Thoughtspot: 10.3.0.cl
3653
+ */
3654
+ Action["ManageTags"] = "manageTags";
3526
3655
  /**
3527
3656
  * Action ID for delete schedule action on schedule on homepage
3528
3657
  * @example
@@ -6152,7 +6281,11 @@ const setEmbedConfig = (newConfig) => {
6152
6281
  const tokenizedFetch = async (input, init) => {
6153
6282
  const embedConfig = getEmbedConfig();
6154
6283
  if (embedConfig.authType !== AuthType.TrustedAuthTokenCookieless) {
6155
- return fetch(input, init);
6284
+ return fetch(input, {
6285
+ // ensure cookies are included for the non cookie-less api calls.
6286
+ credentials: 'include',
6287
+ ...init,
6288
+ });
6156
6289
  }
6157
6290
  const req = new Request(input, init);
6158
6291
  const authToken = await getAuthenticationToken(embedConfig);
@@ -6361,7 +6494,6 @@ const getAnswer = `
6361
6494
  isDiscoverable
6362
6495
  isHidden
6363
6496
  modifiedAt
6364
- tags
6365
6497
  }
6366
6498
  visualizations {
6367
6499
  ... on TableViz {
@@ -6406,6 +6538,14 @@ const getAnswerData = `
6406
6538
  }
6407
6539
  }
6408
6540
  }
6541
+ `;
6542
+ const getSQLQuery = `
6543
+ mutation GetSQLQuery($session: BachSessionIdInput!) {
6544
+ Answer__getQuery(session: $session) {
6545
+ ${bachSessionId}
6546
+ sql
6547
+ }
6548
+ }
6409
6549
  `;
6410
6550
 
6411
6551
  // eslint-disable-next-line no-shadow
@@ -6537,6 +6677,10 @@ class AnswerService {
6537
6677
  },
6538
6678
  });
6539
6679
  }
6680
+ async getSQLQuery() {
6681
+ const { sql } = await this.executeQuery(getSQLQuery, {});
6682
+ return sql;
6683
+ }
6540
6684
  /**
6541
6685
  * Fetch data from the answer.
6542
6686
  * @param offset
@@ -6571,6 +6715,20 @@ class AnswerService {
6571
6715
  credentials: 'include',
6572
6716
  });
6573
6717
  }
6718
+ /**
6719
+ * Fetch the data for the answer as a PNG blob. This might be
6720
+ * quicker for larger data.
6721
+ * @param userLocale
6722
+ * @param omitBackground Omit the background in the PNG
6723
+ * @param deviceScaleFactor The scale factor for the PNG
6724
+ * @return Response
6725
+ */
6726
+ async fetchPNGBlob(userLocale = 'en-us', omitBackground = false, deviceScaleFactor = 2) {
6727
+ const fetchUrl = this.getFetchPNGBlobUrl(userLocale, omitBackground, deviceScaleFactor);
6728
+ return tokenizedFetch(fetchUrl, {
6729
+ credentials: 'include',
6730
+ });
6731
+ }
6574
6732
  /**
6575
6733
  * Just get the internal URL for this answer's data
6576
6734
  * as a CSV blob.
@@ -6581,6 +6739,13 @@ class AnswerService {
6581
6739
  getFetchCSVBlobUrl(userLocale = 'en-us', includeInfo = false) {
6582
6740
  return `${this.thoughtSpotHost}/prism/download/answer/csv?sessionId=${this.session.sessionId}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data&hideCsvHeader=${!includeInfo}`;
6583
6741
  }
6742
+ /**
6743
+ * Just get the internal URL for this answer's data
6744
+ * as a PNG blob.
6745
+ */
6746
+ getFetchPNGBlobUrl(userLocale = 'en-us', omitBackground = false, deviceScaleFactor = 2) {
6747
+ return `${this.thoughtSpotHost}/prism/download/answer/png?sessionId=${this.session.sessionId}&deviceScaleFactor=${deviceScaleFactor}&omitBackground=${omitBackground}&genNo=${this.session.genNo}&userLocale=${userLocale}&exportFileName=data`;
6748
+ }
6584
6749
  /**
6585
6750
  * Get underlying data given a point and the output column names.
6586
6751
  * In case of a context menu action, the selectedPoints are
@@ -6787,7 +6952,7 @@ const DEFAULT_EMBED_HEIGHT = '100%';
6787
6952
 
6788
6953
  var Config = {
6789
6954
  DEBUG: false,
6790
- LIB_VERSION: '2.45.0'
6955
+ LIB_VERSION: '2.47.0'
6791
6956
  };
6792
6957
 
6793
6958
  // since es6 imports are static and we run unit tests from the console, window won't be defined when importing this file
@@ -7617,20 +7782,24 @@ _.utf8Encode = function(string) {
7617
7782
 
7618
7783
  _.UUID = (function() {
7619
7784
 
7620
- // Time/ticks information
7621
- // 1*new Date() is a cross browser version of Date.now()
7785
+ // Time-based entropy
7622
7786
  var T = function() {
7623
- var d = 1 * new Date(),
7624
- i = 0;
7625
-
7626
- // this while loop figures how many browser ticks go by
7627
- // before 1*new Date() returns a new number, ie the amount
7628
- // of ticks that go by per millisecond
7629
- while (d == 1 * new Date()) {
7630
- i++;
7787
+ var time = 1 * new Date(); // cross-browser version of Date.now()
7788
+ var ticks;
7789
+ if (window$1.performance && window$1.performance.now) {
7790
+ ticks = window$1.performance.now();
7791
+ } else {
7792
+ // fall back to busy loop
7793
+ ticks = 0;
7794
+
7795
+ // this while loop figures how many browser ticks go by
7796
+ // before 1*new Date() returns a new number, ie the amount
7797
+ // of ticks that go by per millisecond
7798
+ while (time == 1 * new Date()) {
7799
+ ticks++;
7800
+ }
7631
7801
  }
7632
-
7633
- return d.toString(16) + i.toString(16);
7802
+ return time.toString(16) + Math.floor(ticks).toString(16);
7634
7803
  };
7635
7804
 
7636
7805
  // Math.Random entropy
@@ -8197,21 +8366,42 @@ _.dom_query = (function() {
8197
8366
  };
8198
8367
  })();
8199
8368
 
8369
+ var CAMPAIGN_KEYWORDS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term'];
8370
+ var CLICK_IDS = ['dclid', 'fbclid', 'gclid', 'ko_click_id', 'li_fat_id', 'msclkid', 'ttclid', 'twclid', 'wbraid'];
8371
+
8200
8372
  _.info = {
8201
- campaignParams: function() {
8202
- var campaign_keywords = 'utm_source utm_medium utm_campaign utm_content utm_term'.split(' '),
8203
- kw = '',
8373
+ campaignParams: function(default_value) {
8374
+ var kw = '',
8204
8375
  params = {};
8205
- _.each(campaign_keywords, function(kwkey) {
8376
+ _.each(CAMPAIGN_KEYWORDS, function(kwkey) {
8206
8377
  kw = _.getQueryParam(document$1.URL, kwkey);
8207
8378
  if (kw.length) {
8208
8379
  params[kwkey] = kw;
8380
+ } else if (default_value !== undefined) {
8381
+ params[kwkey] = default_value;
8382
+ }
8383
+ });
8384
+
8385
+ return params;
8386
+ },
8387
+
8388
+ clickParams: function() {
8389
+ var id = '',
8390
+ params = {};
8391
+ _.each(CLICK_IDS, function(idkey) {
8392
+ id = _.getQueryParam(document$1.URL, idkey);
8393
+ if (id.length) {
8394
+ params[idkey] = id;
8209
8395
  }
8210
8396
  });
8211
8397
 
8212
8398
  return params;
8213
8399
  },
8214
8400
 
8401
+ marketingParams: function() {
8402
+ return _.extend(_.info.campaignParams(), _.info.clickParams());
8403
+ },
8404
+
8215
8405
  searchEngine: function(referrer) {
8216
8406
  if (referrer.search('https?://(.*)google.([^/?]*)') === 0) {
8217
8407
  return 'google';
@@ -8408,12 +8598,13 @@ _.info = {
8408
8598
  });
8409
8599
  },
8410
8600
 
8411
- pageviewInfo: function(page) {
8601
+ mpPageViewProperties: function() {
8412
8602
  return _.strip_empty_properties({
8413
- 'mp_page': page,
8414
- 'mp_referrer': document$1.referrer,
8415
- 'mp_browser': _.info.browser(userAgent, navigator.vendor, windowOpera),
8416
- 'mp_platform': _.info.os()
8603
+ 'current_page_title': document$1.title,
8604
+ 'current_domain': window$1.location.hostname,
8605
+ 'current_url_path': window$1.location.pathname,
8606
+ 'current_url_protocol': window$1.location.protocol,
8607
+ 'current_url_search': window$1.location.search
8417
8608
  });
8418
8609
  }
8419
8610
  };
@@ -9080,6 +9271,9 @@ var RequestBatcher = function(storageKey, options) {
9080
9271
 
9081
9272
  this.stopped = !this.libConfig['batch_autostart'];
9082
9273
  this.consecutiveRemovalFailures = 0;
9274
+
9275
+ // extra client-side dedupe
9276
+ this.itemIdsSentSuccessfully = {};
9083
9277
  };
9084
9278
 
9085
9279
  /**
@@ -9172,7 +9366,34 @@ RequestBatcher.prototype.flush = function(options) {
9172
9366
  payload = this.beforeSendHook(payload);
9173
9367
  }
9174
9368
  if (payload) {
9175
- dataForRequest.push(payload);
9369
+ // mp_sent_by_lib_version prop captures which lib version actually
9370
+ // sends each event (regardless of which version originally queued
9371
+ // it for sending)
9372
+ if (payload['event'] && payload['properties']) {
9373
+ payload['properties'] = _.extend(
9374
+ {},
9375
+ payload['properties'],
9376
+ {'mp_sent_by_lib_version': Config.LIB_VERSION}
9377
+ );
9378
+ }
9379
+ var addPayload = true;
9380
+ var itemId = item['id'];
9381
+ if (itemId) {
9382
+ if ((this.itemIdsSentSuccessfully[itemId] || 0) > 5) {
9383
+ this.reportError('[dupe] item ID sent too many times, not sending', {
9384
+ item: item,
9385
+ batchSize: batch.length,
9386
+ timesSent: this.itemIdsSentSuccessfully[itemId]
9387
+ });
9388
+ addPayload = false;
9389
+ }
9390
+ } else {
9391
+ this.reportError('[dupe] found item with no ID', {item: item});
9392
+ }
9393
+
9394
+ if (addPayload) {
9395
+ dataForRequest.push(payload);
9396
+ }
9176
9397
  }
9177
9398
  transformedItems[item['id']] = payload;
9178
9399
  }, this);
@@ -9255,6 +9476,24 @@ RequestBatcher.prototype.flush = function(options) {
9255
9476
  }
9256
9477
  }, this)
9257
9478
  );
9479
+
9480
+ // client-side dedupe
9481
+ _.each(batch, _.bind(function(item) {
9482
+ var itemId = item['id'];
9483
+ if (itemId) {
9484
+ this.itemIdsSentSuccessfully[itemId] = this.itemIdsSentSuccessfully[itemId] || 0;
9485
+ this.itemIdsSentSuccessfully[itemId]++;
9486
+ if (this.itemIdsSentSuccessfully[itemId] > 5) {
9487
+ this.reportError('[dupe] item ID sent too many times', {
9488
+ item: item,
9489
+ batchSize: batch.length,
9490
+ timesSent: this.itemIdsSentSuccessfully[itemId]
9491
+ });
9492
+ }
9493
+ } else {
9494
+ this.reportError('[dupe] found item with no ID while removing', {item: item});
9495
+ }
9496
+ }, this));
9258
9497
  }
9259
9498
 
9260
9499
  } catch(err) {
@@ -10100,24 +10339,25 @@ MixpanelPeople.prototype.union = addOptOutCheckMixpanelPeople(function(list_name
10100
10339
  });
10101
10340
 
10102
10341
  /*
10103
- * Record that you have charged the current user a certain amount
10104
- * of money. Charges recorded with track_charge() will appear in the
10105
- * Mixpanel revenue report.
10106
- *
10107
- * ### Usage:
10108
- *
10109
- * // charge a user $50
10110
- * mixpanel.people.track_charge(50);
10111
- *
10112
- * // charge a user $30.50 on the 2nd of january
10113
- * mixpanel.people.track_charge(30.50, {
10114
- * '$time': new Date('jan 1 2012')
10115
- * });
10116
- *
10117
- * @param {Number} amount The amount of money charged to the current user
10118
- * @param {Object} [properties] An associative array of properties associated with the charge
10119
- * @param {Function} [callback] If provided, the callback will be called when the server responds
10120
- */
10342
+ * Record that you have charged the current user a certain amount
10343
+ * of money. Charges recorded with track_charge() will appear in the
10344
+ * Mixpanel revenue report.
10345
+ *
10346
+ * ### Usage:
10347
+ *
10348
+ * // charge a user $50
10349
+ * mixpanel.people.track_charge(50);
10350
+ *
10351
+ * // charge a user $30.50 on the 2nd of january
10352
+ * mixpanel.people.track_charge(30.50, {
10353
+ * '$time': new Date('jan 1 2012')
10354
+ * });
10355
+ *
10356
+ * @param {Number} amount The amount of money charged to the current user
10357
+ * @param {Object} [properties] An associative array of properties associated with the charge
10358
+ * @param {Function} [callback] If provided, the callback will be called when the server responds
10359
+ * @deprecated
10360
+ */
10121
10361
  MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(amount, properties, callback) {
10122
10362
  if (!_.isNumber(amount)) {
10123
10363
  amount = parseFloat(amount);
@@ -10133,15 +10373,16 @@ MixpanelPeople.prototype.track_charge = addOptOutCheckMixpanelPeople(function(am
10133
10373
  });
10134
10374
 
10135
10375
  /*
10136
- * Permanently clear all revenue report transactions from the
10137
- * current user's people analytics profile.
10138
- *
10139
- * ### Usage:
10140
- *
10141
- * mixpanel.people.clear_charges();
10142
- *
10143
- * @param {Function} [callback] If provided, the callback will be called after tracking the event.
10144
- */
10376
+ * Permanently clear all revenue report transactions from the
10377
+ * current user's people analytics profile.
10378
+ *
10379
+ * ### Usage:
10380
+ *
10381
+ * mixpanel.people.clear_charges();
10382
+ *
10383
+ * @param {Function} [callback] If provided, the callback will be called after tracking the event.
10384
+ * @deprecated
10385
+ */
10145
10386
  MixpanelPeople.prototype.clear_charges = function(callback) {
10146
10387
  return this.set('$transactions', [], callback);
10147
10388
  };
@@ -10541,13 +10782,6 @@ MixpanelPersistence.prototype.unregister = function(prop) {
10541
10782
  }
10542
10783
  };
10543
10784
 
10544
- MixpanelPersistence.prototype.update_campaign_params = function() {
10545
- if (!this.campaign_params_saved) {
10546
- this.register_once(_.info.campaignParams());
10547
- this.campaign_params_saved = true;
10548
- }
10549
- };
10550
-
10551
10785
  MixpanelPersistence.prototype.update_search_keyword = function(referrer) {
10552
10786
  this.register(_.info.searchInfo(referrer));
10553
10787
  };
@@ -10830,6 +11064,7 @@ var NOOP_FUNC = function() {};
10830
11064
  /** @const */ var PRIMARY_INSTANCE_NAME = 'mixpanel';
10831
11065
  /** @const */ var PAYLOAD_TYPE_BASE64 = 'base64';
10832
11066
  /** @const */ var PAYLOAD_TYPE_JSON = 'json';
11067
+ /** @const */ var DEVICE_ID_PREFIX = '$device:';
10833
11068
 
10834
11069
 
10835
11070
  /*
@@ -10871,6 +11106,9 @@ var DEFAULT_CONFIG = {
10871
11106
  'cookie_domain': '',
10872
11107
  'cookie_name': '',
10873
11108
  'loaded': NOOP_FUNC,
11109
+ 'track_marketing': true,
11110
+ 'track_pageview': false,
11111
+ 'skip_first_touch_marketing': false,
10874
11112
  'store_google': true,
10875
11113
  'save_referrer': true,
10876
11114
  'test': false,
@@ -10937,6 +11175,25 @@ var create_mplib = function(token, config, name) {
10937
11175
  instance['people'] = new MixpanelPeople();
10938
11176
  instance['people']._init(instance);
10939
11177
 
11178
+ if (!instance.get_config('skip_first_touch_marketing')) {
11179
+ // We need null UTM params in the object because
11180
+ // UTM parameters act as a tuple. If any UTM param
11181
+ // is present, then we set all UTM params including
11182
+ // empty ones together
11183
+ var utm_params = _.info.campaignParams(null);
11184
+ var initial_utm_params = {};
11185
+ var has_utm = false;
11186
+ _.each(utm_params, function(utm_value, utm_key) {
11187
+ initial_utm_params['initial_' + utm_key] = utm_value;
11188
+ if (utm_value) {
11189
+ has_utm = true;
11190
+ }
11191
+ });
11192
+ if (has_utm) {
11193
+ instance['people'].set_once(initial_utm_params);
11194
+ }
11195
+ }
11196
+
10940
11197
  // if any instance on the page has debug = true, we set the
10941
11198
  // global debug to be true
10942
11199
  Config.DEBUG = Config.DEBUG || instance.get_config('debug');
@@ -10968,7 +11225,7 @@ var create_mplib = function(token, config, name) {
10968
11225
  * mixpanel.library_name.track(...);
10969
11226
  *
10970
11227
  * @param {String} token Your Mixpanel API token
10971
- * @param {Object} [config] A dictionary of config options to override. <a href="https://github.com/mixpanel/mixpanel-js/blob/8b2e1f7b/src/mixpanel-core.js#L87-L110">See a list of default config options</a>.
11228
+ * @param {Object} [config] A dictionary of config options to override. <a href="https://github.com/mixpanel/mixpanel-js/blob/v2.46.0/src/mixpanel-core.js#L88-L127">See a list of default config options</a>.
10972
11229
  * @param {String} [name] The name for the new mixpanel instance that you want created
10973
11230
  */
10974
11231
  MixpanelLib.prototype.init = function (token, config, name) {
@@ -11006,7 +11263,7 @@ MixpanelLib.prototype._init = function(token, config, name) {
11006
11263
  // default to JSON payload for standard mixpanel.com API hosts
11007
11264
  if (!('api_payload_format' in config)) {
11008
11265
  var api_host = config['api_host'] || DEFAULT_CONFIG['api_host'];
11009
- if (api_host.match(/\.mixpanel\.com$/)) {
11266
+ if (api_host.match(/\.mixpanel\.com/)) {
11010
11267
  variable_features['api_payload_format'] = PAYLOAD_TYPE_JSON;
11011
11268
  }
11012
11269
  }
@@ -11077,10 +11334,14 @@ MixpanelLib.prototype._init = function(token, config, name) {
11077
11334
  // or the device id if something was already stored
11078
11335
  // in the persitence
11079
11336
  this.register_once({
11080
- 'distinct_id': uuid,
11337
+ 'distinct_id': DEVICE_ID_PREFIX + uuid,
11081
11338
  '$device_id': uuid
11082
11339
  }, '');
11083
11340
  }
11341
+
11342
+ if (this.get_config('track_pageview')) {
11343
+ this.track_pageview();
11344
+ }
11084
11345
  };
11085
11346
 
11086
11347
  // Private methods
@@ -11094,7 +11355,7 @@ MixpanelLib.prototype._loaded = function() {
11094
11355
  MixpanelLib.prototype._set_default_superprops = function() {
11095
11356
  this['persistence'].update_search_keyword(document$1.referrer);
11096
11357
  if (this.get_config('store_google')) {
11097
- this['persistence'].update_campaign_params();
11358
+ this.register(_.info.campaignParams(), {persistent: false});
11098
11359
  }
11099
11360
  if (this.get_config('save_referrer')) {
11100
11361
  this['persistence'].update_referrer_info(document$1.referrer);
@@ -11576,6 +11837,10 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
11576
11837
 
11577
11838
  this._set_default_superprops();
11578
11839
 
11840
+ var marketing_properties = this.get_config('track_marketing')
11841
+ ? _.info.marketingParams()
11842
+ : {};
11843
+
11579
11844
  // note: extend writes to the first object, so lets make sure we
11580
11845
  // don't write to the persistence properties object and info
11581
11846
  // properties object by passing in a new object
@@ -11584,6 +11849,7 @@ MixpanelLib.prototype.track = addOptOutCheckMixpanelLib(function(event_name, pro
11584
11849
  properties = _.extend(
11585
11850
  {},
11586
11851
  _.info.properties(),
11852
+ marketing_properties,
11587
11853
  this['persistence'].properties(),
11588
11854
  this.unpersisted_superprops,
11589
11855
  properties
@@ -11744,17 +12010,54 @@ MixpanelLib.prototype.get_group = function (group_key, group_id) {
11744
12010
  };
11745
12011
 
11746
12012
  /**
11747
- * Track mp_page_view event. This is now ignored by the server.
12013
+ * Track a default Mixpanel page view event, which includes extra default event properties to
12014
+ * improve page view data. The `config.track_pageview` option for <a href="#mixpanelinit">mixpanel.init()</a>
12015
+ * may be turned on for tracking page loads automatically.
11748
12016
  *
11749
- * @param {String} [page] The url of the page to record. If you don't include this, it defaults to the current url.
11750
- * @deprecated
12017
+ * ### Usage
12018
+ *
12019
+ * // track a default $mp_web_page_view event
12020
+ * mixpanel.track_pageview();
12021
+ *
12022
+ * // track a page view event with additional event properties
12023
+ * mixpanel.track_pageview({'ab_test_variant': 'card-layout-b'});
12024
+ *
12025
+ * // example approach to track page views on different page types as event properties
12026
+ * mixpanel.track_pageview({'page': 'pricing'});
12027
+ * mixpanel.track_pageview({'page': 'homepage'});
12028
+ *
12029
+ * // UNCOMMON: Tracking a page view event with a custom event_name option. NOT expected to be used for
12030
+ * // individual pages on the same site or product. Use cases for custom event_name may be page
12031
+ * // views on different products or internal applications that are considered completely separate
12032
+ * mixpanel.track_pageview({'page': 'customer-search'}, {'event_name': '[internal] Admin Page View'});
12033
+ *
12034
+ * @param {Object} [properties] An optional set of additional properties to send with the page view event
12035
+ * @param {Object} [options] Page view tracking options
12036
+ * @param {String} [options.event_name] - Alternate name for the tracking event
12037
+ * @returns {Boolean|Object} If the tracking request was successfully initiated/queued, an object
12038
+ * with the tracking payload sent to the API server is returned; otherwise false.
11751
12039
  */
11752
- MixpanelLib.prototype.track_pageview = function(page) {
11753
- if (_.isUndefined(page)) {
11754
- page = document$1.location.href;
12040
+ MixpanelLib.prototype.track_pageview = addOptOutCheckMixpanelLib(function(properties, options) {
12041
+ if (typeof properties !== 'object') {
12042
+ properties = {};
11755
12043
  }
11756
- this.track('mp_page_view', _.info.pageviewInfo(page));
11757
- };
12044
+ options = options || {};
12045
+ var event_name = options['event_name'] || '$mp_web_page_view';
12046
+
12047
+ var default_page_properties = _.extend(
12048
+ _.info.mpPageViewProperties(),
12049
+ _.info.campaignParams(),
12050
+ _.info.clickParams()
12051
+ );
12052
+
12053
+ var event_properties = _.extend(
12054
+ {},
12055
+ default_page_properties,
12056
+ properties
12057
+ );
12058
+
12059
+ return this.track(event_name, event_properties);
12060
+ });
11758
12061
 
11759
12062
  /**
11760
12063
  * Track clicks on a set of document elements. Selector must be a
@@ -12003,7 +12306,15 @@ MixpanelLib.prototype.identify = function(
12003
12306
  // _unset_callback:function A callback to be run if and when the People unset queue is flushed
12004
12307
 
12005
12308
  var previous_distinct_id = this.get_distinct_id();
12006
- this.register({'$user_id': new_distinct_id});
12309
+ if (new_distinct_id && previous_distinct_id !== new_distinct_id) {
12310
+ // we allow the following condition if previous distinct_id is same as new_distinct_id
12311
+ // so that you can force flush people updates for anonymous profiles.
12312
+ if (typeof new_distinct_id === 'string' && new_distinct_id.indexOf(DEVICE_ID_PREFIX) === 0) {
12313
+ this.report_error('distinct_id cannot have $device: prefix');
12314
+ return -1;
12315
+ }
12316
+ this.register({'$user_id': new_distinct_id});
12317
+ }
12007
12318
 
12008
12319
  if (!this.get_property('$device_id')) {
12009
12320
  // The persisted distinct id might not actually be a device id at all
@@ -12044,7 +12355,7 @@ MixpanelLib.prototype.reset = function() {
12044
12355
  this._flags.identify_called = false;
12045
12356
  var uuid = _.UUID();
12046
12357
  this.register_once({
12047
- 'distinct_id': uuid,
12358
+ 'distinct_id': DEVICE_ID_PREFIX + uuid,
12048
12359
  '$device_id': uuid
12049
12360
  }, '');
12050
12361
  };
@@ -12169,8 +12480,8 @@ MixpanelLib.prototype.name_tag = function(name_tag) {
12169
12480
  * // batching or retry mechanisms.
12170
12481
  * api_transport: 'XHR'
12171
12482
  *
12172
- * // turn on request-batching/queueing/retry
12173
- * batch_requests: false,
12483
+ * // request-batching/queueing/retry
12484
+ * batch_requests: true,
12174
12485
  *
12175
12486
  * // maximum number of events/updates to send in a single
12176
12487
  * // network request
@@ -12242,10 +12553,20 @@ MixpanelLib.prototype.name_tag = function(name_tag) {
12242
12553
  * // secure, meaning they will only be transmitted over https
12243
12554
  * secure_cookie: false
12244
12555
  *
12556
+ * // disables enriching user profiles with first touch marketing data
12557
+ * skip_first_touch_marketing: false
12558
+ *
12245
12559
  * // the amount of time track_links will
12246
12560
  * // wait for Mixpanel's servers to respond
12247
12561
  * track_links_timeout: 300
12248
12562
  *
12563
+ * // adds any UTM parameters and click IDs present on the page to any events fired
12564
+ * track_marketing: true
12565
+ *
12566
+ * // enables automatic page view tracking using default page view events through
12567
+ * // the track_pageview() method
12568
+ * track_pageview: false
12569
+ *
12249
12570
  * // if you set upgrade to be true, the library will check for
12250
12571
  * // a cookie from our old js library and import super
12251
12572
  * // properties from it, then the old cookie is deleted
@@ -12770,6 +13091,10 @@ var mixpanel$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE
12770
13091
  // Needed to avoid error in CJS builds on some bundlers.
12771
13092
  const mixpanelLib = mixpanel_cjs || mixpanel$1;
12772
13093
  let mixpanelInstance;
13094
+ /**
13095
+ * Enum of mixpanel events
13096
+ * @hidden
13097
+ */
12773
13098
  const MIXPANEL_EVENT = {
12774
13099
  VISUAL_SDK_RENDER_START: 'visual-sdk-render-start',
12775
13100
  VISUAL_SDK_CALLED_INIT: 'visual-sdk-called-init',
@@ -13917,22 +14242,23 @@ const renderInQueue = (fn) => {
13917
14242
  /**
13918
14243
  * Imports TML representation of the metadata objects into ThoughtSpot.
13919
14244
  * @param data
14245
+ * @returns imports TML data into ThoughtSpot
13920
14246
  * @example
13921
14247
  * ```js
13922
- * executeTML({
13923
- * //Array of metadata Tmls
13924
- metadata_tmls: [
13925
- "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
13926
- \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
13927
- ],
13928
- import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
13929
- create_new: false, // If selected, creates TML objects with new GUIDs.
13930
- }).then(result => {
13931
- console.log(result);
13932
- }).catch(error => {
13933
- console.error(error);
13934
- });
13935
- *
14248
+ * executeTML({
14249
+ * //Array of metadata Tmls in string format
14250
+ * metadata_tmls: [
14251
+ * "'\''{\"guid\":\"9bd202f5-d431-44bf-9a07-b4f7be372125\",
14252
+ * \"liveboard\":{\"name\":\"Parameters Liveboard\"}}'\''"
14253
+ * ],
14254
+ * import_policy: 'PARTIAL', // Specifies the import policy for the TML import.
14255
+ * create_new: false, // If selected, creates TML objects with new GUIDs.
14256
+ * }).then(result => {
14257
+ * console.log(result);
14258
+ * }).catch(error => {
14259
+ * console.error(error);
14260
+ * });
14261
+ *```
13936
14262
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
13937
14263
  * @group Global methods
13938
14264
  */
@@ -13973,27 +14299,28 @@ const executeTML = async (data) => {
13973
14299
  * Exports TML representation of the metadata objects from ThoughtSpot in JSON or YAML
13974
14300
  * format.
13975
14301
  * @param data
14302
+ * @returns exports TML data
13976
14303
  * @example
13977
14304
  * ```js
13978
- exportTML({
13979
- metadata: [
13980
- {
13981
- type: "LIVEBOARD", //Metadata Type
13982
- identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
13983
- }
13984
- ],
13985
- export_associated: false,//indicates whether to export associated metadata objects
13986
- export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
13987
- //exporting a Liveboard and its associated objects, the API
13988
- //returns the Liveboard TML data with the FQNs of the referenced
13989
- //worksheet. If the exported TML data includes FQNs, you don't need
13990
- //to manually add FQNs of the referenced objects during TML import.
13991
- edoc_format: "JSON" //It takes JSON or YAML value
13992
- }).then(result => {
13993
- console.log(result);
13994
- }).catch(error => {
13995
- console.error(error);
13996
- });
14305
+ * exportTML({
14306
+ * metadata: [
14307
+ * {
14308
+ * type: "LIVEBOARD", //Metadata Type
14309
+ * identifier: "9bd202f5-d431-44bf-9a07-b4f7be372125" //Metadata Id
14310
+ * }
14311
+ * ],
14312
+ * export_associated: false,//indicates whether to export associated metadata objects
14313
+ * export_fqn: false, //Adds FQNs of the referenced objects.For example, if you are
14314
+ * //exporting a Liveboard and its associated objects, the API
14315
+ * //returns the Liveboard TML data with the FQNs of the referenced
14316
+ * //worksheet. If the exported TML data includes FQNs, you don't need
14317
+ * //to manually add FQNs of the referenced objects during TML import.
14318
+ * edoc_format: "JSON" //It takes JSON or YAML value
14319
+ * }).then(result => {
14320
+ * console.log(result);
14321
+ * }).catch(error => {
14322
+ * console.error(error);
14323
+ * });
13997
14324
  * ```
13998
14325
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
13999
14326
  * @group Global methods
@@ -14087,8 +14414,8 @@ function processNoCookieAccess(e, containerEl) {
14087
14414
  * @param containerEl
14088
14415
  */
14089
14416
  function processAuthFailure(e, containerEl) {
14090
- const { loginFailedMessage, authType } = getEmbedConfig();
14091
- if (authType !== AuthType.None) {
14417
+ const { loginFailedMessage, authType, disableLoginFailurePage } = getEmbedConfig();
14418
+ if (authType !== AuthType.None && !disableLoginFailurePage) {
14092
14419
  // eslint-disable-next-line no-param-reassign
14093
14420
  containerEl.innerHTML = loginFailedMessage;
14094
14421
  notifyAuthFailure(AuthFailureType.OTHER);
@@ -14189,7 +14516,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
14189
14516
  });
14190
14517
  }
14191
14518
 
14192
- var name="@thoughtspot/visual-embed-sdk";var version="1.33.0-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",start:"gatsby develop","build:gatsby":"npm run clean:gatsby && gatsby build --prefix-paths","build:gatsby:noprefix":"npm run clean:gatsby && gatsby build","serve:gatsby":"gatsby serve","clean:gatsby":"gatsby clean","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","docs-cmd":"node scripts/gatsby-commands.js",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme","test-sdk":"jest -c jest.config.sdk.js --runInBand","test-docs":"jest -c jest.config.docs.js",test:"npm run test-sdk && npm run test-docs",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={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",lodash:"^4.17.21","mixpanel-browser":"^2.45.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.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/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.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","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0",gatsby:"3.13.1","gatsby-plugin-algolia":"^0.22.2","gatsby-plugin-catch-links":"^3.1.0","gatsby-plugin-env-variables":"^2.1.0","gatsby-plugin-intl":"^0.3.3","gatsby-plugin-manifest":"^3.2.0","gatsby-plugin-output":"^0.1.3","gatsby-plugin-sass":"6.7.0","gatsby-plugin-sitemap":"^4.10.0","gatsby-source-filesystem":"3.1.0","gatsby-transformer-asciidoc":"2.1.0","gatsby-transformer-rehype":"2.0.0","gh-pages":"^3.1.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","node-sass":"^8.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:"2.30.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"48 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};
14519
+ var name="@thoughtspot/visual-embed-sdk";var version="1.33.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={algoliasearch:"^4.10.5",classnames:"^2.3.1",dompurify:"^2.3.4","eslint-plugin-comment-length":"^0.9.2","eslint-plugin-jsdoc":"^46.9.0",eventemitter3:"^4.0.7","gatsby-plugin-vercel":"^1.0.3","html-react-parser":"^1.4.12",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"};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/mixpanel-browser":"^2.35.6","@types/lodash":"^4.17.0","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^4.6.0","@typescript-eslint/parser":"^4.6.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","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^7.12.1","eslint-config-airbnb-base":"^14.2.0","eslint-config-prettier":"^6.15.0","eslint-import-resolver-typescript":"^2.3.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.1.4","eslint-plugin-react-hooks":"^4.2.0","fs-extra":"^10.0.0","gh-pages":"^3.1.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","node-sass":"^8.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:"2.30.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","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^5.3.4"};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,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.js",limit:"49 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};
14193
14520
 
14194
14521
  /**
14195
14522
  * Copyright (c) 2022
@@ -14461,7 +14788,7 @@ class TsEmbed {
14461
14788
  * @returns queryParams
14462
14789
  */
14463
14790
  getBaseQueryParams(queryParams = {}) {
14464
- var _a, _b, _c, _d;
14791
+ var _a, _b, _c;
14465
14792
  let hostAppUrl = ((_a = window === null || window === void 0 ? void 0 : window.location) === null || _a === void 0 ? void 0 : _a.host) || '';
14466
14793
  // The below check is needed because TS Cloud firewall, blocks
14467
14794
  // localhost/127.0.0.1 in any url param.
@@ -14504,11 +14831,6 @@ class TsEmbed {
14504
14831
  this.handleError('You cannot have both hidden Tabs and visible Tabs');
14505
14832
  return queryParams;
14506
14833
  }
14507
- // TODO remove embedConfig.customCssUrl
14508
- const cssUrlParam = ((_c = customizations === null || customizations === void 0 ? void 0 : customizations.style) === null || _c === void 0 ? void 0 : _c.customCSSUrl) || this.embedConfig.customCssUrl;
14509
- if (cssUrlParam) {
14510
- queryParams[Param.CustomCSSUrl] = cssUrlParam;
14511
- }
14512
14834
  if (disabledActions === null || disabledActions === void 0 ? void 0 : disabledActions.length) {
14513
14835
  queryParams[Param.DisableActions] = disabledActions;
14514
14836
  }
@@ -14537,7 +14859,7 @@ class TsEmbed {
14537
14859
  queryParams[Param.ContextMenuTrigger] = false;
14538
14860
  }
14539
14861
  const spriteUrl = (customizations === null || customizations === void 0 ? void 0 : customizations.iconSpriteUrl)
14540
- || ((_d = this.embedConfig.customizations) === null || _d === void 0 ? void 0 : _d.iconSpriteUrl);
14862
+ || ((_c = this.embedConfig.customizations) === null || _c === void 0 ? void 0 : _c.iconSpriteUrl);
14541
14863
  if (spriteUrl) {
14542
14864
  queryParams[Param.IconSpriteUrl] = spriteUrl.replace('https://', '');
14543
14865
  }
@@ -14547,9 +14869,6 @@ class TsEmbed {
14547
14869
  if (locale !== undefined) {
14548
14870
  queryParams[Param.Locale] = locale;
14549
14871
  }
14550
- if (additionalFlags && additionalFlags.constructor.name === 'Object') {
14551
- Object.assign(queryParams, additionalFlags);
14552
- }
14553
14872
  if (linkOverride) {
14554
14873
  queryParams[Param.LinkOverride] = linkOverride;
14555
14874
  }
@@ -14561,6 +14880,11 @@ class TsEmbed {
14561
14880
  }
14562
14881
  queryParams[Param.OverrideNativeConsole] = true;
14563
14882
  queryParams[Param.ClientLogLevel] = this.embedConfig.logLevel;
14883
+ if (additionalFlags && additionalFlags.constructor.name === 'Object') {
14884
+ Object.assign(queryParams, additionalFlags);
14885
+ }
14886
+ // Do not add any flags below this, as we want additional flags to
14887
+ // override other flags
14564
14888
  return queryParams;
14565
14889
  }
14566
14890
  /**
@@ -15154,7 +15478,7 @@ class TsEmbed {
15154
15478
  * @version SDK: 1.25.0 / ThoughtSpot 9.10.0
15155
15479
  */
15156
15480
  async getAnswerService(vizId) {
15157
- const { session } = await this.trigger(HostEvent.GetAnswerSession, vizId);
15481
+ const { session } = await this.trigger(HostEvent.GetAnswerSession, vizId ? { vizId } : {});
15158
15482
  return new AnswerService(session, null, this.embedConfig.thoughtSpotHost);
15159
15483
  }
15160
15484
  }
@@ -15169,7 +15493,6 @@ class V1Embed extends TsEmbed {
15169
15493
  super(domSelector, viewConfig);
15170
15494
  /**
15171
15495
  * Only for testing purposes.
15172
- *
15173
15496
  * @hidden
15174
15497
  */
15175
15498
  // eslint-disable-next-line camelcase
@@ -15266,6 +15589,10 @@ var Page;
15266
15589
  * SpotIQ listing page
15267
15590
  */
15268
15591
  Page["SpotIQ"] = "insights";
15592
+ /**
15593
+ * Monitor Alerts Page
15594
+ */
15595
+ Page["Monitor"] = "monitor";
15269
15596
  })(Page || (Page = {}));
15270
15597
  /**
15271
15598
  * Define the initial state os column custom group accordions
@@ -15334,7 +15661,7 @@ class AppEmbed extends V1Embed {
15334
15661
  getEmbedParams() {
15335
15662
  const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, 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,
15336
15663
  /* eslint-disable-next-line max-len */
15337
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, homePageSearchBarMode, } = this.viewConfig;
15664
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, homePageSearchBarMode, } = this.viewConfig;
15338
15665
  let params = {};
15339
15666
  params[Param.EmbedApp] = true;
15340
15667
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
@@ -15346,6 +15673,9 @@ class AppEmbed extends V1Embed {
15346
15673
  params[Param.ShowLiveboardDescription] = !!showLiveboardDescription;
15347
15674
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
15348
15675
  params[Param.IsFullAppEmbed] = true;
15676
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
15677
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
15678
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
15349
15679
  params = this.getBaseQueryParams(params);
15350
15680
  if (fullHeight === true) {
15351
15681
  params[Param.fullHeight] = true;
@@ -15425,6 +15755,8 @@ class AppEmbed extends V1Embed {
15425
15755
  return 'data/tables';
15426
15756
  case Page.SpotIQ:
15427
15757
  return modularHomeExperience ? 'home/spotiq-analysis' : 'insights/results';
15758
+ case Page.Monitor:
15759
+ return modularHomeExperience ? 'home/monitor-alerts' : 'insights/monitor-alerts';
15428
15760
  case Page.Home:
15429
15761
  default:
15430
15762
  return 'home';
@@ -15616,7 +15948,7 @@ class LiveboardEmbed extends V1Embed {
15616
15948
  let params = {};
15617
15949
  params[Param.EmbedApp] = true;
15618
15950
  params = this.getBaseQueryParams(params);
15619
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, enableAskSage, enable2ColumnLayout, } = this.viewConfig;
15951
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, } = this.viewConfig;
15620
15952
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
15621
15953
  || this.viewConfig.preventPinboardFilterRemoval;
15622
15954
  if (fullHeight === true) {
@@ -15660,6 +15992,11 @@ class LiveboardEmbed extends V1Embed {
15660
15992
  params[Param.enableAskSage] = enableAskSage;
15661
15993
  }
15662
15994
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
15995
+ params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
15996
+ params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
15997
+ params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
15998
+ params[Param.DataPanelV2Enabled] = dataPanelV2;
15999
+ params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
15663
16000
  const queryParams = getQueryParamString(params, true);
15664
16001
  return queryParams;
15665
16002
  }