@thoughtspot/visual-embed-sdk 1.41.0-pre-render-1 → 1.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (259) hide show
  1. package/README.md +2 -4
  2. package/cjs/package.json +3 -3
  3. package/cjs/src/authToken.d.ts +1 -0
  4. package/cjs/src/authToken.d.ts.map +1 -1
  5. package/cjs/src/authToken.js +13 -3
  6. package/cjs/src/authToken.js.map +1 -1
  7. package/cjs/src/authToken.spec.js +29 -0
  8. package/cjs/src/authToken.spec.js.map +1 -1
  9. package/cjs/src/css-variables.d.ts +2 -1
  10. package/cjs/src/css-variables.d.ts.map +1 -1
  11. package/cjs/src/embed/app.d.ts +22 -1
  12. package/cjs/src/embed/app.d.ts.map +1 -1
  13. package/cjs/src/embed/app.js +22 -1
  14. package/cjs/src/embed/app.js.map +1 -1
  15. package/cjs/src/embed/app.spec.js +70 -3
  16. package/cjs/src/embed/app.spec.js.map +1 -1
  17. package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
  18. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/bodyless-conversation.js +3 -7
  20. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  21. package/cjs/src/embed/conversation.d.ts +2 -3
  22. package/cjs/src/embed/conversation.d.ts.map +1 -1
  23. package/cjs/src/embed/conversation.js +2 -7
  24. package/cjs/src/embed/conversation.js.map +1 -1
  25. package/cjs/src/embed/liveboard.d.ts +32 -1
  26. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  27. package/cjs/src/embed/liveboard.js +8 -25
  28. package/cjs/src/embed/liveboard.js.map +1 -1
  29. package/cjs/src/embed/liveboard.spec.js +96 -28
  30. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  31. package/cjs/src/embed/sage.d.ts +0 -1
  32. package/cjs/src/embed/sage.d.ts.map +1 -1
  33. package/cjs/src/embed/sage.js +6 -10
  34. package/cjs/src/embed/sage.js.map +1 -1
  35. package/cjs/src/embed/sage.spec.js +20 -10
  36. package/cjs/src/embed/sage.spec.js.map +1 -1
  37. package/cjs/src/embed/search-bar.d.ts +0 -1
  38. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  39. package/cjs/src/embed/search-bar.js +7 -11
  40. package/cjs/src/embed/search-bar.js.map +1 -1
  41. package/cjs/src/embed/search.d.ts +0 -1
  42. package/cjs/src/embed/search.d.ts.map +1 -1
  43. package/cjs/src/embed/search.js +8 -7
  44. package/cjs/src/embed/search.js.map +1 -1
  45. package/cjs/src/embed/search.spec.js +10 -10
  46. package/cjs/src/embed/search.spec.js.map +1 -1
  47. package/cjs/src/embed/ts-embed.d.ts +5 -7
  48. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  49. package/cjs/src/embed/ts-embed.js +25 -22
  50. package/cjs/src/embed/ts-embed.js.map +1 -1
  51. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  52. package/cjs/src/embed/ts-embed.spec.js +122 -0
  53. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  54. package/cjs/src/errors.d.ts +11 -0
  55. package/cjs/src/errors.d.ts.map +1 -1
  56. package/cjs/src/errors.js +12 -1
  57. package/cjs/src/errors.js.map +1 -1
  58. package/cjs/src/index.d.ts +2 -2
  59. package/cjs/src/index.d.ts.map +1 -1
  60. package/cjs/src/index.js +3 -1
  61. package/cjs/src/index.js.map +1 -1
  62. package/cjs/src/react/index.d.ts +1 -1
  63. package/cjs/src/react/index.d.ts.map +1 -1
  64. package/cjs/src/react/index.js +4 -2
  65. package/cjs/src/react/index.js.map +1 -1
  66. package/cjs/src/react/index.spec.js +1 -1
  67. package/cjs/src/react/index.spec.js.map +1 -1
  68. package/cjs/src/types.d.ts +163 -21
  69. package/cjs/src/types.d.ts.map +1 -1
  70. package/cjs/src/types.js +65 -22
  71. package/cjs/src/types.js.map +1 -1
  72. package/cjs/src/utils/custom-actions.d.ts +12 -0
  73. package/cjs/src/utils/custom-actions.d.ts.map +1 -0
  74. package/cjs/src/utils/custom-actions.js +180 -0
  75. package/cjs/src/utils/custom-actions.js.map +1 -0
  76. package/cjs/src/utils/custom-actions.spec.d.ts +2 -0
  77. package/cjs/src/utils/custom-actions.spec.d.ts.map +1 -0
  78. package/cjs/src/utils/custom-actions.spec.js +399 -0
  79. package/cjs/src/utils/custom-actions.spec.js.map +1 -0
  80. package/cjs/src/utils/processData.d.ts.map +1 -1
  81. package/cjs/src/utils/processData.js +10 -0
  82. package/cjs/src/utils/processData.js.map +1 -1
  83. package/cjs/src/utils/processData.spec.js +11 -0
  84. package/cjs/src/utils/processData.spec.js.map +1 -1
  85. package/cjs/src/utils.d.ts +21 -0
  86. package/cjs/src/utils.d.ts.map +1 -1
  87. package/cjs/src/utils.js +32 -1
  88. package/cjs/src/utils.js.map +1 -1
  89. package/cjs/src/utils.spec.js +38 -0
  90. package/cjs/src/utils.spec.js.map +1 -1
  91. package/dist/{index-CmEQfuE3.js → index-DQueHwfQ.js} +1 -1
  92. package/dist/src/authToken.d.ts +1 -0
  93. package/dist/src/authToken.d.ts.map +1 -1
  94. package/dist/src/css-variables.d.ts +2 -1
  95. package/dist/src/css-variables.d.ts.map +1 -1
  96. package/dist/src/embed/app.d.ts +22 -1
  97. package/dist/src/embed/app.d.ts.map +1 -1
  98. package/dist/src/embed/bodyless-conversation.d.ts +0 -1
  99. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  100. package/dist/src/embed/conversation.d.ts +2 -3
  101. package/dist/src/embed/conversation.d.ts.map +1 -1
  102. package/dist/src/embed/liveboard.d.ts +32 -1
  103. package/dist/src/embed/liveboard.d.ts.map +1 -1
  104. package/dist/src/embed/sage.d.ts +0 -1
  105. package/dist/src/embed/sage.d.ts.map +1 -1
  106. package/dist/src/embed/search-bar.d.ts +0 -1
  107. package/dist/src/embed/search-bar.d.ts.map +1 -1
  108. package/dist/src/embed/search.d.ts +0 -1
  109. package/dist/src/embed/search.d.ts.map +1 -1
  110. package/dist/src/embed/ts-embed.d.ts +5 -7
  111. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  112. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  113. package/dist/src/errors.d.ts +11 -0
  114. package/dist/src/errors.d.ts.map +1 -1
  115. package/dist/src/index.d.ts +2 -2
  116. package/dist/src/index.d.ts.map +1 -1
  117. package/dist/src/react/index.d.ts +1 -1
  118. package/dist/src/react/index.d.ts.map +1 -1
  119. package/dist/src/types.d.ts +163 -21
  120. package/dist/src/types.d.ts.map +1 -1
  121. package/dist/src/utils/custom-actions.d.ts +12 -0
  122. package/dist/src/utils/custom-actions.d.ts.map +1 -0
  123. package/dist/src/utils/custom-actions.spec.d.ts +2 -0
  124. package/dist/src/utils/custom-actions.spec.d.ts.map +1 -0
  125. package/dist/src/utils/processData.d.ts.map +1 -1
  126. package/dist/src/utils.d.ts +21 -0
  127. package/dist/src/utils.d.ts.map +1 -1
  128. package/dist/tsembed-react.es.js +1773 -251
  129. package/dist/tsembed-react.js +1772 -250
  130. package/dist/tsembed.es.js +1771 -250
  131. package/dist/tsembed.js +1770 -249
  132. package/dist/visual-embed-sdk-react-full.d.ts +228 -39
  133. package/dist/visual-embed-sdk-react.d.ts +228 -39
  134. package/dist/visual-embed-sdk.d.ts +228 -39
  135. package/lib/package.json +3 -3
  136. package/lib/src/authToken.d.ts +1 -0
  137. package/lib/src/authToken.d.ts.map +1 -1
  138. package/lib/src/authToken.js +11 -2
  139. package/lib/src/authToken.js.map +1 -1
  140. package/lib/src/authToken.spec.js +30 -1
  141. package/lib/src/authToken.spec.js.map +1 -1
  142. package/lib/src/css-variables.d.ts +2 -1
  143. package/lib/src/css-variables.d.ts.map +1 -1
  144. package/lib/src/embed/app.d.ts +22 -1
  145. package/lib/src/embed/app.d.ts.map +1 -1
  146. package/lib/src/embed/app.js +22 -1
  147. package/lib/src/embed/app.js.map +1 -1
  148. package/lib/src/embed/app.spec.js +70 -3
  149. package/lib/src/embed/app.spec.js.map +1 -1
  150. package/lib/src/embed/bodyless-conversation.d.ts +0 -1
  151. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  152. package/lib/src/embed/bodyless-conversation.js +3 -7
  153. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  154. package/lib/src/embed/conversation.d.ts +2 -3
  155. package/lib/src/embed/conversation.d.ts.map +1 -1
  156. package/lib/src/embed/conversation.js +2 -7
  157. package/lib/src/embed/conversation.js.map +1 -1
  158. package/lib/src/embed/liveboard.d.ts +32 -1
  159. package/lib/src/embed/liveboard.d.ts.map +1 -1
  160. package/lib/src/embed/liveboard.js +8 -25
  161. package/lib/src/embed/liveboard.js.map +1 -1
  162. package/lib/src/embed/liveboard.spec.js +96 -28
  163. package/lib/src/embed/liveboard.spec.js.map +1 -1
  164. package/lib/src/embed/sage.d.ts +0 -1
  165. package/lib/src/embed/sage.d.ts.map +1 -1
  166. package/lib/src/embed/sage.js +6 -10
  167. package/lib/src/embed/sage.js.map +1 -1
  168. package/lib/src/embed/sage.spec.js +20 -10
  169. package/lib/src/embed/sage.spec.js.map +1 -1
  170. package/lib/src/embed/search-bar.d.ts +0 -1
  171. package/lib/src/embed/search-bar.d.ts.map +1 -1
  172. package/lib/src/embed/search-bar.js +7 -11
  173. package/lib/src/embed/search-bar.js.map +1 -1
  174. package/lib/src/embed/search.d.ts +0 -1
  175. package/lib/src/embed/search.d.ts.map +1 -1
  176. package/lib/src/embed/search.js +8 -7
  177. package/lib/src/embed/search.js.map +1 -1
  178. package/lib/src/embed/search.spec.js +11 -11
  179. package/lib/src/embed/search.spec.js.map +1 -1
  180. package/lib/src/embed/ts-embed.d.ts +5 -7
  181. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  182. package/lib/src/embed/ts-embed.js +25 -22
  183. package/lib/src/embed/ts-embed.js.map +1 -1
  184. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  185. package/lib/src/embed/ts-embed.spec.js +123 -1
  186. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  187. package/lib/src/errors.d.ts +11 -0
  188. package/lib/src/errors.d.ts.map +1 -1
  189. package/lib/src/errors.js +11 -0
  190. package/lib/src/errors.js.map +1 -1
  191. package/lib/src/index.d.ts +2 -2
  192. package/lib/src/index.d.ts.map +1 -1
  193. package/lib/src/index.js +2 -2
  194. package/lib/src/index.js.map +1 -1
  195. package/lib/src/react/index.d.ts +1 -1
  196. package/lib/src/react/index.d.ts.map +1 -1
  197. package/lib/src/react/index.js +3 -2
  198. package/lib/src/react/index.js.map +1 -1
  199. package/lib/src/react/index.spec.js +1 -1
  200. package/lib/src/react/index.spec.js.map +1 -1
  201. package/lib/src/types.d.ts +163 -21
  202. package/lib/src/types.d.ts.map +1 -1
  203. package/lib/src/types.js +64 -21
  204. package/lib/src/types.js.map +1 -1
  205. package/lib/src/utils/custom-actions.d.ts +12 -0
  206. package/lib/src/utils/custom-actions.d.ts.map +1 -0
  207. package/lib/src/utils/custom-actions.js +175 -0
  208. package/lib/src/utils/custom-actions.js.map +1 -0
  209. package/lib/src/utils/custom-actions.spec.d.ts +2 -0
  210. package/lib/src/utils/custom-actions.spec.d.ts.map +1 -0
  211. package/lib/src/utils/custom-actions.spec.js +397 -0
  212. package/lib/src/utils/custom-actions.spec.js.map +1 -0
  213. package/lib/src/utils/processData.d.ts.map +1 -1
  214. package/lib/src/utils/processData.js +10 -0
  215. package/lib/src/utils/processData.js.map +1 -1
  216. package/lib/src/utils/processData.spec.js +11 -0
  217. package/lib/src/utils/processData.spec.js.map +1 -1
  218. package/lib/src/utils.d.ts +21 -0
  219. package/lib/src/utils.d.ts.map +1 -1
  220. package/lib/src/utils.js +29 -0
  221. package/lib/src/utils.js.map +1 -1
  222. package/lib/src/utils.spec.js +39 -1
  223. package/lib/src/utils.spec.js.map +1 -1
  224. package/lib/src/visual-embed-sdk.d.ts +229 -40
  225. package/package.json +3 -3
  226. package/src/authToken.spec.ts +48 -1
  227. package/src/authToken.ts +13 -2
  228. package/src/css-variables.ts +2 -1
  229. package/src/embed/app.spec.ts +99 -3
  230. package/src/embed/app.ts +44 -1
  231. package/src/embed/bodyless-conversation.ts +3 -8
  232. package/src/embed/conversation.ts +4 -19
  233. package/src/embed/liveboard.spec.ts +128 -30
  234. package/src/embed/liveboard.ts +66 -52
  235. package/src/embed/sage.spec.ts +24 -10
  236. package/src/embed/sage.ts +7 -12
  237. package/src/embed/search-bar.tsx +7 -14
  238. package/src/embed/search.spec.ts +13 -14
  239. package/src/embed/search.ts +8 -19
  240. package/src/embed/ts-embed.spec.ts +136 -2
  241. package/src/embed/ts-embed.ts +31 -28
  242. package/src/errors.ts +12 -0
  243. package/src/index.ts +4 -0
  244. package/src/react/index.spec.tsx +1 -1
  245. package/src/react/index.tsx +5 -2
  246. package/src/types.ts +225 -79
  247. package/src/utils/custom-actions.spec.ts +431 -0
  248. package/src/utils/custom-actions.ts +217 -0
  249. package/src/utils/processData.spec.ts +12 -0
  250. package/src/utils/processData.ts +10 -0
  251. package/src/utils.spec.ts +52 -0
  252. package/src/utils.ts +31 -0
  253. package/dist/index-BDlM0f0T.js +0 -7371
  254. package/dist/index-D1pyb7RG.js +0 -7371
  255. package/dist/index-DeFzsyFF.js +0 -7371
  256. package/dist/index-Dpf0rd6w.js +0 -7371
  257. package/dist/index-UuEbsISo.js +0 -7447
  258. package/dist/index-e3Uw3YFO.js +0 -7371
  259. package/dist/index-k7pkZMhx.js +0 -7371
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.41.0-pre-render-1 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.41.1 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -195,7 +195,6 @@ merge.withOptions = (options, ...objects) => {
195
195
  * the embedded app
196
196
  * @group Authentication / Init
197
197
  */
198
- // eslint-disable-next-line no-shadow
199
198
  var AuthType;
200
199
  (function (AuthType) {
201
200
  /**
@@ -409,7 +408,6 @@ var HomeLeftNavItem;
409
408
  /**
410
409
  * A map of the supported runtime filter operations
411
410
  */
412
- // eslint-disable-next-line no-shadow
413
411
  var RuntimeFilterOp;
414
412
  (function (RuntimeFilterOp) {
415
413
  /**
@@ -480,7 +478,6 @@ var RuntimeFilterOp;
480
478
  * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
481
479
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
482
480
  */
483
- // eslint-disable-next-line no-shadow
484
481
  var HomepageModule;
485
482
  (function (HomepageModule) {
486
483
  /**
@@ -513,7 +510,6 @@ var HomepageModule;
513
510
  * **Note**: This option is applicable to full app embedding only.
514
511
  * @version SDK: 1.38.0 | ThoughtSpot: 10.9.0.cl
515
512
  */
516
- // eslint-disable-next-line no-shadow
517
513
  var ListPageColumns;
518
514
  (function (ListPageColumns) {
519
515
  /**
@@ -576,7 +572,6 @@ var ListPageColumns;
576
572
  * ```
577
573
  * @group Events
578
574
  */
579
- // eslint-disable-next-line no-shadow
580
575
  var EmbedEvent;
581
576
  (function (EmbedEvent) {
582
577
  /**
@@ -1218,6 +1213,11 @@ var EmbedEvent;
1218
1213
  * @hidden
1219
1214
  */
1220
1215
  EmbedEvent["APP_INIT"] = "appInit";
1216
+ /**
1217
+ * Internal event to clear the cached info
1218
+ * @hidden
1219
+ */
1220
+ EmbedEvent["CLEAR_INFO_CACHE"] = "clearInfoCache";
1221
1221
  /**
1222
1222
  * Emitted when a user clicks **Show Liveboard details** on a Liveboard
1223
1223
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
@@ -1686,6 +1686,17 @@ var EmbedEvent;
1686
1686
  * ```
1687
1687
  */
1688
1688
  EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
1689
+ /**
1690
+ * Emitted when the organization is switched.
1691
+ * @example
1692
+ * ```js
1693
+ * appEmbed.on(EmbedEvent.OrgSwitched, (payload) => {
1694
+ * console.log('payload', payload);
1695
+ * })
1696
+ * ```
1697
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1698
+ */
1699
+ EmbedEvent["OrgSwitched"] = "orgSwitched";
1689
1700
  })(EmbedEvent || (EmbedEvent = {}));
1690
1701
  /**
1691
1702
  * Event types that can be triggered by the host application
@@ -1740,7 +1751,6 @@ var EmbedEvent;
1740
1751
  * ```
1741
1752
  * @group Events
1742
1753
  */
1743
- // eslint-disable-next-line no-shadow
1744
1754
  var HostEvent;
1745
1755
  (function (HostEvent) {
1746
1756
  /**
@@ -2604,7 +2614,7 @@ var HostEvent;
2604
2614
  * column: "Date",
2605
2615
  * oper: 'EQ',
2606
2616
  * values: ["2023-07-31"],
2607
- * types: "EXACT_DATE"
2617
+ * type: "EXACT_DATE"
2608
2618
  * }]
2609
2619
  * });
2610
2620
  * ```
@@ -2950,22 +2960,11 @@ var HostEvent;
2950
2960
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2951
2961
  */
2952
2962
  HostEvent["AskSpotter"] = "AskSpotter";
2953
- /**
2954
- * @hidden
2955
- * Triggers the update of the embed params.
2956
- *
2957
- * @example
2958
- * ```js
2959
- * liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
2960
- * ```
2961
- */
2962
- HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
2963
2963
  })(HostEvent || (HostEvent = {}));
2964
2964
  /**
2965
2965
  * The different visual modes that the data sources panel within
2966
2966
  * search could appear in, such as hidden, collapsed, or expanded.
2967
2967
  */
2968
- // eslint-disable-next-line no-shadow
2969
2968
  var DataSourceVisualMode;
2970
2969
  (function (DataSourceVisualMode) {
2971
2970
  /**
@@ -2985,7 +2984,6 @@ var DataSourceVisualMode;
2985
2984
  * The query params passed down to the embedded ThoughtSpot app
2986
2985
  * containing configuration and/or visual information.
2987
2986
  */
2988
- // eslint-disable-next-line no-shadow
2989
2987
  var Param;
2990
2988
  (function (Param) {
2991
2989
  Param["EmbedApp"] = "embedApp";
@@ -3065,6 +3063,7 @@ var Param;
3065
3063
  Param["Query"] = "query";
3066
3064
  Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
3067
3065
  Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
3066
+ Param["HomepageVersion"] = "homepageVersion";
3068
3067
  Param["ListPageVersion"] = "listpageVersion";
3069
3068
  Param["PendoTrackingKey"] = "additionalPendoKey";
3070
3069
  Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
@@ -3106,6 +3105,8 @@ var Param;
3106
3105
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3107
3106
  Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3108
3107
  Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3108
+ Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
3109
+ Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
3109
3110
  })(Param || (Param = {}));
3110
3111
  /**
3111
3112
  * ThoughtSpot application pages include actions and menu commands
@@ -3134,7 +3135,6 @@ var Param;
3134
3135
  * ```
3135
3136
  * See also link:https://developers.thoughtspot.com/docs/actions[Action IDs in the SDK]
3136
3137
  */
3137
- // eslint-disable-next-line no-shadow
3138
3138
  var Action;
3139
3139
  (function (Action) {
3140
3140
  /**
@@ -3679,7 +3679,7 @@ var Action;
3679
3679
  * The Favorites icon (*) for Answers,
3680
3680
  * Liveboard, and data objects like Worksheet, Model,
3681
3681
  * Tables and Views.
3682
- * Allows adding an object to the users favorites list.
3682
+ * Allows adding an object to the user's favorites list.
3683
3683
  * @example
3684
3684
  * ```js
3685
3685
  * disabledActions: [Action.AddToFavorites]
@@ -4388,6 +4388,29 @@ var Action;
4388
4388
  * @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
4389
4389
  */
4390
4390
  Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
4391
+ /**
4392
+ * The **PNG screenshot in email** option in the schedule email dialog.
4393
+ * Includes a PNG screenshot in the notification email body.
4394
+ * @example
4395
+ * ```js
4396
+ * disabledActions: [Action.PngScreenshotInEmail]
4397
+ * ```
4398
+ * ```
4399
+ * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4400
+ */
4401
+ Action["PngScreenshotInEmail"] = "pngScreenshotInEmail";
4402
+ /**
4403
+ * The **Remove attachment** action in the schedule email dialog.
4404
+ * Removes an attachment from the email configuration.
4405
+ * @example
4406
+ * ```js
4407
+ * disabledActions: [Action.RemoveAttachment]
4408
+ * ```
4409
+ * ```
4410
+ * ```
4411
+ * @version SDK: 1.42.0 | ThoughtSpot Cloud: 10.14.0.cl
4412
+ */
4413
+ Action["RemoveAttachment"] = "removeAttachment";
4391
4414
  })(Action || (Action = {}));
4392
4415
  var PrefetchFeatures;
4393
4416
  (function (PrefetchFeatures) {
@@ -4406,6 +4429,26 @@ var ContextMenuTriggerOptions;
4406
4429
  ContextMenuTriggerOptions["RIGHT_CLICK"] = "right-click";
4407
4430
  ContextMenuTriggerOptions["BOTH_CLICKS"] = "both-clicks";
4408
4431
  })(ContextMenuTriggerOptions || (ContextMenuTriggerOptions = {}));
4432
+ /**
4433
+ * Enum options to show custom actions at different
4434
+ * positions in the application.
4435
+ */
4436
+ var CustomActionsPosition;
4437
+ (function (CustomActionsPosition) {
4438
+ CustomActionsPosition["PRIMARY"] = "PRIMARY";
4439
+ CustomActionsPosition["MENU"] = "MENU";
4440
+ CustomActionsPosition["CONTEXTMENU"] = "CONTEXTMENU";
4441
+ })(CustomActionsPosition || (CustomActionsPosition = {}));
4442
+ /**
4443
+ * Enum options to mention the target of the custom action.
4444
+ */
4445
+ var CustomActionTarget;
4446
+ (function (CustomActionTarget) {
4447
+ CustomActionTarget["LIVEBOARD"] = "LIVEBOARD";
4448
+ CustomActionTarget["VIZ"] = "VIZ";
4449
+ CustomActionTarget["ANSWER"] = "ANSWER";
4450
+ CustomActionTarget["SPOTTER"] = "SPOTTER";
4451
+ })(CustomActionTarget || (CustomActionTarget = {}));
4409
4452
  /**
4410
4453
  * Enum options to show or suppress Visual Embed SDK and
4411
4454
  * ThoughtSpot application logs in the console output.
@@ -4866,6 +4909,15 @@ function storeValueInWindow(key, value, options = {}) {
4866
4909
  * @returns The stored value or `undefined` if the key is not found.
4867
4910
  */
4868
4911
  const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
4912
+ /**
4913
+ * Check if an array includes a string value
4914
+ * @param arr - The array to check
4915
+ * @param key - The string to search for
4916
+ * @returns boolean indicating if the string is found in the array
4917
+ */
4918
+ const arrayIncludesString = (arr, key) => {
4919
+ return arr.some(item => typeof item === 'string' && item === key);
4920
+ };
4869
4921
  /**
4870
4922
  * Check if the document is currently in fullscreen mode
4871
4923
  */
@@ -4947,6 +4999,26 @@ const calculateVisibleElementData = (element) => {
4947
4999
  width: Math.max(0, frameRelativeRight - frameRelativeLeft),
4948
5000
  };
4949
5001
  return data;
5002
+ };
5003
+ /**
5004
+ * Replaces placeholders in a template string with provided values.
5005
+ * Placeholders should be in the format {key}.
5006
+ * @param template - The template string with placeholders
5007
+ * @param values - An object containing key-value pairs to replace placeholders
5008
+ * @returns The template string with placeholders replaced
5009
+ * @example
5010
+ * formatTemplate('Hello {name}, you are {age} years old', { name: 'John', age: 30 })
5011
+ * // Returns: 'Hello John, you are 30 years old'
5012
+ *
5013
+ * formatTemplate('Expected {type}, but received {actual}', { type: 'string', actual: 'number' })
5014
+ * // Returns: 'Expected string, but received number'
5015
+ */
5016
+ const formatTemplate = (template, values) => {
5017
+ // This regex /\{(\w+)\}/g finds all placeholders in the format {word}
5018
+ // and captures the word inside the braces for replacement.
5019
+ return template.replace(/\{(\w+)\}/g, (match, key) => {
5020
+ return values[key] !== undefined ? String(values[key]) : match;
5021
+ });
4950
5022
  };
4951
5023
 
4952
5024
  /**
@@ -5950,8 +6022,8 @@ function cacheHas(cache, key) {
5950
6022
  var _cacheHas = cacheHas;
5951
6023
 
5952
6024
  /** Used to compose bitmasks for value comparisons. */
5953
- var COMPARE_PARTIAL_FLAG$3 = 1,
5954
- COMPARE_UNORDERED_FLAG$1 = 2;
6025
+ var COMPARE_PARTIAL_FLAG$5 = 1,
6026
+ COMPARE_UNORDERED_FLAG$3 = 2;
5955
6027
 
5956
6028
  /**
5957
6029
  * A specialized version of `baseIsEqualDeep` for arrays with support for
@@ -5967,7 +6039,7 @@ var COMPARE_PARTIAL_FLAG$3 = 1,
5967
6039
  * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
5968
6040
  */
5969
6041
  function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
5970
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
6042
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$5,
5971
6043
  arrLength = array.length,
5972
6044
  othLength = other.length;
5973
6045
 
@@ -5982,7 +6054,7 @@ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
5982
6054
  }
5983
6055
  var index = -1,
5984
6056
  result = true,
5985
- seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new _SetCache : undefined;
6057
+ seen = (bitmask & COMPARE_UNORDERED_FLAG$3) ? new _SetCache : undefined;
5986
6058
 
5987
6059
  stack.set(array, other);
5988
6060
  stack.set(other, array);
@@ -6074,8 +6146,8 @@ function setToArray(set) {
6074
6146
  var _setToArray = setToArray;
6075
6147
 
6076
6148
  /** Used to compose bitmasks for value comparisons. */
6077
- var COMPARE_PARTIAL_FLAG$2 = 1,
6078
- COMPARE_UNORDERED_FLAG = 2;
6149
+ var COMPARE_PARTIAL_FLAG$4 = 1,
6150
+ COMPARE_UNORDERED_FLAG$2 = 2;
6079
6151
 
6080
6152
  /** `Object#toString` result references. */
6081
6153
  var boolTag$1 = '[object Boolean]',
@@ -6086,14 +6158,14 @@ var boolTag$1 = '[object Boolean]',
6086
6158
  regexpTag$1 = '[object RegExp]',
6087
6159
  setTag$3 = '[object Set]',
6088
6160
  stringTag$1 = '[object String]',
6089
- symbolTag = '[object Symbol]';
6161
+ symbolTag$1 = '[object Symbol]';
6090
6162
 
6091
6163
  var arrayBufferTag$1 = '[object ArrayBuffer]',
6092
6164
  dataViewTag$2 = '[object DataView]';
6093
6165
 
6094
6166
  /** Used to convert symbols to primitives and strings. */
6095
- var symbolProto = _Symbol ? _Symbol.prototype : undefined,
6096
- symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
6167
+ var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
6168
+ symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
6097
6169
 
6098
6170
  /**
6099
6171
  * A specialized version of `baseIsEqualDeep` for comparing objects of
@@ -6150,7 +6222,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
6150
6222
  var convert = _mapToArray;
6151
6223
 
6152
6224
  case setTag$3:
6153
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
6225
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$4;
6154
6226
  convert || (convert = _setToArray);
6155
6227
 
6156
6228
  if (object.size != other.size && !isPartial) {
@@ -6161,7 +6233,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
6161
6233
  if (stacked) {
6162
6234
  return stacked == other;
6163
6235
  }
6164
- bitmask |= COMPARE_UNORDERED_FLAG;
6236
+ bitmask |= COMPARE_UNORDERED_FLAG$2;
6165
6237
 
6166
6238
  // Recursively compare objects (susceptible to call stack limits).
6167
6239
  stack.set(object, other);
@@ -6169,7 +6241,7 @@ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
6169
6241
  stack['delete'](object);
6170
6242
  return result;
6171
6243
 
6172
- case symbolTag:
6244
+ case symbolTag$1:
6173
6245
  if (symbolValueOf) {
6174
6246
  return symbolValueOf.call(object) == symbolValueOf.call(other);
6175
6247
  }
@@ -6860,7 +6932,7 @@ function getAllKeys(object) {
6860
6932
  var _getAllKeys = getAllKeys;
6861
6933
 
6862
6934
  /** Used to compose bitmasks for value comparisons. */
6863
- var COMPARE_PARTIAL_FLAG$1 = 1;
6935
+ var COMPARE_PARTIAL_FLAG$3 = 1;
6864
6936
 
6865
6937
  /** Used for built-in method references. */
6866
6938
  var objectProto$2 = Object.prototype;
@@ -6882,7 +6954,7 @@ var hasOwnProperty$3 = objectProto$2.hasOwnProperty;
6882
6954
  * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
6883
6955
  */
6884
6956
  function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
6885
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
6957
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
6886
6958
  objProps = _getAllKeys(object),
6887
6959
  objLength = objProps.length,
6888
6960
  othProps = _getAllKeys(other),
@@ -7020,7 +7092,7 @@ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
7020
7092
  var _getTag = getTag;
7021
7093
 
7022
7094
  /** Used to compose bitmasks for value comparisons. */
7023
- var COMPARE_PARTIAL_FLAG = 1;
7095
+ var COMPARE_PARTIAL_FLAG$2 = 1;
7024
7096
 
7025
7097
  /** `Object#toString` result references. */
7026
7098
  var argsTag = '[object Arguments]',
@@ -7073,7 +7145,7 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
7073
7145
  ? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
7074
7146
  : _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
7075
7147
  }
7076
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
7148
+ if (!(bitmask & COMPARE_PARTIAL_FLAG$2)) {
7077
7149
  var objIsWrapped = objIsObj && hasOwnProperty$2.call(object, '__wrapped__'),
7078
7150
  othIsWrapped = othIsObj && hasOwnProperty$2.call(other, '__wrapped__');
7079
7151
 
@@ -7235,6 +7307,7 @@ const ERROR_MESSAGE = {
7235
7307
  SDK_NOT_INITIALIZED: 'SDK not initialized',
7236
7308
  SESSION_INFO_FAILED: 'Failed to get session information',
7237
7309
  INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
7310
+ INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
7238
7311
  MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
7239
7312
  PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
7240
7313
  SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
@@ -7243,6 +7316,16 @@ const ERROR_MESSAGE = {
7243
7316
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7244
7317
  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',
7245
7318
  SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7319
+ };
7320
+ const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7321
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
7322
+ MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
7323
+ UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
7324
+ INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
7325
+ INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
7326
+ INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
7327
+ INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
7328
+ DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
7246
7329
  };
7247
7330
 
7248
7331
  const EndPoints = {
@@ -7405,6 +7488,15 @@ async function getAuthenticationToken(embedConfig) {
7405
7488
  return authToken;
7406
7489
  }
7407
7490
  const validateAuthToken = async (embedConfig, authToken, suppressAlert) => {
7491
+ // even if token verification is disabled, we will still validate
7492
+ // that the token is a string before proceeding.
7493
+ if (typeof authToken !== 'string') {
7494
+ const errorMessage = formatTemplate(ERROR_MESSAGE.INVALID_TOKEN_TYPE_ERROR, {
7495
+ invalidType: typeof authToken,
7496
+ });
7497
+ logger$3.error(errorMessage);
7498
+ throw new Error(errorMessage);
7499
+ }
7408
7500
  const cachedAuthToken = getCacheAuthToken();
7409
7501
  if (embedConfig.disableTokenVerification) {
7410
7502
  logger$3.info('Token verification is disabled. Assuming token is valid.');
@@ -8095,141 +8187,1571 @@ class AnswerService {
8095
8187
  if (columnsToRemove.length) {
8096
8188
  await unaggAnswerSession.removeColumns(columnsToRemove);
8097
8189
  }
8098
- return unaggAnswerSession;
8099
- }
8100
- /**
8101
- * Execute a custom graphql query in the context of the answer.
8102
- * @param query graphql query
8103
- * @param variables graphql variables
8104
- * @returns
8105
- */
8106
- async executeQuery(query, variables) {
8107
- const data = await graphqlQuery({
8108
- query,
8109
- variables: {
8110
- session: this.session,
8111
- ...variables,
8112
- },
8113
- thoughtSpotHost: this.thoughtSpotHost,
8114
- isCompositeQuery: false,
8115
- });
8116
- this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
8117
- return data;
8118
- }
8119
- /**
8120
- * Get the internal session details for the answer.
8121
- * @returns
8122
- */
8123
- getSession() {
8124
- return this.session;
8190
+ return unaggAnswerSession;
8191
+ }
8192
+ /**
8193
+ * Execute a custom graphql query in the context of the answer.
8194
+ * @param query graphql query
8195
+ * @param variables graphql variables
8196
+ * @returns
8197
+ */
8198
+ async executeQuery(query, variables) {
8199
+ const data = await graphqlQuery({
8200
+ query,
8201
+ variables: {
8202
+ session: this.session,
8203
+ ...variables,
8204
+ },
8205
+ thoughtSpotHost: this.thoughtSpotHost,
8206
+ isCompositeQuery: false,
8207
+ });
8208
+ this.session = deepMerge(this.session, (data === null || data === void 0 ? void 0 : data.id) || {});
8209
+ return data;
8210
+ }
8211
+ /**
8212
+ * Get the internal session details for the answer.
8213
+ * @returns
8214
+ */
8215
+ getSession() {
8216
+ return this.session;
8217
+ }
8218
+ async getAnswer() {
8219
+ if (this.answer) {
8220
+ return this.answer;
8221
+ }
8222
+ this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
8223
+ return this.answer;
8224
+ }
8225
+ async getTML() {
8226
+ const { object } = await this.executeQuery(getAnswerTML, {});
8227
+ const edoc = object[0].edoc;
8228
+ const YAML = await import('./index-DQueHwfQ.js');
8229
+ const parsedDoc = YAML.parse(edoc);
8230
+ return {
8231
+ answer: {
8232
+ ...parsedDoc.answer,
8233
+ ...this.tmlOverride,
8234
+ },
8235
+ };
8236
+ }
8237
+ async addDisplayedVizToLiveboard(liveboardId) {
8238
+ const { displayMode, visualizations } = await this.getAnswer();
8239
+ const viz = getDisplayedViz(visualizations, displayMode);
8240
+ return this.executeQuery(addVizToLiveboard, {
8241
+ liveboardId,
8242
+ vizId: viz.id,
8243
+ });
8244
+ }
8245
+ setTMLOverride(override) {
8246
+ this.tmlOverride = override;
8247
+ }
8248
+ }
8249
+ /**
8250
+ *
8251
+ * @param sourceDetail
8252
+ * @param colNames
8253
+ */
8254
+ function getGuidsFromColumnNames(sourceDetail, colNames) {
8255
+ const cols = sourceDetail.columns.reduce((colSet, col) => {
8256
+ colSet[col.name.toLowerCase()] = col;
8257
+ return colSet;
8258
+ }, {});
8259
+ return new Set(colNames.map((colName) => {
8260
+ const col = cols[colName.toLowerCase()];
8261
+ return col.id;
8262
+ }));
8263
+ }
8264
+ /**
8265
+ *
8266
+ * @param selectedPoints
8267
+ */
8268
+ function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
8269
+ const underlyingDataPoint = [];
8270
+ /**
8271
+ *
8272
+ * @param colVal
8273
+ */
8274
+ function addPointFromColVal(colVal) {
8275
+ var _a;
8276
+ const dataType = colVal.column.dataType;
8277
+ colVal.column.id;
8278
+ let dataValue;
8279
+ if (dataType === 'DATE') {
8280
+ if (Number.isFinite(colVal.value)) {
8281
+ dataValue = [{
8282
+ epochRange: {
8283
+ startEpoch: colVal.value,
8284
+ },
8285
+ }];
8286
+ // Case for custom calendar.
8287
+ }
8288
+ else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
8289
+ dataValue = [{
8290
+ epochRange: {
8291
+ startEpoch: colVal.value.v.s,
8292
+ endEpoch: colVal.value.v.e,
8293
+ },
8294
+ }];
8295
+ }
8296
+ }
8297
+ else {
8298
+ dataValue = [{ value: colVal.value }];
8299
+ }
8300
+ underlyingDataPoint.push({
8301
+ columnId: colVal.column.id,
8302
+ dataValue,
8303
+ });
8304
+ }
8305
+ selectedPoints.forEach((p) => {
8306
+ p.selectedAttributes.forEach(addPointFromColVal);
8307
+ });
8308
+ return underlyingDataPoint;
8309
+ }
8310
+ /**
8311
+ *
8312
+ * @param visualizations
8313
+ * @param displayMode
8314
+ */
8315
+ function getDisplayedViz(visualizations, displayMode) {
8316
+ if (displayMode === 'CHART_MODE') {
8317
+ return visualizations.find(
8318
+ // eslint-disable-next-line no-underscore-dangle
8319
+ (viz) => viz.__typename === 'ChartViz');
8320
+ }
8321
+ return visualizations.find(
8322
+ // eslint-disable-next-line no-underscore-dangle
8323
+ (viz) => viz.__typename === 'TableViz');
8324
+ }
8325
+
8326
+ /** Built-in value references. */
8327
+ var spreadableSymbol = _Symbol ? _Symbol.isConcatSpreadable : undefined;
8328
+
8329
+ /**
8330
+ * Checks if `value` is a flattenable `arguments` object or array.
8331
+ *
8332
+ * @private
8333
+ * @param {*} value The value to check.
8334
+ * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
8335
+ */
8336
+ function isFlattenable(value) {
8337
+ return isArray_1(value) || isArguments_1(value) ||
8338
+ !!(spreadableSymbol && value && value[spreadableSymbol]);
8339
+ }
8340
+
8341
+ var _isFlattenable = isFlattenable;
8342
+
8343
+ /**
8344
+ * The base implementation of `_.flatten` with support for restricting flattening.
8345
+ *
8346
+ * @private
8347
+ * @param {Array} array The array to flatten.
8348
+ * @param {number} depth The maximum recursion depth.
8349
+ * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
8350
+ * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
8351
+ * @param {Array} [result=[]] The initial result value.
8352
+ * @returns {Array} Returns the new flattened array.
8353
+ */
8354
+ function baseFlatten(array, depth, predicate, isStrict, result) {
8355
+ var index = -1,
8356
+ length = array.length;
8357
+
8358
+ predicate || (predicate = _isFlattenable);
8359
+ result || (result = []);
8360
+
8361
+ while (++index < length) {
8362
+ var value = array[index];
8363
+ if (depth > 0 && predicate(value)) {
8364
+ if (depth > 1) {
8365
+ // Recursively flatten arrays (susceptible to call stack limits).
8366
+ baseFlatten(value, depth - 1, predicate, isStrict, result);
8367
+ } else {
8368
+ _arrayPush(result, value);
8369
+ }
8370
+ } else if (!isStrict) {
8371
+ result[result.length] = value;
8372
+ }
8373
+ }
8374
+ return result;
8375
+ }
8376
+
8377
+ var _baseFlatten = baseFlatten;
8378
+
8379
+ /**
8380
+ * A specialized version of `_.map` for arrays without support for iteratee
8381
+ * shorthands.
8382
+ *
8383
+ * @private
8384
+ * @param {Array} [array] The array to iterate over.
8385
+ * @param {Function} iteratee The function invoked per iteration.
8386
+ * @returns {Array} Returns the new mapped array.
8387
+ */
8388
+ function arrayMap(array, iteratee) {
8389
+ var index = -1,
8390
+ length = array == null ? 0 : array.length,
8391
+ result = Array(length);
8392
+
8393
+ while (++index < length) {
8394
+ result[index] = iteratee(array[index], index, array);
8395
+ }
8396
+ return result;
8397
+ }
8398
+
8399
+ var _arrayMap = arrayMap;
8400
+
8401
+ /** `Object#toString` result references. */
8402
+ var symbolTag = '[object Symbol]';
8403
+
8404
+ /**
8405
+ * Checks if `value` is classified as a `Symbol` primitive or object.
8406
+ *
8407
+ * @static
8408
+ * @memberOf _
8409
+ * @since 4.0.0
8410
+ * @category Lang
8411
+ * @param {*} value The value to check.
8412
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
8413
+ * @example
8414
+ *
8415
+ * _.isSymbol(Symbol.iterator);
8416
+ * // => true
8417
+ *
8418
+ * _.isSymbol('abc');
8419
+ * // => false
8420
+ */
8421
+ function isSymbol(value) {
8422
+ return typeof value == 'symbol' ||
8423
+ (isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
8424
+ }
8425
+
8426
+ var isSymbol_1 = isSymbol;
8427
+
8428
+ /** Used to match property names within property paths. */
8429
+ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
8430
+ reIsPlainProp = /^\w*$/;
8431
+
8432
+ /**
8433
+ * Checks if `value` is a property name and not a property path.
8434
+ *
8435
+ * @private
8436
+ * @param {*} value The value to check.
8437
+ * @param {Object} [object] The object to query keys on.
8438
+ * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
8439
+ */
8440
+ function isKey(value, object) {
8441
+ if (isArray_1(value)) {
8442
+ return false;
8443
+ }
8444
+ var type = typeof value;
8445
+ if (type == 'number' || type == 'symbol' || type == 'boolean' ||
8446
+ value == null || isSymbol_1(value)) {
8447
+ return true;
8448
+ }
8449
+ return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
8450
+ (object != null && value in Object(object));
8451
+ }
8452
+
8453
+ var _isKey = isKey;
8454
+
8455
+ /** Error message constants. */
8456
+ var FUNC_ERROR_TEXT = 'Expected a function';
8457
+
8458
+ /**
8459
+ * Creates a function that memoizes the result of `func`. If `resolver` is
8460
+ * provided, it determines the cache key for storing the result based on the
8461
+ * arguments provided to the memoized function. By default, the first argument
8462
+ * provided to the memoized function is used as the map cache key. The `func`
8463
+ * is invoked with the `this` binding of the memoized function.
8464
+ *
8465
+ * **Note:** The cache is exposed as the `cache` property on the memoized
8466
+ * function. Its creation may be customized by replacing the `_.memoize.Cache`
8467
+ * constructor with one whose instances implement the
8468
+ * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
8469
+ * method interface of `clear`, `delete`, `get`, `has`, and `set`.
8470
+ *
8471
+ * @static
8472
+ * @memberOf _
8473
+ * @since 0.1.0
8474
+ * @category Function
8475
+ * @param {Function} func The function to have its output memoized.
8476
+ * @param {Function} [resolver] The function to resolve the cache key.
8477
+ * @returns {Function} Returns the new memoized function.
8478
+ * @example
8479
+ *
8480
+ * var object = { 'a': 1, 'b': 2 };
8481
+ * var other = { 'c': 3, 'd': 4 };
8482
+ *
8483
+ * var values = _.memoize(_.values);
8484
+ * values(object);
8485
+ * // => [1, 2]
8486
+ *
8487
+ * values(other);
8488
+ * // => [3, 4]
8489
+ *
8490
+ * object.a = 2;
8491
+ * values(object);
8492
+ * // => [1, 2]
8493
+ *
8494
+ * // Modify the result cache.
8495
+ * values.cache.set(object, ['a', 'b']);
8496
+ * values(object);
8497
+ * // => ['a', 'b']
8498
+ *
8499
+ * // Replace `_.memoize.Cache`.
8500
+ * _.memoize.Cache = WeakMap;
8501
+ */
8502
+ function memoize(func, resolver) {
8503
+ if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
8504
+ throw new TypeError(FUNC_ERROR_TEXT);
8505
+ }
8506
+ var memoized = function() {
8507
+ var args = arguments,
8508
+ key = resolver ? resolver.apply(this, args) : args[0],
8509
+ cache = memoized.cache;
8510
+
8511
+ if (cache.has(key)) {
8512
+ return cache.get(key);
8513
+ }
8514
+ var result = func.apply(this, args);
8515
+ memoized.cache = cache.set(key, result) || cache;
8516
+ return result;
8517
+ };
8518
+ memoized.cache = new (memoize.Cache || _MapCache);
8519
+ return memoized;
8520
+ }
8521
+
8522
+ // Expose `MapCache`.
8523
+ memoize.Cache = _MapCache;
8524
+
8525
+ var memoize_1 = memoize;
8526
+
8527
+ /** Used as the maximum memoize cache size. */
8528
+ var MAX_MEMOIZE_SIZE = 500;
8529
+
8530
+ /**
8531
+ * A specialized version of `_.memoize` which clears the memoized function's
8532
+ * cache when it exceeds `MAX_MEMOIZE_SIZE`.
8533
+ *
8534
+ * @private
8535
+ * @param {Function} func The function to have its output memoized.
8536
+ * @returns {Function} Returns the new memoized function.
8537
+ */
8538
+ function memoizeCapped(func) {
8539
+ var result = memoize_1(func, function(key) {
8540
+ if (cache.size === MAX_MEMOIZE_SIZE) {
8541
+ cache.clear();
8542
+ }
8543
+ return key;
8544
+ });
8545
+
8546
+ var cache = result.cache;
8547
+ return result;
8548
+ }
8549
+
8550
+ var _memoizeCapped = memoizeCapped;
8551
+
8552
+ /** Used to match property names within property paths. */
8553
+ var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
8554
+
8555
+ /** Used to match backslashes in property paths. */
8556
+ var reEscapeChar = /\\(\\)?/g;
8557
+
8558
+ /**
8559
+ * Converts `string` to a property path array.
8560
+ *
8561
+ * @private
8562
+ * @param {string} string The string to convert.
8563
+ * @returns {Array} Returns the property path array.
8564
+ */
8565
+ var stringToPath = _memoizeCapped(function(string) {
8566
+ var result = [];
8567
+ if (string.charCodeAt(0) === 46 /* . */) {
8568
+ result.push('');
8569
+ }
8570
+ string.replace(rePropName, function(match, number, quote, subString) {
8571
+ result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
8572
+ });
8573
+ return result;
8574
+ });
8575
+
8576
+ var _stringToPath = stringToPath;
8577
+
8578
+ /** Used as references for various `Number` constants. */
8579
+ var INFINITY$1 = 1 / 0;
8580
+
8581
+ /** Used to convert symbols to primitives and strings. */
8582
+ var symbolProto = _Symbol ? _Symbol.prototype : undefined,
8583
+ symbolToString = symbolProto ? symbolProto.toString : undefined;
8584
+
8585
+ /**
8586
+ * The base implementation of `_.toString` which doesn't convert nullish
8587
+ * values to empty strings.
8588
+ *
8589
+ * @private
8590
+ * @param {*} value The value to process.
8591
+ * @returns {string} Returns the string.
8592
+ */
8593
+ function baseToString(value) {
8594
+ // Exit early for strings to avoid a performance hit in some environments.
8595
+ if (typeof value == 'string') {
8596
+ return value;
8597
+ }
8598
+ if (isArray_1(value)) {
8599
+ // Recursively convert values (susceptible to call stack limits).
8600
+ return _arrayMap(value, baseToString) + '';
8601
+ }
8602
+ if (isSymbol_1(value)) {
8603
+ return symbolToString ? symbolToString.call(value) : '';
8604
+ }
8605
+ var result = (value + '');
8606
+ return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
8607
+ }
8608
+
8609
+ var _baseToString = baseToString;
8610
+
8611
+ /**
8612
+ * Converts `value` to a string. An empty string is returned for `null`
8613
+ * and `undefined` values. The sign of `-0` is preserved.
8614
+ *
8615
+ * @static
8616
+ * @memberOf _
8617
+ * @since 4.0.0
8618
+ * @category Lang
8619
+ * @param {*} value The value to convert.
8620
+ * @returns {string} Returns the converted string.
8621
+ * @example
8622
+ *
8623
+ * _.toString(null);
8624
+ * // => ''
8625
+ *
8626
+ * _.toString(-0);
8627
+ * // => '-0'
8628
+ *
8629
+ * _.toString([1, 2, 3]);
8630
+ * // => '1,2,3'
8631
+ */
8632
+ function toString$1(value) {
8633
+ return value == null ? '' : _baseToString(value);
8634
+ }
8635
+
8636
+ var toString_1 = toString$1;
8637
+
8638
+ /**
8639
+ * Casts `value` to a path array if it's not one.
8640
+ *
8641
+ * @private
8642
+ * @param {*} value The value to inspect.
8643
+ * @param {Object} [object] The object to query keys on.
8644
+ * @returns {Array} Returns the cast property path array.
8645
+ */
8646
+ function castPath(value, object) {
8647
+ if (isArray_1(value)) {
8648
+ return value;
8649
+ }
8650
+ return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
8651
+ }
8652
+
8653
+ var _castPath = castPath;
8654
+
8655
+ /** Used as references for various `Number` constants. */
8656
+ var INFINITY = 1 / 0;
8657
+
8658
+ /**
8659
+ * Converts `value` to a string key if it's not a string or symbol.
8660
+ *
8661
+ * @private
8662
+ * @param {*} value The value to inspect.
8663
+ * @returns {string|symbol} Returns the key.
8664
+ */
8665
+ function toKey(value) {
8666
+ if (typeof value == 'string' || isSymbol_1(value)) {
8667
+ return value;
8668
+ }
8669
+ var result = (value + '');
8670
+ return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
8671
+ }
8672
+
8673
+ var _toKey = toKey;
8674
+
8675
+ /**
8676
+ * The base implementation of `_.get` without support for default values.
8677
+ *
8678
+ * @private
8679
+ * @param {Object} object The object to query.
8680
+ * @param {Array|string} path The path of the property to get.
8681
+ * @returns {*} Returns the resolved value.
8682
+ */
8683
+ function baseGet(object, path) {
8684
+ path = _castPath(path, object);
8685
+
8686
+ var index = 0,
8687
+ length = path.length;
8688
+
8689
+ while (object != null && index < length) {
8690
+ object = object[_toKey(path[index++])];
8691
+ }
8692
+ return (index && index == length) ? object : undefined;
8693
+ }
8694
+
8695
+ var _baseGet = baseGet;
8696
+
8697
+ /** Used to compose bitmasks for value comparisons. */
8698
+ var COMPARE_PARTIAL_FLAG$1 = 1,
8699
+ COMPARE_UNORDERED_FLAG$1 = 2;
8700
+
8701
+ /**
8702
+ * The base implementation of `_.isMatch` without support for iteratee shorthands.
8703
+ *
8704
+ * @private
8705
+ * @param {Object} object The object to inspect.
8706
+ * @param {Object} source The object of property values to match.
8707
+ * @param {Array} matchData The property names, values, and compare flags to match.
8708
+ * @param {Function} [customizer] The function to customize comparisons.
8709
+ * @returns {boolean} Returns `true` if `object` is a match, else `false`.
8710
+ */
8711
+ function baseIsMatch(object, source, matchData, customizer) {
8712
+ var index = matchData.length,
8713
+ length = index,
8714
+ noCustomizer = !customizer;
8715
+
8716
+ if (object == null) {
8717
+ return !length;
8718
+ }
8719
+ object = Object(object);
8720
+ while (index--) {
8721
+ var data = matchData[index];
8722
+ if ((noCustomizer && data[2])
8723
+ ? data[1] !== object[data[0]]
8724
+ : !(data[0] in object)
8725
+ ) {
8726
+ return false;
8727
+ }
8728
+ }
8729
+ while (++index < length) {
8730
+ data = matchData[index];
8731
+ var key = data[0],
8732
+ objValue = object[key],
8733
+ srcValue = data[1];
8734
+
8735
+ if (noCustomizer && data[2]) {
8736
+ if (objValue === undefined && !(key in object)) {
8737
+ return false;
8738
+ }
8739
+ } else {
8740
+ var stack = new _Stack;
8741
+ if (customizer) {
8742
+ var result = customizer(objValue, srcValue, key, object, source, stack);
8743
+ }
8744
+ if (!(result === undefined
8745
+ ? _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG$1 | COMPARE_UNORDERED_FLAG$1, customizer, stack)
8746
+ : result
8747
+ )) {
8748
+ return false;
8749
+ }
8750
+ }
8751
+ }
8752
+ return true;
8753
+ }
8754
+
8755
+ var _baseIsMatch = baseIsMatch;
8756
+
8757
+ /**
8758
+ * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
8759
+ *
8760
+ * @private
8761
+ * @param {*} value The value to check.
8762
+ * @returns {boolean} Returns `true` if `value` if suitable for strict
8763
+ * equality comparisons, else `false`.
8764
+ */
8765
+ function isStrictComparable(value) {
8766
+ return value === value && !isObject_1(value);
8767
+ }
8768
+
8769
+ var _isStrictComparable = isStrictComparable;
8770
+
8771
+ /**
8772
+ * Gets the property names, values, and compare flags of `object`.
8773
+ *
8774
+ * @private
8775
+ * @param {Object} object The object to query.
8776
+ * @returns {Array} Returns the match data of `object`.
8777
+ */
8778
+ function getMatchData(object) {
8779
+ var result = keys_1(object),
8780
+ length = result.length;
8781
+
8782
+ while (length--) {
8783
+ var key = result[length],
8784
+ value = object[key];
8785
+
8786
+ result[length] = [key, value, _isStrictComparable(value)];
8787
+ }
8788
+ return result;
8789
+ }
8790
+
8791
+ var _getMatchData = getMatchData;
8792
+
8793
+ /**
8794
+ * A specialized version of `matchesProperty` for source values suitable
8795
+ * for strict equality comparisons, i.e. `===`.
8796
+ *
8797
+ * @private
8798
+ * @param {string} key The key of the property to get.
8799
+ * @param {*} srcValue The value to match.
8800
+ * @returns {Function} Returns the new spec function.
8801
+ */
8802
+ function matchesStrictComparable(key, srcValue) {
8803
+ return function(object) {
8804
+ if (object == null) {
8805
+ return false;
8806
+ }
8807
+ return object[key] === srcValue &&
8808
+ (srcValue !== undefined || (key in Object(object)));
8809
+ };
8810
+ }
8811
+
8812
+ var _matchesStrictComparable = matchesStrictComparable;
8813
+
8814
+ /**
8815
+ * The base implementation of `_.matches` which doesn't clone `source`.
8816
+ *
8817
+ * @private
8818
+ * @param {Object} source The object of property values to match.
8819
+ * @returns {Function} Returns the new spec function.
8820
+ */
8821
+ function baseMatches(source) {
8822
+ var matchData = _getMatchData(source);
8823
+ if (matchData.length == 1 && matchData[0][2]) {
8824
+ return _matchesStrictComparable(matchData[0][0], matchData[0][1]);
8825
+ }
8826
+ return function(object) {
8827
+ return object === source || _baseIsMatch(object, source, matchData);
8828
+ };
8829
+ }
8830
+
8831
+ var _baseMatches = baseMatches;
8832
+
8833
+ /**
8834
+ * Gets the value at `path` of `object`. If the resolved value is
8835
+ * `undefined`, the `defaultValue` is returned in its place.
8836
+ *
8837
+ * @static
8838
+ * @memberOf _
8839
+ * @since 3.7.0
8840
+ * @category Object
8841
+ * @param {Object} object The object to query.
8842
+ * @param {Array|string} path The path of the property to get.
8843
+ * @param {*} [defaultValue] The value returned for `undefined` resolved values.
8844
+ * @returns {*} Returns the resolved value.
8845
+ * @example
8846
+ *
8847
+ * var object = { 'a': [{ 'b': { 'c': 3 } }] };
8848
+ *
8849
+ * _.get(object, 'a[0].b.c');
8850
+ * // => 3
8851
+ *
8852
+ * _.get(object, ['a', '0', 'b', 'c']);
8853
+ * // => 3
8854
+ *
8855
+ * _.get(object, 'a.b.c', 'default');
8856
+ * // => 'default'
8857
+ */
8858
+ function get(object, path, defaultValue) {
8859
+ var result = object == null ? undefined : _baseGet(object, path);
8860
+ return result === undefined ? defaultValue : result;
8861
+ }
8862
+
8863
+ var get_1 = get;
8864
+
8865
+ /**
8866
+ * The base implementation of `_.hasIn` without support for deep paths.
8867
+ *
8868
+ * @private
8869
+ * @param {Object} [object] The object to query.
8870
+ * @param {Array|string} key The key to check.
8871
+ * @returns {boolean} Returns `true` if `key` exists, else `false`.
8872
+ */
8873
+ function baseHasIn(object, key) {
8874
+ return object != null && key in Object(object);
8875
+ }
8876
+
8877
+ var _baseHasIn = baseHasIn;
8878
+
8879
+ /**
8880
+ * Checks if `path` exists on `object`.
8881
+ *
8882
+ * @private
8883
+ * @param {Object} object The object to query.
8884
+ * @param {Array|string} path The path to check.
8885
+ * @param {Function} hasFunc The function to check properties.
8886
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
8887
+ */
8888
+ function hasPath(object, path, hasFunc) {
8889
+ path = _castPath(path, object);
8890
+
8891
+ var index = -1,
8892
+ length = path.length,
8893
+ result = false;
8894
+
8895
+ while (++index < length) {
8896
+ var key = _toKey(path[index]);
8897
+ if (!(result = object != null && hasFunc(object, key))) {
8898
+ break;
8899
+ }
8900
+ object = object[key];
8901
+ }
8902
+ if (result || ++index != length) {
8903
+ return result;
8904
+ }
8905
+ length = object == null ? 0 : object.length;
8906
+ return !!length && isLength_1(length) && _isIndex(key, length) &&
8907
+ (isArray_1(object) || isArguments_1(object));
8908
+ }
8909
+
8910
+ var _hasPath = hasPath;
8911
+
8912
+ /**
8913
+ * Checks if `path` is a direct or inherited property of `object`.
8914
+ *
8915
+ * @static
8916
+ * @memberOf _
8917
+ * @since 4.0.0
8918
+ * @category Object
8919
+ * @param {Object} object The object to query.
8920
+ * @param {Array|string} path The path to check.
8921
+ * @returns {boolean} Returns `true` if `path` exists, else `false`.
8922
+ * @example
8923
+ *
8924
+ * var object = _.create({ 'a': _.create({ 'b': 2 }) });
8925
+ *
8926
+ * _.hasIn(object, 'a');
8927
+ * // => true
8928
+ *
8929
+ * _.hasIn(object, 'a.b');
8930
+ * // => true
8931
+ *
8932
+ * _.hasIn(object, ['a', 'b']);
8933
+ * // => true
8934
+ *
8935
+ * _.hasIn(object, 'b');
8936
+ * // => false
8937
+ */
8938
+ function hasIn(object, path) {
8939
+ return object != null && _hasPath(object, path, _baseHasIn);
8940
+ }
8941
+
8942
+ var hasIn_1 = hasIn;
8943
+
8944
+ /** Used to compose bitmasks for value comparisons. */
8945
+ var COMPARE_PARTIAL_FLAG = 1,
8946
+ COMPARE_UNORDERED_FLAG = 2;
8947
+
8948
+ /**
8949
+ * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
8950
+ *
8951
+ * @private
8952
+ * @param {string} path The path of the property to get.
8953
+ * @param {*} srcValue The value to match.
8954
+ * @returns {Function} Returns the new spec function.
8955
+ */
8956
+ function baseMatchesProperty(path, srcValue) {
8957
+ if (_isKey(path) && _isStrictComparable(srcValue)) {
8958
+ return _matchesStrictComparable(_toKey(path), srcValue);
8959
+ }
8960
+ return function(object) {
8961
+ var objValue = get_1(object, path);
8962
+ return (objValue === undefined && objValue === srcValue)
8963
+ ? hasIn_1(object, path)
8964
+ : _baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
8965
+ };
8966
+ }
8967
+
8968
+ var _baseMatchesProperty = baseMatchesProperty;
8969
+
8970
+ /**
8971
+ * This method returns the first argument it receives.
8972
+ *
8973
+ * @static
8974
+ * @since 0.1.0
8975
+ * @memberOf _
8976
+ * @category Util
8977
+ * @param {*} value Any value.
8978
+ * @returns {*} Returns `value`.
8979
+ * @example
8980
+ *
8981
+ * var object = { 'a': 1 };
8982
+ *
8983
+ * console.log(_.identity(object) === object);
8984
+ * // => true
8985
+ */
8986
+ function identity(value) {
8987
+ return value;
8988
+ }
8989
+
8990
+ var identity_1 = identity;
8991
+
8992
+ /**
8993
+ * The base implementation of `_.property` without support for deep paths.
8994
+ *
8995
+ * @private
8996
+ * @param {string} key The key of the property to get.
8997
+ * @returns {Function} Returns the new accessor function.
8998
+ */
8999
+ function baseProperty(key) {
9000
+ return function(object) {
9001
+ return object == null ? undefined : object[key];
9002
+ };
9003
+ }
9004
+
9005
+ var _baseProperty = baseProperty;
9006
+
9007
+ /**
9008
+ * A specialized version of `baseProperty` which supports deep paths.
9009
+ *
9010
+ * @private
9011
+ * @param {Array|string} path The path of the property to get.
9012
+ * @returns {Function} Returns the new accessor function.
9013
+ */
9014
+ function basePropertyDeep(path) {
9015
+ return function(object) {
9016
+ return _baseGet(object, path);
9017
+ };
9018
+ }
9019
+
9020
+ var _basePropertyDeep = basePropertyDeep;
9021
+
9022
+ /**
9023
+ * Creates a function that returns the value at `path` of a given object.
9024
+ *
9025
+ * @static
9026
+ * @memberOf _
9027
+ * @since 2.4.0
9028
+ * @category Util
9029
+ * @param {Array|string} path The path of the property to get.
9030
+ * @returns {Function} Returns the new accessor function.
9031
+ * @example
9032
+ *
9033
+ * var objects = [
9034
+ * { 'a': { 'b': 2 } },
9035
+ * { 'a': { 'b': 1 } }
9036
+ * ];
9037
+ *
9038
+ * _.map(objects, _.property('a.b'));
9039
+ * // => [2, 1]
9040
+ *
9041
+ * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
9042
+ * // => [1, 2]
9043
+ */
9044
+ function property(path) {
9045
+ return _isKey(path) ? _baseProperty(_toKey(path)) : _basePropertyDeep(path);
9046
+ }
9047
+
9048
+ var property_1 = property;
9049
+
9050
+ /**
9051
+ * The base implementation of `_.iteratee`.
9052
+ *
9053
+ * @private
9054
+ * @param {*} [value=_.identity] The value to convert to an iteratee.
9055
+ * @returns {Function} Returns the iteratee.
9056
+ */
9057
+ function baseIteratee(value) {
9058
+ // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
9059
+ // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
9060
+ if (typeof value == 'function') {
9061
+ return value;
9062
+ }
9063
+ if (value == null) {
9064
+ return identity_1;
9065
+ }
9066
+ if (typeof value == 'object') {
9067
+ return isArray_1(value)
9068
+ ? _baseMatchesProperty(value[0], value[1])
9069
+ : _baseMatches(value);
9070
+ }
9071
+ return property_1(value);
9072
+ }
9073
+
9074
+ var _baseIteratee = baseIteratee;
9075
+
9076
+ /**
9077
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
9078
+ *
9079
+ * @private
9080
+ * @param {boolean} [fromRight] Specify iterating from right to left.
9081
+ * @returns {Function} Returns the new base function.
9082
+ */
9083
+ function createBaseFor(fromRight) {
9084
+ return function(object, iteratee, keysFunc) {
9085
+ var index = -1,
9086
+ iterable = Object(object),
9087
+ props = keysFunc(object),
9088
+ length = props.length;
9089
+
9090
+ while (length--) {
9091
+ var key = props[fromRight ? length : ++index];
9092
+ if (iteratee(iterable[key], key, iterable) === false) {
9093
+ break;
9094
+ }
9095
+ }
9096
+ return object;
9097
+ };
9098
+ }
9099
+
9100
+ var _createBaseFor = createBaseFor;
9101
+
9102
+ /**
9103
+ * The base implementation of `baseForOwn` which iterates over `object`
9104
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
9105
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
9106
+ *
9107
+ * @private
9108
+ * @param {Object} object The object to iterate over.
9109
+ * @param {Function} iteratee The function invoked per iteration.
9110
+ * @param {Function} keysFunc The function to get the keys of `object`.
9111
+ * @returns {Object} Returns `object`.
9112
+ */
9113
+ var baseFor = _createBaseFor();
9114
+
9115
+ var _baseFor = baseFor;
9116
+
9117
+ /**
9118
+ * The base implementation of `_.forOwn` without support for iteratee shorthands.
9119
+ *
9120
+ * @private
9121
+ * @param {Object} object The object to iterate over.
9122
+ * @param {Function} iteratee The function invoked per iteration.
9123
+ * @returns {Object} Returns `object`.
9124
+ */
9125
+ function baseForOwn(object, iteratee) {
9126
+ return object && _baseFor(object, iteratee, keys_1);
9127
+ }
9128
+
9129
+ var _baseForOwn = baseForOwn;
9130
+
9131
+ /**
9132
+ * Creates a `baseEach` or `baseEachRight` function.
9133
+ *
9134
+ * @private
9135
+ * @param {Function} eachFunc The function to iterate over a collection.
9136
+ * @param {boolean} [fromRight] Specify iterating from right to left.
9137
+ * @returns {Function} Returns the new base function.
9138
+ */
9139
+ function createBaseEach(eachFunc, fromRight) {
9140
+ return function(collection, iteratee) {
9141
+ if (collection == null) {
9142
+ return collection;
9143
+ }
9144
+ if (!isArrayLike_1(collection)) {
9145
+ return eachFunc(collection, iteratee);
9146
+ }
9147
+ var length = collection.length,
9148
+ index = fromRight ? length : -1,
9149
+ iterable = Object(collection);
9150
+
9151
+ while ((fromRight ? index-- : ++index < length)) {
9152
+ if (iteratee(iterable[index], index, iterable) === false) {
9153
+ break;
9154
+ }
9155
+ }
9156
+ return collection;
9157
+ };
9158
+ }
9159
+
9160
+ var _createBaseEach = createBaseEach;
9161
+
9162
+ /**
9163
+ * The base implementation of `_.forEach` without support for iteratee shorthands.
9164
+ *
9165
+ * @private
9166
+ * @param {Array|Object} collection The collection to iterate over.
9167
+ * @param {Function} iteratee The function invoked per iteration.
9168
+ * @returns {Array|Object} Returns `collection`.
9169
+ */
9170
+ var baseEach = _createBaseEach(_baseForOwn);
9171
+
9172
+ var _baseEach = baseEach;
9173
+
9174
+ /**
9175
+ * The base implementation of `_.map` without support for iteratee shorthands.
9176
+ *
9177
+ * @private
9178
+ * @param {Array|Object} collection The collection to iterate over.
9179
+ * @param {Function} iteratee The function invoked per iteration.
9180
+ * @returns {Array} Returns the new mapped array.
9181
+ */
9182
+ function baseMap(collection, iteratee) {
9183
+ var index = -1,
9184
+ result = isArrayLike_1(collection) ? Array(collection.length) : [];
9185
+
9186
+ _baseEach(collection, function(value, key, collection) {
9187
+ result[++index] = iteratee(value, key, collection);
9188
+ });
9189
+ return result;
9190
+ }
9191
+
9192
+ var _baseMap = baseMap;
9193
+
9194
+ /**
9195
+ * The base implementation of `_.sortBy` which uses `comparer` to define the
9196
+ * sort order of `array` and replaces criteria objects with their corresponding
9197
+ * values.
9198
+ *
9199
+ * @private
9200
+ * @param {Array} array The array to sort.
9201
+ * @param {Function} comparer The function to define sort order.
9202
+ * @returns {Array} Returns `array`.
9203
+ */
9204
+ function baseSortBy(array, comparer) {
9205
+ var length = array.length;
9206
+
9207
+ array.sort(comparer);
9208
+ while (length--) {
9209
+ array[length] = array[length].value;
9210
+ }
9211
+ return array;
9212
+ }
9213
+
9214
+ var _baseSortBy = baseSortBy;
9215
+
9216
+ /**
9217
+ * Compares values to sort them in ascending order.
9218
+ *
9219
+ * @private
9220
+ * @param {*} value The value to compare.
9221
+ * @param {*} other The other value to compare.
9222
+ * @returns {number} Returns the sort order indicator for `value`.
9223
+ */
9224
+ function compareAscending(value, other) {
9225
+ if (value !== other) {
9226
+ var valIsDefined = value !== undefined,
9227
+ valIsNull = value === null,
9228
+ valIsReflexive = value === value,
9229
+ valIsSymbol = isSymbol_1(value);
9230
+
9231
+ var othIsDefined = other !== undefined,
9232
+ othIsNull = other === null,
9233
+ othIsReflexive = other === other,
9234
+ othIsSymbol = isSymbol_1(other);
9235
+
9236
+ if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
9237
+ (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
9238
+ (valIsNull && othIsDefined && othIsReflexive) ||
9239
+ (!valIsDefined && othIsReflexive) ||
9240
+ !valIsReflexive) {
9241
+ return 1;
9242
+ }
9243
+ if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
9244
+ (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
9245
+ (othIsNull && valIsDefined && valIsReflexive) ||
9246
+ (!othIsDefined && valIsReflexive) ||
9247
+ !othIsReflexive) {
9248
+ return -1;
9249
+ }
9250
+ }
9251
+ return 0;
9252
+ }
9253
+
9254
+ var _compareAscending = compareAscending;
9255
+
9256
+ /**
9257
+ * Used by `_.orderBy` to compare multiple properties of a value to another
9258
+ * and stable sort them.
9259
+ *
9260
+ * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
9261
+ * specify an order of "desc" for descending or "asc" for ascending sort order
9262
+ * of corresponding values.
9263
+ *
9264
+ * @private
9265
+ * @param {Object} object The object to compare.
9266
+ * @param {Object} other The other object to compare.
9267
+ * @param {boolean[]|string[]} orders The order to sort by for each property.
9268
+ * @returns {number} Returns the sort order indicator for `object`.
9269
+ */
9270
+ function compareMultiple(object, other, orders) {
9271
+ var index = -1,
9272
+ objCriteria = object.criteria,
9273
+ othCriteria = other.criteria,
9274
+ length = objCriteria.length,
9275
+ ordersLength = orders.length;
9276
+
9277
+ while (++index < length) {
9278
+ var result = _compareAscending(objCriteria[index], othCriteria[index]);
9279
+ if (result) {
9280
+ if (index >= ordersLength) {
9281
+ return result;
9282
+ }
9283
+ var order = orders[index];
9284
+ return result * (order == 'desc' ? -1 : 1);
9285
+ }
9286
+ }
9287
+ // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
9288
+ // that causes it, under certain circumstances, to provide the same value for
9289
+ // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
9290
+ // for more details.
9291
+ //
9292
+ // This also ensures a stable sort in V8 and other engines.
9293
+ // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
9294
+ return object.index - other.index;
9295
+ }
9296
+
9297
+ var _compareMultiple = compareMultiple;
9298
+
9299
+ /**
9300
+ * The base implementation of `_.orderBy` without param guards.
9301
+ *
9302
+ * @private
9303
+ * @param {Array|Object} collection The collection to iterate over.
9304
+ * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
9305
+ * @param {string[]} orders The sort orders of `iteratees`.
9306
+ * @returns {Array} Returns the new sorted array.
9307
+ */
9308
+ function baseOrderBy(collection, iteratees, orders) {
9309
+ if (iteratees.length) {
9310
+ iteratees = _arrayMap(iteratees, function(iteratee) {
9311
+ if (isArray_1(iteratee)) {
9312
+ return function(value) {
9313
+ return _baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
9314
+ }
9315
+ }
9316
+ return iteratee;
9317
+ });
9318
+ } else {
9319
+ iteratees = [identity_1];
9320
+ }
9321
+
9322
+ var index = -1;
9323
+ iteratees = _arrayMap(iteratees, _baseUnary(_baseIteratee));
9324
+
9325
+ var result = _baseMap(collection, function(value, key, collection) {
9326
+ var criteria = _arrayMap(iteratees, function(iteratee) {
9327
+ return iteratee(value);
9328
+ });
9329
+ return { 'criteria': criteria, 'index': ++index, 'value': value };
9330
+ });
9331
+
9332
+ return _baseSortBy(result, function(object, other) {
9333
+ return _compareMultiple(object, other, orders);
9334
+ });
9335
+ }
9336
+
9337
+ var _baseOrderBy = baseOrderBy;
9338
+
9339
+ /**
9340
+ * A faster alternative to `Function#apply`, this function invokes `func`
9341
+ * with the `this` binding of `thisArg` and the arguments of `args`.
9342
+ *
9343
+ * @private
9344
+ * @param {Function} func The function to invoke.
9345
+ * @param {*} thisArg The `this` binding of `func`.
9346
+ * @param {Array} args The arguments to invoke `func` with.
9347
+ * @returns {*} Returns the result of `func`.
9348
+ */
9349
+ function apply(func, thisArg, args) {
9350
+ switch (args.length) {
9351
+ case 0: return func.call(thisArg);
9352
+ case 1: return func.call(thisArg, args[0]);
9353
+ case 2: return func.call(thisArg, args[0], args[1]);
9354
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
9355
+ }
9356
+ return func.apply(thisArg, args);
9357
+ }
9358
+
9359
+ var _apply = apply;
9360
+
9361
+ /* Built-in method references for those with the same name as other `lodash` methods. */
9362
+ var nativeMax = Math.max;
9363
+
9364
+ /**
9365
+ * A specialized version of `baseRest` which transforms the rest array.
9366
+ *
9367
+ * @private
9368
+ * @param {Function} func The function to apply a rest parameter to.
9369
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
9370
+ * @param {Function} transform The rest array transform.
9371
+ * @returns {Function} Returns the new function.
9372
+ */
9373
+ function overRest(func, start, transform) {
9374
+ start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
9375
+ return function() {
9376
+ var args = arguments,
9377
+ index = -1,
9378
+ length = nativeMax(args.length - start, 0),
9379
+ array = Array(length);
9380
+
9381
+ while (++index < length) {
9382
+ array[index] = args[start + index];
9383
+ }
9384
+ index = -1;
9385
+ var otherArgs = Array(start + 1);
9386
+ while (++index < start) {
9387
+ otherArgs[index] = args[index];
9388
+ }
9389
+ otherArgs[start] = transform(array);
9390
+ return _apply(func, this, otherArgs);
9391
+ };
9392
+ }
9393
+
9394
+ var _overRest = overRest;
9395
+
9396
+ /**
9397
+ * Creates a function that returns `value`.
9398
+ *
9399
+ * @static
9400
+ * @memberOf _
9401
+ * @since 2.4.0
9402
+ * @category Util
9403
+ * @param {*} value The value to return from the new function.
9404
+ * @returns {Function} Returns the new constant function.
9405
+ * @example
9406
+ *
9407
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
9408
+ *
9409
+ * console.log(objects);
9410
+ * // => [{ 'a': 1 }, { 'a': 1 }]
9411
+ *
9412
+ * console.log(objects[0] === objects[1]);
9413
+ * // => true
9414
+ */
9415
+ function constant(value) {
9416
+ return function() {
9417
+ return value;
9418
+ };
9419
+ }
9420
+
9421
+ var constant_1 = constant;
9422
+
9423
+ var defineProperty = (function() {
9424
+ try {
9425
+ var func = _getNative(Object, 'defineProperty');
9426
+ func({}, '', {});
9427
+ return func;
9428
+ } catch (e) {}
9429
+ }());
9430
+
9431
+ var _defineProperty = defineProperty;
9432
+
9433
+ /**
9434
+ * The base implementation of `setToString` without support for hot loop shorting.
9435
+ *
9436
+ * @private
9437
+ * @param {Function} func The function to modify.
9438
+ * @param {Function} string The `toString` result.
9439
+ * @returns {Function} Returns `func`.
9440
+ */
9441
+ var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
9442
+ return _defineProperty(func, 'toString', {
9443
+ 'configurable': true,
9444
+ 'enumerable': false,
9445
+ 'value': constant_1(string),
9446
+ 'writable': true
9447
+ });
9448
+ };
9449
+
9450
+ var _baseSetToString = baseSetToString;
9451
+
9452
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
9453
+ var HOT_COUNT = 800,
9454
+ HOT_SPAN = 16;
9455
+
9456
+ /* Built-in method references for those with the same name as other `lodash` methods. */
9457
+ var nativeNow = Date.now;
9458
+
9459
+ /**
9460
+ * Creates a function that'll short out and invoke `identity` instead
9461
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
9462
+ * milliseconds.
9463
+ *
9464
+ * @private
9465
+ * @param {Function} func The function to restrict.
9466
+ * @returns {Function} Returns the new shortable function.
9467
+ */
9468
+ function shortOut(func) {
9469
+ var count = 0,
9470
+ lastCalled = 0;
9471
+
9472
+ return function() {
9473
+ var stamp = nativeNow(),
9474
+ remaining = HOT_SPAN - (stamp - lastCalled);
9475
+
9476
+ lastCalled = stamp;
9477
+ if (remaining > 0) {
9478
+ if (++count >= HOT_COUNT) {
9479
+ return arguments[0];
9480
+ }
9481
+ } else {
9482
+ count = 0;
9483
+ }
9484
+ return func.apply(undefined, arguments);
9485
+ };
9486
+ }
9487
+
9488
+ var _shortOut = shortOut;
9489
+
9490
+ /**
9491
+ * Sets the `toString` method of `func` to return `string`.
9492
+ *
9493
+ * @private
9494
+ * @param {Function} func The function to modify.
9495
+ * @param {Function} string The `toString` result.
9496
+ * @returns {Function} Returns `func`.
9497
+ */
9498
+ var setToString = _shortOut(_baseSetToString);
9499
+
9500
+ var _setToString = setToString;
9501
+
9502
+ /**
9503
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
9504
+ *
9505
+ * @private
9506
+ * @param {Function} func The function to apply a rest parameter to.
9507
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
9508
+ * @returns {Function} Returns the new function.
9509
+ */
9510
+ function baseRest(func, start) {
9511
+ return _setToString(_overRest(func, start, identity_1), func + '');
9512
+ }
9513
+
9514
+ var _baseRest = baseRest;
9515
+
9516
+ /**
9517
+ * Checks if the given arguments are from an iteratee call.
9518
+ *
9519
+ * @private
9520
+ * @param {*} value The potential iteratee value argument.
9521
+ * @param {*} index The potential iteratee index or key argument.
9522
+ * @param {*} object The potential iteratee object argument.
9523
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
9524
+ * else `false`.
9525
+ */
9526
+ function isIterateeCall(value, index, object) {
9527
+ if (!isObject_1(object)) {
9528
+ return false;
9529
+ }
9530
+ var type = typeof index;
9531
+ if (type == 'number'
9532
+ ? (isArrayLike_1(object) && _isIndex(index, object.length))
9533
+ : (type == 'string' && index in object)
9534
+ ) {
9535
+ return eq_1(object[index], value);
9536
+ }
9537
+ return false;
9538
+ }
9539
+
9540
+ var _isIterateeCall = isIterateeCall;
9541
+
9542
+ /**
9543
+ * Creates an array of elements, sorted in ascending order by the results of
9544
+ * running each element in a collection thru each iteratee. This method
9545
+ * performs a stable sort, that is, it preserves the original sort order of
9546
+ * equal elements. The iteratees are invoked with one argument: (value).
9547
+ *
9548
+ * @static
9549
+ * @memberOf _
9550
+ * @since 0.1.0
9551
+ * @category Collection
9552
+ * @param {Array|Object} collection The collection to iterate over.
9553
+ * @param {...(Function|Function[])} [iteratees=[_.identity]]
9554
+ * The iteratees to sort by.
9555
+ * @returns {Array} Returns the new sorted array.
9556
+ * @example
9557
+ *
9558
+ * var users = [
9559
+ * { 'user': 'fred', 'age': 48 },
9560
+ * { 'user': 'barney', 'age': 36 },
9561
+ * { 'user': 'fred', 'age': 30 },
9562
+ * { 'user': 'barney', 'age': 34 }
9563
+ * ];
9564
+ *
9565
+ * _.sortBy(users, [function(o) { return o.user; }]);
9566
+ * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
9567
+ *
9568
+ * _.sortBy(users, ['user', 'age']);
9569
+ * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
9570
+ */
9571
+ var sortBy = _baseRest(function(collection, iteratees) {
9572
+ if (collection == null) {
9573
+ return [];
9574
+ }
9575
+ var length = iteratees.length;
9576
+ if (length > 1 && _isIterateeCall(collection, iteratees[0], iteratees[1])) {
9577
+ iteratees = [];
9578
+ } else if (length > 2 && _isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
9579
+ iteratees = [iteratees[0]];
9580
+ }
9581
+ return _baseOrderBy(collection, _baseFlatten(iteratees, 1), []);
9582
+ });
9583
+
9584
+ var sortBy_1 = sortBy;
9585
+
9586
+ /**
9587
+ * Configuration for custom action validation rules.
9588
+ * Defines allowed positions, metadata IDs, data model IDs, and fields for each target
9589
+ * type.
9590
+ *
9591
+ */
9592
+ const customActionValidationConfig = {
9593
+ [CustomActionTarget.LIVEBOARD]: {
9594
+ positions: [CustomActionsPosition.PRIMARY, CustomActionsPosition.MENU],
9595
+ allowedMetadataIds: ['liveboardIds'],
9596
+ allowedDataModelIds: [],
9597
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds'],
9598
+ },
9599
+ [CustomActionTarget.VIZ]: {
9600
+ positions: [CustomActionsPosition.MENU, CustomActionsPosition.PRIMARY, CustomActionsPosition.CONTEXTMENU],
9601
+ allowedMetadataIds: ['liveboardIds', 'vizIds', 'answerIds'],
9602
+ allowedDataModelIds: ['modelIds', 'modelColumnNames'],
9603
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
9604
+ },
9605
+ [CustomActionTarget.ANSWER]: {
9606
+ positions: [CustomActionsPosition.MENU, CustomActionsPosition.PRIMARY, CustomActionsPosition.CONTEXTMENU],
9607
+ allowedMetadataIds: ['answerIds'],
9608
+ allowedDataModelIds: ['modelIds', 'modelColumnNames'],
9609
+ allowedFields: ['name', 'id', 'position', 'target', 'metadataIds', 'orgIds', 'groupIds', 'dataModelIds'],
9610
+ },
9611
+ [CustomActionTarget.SPOTTER]: {
9612
+ positions: [CustomActionsPosition.MENU, CustomActionsPosition.CONTEXTMENU],
9613
+ allowedMetadataIds: [],
9614
+ allowedDataModelIds: ['modelIds'],
9615
+ allowedFields: ['name', 'id', 'position', 'target', 'orgIds', 'groupIds', 'dataModelIds'],
9616
+ },
9617
+ };
9618
+ /**
9619
+ * Validates a single custom action based on its target type
9620
+ * @param action - The custom action to validate
9621
+ * @param primaryActionsPerTarget - Map to track primary actions per target
9622
+ * @returns CustomActionValidation with isValid flag and reason string
9623
+ *
9624
+ * @hidden
9625
+ */
9626
+ const validateCustomAction = (action, primaryActionsPerTarget) => {
9627
+ const { id: actionId, target: targetType, position, metadataIds, dataModelIds } = action;
9628
+ // Check if target type is supported
9629
+ if (!customActionValidationConfig[targetType]) {
9630
+ const errorMessage = CUSTOM_ACTIONS_ERROR_MESSAGE.UNSUPPORTED_TARGET(actionId, targetType);
9631
+ return { isValid: false, errors: [errorMessage] };
9632
+ }
9633
+ const config = customActionValidationConfig[targetType];
9634
+ const errors = [];
9635
+ // Validate position
9636
+ if (!arrayIncludesString(config.positions, position)) {
9637
+ const supportedPositions = config.positions.join(', ');
9638
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_POSITION(position, targetType, supportedPositions));
9639
+ }
9640
+ // Validate metadata IDs
9641
+ if (metadataIds) {
9642
+ const invalidMetadataIds = Object.keys(metadataIds).filter((key) => !arrayIncludesString(config.allowedMetadataIds, key));
9643
+ if (invalidMetadataIds.length > 0) {
9644
+ const supportedMetadataIds = config.allowedMetadataIds.length > 0 ? config.allowedMetadataIds.join(', ') : 'none';
9645
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_METADATA_IDS(targetType, invalidMetadataIds, supportedMetadataIds));
9646
+ }
8125
9647
  }
8126
- async getAnswer() {
8127
- if (this.answer) {
8128
- return this.answer;
9648
+ // Validate data model IDs
9649
+ if (dataModelIds) {
9650
+ const invalidDataModelIds = Object.keys(dataModelIds).filter((key) => !arrayIncludesString(config.allowedDataModelIds, key));
9651
+ if (invalidDataModelIds.length > 0) {
9652
+ const supportedDataModelIds = config.allowedDataModelIds.length > 0 ? config.allowedDataModelIds.join(', ') : 'none';
9653
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_DATA_MODEL_IDS(targetType, invalidDataModelIds, supportedDataModelIds));
8129
9654
  }
8130
- this.answer = this.executeQuery(getAnswer, {}).then((data) => data === null || data === void 0 ? void 0 : data.answer);
8131
- return this.answer;
8132
- }
8133
- async getTML() {
8134
- const { object } = await this.executeQuery(getAnswerTML, {});
8135
- const edoc = object[0].edoc;
8136
- const YAML = await import('./index-BDlM0f0T.js');
8137
- const parsedDoc = YAML.parse(edoc);
8138
- return {
8139
- answer: {
8140
- ...parsedDoc.answer,
8141
- ...this.tmlOverride,
8142
- },
8143
- };
8144
9655
  }
8145
- async addDisplayedVizToLiveboard(liveboardId) {
8146
- const { displayMode, visualizations } = await this.getAnswer();
8147
- const viz = getDisplayedViz(visualizations, displayMode);
8148
- return this.executeQuery(addVizToLiveboard, {
8149
- liveboardId,
8150
- vizId: viz.id,
8151
- });
8152
- }
8153
- setTMLOverride(override) {
8154
- this.tmlOverride = override;
9656
+ // Validate allowed fields
9657
+ const actionKeys = Object.keys(action);
9658
+ const invalidFields = actionKeys.filter((key) => !arrayIncludesString(config.allowedFields, key));
9659
+ if (invalidFields.length > 0) {
9660
+ const supportedFields = config.allowedFields.join(', ');
9661
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_FIELDS(targetType, invalidFields, supportedFields));
8155
9662
  }
8156
- }
9663
+ return {
9664
+ isValid: errors.length === 0,
9665
+ errors,
9666
+ };
9667
+ };
8157
9668
  /**
9669
+ * Validates basic action structure and required fields
9670
+ * @param action - The action to validate
9671
+ * @returns Object containing validation result and missing fields
8158
9672
  *
8159
- * @param sourceDetail
8160
- * @param colNames
9673
+ * @hidden
8161
9674
  */
8162
- function getGuidsFromColumnNames(sourceDetail, colNames) {
8163
- const cols = sourceDetail.columns.reduce((colSet, col) => {
8164
- colSet[col.name.toLowerCase()] = col;
8165
- return colSet;
8166
- }, {});
8167
- return new Set(colNames.map((colName) => {
8168
- const col = cols[colName.toLowerCase()];
8169
- return col.id;
8170
- }));
8171
- }
9675
+ const validateActionStructure = (action) => {
9676
+ if (!action || typeof action !== 'object') {
9677
+ return { isValid: false, missingFields: [] };
9678
+ }
9679
+ // Check for all missing required fields
9680
+ const missingFields = ['id', 'name', 'target', 'position'].filter(field => !action[field]);
9681
+ return { isValid: missingFields.length === 0, missingFields };
9682
+ };
8172
9683
  /**
9684
+ * Checks for duplicate IDs among actions
9685
+ * @param actions - Array of actions to check
9686
+ * @returns Object containing filtered actions and duplicate errors
8173
9687
  *
8174
- * @param selectedPoints
9688
+ * @hidden
8175
9689
  */
8176
- function getSelectedPointsForUnderlyingDataQuery(selectedPoints) {
8177
- const underlyingDataPoint = [];
8178
- /**
8179
- *
8180
- * @param colVal
8181
- */
8182
- function addPointFromColVal(colVal) {
8183
- var _a;
8184
- const dataType = colVal.column.dataType;
8185
- colVal.column.id;
8186
- let dataValue;
8187
- if (dataType === 'DATE') {
8188
- if (Number.isFinite(colVal.value)) {
8189
- dataValue = [{
8190
- epochRange: {
8191
- startEpoch: colVal.value,
8192
- },
8193
- }];
8194
- // Case for custom calendar.
8195
- }
8196
- else if ((_a = colVal.value) === null || _a === void 0 ? void 0 : _a.v) {
8197
- dataValue = [{
8198
- epochRange: {
8199
- startEpoch: colVal.value.v.s,
8200
- endEpoch: colVal.value.v.e,
8201
- },
8202
- }];
8203
- }
9690
+ const filterDuplicateIds = (actions) => {
9691
+ const idMap = actions.reduce((map, action) => {
9692
+ const list = map.get(action.id) || [];
9693
+ list.push(action);
9694
+ map.set(action.id, list);
9695
+ return map;
9696
+ }, new Map());
9697
+ const { actions: actionsWithUniqueIds, errors } = Array.from(idMap.entries()).reduce((acc, [id, actionsWithSameId]) => {
9698
+ if (actionsWithSameId.length === 1) {
9699
+ acc.actions.push(actionsWithSameId[0]);
8204
9700
  }
8205
9701
  else {
8206
- dataValue = [{ value: colVal.value }];
9702
+ // Keep the first action and add error for duplicates
9703
+ acc.actions.push(actionsWithSameId[0]);
9704
+ const duplicateNames = actionsWithSameId.slice(1).map(action => action.name);
9705
+ acc.errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.DUPLICATE_IDS(id, duplicateNames, actionsWithSameId[0].name));
8207
9706
  }
8208
- underlyingDataPoint.push({
8209
- columnId: colVal.column.id,
8210
- dataValue,
8211
- });
8212
- }
8213
- selectedPoints.forEach((p) => {
8214
- p.selectedAttributes.forEach(addPointFromColVal);
8215
- });
8216
- return underlyingDataPoint;
8217
- }
9707
+ return acc;
9708
+ }, { actions: [], errors: [] });
9709
+ return { actions: actionsWithUniqueIds, errors };
9710
+ };
8218
9711
  /**
8219
- *
8220
- * @param visualizations
8221
- * @param displayMode
9712
+ * Validates and processes custom actions
9713
+ * @param customActions - Array of custom actions to validate
9714
+ * @returns Object containing valid actions and any validation errors
8222
9715
  */
8223
- function getDisplayedViz(visualizations, displayMode) {
8224
- if (displayMode === 'CHART_MODE') {
8225
- return visualizations.find(
8226
- // eslint-disable-next-line no-underscore-dangle
8227
- (viz) => viz.__typename === 'ChartViz');
8228
- }
8229
- return visualizations.find(
8230
- // eslint-disable-next-line no-underscore-dangle
8231
- (viz) => viz.__typename === 'TableViz');
8232
- }
9716
+ const getCustomActions = (customActions) => {
9717
+ const errors = [];
9718
+ if (!customActions || !Array.isArray(customActions)) {
9719
+ return { actions: [], errors: [] };
9720
+ }
9721
+ // Step 1: Handle invalid actions first (null, undefined, missing required
9722
+ // fields)
9723
+ const validActions = customActions.filter(action => {
9724
+ const validation = validateActionStructure(action);
9725
+ if (!validation.isValid) {
9726
+ if (!action || typeof action !== 'object') {
9727
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.INVALID_ACTION_OBJECT);
9728
+ }
9729
+ else {
9730
+ errors.push(CUSTOM_ACTIONS_ERROR_MESSAGE.MISSING_REQUIRED_FIELDS(action.id, validation.missingFields));
9731
+ }
9732
+ return false;
9733
+ }
9734
+ return true;
9735
+ });
9736
+ // Step 2: Check for duplicate IDs among valid actions
9737
+ const { actions: actionsWithUniqueIds, errors: duplicateErrors } = filterDuplicateIds(validActions);
9738
+ // Add duplicate errors to the errors array
9739
+ duplicateErrors.forEach(error => errors.push(error));
9740
+ // Step 3: Validate actions with unique IDs
9741
+ const finalValidActions = [];
9742
+ actionsWithUniqueIds.forEach((action) => {
9743
+ const { isValid, errors: validationErrors } = validateCustomAction(action);
9744
+ validationErrors.forEach(error => errors.push(error));
9745
+ if (isValid) {
9746
+ finalValidActions.push(action);
9747
+ }
9748
+ });
9749
+ const sortedActions = sortBy_1(finalValidActions, (a) => a.name.toLocaleLowerCase());
9750
+ return {
9751
+ actions: sortedActions,
9752
+ errors: errors,
9753
+ };
9754
+ };
8233
9755
 
8234
9756
  /**
8235
9757
  * Copyright (c) 2023
@@ -15757,6 +17279,13 @@ function processExitPresentMode(e) {
15757
17279
  handleExitPresentMode();
15758
17280
  }
15759
17281
  }
17282
+ /**
17283
+ * Clears the cached preauth and session info.
17284
+ */
17285
+ function processClearInfoCache() {
17286
+ resetCachedPreauthInfo();
17287
+ resetCachedSessionInfo();
17288
+ }
15760
17289
  /**
15761
17290
  *
15762
17291
  * @param e
@@ -15863,11 +17392,13 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15863
17392
  return processAuthLogout(e, containerEl);
15864
17393
  case EmbedEvent.ExitPresentMode:
15865
17394
  return processExitPresentMode();
17395
+ case EmbedEvent.CLEAR_INFO_CACHE:
17396
+ return processClearInfoCache();
15866
17397
  }
15867
17398
  return e;
15868
17399
  }
15869
17400
 
15870
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0-pre-render-1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17401
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.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 | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15871
17402
 
15872
17403
  /**
15873
17404
  * Reloads the ThoughtSpot iframe.
@@ -16178,10 +17709,10 @@ class TsEmbed {
16178
17709
  };
16179
17710
  this.showPreRenderByDefault = false;
16180
17711
  /**
16181
- * @hidden
16182
- * Internal state to track if the embed container is loaded.
16183
- * This is used to trigger events after the embed container is loaded.
16184
- */
17712
+ * @hidden
17713
+ * Internal state to track if the embed container is loaded.
17714
+ * This is used to trigger events after the embed container is loaded.
17715
+ */
16185
17716
  this.isEmbedContainerLoaded = false;
16186
17717
  /**
16187
17718
  * @hidden
@@ -16240,10 +17771,10 @@ class TsEmbed {
16240
17771
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
16241
17772
  ...viewConfig,
16242
17773
  });
16243
- const embedConfig = getEmbedConfig();
16244
- this.embedConfig = embedConfig;
16245
17774
  this.hostEventClient = new HostEventClient(this.iFrame);
16246
17775
  this.isReadyForRenderPromise = getInitPromise().then(async () => {
17776
+ const embedConfig = getEmbedConfig();
17777
+ this.embedConfig = embedConfig;
16247
17778
  if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
16248
17779
  this.embedConfig.authTriggerContainer = domSelector;
16249
17780
  }
@@ -16392,6 +17923,16 @@ class TsEmbed {
16392
17923
  async getDefaultAppInitData() {
16393
17924
  var _a, _b;
16394
17925
  const authToken = await this.getAuthTokenForCookielessInit();
17926
+ const customActionsResult = getCustomActions([
17927
+ ...(this.viewConfig.customActions || []),
17928
+ ...(this.embedConfig.customActions || [])
17929
+ ]);
17930
+ if (customActionsResult.errors.length > 0) {
17931
+ this.handleError({
17932
+ type: 'CUSTOM_ACTION_VALIDATION',
17933
+ message: customActionsResult.errors,
17934
+ });
17935
+ }
16395
17936
  return {
16396
17937
  customisations: getCustomisations(this.embedConfig, this.viewConfig),
16397
17938
  authToken,
@@ -16409,6 +17950,7 @@ class TsEmbed {
16409
17950
  : [],
16410
17951
  customVariablesForThirdPartyTools: this.embedConfig.customVariablesForThirdPartyTools || {},
16411
17952
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
17953
+ customActions: customActionsResult.actions,
16412
17954
  };
16413
17955
  }
16414
17956
  async getAppInitData() {
@@ -16428,11 +17970,6 @@ class TsEmbed {
16428
17970
  .join('/');
16429
17971
  return `${basePath}#`;
16430
17972
  }
16431
- getUpdateEmbedParamsObject() {
16432
- let queryParams = this.getEmbedParamsObject();
16433
- queryParams = { ...this.viewConfig, ...queryParams };
16434
- return queryParams;
16435
- }
16436
17973
  /**
16437
17974
  * Common query params set for all the embed modes.
16438
17975
  * @param queryParams
@@ -16582,13 +18119,9 @@ class TsEmbed {
16582
18119
  return path;
16583
18120
  }
16584
18121
  getEmbedParams() {
16585
- const queryParams = this.getEmbedParamsObject();
18122
+ const queryParams = this.getBaseQueryParams();
16586
18123
  return getQueryParamString(queryParams);
16587
18124
  }
16588
- getEmbedParamsObject() {
16589
- const params = this.getBaseQueryParams();
16590
- return params;
16591
- }
16592
18125
  getRootIframeSrc() {
16593
18126
  const query = this.getEmbedParams();
16594
18127
  return this.getEmbedBasePath(query);
@@ -17059,13 +18592,17 @@ class TsEmbed {
17059
18592
  * Creates the preRender shell
17060
18593
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
17061
18594
  */
17062
- async preRender(showPreRenderByDefault = false) {
18595
+ async preRender(showPreRenderByDefault = false, replaceExistingPreRender = false) {
17063
18596
  if (!this.viewConfig.preRenderId) {
17064
18597
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
17065
18598
  return this;
17066
18599
  }
17067
18600
  this.isPreRendered = true;
17068
18601
  this.showPreRenderByDefault = showPreRenderByDefault;
18602
+ const isAlreadyRendered = this.connectPreRendered();
18603
+ if (isAlreadyRendered && !replaceExistingPreRender) {
18604
+ return this;
18605
+ }
17069
18606
  return this.handleRenderForPrerender();
17070
18607
  }
17071
18608
  /**
@@ -17149,12 +18686,7 @@ class TsEmbed {
17149
18686
  return this.preRender(true);
17150
18687
  }
17151
18688
  this.validatePreRenderViewConfig(this.viewConfig);
17152
- logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
17153
- this.executeAfterEmbedContainerLoaded(() => {
17154
- this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
17155
- });
17156
18689
  }
17157
- this.beforePrerenderVisible();
17158
18690
  if (this.el) {
17159
18691
  this.syncPreRenderStyle();
17160
18692
  if (!this.viewConfig.doNotTrackPreRenderSize) {
@@ -17171,6 +18703,7 @@ class TsEmbed {
17171
18703
  this.resizeObserver.observe(this.el);
17172
18704
  }
17173
18705
  }
18706
+ this.beforePrerenderVisible();
17174
18707
  removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
17175
18708
  this.subscribeToEvents();
17176
18709
  // Setup fullscreen change handler for prerendered components
@@ -17359,9 +18892,15 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
17359
18892
  this.embedComponentType = 'SearchBarEmbed';
17360
18893
  this.viewConfig = viewConfig;
17361
18894
  }
17362
- getEmbedParamsObject() {
18895
+ /**
18896
+ * Construct the URL of the embedded ThoughtSpot search to be
18897
+ * loaded in the iframe
18898
+ * @param dataSources A list of data source GUIDs
18899
+ */
18900
+ getIFrameSrc() {
17363
18901
  var _a;
17364
18902
  const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
18903
+ const path = 'search-bar-embed';
17365
18904
  const queryParams = this.getBaseQueryParams();
17366
18905
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
17367
18906
  if (dataSources && dataSources.length) {
@@ -17383,16 +18922,6 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
17383
18922
  queryParams[Param.UseLastSelectedDataSource] = false;
17384
18923
  }
17385
18924
  queryParams[Param.searchEmbed] = true;
17386
- return queryParams;
17387
- }
17388
- /**
17389
- * Construct the URL of the embedded ThoughtSpot search to be
17390
- * loaded in the iframe
17391
- * @param dataSources A list of data source GUIDs
17392
- */
17393
- getIFrameSrc() {
17394
- const queryParams = this.getEmbedParamsObject();
17395
- const path = 'search-bar-embed';
17396
18925
  let query = '';
17397
18926
  const queryParamsString = getQueryParamString(queryParams, true);
17398
18927
  if (queryParamsString) {
@@ -17443,7 +18972,12 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
17443
18972
  viewConfig.embedComponentType = 'SageEmbed';
17444
18973
  super(domSelector, viewConfig);
17445
18974
  }
17446
- getEmbedParamsObject() {
18975
+ /**
18976
+ * Constructs a map of parameters to be passed on to the
18977
+ * embedded Eureka or Sage search page.
18978
+ * @returns {string} query string
18979
+ */
18980
+ getEmbedParams() {
17447
18981
  const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
17448
18982
  const params = this.getBaseQueryParams();
17449
18983
  params[Param.DataPanelV2Enabled] = !!dataPanelV2;
@@ -17458,15 +18992,6 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
17458
18992
  params[Param.HideSampleQuestions] = !!hideSampleQuestions;
17459
18993
  params[Param.IsProductTour] = !!isProductTour;
17460
18994
  params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
17461
- return params;
17462
- }
17463
- /**
17464
- * Constructs a map of parameters to be passed on to the
17465
- * embedded Eureka or Sage search page.
17466
- * @returns {string} query string
17467
- */
17468
- getEmbedParams() {
17469
- const params = this.getEmbedParamsObject();
17470
18995
  return getQueryParamString(params, true);
17471
18996
  }
17472
18997
  /**
@@ -17576,9 +19101,11 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17576
19101
  const defaultAppInitData = await super.getAppInitData();
17577
19102
  return { ...defaultAppInitData, ...this.getSearchInitData() };
17578
19103
  }
17579
- getEmbedParamsObject() {
19104
+ getEmbedParams() {
17580
19105
  var _a;
17581
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
19106
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
19107
+ /* eslint-disable-next-line max-len */
19108
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
17582
19109
  const queryParams = this.getBaseQueryParams();
17583
19110
  queryParams[Param.HideActions] = [
17584
19111
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -17611,6 +19138,7 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17611
19138
  queryParams[Param.HideSearchBar] = true;
17612
19139
  }
17613
19140
  if (isOnBeforeGetVizDataInterceptEnabled) {
19141
+ /* eslint-disable-next-line max-len */
17614
19142
  queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17615
19143
  }
17616
19144
  if (!focusSearchBarOnRender) {
@@ -17623,22 +19151,20 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17623
19151
  queryParams[Param.UseLastSelectedDataSource] = false;
17624
19152
  }
17625
19153
  queryParams[Param.searchEmbed] = true;
19154
+ /* eslint-disable-next-line max-len */
17626
19155
  queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
17627
19156
  queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
17628
19157
  if (dataPanelCustomGroupsAccordionInitialState
17629
19158
  === DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
17630
19159
  || dataPanelCustomGroupsAccordionInitialState
17631
19160
  === DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
19161
+ /* eslint-disable-next-line max-len */
17632
19162
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17633
19163
  }
17634
19164
  else {
19165
+ /* eslint-disable-next-line max-len */
17635
19166
  queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
17636
19167
  }
17637
- return queryParams;
17638
- }
17639
- getEmbedParams() {
17640
- const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
17641
- const queryParams = this.getEmbedParamsObject();
17642
19168
  let query = '';
17643
19169
  const queryParamsString = getQueryParamString(queryParams, true);
17644
19170
  if (queryParamsString) {
@@ -17779,6 +19305,11 @@ var HomePage;
17779
19305
  * It serves as the foundational version of the home page.
17780
19306
  */
17781
19307
  HomePage["Modular"] = "v2";
19308
+ /**
19309
+ * ModularWithStylingChanges (v3) introduces Modular Home Experience
19310
+ * with styling changes.
19311
+ */
19312
+ HomePage["ModularWithStylingChanges"] = "v3";
17782
19313
  })(HomePage || (HomePage = {}));
17783
19314
  /**
17784
19315
  * Define the version of the list page
@@ -17866,7 +19397,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17866
19397
  * embedded Liveboard or visualization.
17867
19398
  */
17868
19399
  getEmbedParams() {
17869
- 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.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
19400
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
17870
19401
  let params = {};
17871
19402
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17872
19403
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17883,6 +19414,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17883
19414
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17884
19415
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17885
19416
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
19417
+ params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
17886
19418
  params = this.getBaseQueryParams(params);
17887
19419
  if (hideObjectSearch) {
17888
19420
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -17930,6 +19462,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17930
19462
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17931
19463
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17932
19464
  }
19465
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
19466
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
19467
+ }
17933
19468
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17934
19469
  params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
17935
19470
  params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
@@ -17950,6 +19485,12 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17950
19485
  // To use v3 navigation, we must manually set the discoveryExperience
17951
19486
  // settings.
17952
19487
  params[Param.NavigationVersion] = 'v2';
19488
+ // Set homePageVersion to v2 by default to reset the LD flag value
19489
+ // for the homepageVersion.
19490
+ params[Param.HomepageVersion] = 'v2';
19491
+ // Set listpageVersion to v2 by default to reset the LD flag value
19492
+ // for the listpageVersion.
19493
+ params[Param.ListPageVersion] = ListPage.List;
17953
19494
  if (discoveryExperience) {
17954
19495
  // primaryNavbarVersion v3 will enabled the new left navigation
17955
19496
  if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
@@ -17962,6 +19503,12 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17962
19503
  if (discoveryExperience.homePage === HomePage.Modular) {
17963
19504
  params[Param.ModularHomeExperienceEnabled] = true;
17964
19505
  }
19506
+ // ModularWithStylingChanges (v3) introduces the styling changes
19507
+ // to the Modular Homepage.
19508
+ // v3 will be the base version of homePageVersion.
19509
+ if (discoveryExperience.homePage === HomePage.ModularWithStylingChanges) {
19510
+ params[Param.HomepageVersion] = HomePage.ModularWithStylingChanges;
19511
+ }
17965
19512
  // listPageVersion v3 will enable the new list page
17966
19513
  if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
17967
19514
  params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
@@ -18265,14 +19812,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18265
19812
  * embedded Liveboard or visualization.
18266
19813
  */
18267
19814
  getEmbedParams() {
18268
- const params = this.getEmbedParamsObject();
18269
- const queryParams = getQueryParamString(params, true);
18270
- return queryParams;
18271
- }
18272
- getEmbedParamsObject() {
18273
19815
  let params = {};
18274
19816
  params = this.getBaseQueryParams(params);
18275
- 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;
19817
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
18276
19818
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
18277
19819
  || this.viewConfig.preventPinboardFilterRemoval;
18278
19820
  if (fullHeight === true) {
@@ -18331,25 +19873,11 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18331
19873
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18332
19874
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
18333
19875
  }
18334
- params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18335
- params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
18336
- params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
18337
- params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
18338
- params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
18339
- params[Param.DataPanelV2Enabled] = dataPanelV2;
18340
- params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18341
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18342
- if (oAuthPollingInterval !== undefined) {
18343
- params[Param.OauthPollingInterval] = oAuthPollingInterval;
18344
- }
18345
- if (isForceRedirect) {
18346
- params[Param.IsForceRedirect] = isForceRedirect;
18347
- }
18348
- if (dataSourceId !== undefined) {
18349
- params[Param.DataSourceId] = dataSourceId;
19876
+ if (isPNGInScheduledEmailsEnabled !== undefined) {
19877
+ params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
18350
19878
  }
18351
- if (isLiveboardStylingAndGroupingEnabled !== undefined) {
18352
- params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
19879
+ if (showSpotterLimitations !== undefined) {
19880
+ params[Param.ShowSpotterLimitations] = showSpotterLimitations;
18353
19881
  }
18354
19882
  params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
18355
19883
  params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
@@ -18359,7 +19887,9 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
18359
19887
  params[Param.DataPanelV2Enabled] = dataPanelV2;
18360
19888
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18361
19889
  params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
18362
- return params;
19890
+ params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
19891
+ const queryParams = getQueryParamString(params, true);
19892
+ return queryParams;
18363
19893
  }
18364
19894
  getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
18365
19895
  let suffix = `/embed/viz/${liveboardId}`;
@@ -18917,17 +20447,13 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18917
20447
  super(container, viewConfig);
18918
20448
  this.viewConfig = viewConfig;
18919
20449
  }
18920
- getEmbedParamsObject() {
20450
+ getIframeSrc() {
18921
20451
  var _a;
20452
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
20453
+ const path = 'conv-assist-answer';
18922
20454
  const queryParams = this.getBaseQueryParams();
18923
20455
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18924
20456
  queryParams[Param.isSpotterAgentEmbed] = true;
18925
- return queryParams;
18926
- }
18927
- getIframeSrc() {
18928
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18929
- const path = 'conv-assist-answer';
18930
- const queryParams = this.getEmbedParamsObject();
18931
20457
  let query = '';
18932
20458
  const queryParamsString = getQueryParamString(queryParams, true);
18933
20459
  if (queryParamsString) {
@@ -19083,8 +20609,9 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
19083
20609
  super(container, viewConfig);
19084
20610
  this.viewConfig = viewConfig;
19085
20611
  }
19086
- getEmbedParamsObject() {
20612
+ getIframeSrc() {
19087
20613
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
20614
+ const path = 'insights/conv-assist';
19088
20615
  if (!worksheetId) {
19089
20616
  this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
19090
20617
  }
@@ -19105,12 +20632,6 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
19105
20632
  if (!isUndefined_1(hideSampleQuestions)) {
19106
20633
  queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
19107
20634
  }
19108
- return queryParams;
19109
- }
19110
- getIframeSrc() {
19111
- const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
19112
- const path = 'insights/conv-assist';
19113
- const queryParams = this.getEmbedParamsObject();
19114
20635
  let query = '';
19115
20636
  const queryParamsString = getQueryParamString(queryParams, true);
19116
20637
  if (queryParamsString) {
@@ -19219,7 +20740,8 @@ isPreRenderedComponent = false) => React__default.forwardRef((props, forwardedRe
19219
20740
  handleDestroy(tsEmbed);
19220
20741
  };
19221
20742
  }, [viewConfig, listeners]);
19222
- return viewConfig.insertAsSibling ? (React__default.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute' } })) : (React__default.createElement("div", { "data-testid": "tsEmbed", ref: ref, style: style, className: `ts-embed-container ${className}` }));
20743
+ const preRenderStyles = isPreRenderedComponent ? { display: 'none' } : {};
20744
+ return viewConfig.insertAsSibling ? (React__default.createElement("span", { "data-testid": "tsEmbed", ref: ref, style: { position: 'absolute', ...preRenderStyles } })) : (React__default.createElement("div", { "data-testid": "tsEmbed", ref: ref, style: { ...style, ...preRenderStyles }, className: `ts-embed-container ${className}` }));
19223
20745
  });
19224
20746
  /**
19225
20747
  * React component for Search Embed.
@@ -19550,4 +21072,4 @@ function useSpotterAgent(config) {
19550
21072
  };
19551
21073
  }
19552
21074
 
19553
- export { Action, AppEmbed, ConversationEmbed, ConversationMessage, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, SpotterMessage, getSessionInfo, useEmbedRef, useInit, useSpotterAgent };
21075
+ export { Action, AppEmbed, ConversationEmbed, ConversationMessage, CustomActionsPosition, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, SpotterMessage, getSessionInfo, useEmbedRef, useInit, useSpotterAgent };