@thoughtspot/visual-embed-sdk 1.37.1-spotter-embed → 1.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/cjs/package.json +2 -2
  2. package/cjs/src/embed/app.d.ts +43 -3
  3. package/cjs/src/embed/app.d.ts.map +1 -1
  4. package/cjs/src/embed/app.js +39 -6
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/app.spec.js +23 -6
  7. package/cjs/src/embed/app.spec.js.map +1 -1
  8. package/cjs/src/embed/base.d.ts.map +1 -1
  9. package/cjs/src/embed/base.js +7 -0
  10. package/cjs/src/embed/base.js.map +1 -1
  11. package/cjs/src/embed/bodyless-conversation.d.ts +8 -3
  12. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  13. package/cjs/src/embed/bodyless-conversation.js +5 -2
  14. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  15. package/cjs/src/embed/bodyless-conversation.spec.js +286 -1
  16. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  17. package/cjs/src/embed/conversation.d.ts +5 -3
  18. package/cjs/src/embed/conversation.d.ts.map +1 -1
  19. package/cjs/src/embed/conversation.js +3 -2
  20. package/cjs/src/embed/conversation.js.map +1 -1
  21. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  22. package/cjs/src/embed/ts-embed.js +6 -4
  23. package/cjs/src/embed/ts-embed.js.map +1 -1
  24. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  25. package/cjs/src/embed/ts-embed.spec.js +105 -0
  26. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  27. package/cjs/src/index.d.ts +4 -4
  28. package/cjs/src/index.d.ts.map +1 -1
  29. package/cjs/src/index.js +5 -3
  30. package/cjs/src/index.js.map +1 -1
  31. package/cjs/src/react/all-types-export.d.ts +1 -1
  32. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  33. package/cjs/src/react/all-types-export.js +2 -1
  34. package/cjs/src/react/all-types-export.js.map +1 -1
  35. package/cjs/src/react/index.d.ts +32 -3
  36. package/cjs/src/react/index.d.ts.map +1 -1
  37. package/cjs/src/react/index.js +54 -2
  38. package/cjs/src/react/index.js.map +1 -1
  39. package/cjs/src/react/index.spec.js +94 -0
  40. package/cjs/src/react/index.spec.js.map +1 -1
  41. package/cjs/src/types.d.ts +25 -51
  42. package/cjs/src/types.d.ts.map +1 -1
  43. package/cjs/src/types.js +24 -50
  44. package/cjs/src/types.js.map +1 -1
  45. package/dist/{index-DnIvX1FR.js → index-BIcnpmMY.js} +1 -1
  46. package/dist/src/embed/app.d.ts +43 -3
  47. package/dist/src/embed/app.d.ts.map +1 -1
  48. package/dist/src/embed/base.d.ts.map +1 -1
  49. package/dist/src/embed/bodyless-conversation.d.ts +8 -3
  50. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  51. package/dist/src/embed/conversation.d.ts +5 -3
  52. package/dist/src/embed/conversation.d.ts.map +1 -1
  53. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  54. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  55. package/dist/src/index.d.ts +4 -4
  56. package/dist/src/index.d.ts.map +1 -1
  57. package/dist/src/react/all-types-export.d.ts +1 -1
  58. package/dist/src/react/all-types-export.d.ts.map +1 -1
  59. package/dist/src/react/index.d.ts +32 -3
  60. package/dist/src/react/index.d.ts.map +1 -1
  61. package/dist/src/types.d.ts +25 -51
  62. package/dist/src/types.d.ts.map +1 -1
  63. package/dist/tsembed-react.es.js +593 -66
  64. package/dist/tsembed-react.js +737 -285
  65. package/dist/tsembed.es.js +132 -64
  66. package/dist/tsembed.js +276 -284
  67. package/dist/visual-embed-sdk-react-full.d.ts +194 -145
  68. package/dist/visual-embed-sdk-react.d.ts +194 -145
  69. package/dist/visual-embed-sdk.d.ts +82 -61
  70. package/lib/package.json +2 -2
  71. package/lib/src/embed/app.d.ts +43 -3
  72. package/lib/src/embed/app.d.ts.map +1 -1
  73. package/lib/src/embed/app.js +38 -5
  74. package/lib/src/embed/app.js.map +1 -1
  75. package/lib/src/embed/app.spec.js +24 -7
  76. package/lib/src/embed/app.spec.js.map +1 -1
  77. package/lib/src/embed/base.d.ts.map +1 -1
  78. package/lib/src/embed/base.js +7 -0
  79. package/lib/src/embed/base.js.map +1 -1
  80. package/lib/src/embed/bodyless-conversation.d.ts +8 -3
  81. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  82. package/lib/src/embed/bodyless-conversation.js +5 -2
  83. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  84. package/lib/src/embed/bodyless-conversation.spec.js +287 -2
  85. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  86. package/lib/src/embed/conversation.d.ts +5 -3
  87. package/lib/src/embed/conversation.d.ts.map +1 -1
  88. package/lib/src/embed/conversation.js +3 -2
  89. package/lib/src/embed/conversation.js.map +1 -1
  90. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  91. package/lib/src/embed/ts-embed.js +6 -4
  92. package/lib/src/embed/ts-embed.js.map +1 -1
  93. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  94. package/lib/src/embed/ts-embed.spec.js +105 -0
  95. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  96. package/lib/src/index.d.ts +4 -4
  97. package/lib/src/index.d.ts.map +1 -1
  98. package/lib/src/index.js +4 -4
  99. package/lib/src/index.js.map +1 -1
  100. package/lib/src/react/all-types-export.d.ts +1 -1
  101. package/lib/src/react/all-types-export.d.ts.map +1 -1
  102. package/lib/src/react/all-types-export.js +1 -1
  103. package/lib/src/react/all-types-export.js.map +1 -1
  104. package/lib/src/react/index.d.ts +32 -3
  105. package/lib/src/react/index.d.ts.map +1 -1
  106. package/lib/src/react/index.js +53 -1
  107. package/lib/src/react/index.js.map +1 -1
  108. package/lib/src/react/index.spec.js +96 -2
  109. package/lib/src/react/index.spec.js.map +1 -1
  110. package/lib/src/types.d.ts +25 -51
  111. package/lib/src/types.d.ts.map +1 -1
  112. package/lib/src/types.js +24 -50
  113. package/lib/src/types.js.map +1 -1
  114. package/lib/src/visual-embed-sdk.d.ts +85 -64
  115. package/package.json +2 -2
  116. package/src/embed/app.spec.ts +30 -6
  117. package/src/embed/app.ts +61 -8
  118. package/src/embed/base.ts +9 -0
  119. package/src/embed/bodyless-conversation.spec.ts +308 -1
  120. package/src/embed/bodyless-conversation.ts +13 -3
  121. package/src/embed/conversation.ts +5 -3
  122. package/src/embed/ts-embed.spec.ts +130 -0
  123. package/src/embed/ts-embed.ts +6 -4
  124. package/src/index.ts +10 -3
  125. package/src/react/all-types-export.ts +1 -0
  126. package/src/react/index.spec.tsx +157 -1
  127. package/src/react/index.tsx +64 -3
  128. package/src/types.ts +24 -56
  129. package/cjs/src/pages/embed-test.page.d.ts +0 -8
  130. package/cjs/src/pages/embed-test.page.d.ts.map +0 -1
  131. package/cjs/src/pages/embed-test.page.js +0 -20
  132. package/cjs/src/pages/embed-test.page.js.map +0 -1
  133. package/cjs/src/pages/home.page.d.ts +0 -6
  134. package/cjs/src/pages/home.page.d.ts.map +0 -1
  135. package/cjs/src/pages/home.page.js +0 -12
  136. package/cjs/src/pages/home.page.js.map +0 -1
  137. package/cjs/src/pages/login.page.d.ts +0 -15
  138. package/cjs/src/pages/login.page.d.ts.map +0 -1
  139. package/cjs/src/pages/login.page.js +0 -22
  140. package/cjs/src/pages/login.page.js.map +0 -1
  141. package/cjs/src/tests/auth.test.d.ts +0 -1
  142. package/cjs/src/tests/auth.test.d.ts.map +0 -1
  143. package/cjs/src/tests/auth.test.js +0 -1
  144. package/cjs/src/tests/auth.test.js.map +0 -1
  145. package/cjs/src/tests/e2e/auth.spec.d.ts +0 -2
  146. package/cjs/src/tests/e2e/auth.spec.d.ts.map +0 -1
  147. package/cjs/src/tests/e2e/auth.spec.js +0 -54
  148. package/cjs/src/tests/e2e/auth.spec.js.map +0 -1
  149. package/dist/index-Cj4BVGHL.js +0 -7371
  150. package/dist/index-DUaG1OG2.js +0 -7447
  151. package/dist/index-Fhk1V_Gw.js +0 -7371
  152. package/dist/index-OuiZF3zE.js +0 -7371
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.37.1-spotter-embed */
1
+ /* @thoughtspot/visual-embed-sdk version 1.38.0 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -163,7 +163,7 @@
163
163
  }
164
164
  return false;
165
165
  };
166
- const merge$1 = (...objects) => objects.reduce((result, current) => {
166
+ const merge = (...objects) => objects.reduce((result, current) => {
167
167
  if (Array.isArray(current)) {
168
168
  throw new TypeError("Arguments provided to ts-deepmerge must be objects, not arrays.");
169
169
  }
@@ -172,19 +172,19 @@
172
172
  return;
173
173
  }
174
174
  if (Array.isArray(result[key]) && Array.isArray(current[key])) {
175
- result[key] = merge$1.options.mergeArrays
176
- ? merge$1.options.uniqueArrayItems
175
+ result[key] = merge.options.mergeArrays
176
+ ? merge.options.uniqueArrayItems
177
177
  ? Array.from(new Set(result[key].concat(current[key])))
178
178
  : [...result[key], ...current[key]]
179
179
  : current[key];
180
180
  }
181
181
  else if (isObject$1(result[key]) && isObject$1(current[key])) {
182
- result[key] = merge$1(result[key], current[key]);
182
+ result[key] = merge(result[key], current[key]);
183
183
  }
184
184
  else {
185
185
  result[key] =
186
186
  current[key] === undefined
187
- ? merge$1.options.allowUndefinedOverrides
187
+ ? merge.options.allowUndefinedOverrides
188
188
  ? current[key]
189
189
  : result[key]
190
190
  : current[key];
@@ -197,11 +197,11 @@
197
197
  mergeArrays: true,
198
198
  uniqueArrayItems: true,
199
199
  };
200
- merge$1.options = defaultOptions;
201
- merge$1.withOptions = (options, ...objects) => {
202
- merge$1.options = Object.assign(Object.assign({}, defaultOptions), options);
203
- const result = merge$1(...objects);
204
- merge$1.options = defaultOptions;
200
+ merge.options = defaultOptions;
201
+ merge.withOptions = (options, ...objects) => {
202
+ merge.options = Object.assign(Object.assign({}, defaultOptions), options);
203
+ const result = merge(...objects);
204
+ merge.options = defaultOptions;
205
205
  return result;
206
206
  };
207
207
 
@@ -402,7 +402,7 @@
402
402
  function getDOMNode(domSelector) {
403
403
  return typeof domSelector === 'string' ? document.querySelector(domSelector) : domSelector;
404
404
  }
405
- const deepMerge = (target, source) => merge$1(target, source);
405
+ const deepMerge = (target, source) => merge(target, source);
406
406
  const getOperationNameFromQuery = (query) => {
407
407
  const regex = /(?:query|mutation)\s+(\w+)/;
408
408
  const matches = query.match(regex);
@@ -2136,9 +2136,12 @@
2136
2136
  * @example
2137
2137
  * ```js
2138
2138
  * searchEmbed.trigger(HostEvent.OpenFilter,
2139
- * { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'})
2139
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
2140
+ * ```
2141
+ * @example
2142
+ * ```js
2140
2143
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
2141
- * { columnId: '<column-GUID>'})
2144
+ * { column: {columnId: '<column-GUID>'}})
2142
2145
  * ```
2143
2146
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
2144
2147
  */
@@ -2747,6 +2750,25 @@
2747
2750
  * }]
2748
2751
  * });
2749
2752
  * ```
2753
+ * If there are multiple columns with the same name, consider
2754
+ * using `WORKSHEET_NAME::COLUMN_NAME` format.
2755
+ *
2756
+ * @example
2757
+ *
2758
+ * ```js
2759
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
2760
+ * filters: [{
2761
+ * column: "(Sample) Retail - Apparel::city",
2762
+ * oper: 'IN',
2763
+ * values: ["atlanta"]
2764
+ * },
2765
+ * {
2766
+ * column: "(Sample) Retail - Apparel::Region",
2767
+ * oper: 'IN',
2768
+ * values: ["West","Midwest"]
2769
+ * }]
2770
+ * });
2771
+ * ```
2750
2772
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2751
2773
  */
2752
2774
  HostEvent["UpdateFilters"] = "updateFilters";
@@ -2956,54 +2978,6 @@
2956
2978
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2957
2979
  */
2958
2980
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2959
- /**
2960
- * Triggers the table visualization re-render with the updated data.
2961
- * Includes the following properties:
2962
- * @param - `columnDataLite` - an array of object containing the
2963
- * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2964
- * payload.For example, { columnDataLite: []}`.
2965
- */
2966
- HostEvent["SpotterSearch"] = "SpotterSearch";
2967
- /**
2968
- * Triggers the table visualization re-render with the updated data.
2969
- * Includes the following properties:
2970
- * @param - `columnDataLite` - an array of object containing the
2971
- * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2972
- * payload.For example, { columnDataLite: []}`.
2973
- */
2974
- HostEvent["EditLastPrompt"] = "EditLastPrompt";
2975
- /**
2976
- * Triggers the table visualization re-render with the updated data.
2977
- * Includes the following properties:
2978
- * @param - `columnDataLite` - an array of object containing the
2979
- * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2980
- * payload.For example, { columnDataLite: []}`.
2981
- */
2982
- HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2983
- /**
2984
- * Triggers the table visualization re-render with the updated data.
2985
- * Includes the following properties:
2986
- * @param - `columnDataLite` - an array of object containing the
2987
- * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2988
- * payload.For example, { columnDataLite: []}`.
2989
- */
2990
- HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2991
- /**
2992
- * Triggers the table visualization re-render with the updated data.
2993
- * Includes the following properties:
2994
- * @param - `columnDataLite` - an array of object containing the
2995
- * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
2996
- * payload.For example, { columnDataLite: []}`.
2997
- */
2998
- HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2999
- /**
3000
- * Triggers the table visualization re-render with the updated data.
3001
- * Includes the following properties:
3002
- * @param - `columnDataLite` - an array of object containing the
3003
- * data value modifications retrieved from the `EmbedEvent.TableVizRendered`
3004
- * payload.For example, { columnDataLite: []}`.
3005
- */
3006
- HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
3007
2981
  })(exports.HostEvent || (exports.HostEvent = {}));
3008
2982
  /**
3009
2983
  * The different visual modes that the data sources panel within
@@ -15159,6 +15133,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15159
15133
  iFrame.style.width = '0';
15160
15134
  iFrame.style.height = '0';
15161
15135
  iFrame.style.border = '0';
15136
+ // Make it 'fixed' to keep it in a different stacking context.
15137
+ // This should solve the focus behaviours inside the iframe from
15138
+ // interfering with main body.
15139
+ iFrame.style.position = 'fixed';
15140
+ // Push it out of viewport.
15141
+ iFrame.style.top = '100vh';
15142
+ iFrame.style.left = '100vw';
15162
15143
  iFrame.classList.add('prefetchIframe');
15163
15144
  iFrame.classList.add(`prefetchIframeNum-${index}`);
15164
15145
  document.body.appendChild(iFrame);
@@ -15390,7 +15371,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15390
15371
  return e;
15391
15372
  }
15392
15373
 
15393
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.37.1-spotter-embed";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$1={".":{"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 tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15374
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.38.0";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
15394
15375
 
15395
15376
  /**
15396
15377
  * Reloads the ThoughtSpot iframe.
@@ -15624,11 +15605,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15624
15605
  * @param responder
15625
15606
  */
15626
15607
  this.updateAuthToken = async (_, responder) => {
15627
- const { autoLogin = false, authType } = this.embedConfig; // Set autoLogin default to false
15628
- if (authType === AuthType.TrustedAuthTokenCookieless) {
15629
- let authToken = '';
15608
+ const { authType } = this.embedConfig;
15609
+ let { autoLogin } = this.embedConfig;
15610
+ // Default autoLogin: true for cookieless if undefined/null, otherwise false
15611
+ autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
15612
+ if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
15630
15613
  try {
15631
- authToken = await getAuthenticationToken(this.embedConfig);
15614
+ const authToken = await getAuthenticationToken(this.embedConfig);
15632
15615
  responder({
15633
15616
  type: exports.EmbedEvent.AuthExpire,
15634
15617
  data: { authToken },
@@ -17108,6 +17091,31 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17108
17091
  HomePageSearchBarMode["AI_ANSWER"] = "aiAnswer";
17109
17092
  HomePageSearchBarMode["NONE"] = "none";
17110
17093
  })(HomePageSearchBarMode || (HomePageSearchBarMode = {}));
17094
+ /**
17095
+ * Define the version of the primary navbar
17096
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
17097
+ */
17098
+ var PrimaryNavbarVersion;
17099
+ (function (PrimaryNavbarVersion) {
17100
+ /**
17101
+ * Sliding (v3) introduces a new left-side navigation hub featuring a tab switcher,
17102
+ * along with updates to the top navigation bar.
17103
+ * It serves as the foundational version of the PrimaryNavBar.
17104
+ */
17105
+ PrimaryNavbarVersion["Sliding"] = "v3";
17106
+ })(PrimaryNavbarVersion || (PrimaryNavbarVersion = {}));
17107
+ /**
17108
+ * Define the version of the home page
17109
+ * @version SDK: 1.39.0 | Thoughtspot: 10.10.0.cl
17110
+ */
17111
+ var HomePage;
17112
+ (function (HomePage) {
17113
+ /**
17114
+ * Modular (v2) introduces the updated Modular Home Experience.
17115
+ * It serves as the foundational version of the home page.
17116
+ */
17117
+ HomePage["Modular"] = "v2";
17118
+ })(HomePage || (HomePage = {}));
17111
17119
  /**
17112
17120
  * Embeds full ThoughtSpot experience in a host application.
17113
17121
  * @group Embed components
@@ -17162,9 +17170,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17162
17170
  * embedded Liveboard or visualization.
17163
17171
  */
17164
17172
  getEmbedParams() {
17165
- 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, modularHomeExperienceV3 = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17173
+ 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,
17166
17174
  /* eslint-disable-next-line max-len */
17167
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, } = this.viewConfig;
17175
+ dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, } = this.viewConfig;
17168
17176
  let params = {};
17169
17177
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17170
17178
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17181,9 +17189,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17181
17189
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17182
17190
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17183
17191
  params = this.getBaseQueryParams(params);
17184
- if (modularHomeExperienceV3) {
17185
- params[Param.NavigationVersion] = 'v3';
17186
- }
17187
17192
  if (hideObjectSearch) {
17188
17193
  params[Param.HideObjectSearch] = !!hideObjectSearch;
17189
17194
  }
@@ -17240,6 +17245,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17240
17245
  /* eslint-disable-next-line max-len */
17241
17246
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17242
17247
  }
17248
+ if (discoveryExperience) {
17249
+ // primaryNavbarVersion v3 will enabled the new left navigation
17250
+ if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
17251
+ params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
17252
+ }
17253
+ // homePage v2 will enable the modular home page
17254
+ // and it will override the modularHomeExperience value
17255
+ if (discoveryExperience.homePage === HomePage.Modular) {
17256
+ params[Param.ModularHomeExperienceEnabled] = true;
17257
+ }
17258
+ }
17243
17259
  const queryParams = getQueryParamString(params, true);
17244
17260
  return queryParams;
17245
17261
  }
@@ -17681,6 +17697,465 @@ query GetEurekaVizSnapshots(
17681
17697
  }
17682
17698
  };
17683
17699
 
17700
+ const createConversation = `
17701
+ mutation CreateConversation($params: Input_convassist_CreateConversationRequest) {
17702
+ ConvAssist__createConversation(request: $params) {
17703
+ convId
17704
+ initialCtx {
17705
+ type
17706
+ tsAnsCtx {
17707
+ sessionId
17708
+ genNo
17709
+ stateKey {
17710
+ transactionId
17711
+ generationNumber
17712
+ }
17713
+ worksheet {
17714
+ worksheetId
17715
+ worksheetName
17716
+ }
17717
+ }
17718
+ }
17719
+ }
17720
+ }
17721
+ `;
17722
+ const sendMessage = `
17723
+ query SendMessage($params: Input_convassist_SendMessageRequest) {
17724
+ ConvAssist__sendMessage(request: $params) {
17725
+ responses {
17726
+ timestamp
17727
+ msgId
17728
+ data {
17729
+ asstRespData {
17730
+ tool
17731
+ asstRespText
17732
+ nlsAnsData {
17733
+ sageQuerySuggestions {
17734
+ sageQueryTokens {
17735
+ additions {
17736
+ phrase {
17737
+ isCompletePhrase
17738
+ numTokens
17739
+ phraseType
17740
+ startIndex
17741
+ __typename
17742
+ }
17743
+ tokens {
17744
+ token
17745
+ dataType
17746
+ typeEnum
17747
+ guid
17748
+ tokenMetadata {
17749
+ name
17750
+ __typename
17751
+ }
17752
+ __typename
17753
+ }
17754
+ __typename
17755
+ }
17756
+ phrases {
17757
+ isCompletePhrase
17758
+ numTokens
17759
+ phraseType
17760
+ startIndex
17761
+ __typename
17762
+ }
17763
+ removals {
17764
+ phrase {
17765
+ isCompletePhrase
17766
+ numTokens
17767
+ phraseType
17768
+ startIndex
17769
+ __typename
17770
+ }
17771
+ tokens {
17772
+ token
17773
+ dataType
17774
+ typeEnum
17775
+ guid
17776
+ tokenMetadata {
17777
+ name
17778
+ __typename
17779
+ }
17780
+ __typename
17781
+ }
17782
+ __typename
17783
+ }
17784
+ tokens {
17785
+ token
17786
+ dataType
17787
+ typeEnum
17788
+ guid
17789
+ tokenMetadata {
17790
+ name
17791
+ __typename
17792
+ }
17793
+ __typename
17794
+ }
17795
+ __typename
17796
+ }
17797
+ llmReasoning {
17798
+ assumptions
17799
+ clarifications
17800
+ interpretation
17801
+ __typename
17802
+ }
17803
+ tokens
17804
+ tmlTokens
17805
+ worksheetId
17806
+ tokens
17807
+ description
17808
+ title
17809
+ tmlTokens
17810
+ cached
17811
+ sqlQuery
17812
+ sessionId
17813
+ genNo
17814
+ formulaInfo {
17815
+ name
17816
+ expression
17817
+ __typename
17818
+ }
17819
+ tmlPhrases
17820
+ ambiguousPhrases {
17821
+ alternativePhrases {
17822
+ phraseType
17823
+ token {
17824
+ token
17825
+ dataType
17826
+ typeEnum
17827
+ guid
17828
+ tokenMetadata {
17829
+ name
17830
+ __typename
17831
+ }
17832
+ __typename
17833
+ }
17834
+ __typename
17835
+ }
17836
+ ambiguityType
17837
+ token {
17838
+ token
17839
+ dataType
17840
+ typeEnum
17841
+ guid
17842
+ tokenMetadata {
17843
+ name
17844
+ __typename
17845
+ }
17846
+ __typename
17847
+ }
17848
+ __typename
17849
+ }
17850
+ ambiguousTokens {
17851
+ alternativeTokens {
17852
+ token
17853
+ dataType
17854
+ typeEnum
17855
+ guid
17856
+ tokenMetadata {
17857
+ name
17858
+ deprecatedTableGuid
17859
+ deprecatedTableName
17860
+ isFormula
17861
+ rootTables {
17862
+ created
17863
+ description
17864
+ guid
17865
+ indexVersion
17866
+ modified
17867
+ name
17868
+ __typename
17869
+ }
17870
+ schemaTableUserDefinedName
17871
+ table {
17872
+ created
17873
+ description
17874
+ guid
17875
+ indexVersion
17876
+ modified
17877
+ name
17878
+ __typename
17879
+ }
17880
+ __typename
17881
+ }
17882
+ __typename
17883
+ }
17884
+ ambiguityType
17885
+ token {
17886
+ token
17887
+ dataType
17888
+ typeEnum
17889
+ guid
17890
+ tokenMetadata {
17891
+ name
17892
+ __typename
17893
+ }
17894
+ __typename
17895
+ }
17896
+ __typename
17897
+ }
17898
+ stateKey {
17899
+ transactionId
17900
+ generationNumber
17901
+ transactionId
17902
+ __typename
17903
+ }
17904
+ subQueries {
17905
+ tokens
17906
+ cohortConfig {
17907
+ anchorColumnId
17908
+ cohortAnswerGuid
17909
+ cohortGroupingType
17910
+ cohortGuid
17911
+ cohortType
17912
+ combineNonGroupValues
17913
+ description
17914
+ groupExcludedQueryValues
17915
+ hideExcludedQueryValues
17916
+ isEditable
17917
+ name
17918
+ nullOutputValue
17919
+ returnColumnId
17920
+ __typename
17921
+ }
17922
+ formulas {
17923
+ name
17924
+ expression
17925
+ __typename
17926
+ }
17927
+ __typename
17928
+ }
17929
+ visualizationSuggestion {
17930
+ chartType
17931
+ displayMode
17932
+ axisConfigs {
17933
+ category
17934
+ color
17935
+ hidden
17936
+ size
17937
+ sort
17938
+ x
17939
+ y
17940
+ __typename
17941
+ }
17942
+ usersVizIntentApplied
17943
+ customChartConfigs {
17944
+ dimensions {
17945
+ columns
17946
+ key
17947
+ __typename
17948
+ }
17949
+ key
17950
+ __typename
17951
+ }
17952
+ customChartGuid
17953
+ __typename
17954
+ }
17955
+ tableData {
17956
+ columnDataLite {
17957
+ columnId
17958
+ columnDataType
17959
+ dataValue
17960
+ columnName
17961
+ __typename
17962
+ }
17963
+ __typename
17964
+ }
17965
+ warningType
17966
+ cached
17967
+ __typename
17968
+ }
17969
+ debugInfo {
17970
+ fewShotExamples {
17971
+ chartType
17972
+ id
17973
+ mappingId
17974
+ nlQuery
17975
+ nlQueryConcepts
17976
+ sageQuery
17977
+ scope
17978
+ sql
17979
+ tml
17980
+ __typename
17981
+ }
17982
+ __typename
17983
+ }
17984
+ __typename
17985
+ }
17986
+ __typename
17987
+ }
17988
+ errorData {
17989
+ tool
17990
+ errCode
17991
+ errTxt
17992
+ toolErrCode
17993
+ __typename
17994
+ }
17995
+ __typename
17996
+ }
17997
+ type
17998
+ __typename
17999
+ }
18000
+ prevCtx {
18001
+ genNo
18002
+ sessionId
18003
+ __typename
18004
+ }
18005
+ __typename
18006
+ }
18007
+ }
18008
+ `;
18009
+
18010
+ class Conversation {
18011
+ constructor(thoughtSpotHost, worksheetId) {
18012
+ this.thoughtSpotHost = thoughtSpotHost;
18013
+ this.worksheetId = worksheetId;
18014
+ this.inProgress = null;
18015
+ this.inProgress = this.init();
18016
+ }
18017
+ async init() {
18018
+ const { convId } = await this.createConversation();
18019
+ this.conversationId = convId;
18020
+ }
18021
+ createConversation() {
18022
+ return this.executeQuery(createConversation, {
18023
+ params: {
18024
+ initialCtx: {
18025
+ tsWorksheetCtx: {
18026
+ worksheet: {
18027
+ worksheetId: this.worksheetId,
18028
+ },
18029
+ },
18030
+ type: 'TS_WORKSHEET',
18031
+ },
18032
+ userInfo: {
18033
+ tenantUrl: `${this.thoughtSpotHost}/prism`,
18034
+ },
18035
+ },
18036
+ });
18037
+ }
18038
+ async sendMessage(userMessage) {
18039
+ await this.inProgress;
18040
+ try {
18041
+ const { responses } = await this.executeQuery(sendMessage, {
18042
+ params: {
18043
+ convId: this.conversationId,
18044
+ headers: [],
18045
+ msg: {
18046
+ data: {
18047
+ userCmdData: {
18048
+ cmdText: userMessage,
18049
+ nlsData: {
18050
+ worksheetId: this.worksheetId,
18051
+ questionType: 'ANSWER_SPEC_GENERATION',
18052
+ },
18053
+ },
18054
+ },
18055
+ msgId: crypto.randomUUID(),
18056
+ type: 'USER_COMMAND',
18057
+ },
18058
+ },
18059
+ });
18060
+ const data = responses[0].data;
18061
+ return {
18062
+ data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18063
+ error: null,
18064
+ };
18065
+ }
18066
+ catch (error) {
18067
+ return { error };
18068
+ }
18069
+ }
18070
+ async executeQuery(query, variables) {
18071
+ return graphqlQuery({
18072
+ query,
18073
+ variables,
18074
+ thoughtSpotHost: this.thoughtSpotHost,
18075
+ isCompositeQuery: false,
18076
+ });
18077
+ }
18078
+ }
18079
+
18080
+ class ConversationMessage extends TsEmbed {
18081
+ constructor(container, viewConfig) {
18082
+ viewConfig.embedComponentType = 'bodyless-conversation';
18083
+ super(container, viewConfig);
18084
+ this.viewConfig = viewConfig;
18085
+ }
18086
+ getIframeSrc() {
18087
+ var _a;
18088
+ const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18089
+ const path = 'conv-assist-answer';
18090
+ const queryParams = this.getBaseQueryParams();
18091
+ queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
18092
+ queryParams[Param.isSpotterAgentEmbed] = true;
18093
+ let query = '';
18094
+ const queryParamsString = getQueryParamString(queryParams, true);
18095
+ if (queryParamsString) {
18096
+ query = `?${queryParamsString}`;
18097
+ }
18098
+ const tsPostHashParams = this.getThoughtSpotPostUrlParams({
18099
+ sessionId,
18100
+ genNo,
18101
+ acSessionId,
18102
+ acGenNo,
18103
+ });
18104
+ return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18105
+ }
18106
+ async render() {
18107
+ await super.render();
18108
+ const src = this.getIframeSrc();
18109
+ await this.renderIFrame(src);
18110
+ return this;
18111
+ }
18112
+ }
18113
+ /**
18114
+ * Create a conversation embed, which can be integrated inside
18115
+ * chatbots or other conversational interfaces.
18116
+ * @example
18117
+ * ```js
18118
+ * import { SpotterAgentEmbed } from '@thoughtspot/visual-embed-sdk';
18119
+ *
18120
+ * const conversation = new SpotterAgentEmbed({
18121
+ * worksheetId: 'worksheetId',
18122
+ * });
18123
+ *
18124
+ * const { container, error } = await conversation.sendMessage('show me sales by region');
18125
+ *
18126
+ * // append the container to the DOM
18127
+ * document.body.appendChild(container); // or to any other element
18128
+ * ```
18129
+ * @group Embed components
18130
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18131
+ */
18132
+ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
18133
+ constructor(viewConfig) {
18134
+ this.viewConfig = viewConfig;
18135
+ const embedConfig = getEmbedConfig();
18136
+ this.conversationService = new Conversation(embedConfig.thoughtSpotHost, viewConfig.worksheetId);
18137
+ }
18138
+ async sendMessage(userMessage) {
18139
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18140
+ if (error) {
18141
+ return { error };
18142
+ }
18143
+ const container = document.createElement('div');
18144
+ if (this.viewConfig.containerClassName) {
18145
+ container.className = this.viewConfig.containerClassName;
18146
+ }
18147
+ const embed = new ConversationMessage(container, {
18148
+ ...this.viewConfig,
18149
+ sessionId: data.sessionId,
18150
+ genNo: data.genNo,
18151
+ acSessionId: data.stateKey.transactionId,
18152
+ acGenNo: data.stateKey.generationNumber,
18153
+ });
18154
+ await embed.render();
18155
+ return { container, viz: embed };
18156
+ }
18157
+ };
18158
+
17684
18159
  /**
17685
18160
  *
17686
18161
  * @param props
@@ -17737,7 +18212,7 @@ query GetEurekaVizSnapshots(
17737
18212
  * });
17738
18213
  * conversation.render();
17739
18214
  * ```
17740
- * @version SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18215
+ * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
17741
18216
  */
17742
18217
  let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
17743
18218
  constructor(container, viewConfig) {
@@ -17788,7 +18263,8 @@ query GetEurekaVizSnapshots(
17788
18263
  };
17789
18264
  /**
17790
18265
  * Embed ThoughtSpot AI Conversation.
17791
- * @deprecated Renamed to SpotterEmbed
18266
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18267
+ * Use {@link SpotterEmbed} instead
17792
18268
  * @group Embed components
17793
18269
  * @example
17794
18270
  * ```js
@@ -18037,7 +18513,8 @@ query GetEurekaVizSnapshots(
18037
18513
  const SpotterEmbed = componentFactory(SpotterEmbed$1);
18038
18514
  /**
18039
18515
  * React component for LLM based conversation BI.
18040
- * @deprecated This component is renamed to SpotterEmbed. Use {@link SpotterEmbed} instead.
18516
+ * @deprecated from SDK: 1.38.0 | ThoughtSpot: 10.10.0.cl
18517
+ * Use {@link SpotterEmbed} instead
18041
18518
  * @example
18042
18519
  * ```tsx
18043
18520
  * function Sage() {
@@ -18052,6 +18529,56 @@ query GetEurekaVizSnapshots(
18052
18529
  * ```
18053
18530
  */
18054
18531
  const ConversationEmbed = componentFactory(ConversationEmbed$1);
18532
+ /**
18533
+ * React component for SpotterAgent embed, which can be integrated inside
18534
+ * chatbots or other conversational interfaces.
18535
+ * @example
18536
+ * ```tsx
18537
+ * function SpotterAgent() {
18538
+ * const ref = useRef();
18539
+ *
18540
+ * const handleSendMessage = async () => {
18541
+ * const { container, error } = await ref.current.sendMessage('show me sales by region');
18542
+ * if (container) {
18543
+ * document.body.appendChild(container);
18544
+ * }
18545
+ * };
18546
+ *
18547
+ * return (
18548
+ * <div>
18549
+ * <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
18550
+ * <button onClick={handleSendMessage}>Send Message</button>
18551
+ * </div>
18552
+ * );
18553
+ * }
18554
+ * ```
18555
+ */
18556
+ const SpotterAgentEmbed = React.forwardRef((props, ref) => {
18557
+ const { className, ...restProps } = props;
18558
+ const serviceRef = React.useRef(null);
18559
+ useDeepCompareEffect(() => {
18560
+ if (serviceRef.current) {
18561
+ serviceRef.current = null;
18562
+ }
18563
+ const configProps = {
18564
+ ...restProps,
18565
+ ...(className ? { containerClassName: className } : {})
18566
+ };
18567
+ serviceRef.current = new SpotterAgentEmbed$1(configProps);
18568
+ if (ref) {
18569
+ if (typeof ref === 'function') {
18570
+ ref(serviceRef.current);
18571
+ }
18572
+ else {
18573
+ ref.current = serviceRef.current;
18574
+ }
18575
+ }
18576
+ return () => {
18577
+ serviceRef.current = null;
18578
+ };
18579
+ }, [props]);
18580
+ return null;
18581
+ });
18055
18582
  /**
18056
18583
  * React component for PreRendered Conversation embed.
18057
18584
  *
@@ -18587,7 +19114,8 @@ query GetEurekaVizSnapshots(
18587
19114
  return {
18588
19115
  onAnchor: (source) => {
18589
19116
  aliasObjects.push(source);
18590
- prevAnchors ?? (prevAnchors = anchorNames(doc));
19117
+ if (!prevAnchors)
19118
+ prevAnchors = anchorNames(doc);
18591
19119
  const anchor = findNewAnchor(prefix, prevAnchors);
18592
19120
  prevAnchors.add(anchor);
18593
19121
  return anchor;
@@ -18751,36 +19279,23 @@ query GetEurekaVizSnapshots(
18751
19279
  * Resolve the value of this alias within `doc`, finding the last
18752
19280
  * instance of the `source` anchor before this node.
18753
19281
  */
18754
- resolve(doc, ctx) {
18755
- let nodes;
18756
- if (ctx?.aliasResolveCache) {
18757
- nodes = ctx.aliasResolveCache;
18758
- }
18759
- else {
18760
- nodes = [];
18761
- visit$1(doc, {
18762
- Node: (_key, node) => {
18763
- if (isAlias(node) || hasAnchor(node))
18764
- nodes.push(node);
18765
- }
18766
- });
18767
- if (ctx)
18768
- ctx.aliasResolveCache = nodes;
18769
- }
19282
+ resolve(doc) {
18770
19283
  let found = undefined;
18771
- for (const node of nodes) {
18772
- if (node === this)
18773
- break;
18774
- if (node.anchor === this.source)
18775
- found = node;
18776
- }
19284
+ visit$1(doc, {
19285
+ Node: (_key, node) => {
19286
+ if (node === this)
19287
+ return visit$1.BREAK;
19288
+ if (node.anchor === this.source)
19289
+ found = node;
19290
+ }
19291
+ });
18777
19292
  return found;
18778
19293
  }
18779
19294
  toJSON(_arg, ctx) {
18780
19295
  if (!ctx)
18781
19296
  return { source: this.source };
18782
19297
  const { anchors, doc, maxAliasCount } = ctx;
18783
- const source = this.resolve(doc, ctx);
19298
+ const source = this.resolve(doc);
18784
19299
  if (!source) {
18785
19300
  const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
18786
19301
  throw new ReferenceError(msg);
@@ -18899,7 +19414,8 @@ query GetEurekaVizSnapshots(
18899
19414
  if (aliasDuplicateObjects && value && typeof value === 'object') {
18900
19415
  ref = sourceObjects.get(value);
18901
19416
  if (ref) {
18902
- ref.anchor ?? (ref.anchor = onAnchor(value));
19417
+ if (!ref.anchor)
19418
+ ref.anchor = onAnchor(value);
18903
19419
  return new Alias(ref.anchor);
18904
19420
  }
18905
19421
  else {
@@ -19470,32 +19986,23 @@ query GetEurekaVizSnapshots(
19470
19986
  start = start.replace(/\n+/g, `$&${indent}`);
19471
19987
  }
19472
19988
  const indentSize = indent ? '2' : '1'; // root is at -1
19473
- // Leading | or > is added later
19474
- let header = (startWithSpace ? indentSize : '') + chomp;
19989
+ let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
19475
19990
  if (comment) {
19476
19991
  header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
19477
19992
  if (onComment)
19478
19993
  onComment();
19479
19994
  }
19480
- if (!literal) {
19481
- const foldedValue = value
19482
- .replace(/\n+/g, '\n$&')
19483
- .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
19484
- // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
19485
- .replace(/\n+/g, `$&${indent}`);
19486
- let literalFallback = false;
19487
- const foldOptions = getFoldOptions(ctx, true);
19488
- if (blockQuote !== 'folded' && type !== Scalar.BLOCK_FOLDED) {
19489
- foldOptions.onOverflow = () => {
19490
- literalFallback = true;
19491
- };
19492
- }
19493
- const body = foldFlowLines(`${start}${foldedValue}${end}`, indent, FOLD_BLOCK, foldOptions);
19494
- if (!literalFallback)
19495
- return `>${header}\n${indent}${body}`;
19496
- }
19497
- value = value.replace(/\n+/g, `$&${indent}`);
19498
- return `|${header}\n${indent}${start}${value}${end}`;
19995
+ if (literal) {
19996
+ value = value.replace(/\n+/g, `$&${indent}`);
19997
+ return `${header}\n${indent}${start}${value}${end}`;
19998
+ }
19999
+ value = value
20000
+ .replace(/\n+/g, '\n$&')
20001
+ .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
20002
+ // ^ more-ind. ^ empty ^ capture next empty lines only at end of indent
20003
+ .replace(/\n+/g, `$&${indent}`);
20004
+ const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
20005
+ return `${header}\n${indent}${body}`;
19499
20006
  }
19500
20007
  function plainString(item, ctx, onComment, onChompKeep) {
19501
20008
  const { type, value } = item;
@@ -19504,9 +20011,10 @@ query GetEurekaVizSnapshots(
19504
20011
  (inFlow && /[[\]{},]/.test(value))) {
19505
20012
  return quotedString(value, ctx);
19506
20013
  }
19507
- if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
20014
+ if (!value ||
20015
+ /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
19508
20016
  // not allowed:
19509
- // - '-' or '?'
20017
+ // - empty string, '-' or '?'
19510
20018
  // - start with an indicator character (except [?:-]) or /[?-] /
19511
20019
  // - '\n ', ': ' or ' \n' anywhere
19512
20020
  // - '#' not preceded by a non-space char
@@ -19635,12 +20143,7 @@ query GetEurekaVizSnapshots(
19635
20143
  let obj;
19636
20144
  if (isScalar$1(item)) {
19637
20145
  obj = item.value;
19638
- let match = tags.filter(t => t.identify?.(obj));
19639
- if (match.length > 1) {
19640
- const testMatch = match.filter(t => t.test);
19641
- if (testMatch.length > 0)
19642
- match = testMatch;
19643
- }
20146
+ const match = tags.filter(t => t.identify?.(obj));
19644
20147
  tagObj =
19645
20148
  match.find(t => t.format === item.format) ?? match.find(t => !t.format);
19646
20149
  }
@@ -19649,7 +20152,7 @@ query GetEurekaVizSnapshots(
19649
20152
  tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
19650
20153
  }
19651
20154
  if (!tagObj) {
19652
- const name = obj?.constructor?.name ?? (obj === null ? 'null' : typeof obj);
20155
+ const name = obj?.constructor?.name ?? typeof obj;
19653
20156
  throw new Error(`Tag not resolved for ${name} value`);
19654
20157
  }
19655
20158
  return tagObj;
@@ -19664,7 +20167,7 @@ query GetEurekaVizSnapshots(
19664
20167
  anchors.add(anchor);
19665
20168
  props.push(`&${anchor}`);
19666
20169
  }
19667
- const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
20170
+ const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
19668
20171
  if (tag)
19669
20172
  props.push(doc.directives.tagString(tag));
19670
20173
  return props.join(' ');
@@ -19690,7 +20193,8 @@ query GetEurekaVizSnapshots(
19690
20193
  const node = isNode(item)
19691
20194
  ? item
19692
20195
  : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
19693
- tagObj ?? (tagObj = getTagObject(ctx.doc.schema.tags, node));
20196
+ if (!tagObj)
20197
+ tagObj = getTagObject(ctx.doc.schema.tags, node);
19694
20198
  const props = stringifyProps(node, tagObj, ctx);
19695
20199
  if (props.length > 0)
19696
20200
  ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
@@ -19852,10 +20356,54 @@ query GetEurekaVizSnapshots(
19852
20356
 
19853
20357
  function warn(logLevel, warning) {
19854
20358
  if (logLevel === 'debug' || logLevel === 'warn') {
19855
- console.warn(warning);
20359
+ if (typeof process !== 'undefined' && process.emitWarning)
20360
+ process.emitWarning(warning);
20361
+ else
20362
+ console.warn(warning);
19856
20363
  }
19857
20364
  }
19858
20365
 
20366
+ const MERGE_KEY = '<<';
20367
+ function addPairToJSMap(ctx, map, { key, value }) {
20368
+ if (ctx?.doc.schema.merge && isMergeKey(key)) {
20369
+ value = isAlias(value) ? value.resolve(ctx.doc) : value;
20370
+ if (isSeq(value))
20371
+ for (const it of value.items)
20372
+ mergeToJSMap(ctx, map, it);
20373
+ else if (Array.isArray(value))
20374
+ for (const it of value)
20375
+ mergeToJSMap(ctx, map, it);
20376
+ else
20377
+ mergeToJSMap(ctx, map, value);
20378
+ }
20379
+ else {
20380
+ const jsKey = toJS(key, '', ctx);
20381
+ if (map instanceof Map) {
20382
+ map.set(jsKey, toJS(value, jsKey, ctx));
20383
+ }
20384
+ else if (map instanceof Set) {
20385
+ map.add(jsKey);
20386
+ }
20387
+ else {
20388
+ const stringKey = stringifyKey(key, jsKey, ctx);
20389
+ const jsValue = toJS(value, stringKey, ctx);
20390
+ if (stringKey in map)
20391
+ Object.defineProperty(map, stringKey, {
20392
+ value: jsValue,
20393
+ writable: true,
20394
+ enumerable: true,
20395
+ configurable: true
20396
+ });
20397
+ else
20398
+ map[stringKey] = jsValue;
20399
+ }
20400
+ }
20401
+ return map;
20402
+ }
20403
+ const isMergeKey = (key) => key === MERGE_KEY ||
20404
+ (isScalar$1(key) &&
20405
+ key.value === MERGE_KEY &&
20406
+ (!key.type || key.type === Scalar.PLAIN));
19859
20407
  // If the value associated with a merge key is a single mapping node, each of
19860
20408
  // its key/value pairs is inserted into the current mapping, unless the key
19861
20409
  // already exists in it. If the value associated with the merge key is a
@@ -19863,35 +20411,7 @@ query GetEurekaVizSnapshots(
19863
20411
  // of these nodes is merged in turn according to its order in the sequence.
19864
20412
  // Keys in mapping nodes earlier in the sequence override keys specified in
19865
20413
  // later mapping nodes. -- http://yaml.org/type/merge.html
19866
- const MERGE_KEY = '<<';
19867
- const merge = {
19868
- identify: value => value === MERGE_KEY ||
19869
- (typeof value === 'symbol' && value.description === MERGE_KEY),
19870
- default: 'key',
19871
- tag: 'tag:yaml.org,2002:merge',
19872
- test: /^<<$/,
19873
- resolve: () => Object.assign(new Scalar(Symbol(MERGE_KEY)), {
19874
- addToJSMap: addMergeToJSMap
19875
- }),
19876
- stringify: () => MERGE_KEY
19877
- };
19878
- const isMergeKey = (ctx, key) => (merge.identify(key) ||
19879
- (isScalar$1(key) &&
19880
- (!key.type || key.type === Scalar.PLAIN) &&
19881
- merge.identify(key.value))) &&
19882
- ctx?.doc.schema.tags.some(tag => tag.tag === merge.tag && tag.default);
19883
- function addMergeToJSMap(ctx, map, value) {
19884
- value = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
19885
- if (isSeq(value))
19886
- for (const it of value.items)
19887
- mergeValue(ctx, map, it);
19888
- else if (Array.isArray(value))
19889
- for (const it of value)
19890
- mergeValue(ctx, map, it);
19891
- else
19892
- mergeValue(ctx, map, value);
19893
- }
19894
- function mergeValue(ctx, map, value) {
20414
+ function mergeToJSMap(ctx, map, value) {
19895
20415
  const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
19896
20416
  if (!isMap(source))
19897
20417
  throw new Error('Merge sources must be maps or map aliases');
@@ -19915,41 +20435,9 @@ query GetEurekaVizSnapshots(
19915
20435
  }
19916
20436
  return map;
19917
20437
  }
19918
-
19919
- function addPairToJSMap(ctx, map, { key, value }) {
19920
- if (isNode(key) && key.addToJSMap)
19921
- key.addToJSMap(ctx, map, value);
19922
- // TODO: Should drop this special case for bare << handling
19923
- else if (isMergeKey(ctx, key))
19924
- addMergeToJSMap(ctx, map, value);
19925
- else {
19926
- const jsKey = toJS(key, '', ctx);
19927
- if (map instanceof Map) {
19928
- map.set(jsKey, toJS(value, jsKey, ctx));
19929
- }
19930
- else if (map instanceof Set) {
19931
- map.add(jsKey);
19932
- }
19933
- else {
19934
- const stringKey = stringifyKey(key, jsKey, ctx);
19935
- const jsValue = toJS(value, stringKey, ctx);
19936
- if (stringKey in map)
19937
- Object.defineProperty(map, stringKey, {
19938
- value: jsValue,
19939
- writable: true,
19940
- enumerable: true,
19941
- configurable: true
19942
- });
19943
- else
19944
- map[stringKey] = jsValue;
19945
- }
19946
- }
19947
- return map;
19948
- }
19949
20438
  function stringifyKey(key, jsKey, ctx) {
19950
20439
  if (jsKey === null)
19951
20440
  return '';
19952
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
19953
20441
  if (typeof jsKey !== 'object')
19954
20442
  return String(jsKey);
19955
20443
  if (isNode(key) && ctx?.doc) {
@@ -20582,7 +21070,7 @@ query GetEurekaVizSnapshots(
20582
21070
  identify: value => typeof value === 'boolean',
20583
21071
  default: true,
20584
21072
  tag: 'tag:yaml.org,2002:bool',
20585
- test: /^true$|^false$/,
21073
+ test: /^true|false$/,
20586
21074
  resolve: str => str === 'true',
20587
21075
  stringify: stringifyJSON
20588
21076
  },
@@ -20627,7 +21115,10 @@ query GetEurekaVizSnapshots(
20627
21115
  * document.querySelector('#photo').src = URL.createObjectURL(blob)
20628
21116
  */
20629
21117
  resolve(src, onError) {
20630
- if (typeof atob === 'function') {
21118
+ if (typeof Buffer === 'function') {
21119
+ return Buffer.from(src, 'base64');
21120
+ }
21121
+ else if (typeof atob === 'function') {
20631
21122
  // On IE 11, atob() can't handle newlines
20632
21123
  const str = atob(src.replace(/[\n\r]/g, ''));
20633
21124
  const buffer = new Uint8Array(str.length);
@@ -20641,11 +21132,15 @@ query GetEurekaVizSnapshots(
20641
21132
  }
20642
21133
  },
20643
21134
  stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
20644
- if (!value)
20645
- return '';
20646
21135
  const buf = value; // checked earlier by binary.identify()
20647
21136
  let str;
20648
- if (typeof btoa === 'function') {
21137
+ if (typeof Buffer === 'function') {
21138
+ str =
21139
+ buf instanceof Buffer
21140
+ ? buf.toString('base64')
21141
+ : Buffer.from(buf.buffer).toString('base64');
21142
+ }
21143
+ else if (typeof btoa === 'function') {
20649
21144
  let s = '';
20650
21145
  for (let i = 0; i < buf.length; ++i)
20651
21146
  s += String.fromCharCode(buf[i]);
@@ -20654,7 +21149,8 @@ query GetEurekaVizSnapshots(
20654
21149
  else {
20655
21150
  throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
20656
21151
  }
20657
- type ?? (type = Scalar.BLOCK_LITERAL);
21152
+ if (!type)
21153
+ type = Scalar.BLOCK_LITERAL;
20658
21154
  if (type !== Scalar.QUOTE_DOUBLE) {
20659
21155
  const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
20660
21156
  const n = Math.ceil(str.length / lineWidth);
@@ -21123,7 +21619,7 @@ query GetEurekaVizSnapshots(
21123
21619
  }
21124
21620
  return new Date(date);
21125
21621
  },
21126
- stringify: ({ value }) => value?.toISOString().replace(/(T00:00:00)?\.000Z$/, '') ?? ''
21622
+ stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
21127
21623
  };
21128
21624
 
21129
21625
  const schema = [
@@ -21141,7 +21637,6 @@ query GetEurekaVizSnapshots(
21141
21637
  floatExp,
21142
21638
  float,
21143
21639
  binary,
21144
- merge,
21145
21640
  omap,
21146
21641
  pairs,
21147
21642
  set,
@@ -21169,7 +21664,6 @@ query GetEurekaVizSnapshots(
21169
21664
  intOct: intOct$1,
21170
21665
  intTime,
21171
21666
  map,
21172
- merge,
21173
21667
  null: nullTag,
21174
21668
  omap,
21175
21669
  pairs,
@@ -21179,20 +21673,13 @@ query GetEurekaVizSnapshots(
21179
21673
  };
21180
21674
  const coreKnownTags = {
21181
21675
  'tag:yaml.org,2002:binary': binary,
21182
- 'tag:yaml.org,2002:merge': merge,
21183
21676
  'tag:yaml.org,2002:omap': omap,
21184
21677
  'tag:yaml.org,2002:pairs': pairs,
21185
21678
  'tag:yaml.org,2002:set': set,
21186
21679
  'tag:yaml.org,2002:timestamp': timestamp
21187
21680
  };
21188
- function getTags(customTags, schemaName, addMergeTag) {
21189
- const schemaTags = schemas.get(schemaName);
21190
- if (schemaTags && !customTags) {
21191
- return addMergeTag && !schemaTags.includes(merge)
21192
- ? schemaTags.concat(merge)
21193
- : schemaTags.slice();
21194
- }
21195
- let tags = schemaTags;
21681
+ function getTags(customTags, schemaName) {
21682
+ let tags = schemas.get(schemaName);
21196
21683
  if (!tags) {
21197
21684
  if (Array.isArray(customTags))
21198
21685
  tags = [];
@@ -21211,21 +21698,17 @@ query GetEurekaVizSnapshots(
21211
21698
  else if (typeof customTags === 'function') {
21212
21699
  tags = customTags(tags.slice());
21213
21700
  }
21214
- if (addMergeTag)
21215
- tags = tags.concat(merge);
21216
- return tags.reduce((tags, tag) => {
21217
- const tagObj = typeof tag === 'string' ? tagsByName[tag] : tag;
21218
- if (!tagObj) {
21219
- const tagName = JSON.stringify(tag);
21220
- const keys = Object.keys(tagsByName)
21221
- .map(key => JSON.stringify(key))
21222
- .join(', ');
21223
- throw new Error(`Unknown custom tag ${tagName}; use one of ${keys}`);
21224
- }
21225
- if (!tags.includes(tagObj))
21226
- tags.push(tagObj);
21227
- return tags;
21228
- }, []);
21701
+ return tags.map(tag => {
21702
+ if (typeof tag !== 'string')
21703
+ return tag;
21704
+ const tagObj = tagsByName[tag];
21705
+ if (tagObj)
21706
+ return tagObj;
21707
+ const keys = Object.keys(tagsByName)
21708
+ .map(key => JSON.stringify(key))
21709
+ .join(', ');
21710
+ throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
21711
+ });
21229
21712
  }
21230
21713
 
21231
21714
  const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
@@ -21236,9 +21719,10 @@ query GetEurekaVizSnapshots(
21236
21719
  : compat
21237
21720
  ? getTags(null, compat)
21238
21721
  : null;
21722
+ this.merge = !!merge;
21239
21723
  this.name = (typeof schema === 'string' && schema) || 'core';
21240
21724
  this.knownTags = resolveKnownTags ? coreKnownTags : {};
21241
- this.tags = getTags(customTags, this.name, merge);
21725
+ this.tags = getTags(customTags, this.name);
21242
21726
  this.toStringOptions = toStringDefaults ?? null;
21243
21727
  Object.defineProperty(this, MAP, { value: map });
21244
21728
  Object.defineProperty(this, SCALAR$1, { value: string });
@@ -21363,7 +21847,6 @@ query GetEurekaVizSnapshots(
21363
21847
  logLevel: 'warn',
21364
21848
  prettyErrors: true,
21365
21849
  strict: true,
21366
- stringKeys: false,
21367
21850
  uniqueKeys: true,
21368
21851
  version: '1.2'
21369
21852
  }, options);
@@ -21587,7 +22070,7 @@ query GetEurekaVizSnapshots(
21587
22070
  this.directives.yaml.version = '1.1';
21588
22071
  else
21589
22072
  this.directives = new Directives({ version: '1.1' });
21590
- opt = { resolveKnownTags: false, schema: 'yaml-1.1' };
22073
+ opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
21591
22074
  break;
21592
22075
  case '1.2':
21593
22076
  case 'next':
@@ -21595,7 +22078,7 @@ query GetEurekaVizSnapshots(
21595
22078
  this.directives.yaml.version = version;
21596
22079
  else
21597
22080
  this.directives = new Directives({ version });
21598
- opt = { resolveKnownTags: true, schema: 'core' };
22081
+ opt = { merge: false, resolveKnownTags: true, schema: 'core' };
21599
22082
  break;
21600
22083
  case null:
21601
22084
  if (this.directives)
@@ -21773,7 +22256,7 @@ query GetEurekaVizSnapshots(
21773
22256
  if (atNewline) {
21774
22257
  if (comment)
21775
22258
  comment += token.source;
21776
- else if (!found || indicator !== 'seq-item-ind')
22259
+ else
21777
22260
  spaceBefore = true;
21778
22261
  }
21779
22262
  else
@@ -21790,7 +22273,8 @@ query GetEurekaVizSnapshots(
21790
22273
  if (token.source.endsWith(':'))
21791
22274
  onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
21792
22275
  anchor = token;
21793
- start ?? (start = token.offset);
22276
+ if (start === null)
22277
+ start = token.offset;
21794
22278
  atNewline = false;
21795
22279
  hasSpace = false;
21796
22280
  reqSpace = true;
@@ -21799,7 +22283,8 @@ query GetEurekaVizSnapshots(
21799
22283
  if (tag)
21800
22284
  onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
21801
22285
  tag = token;
21802
- start ?? (start = token.offset);
22286
+ if (start === null)
22287
+ start = token.offset;
21803
22288
  atNewline = false;
21804
22289
  hasSpace = false;
21805
22290
  reqSpace = true;
@@ -21912,7 +22397,11 @@ query GetEurekaVizSnapshots(
21912
22397
  return false;
21913
22398
  const isEqual = typeof uniqueKeys === 'function'
21914
22399
  ? uniqueKeys
21915
- : (a, b) => a === b || (isScalar$1(a) && isScalar$1(b) && a.value === b.value);
22400
+ : (a, b) => a === b ||
22401
+ (isScalar$1(a) &&
22402
+ isScalar$1(b) &&
22403
+ a.value === b.value &&
22404
+ !(a.value === '<<' && ctx.schema.merge));
21916
22405
  return items.some(pair => isEqual(pair.key, search));
21917
22406
  }
21918
22407
 
@@ -21961,14 +22450,12 @@ query GetEurekaVizSnapshots(
21961
22450
  onError(offset, 'BAD_INDENT', startColMsg);
21962
22451
  }
21963
22452
  // key value
21964
- ctx.atKey = true;
21965
22453
  const keyStart = keyProps.end;
21966
22454
  const keyNode = key
21967
22455
  ? composeNode(ctx, key, keyProps, onError)
21968
22456
  : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
21969
22457
  if (ctx.schema.compat)
21970
22458
  flowIndentCheck(bm.indent, key, onError);
21971
- ctx.atKey = false;
21972
22459
  if (mapIncludes(ctx, map.items, keyNode))
21973
22460
  onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
21974
22461
  // value properties
@@ -22028,8 +22515,6 @@ query GetEurekaVizSnapshots(
22028
22515
  const seq = new NodeClass(ctx.schema);
22029
22516
  if (ctx.atRoot)
22030
22517
  ctx.atRoot = false;
22031
- if (ctx.atKey)
22032
- ctx.atKey = false;
22033
22518
  let offset = bs.offset;
22034
22519
  let commentEnd = null;
22035
22520
  for (const { start, value } of bs.items) {
@@ -22114,8 +22599,6 @@ query GetEurekaVizSnapshots(
22114
22599
  const atRoot = ctx.atRoot;
22115
22600
  if (atRoot)
22116
22601
  ctx.atRoot = false;
22117
- if (ctx.atKey)
22118
- ctx.atKey = false;
22119
22602
  let offset = fc.offset + fc.start.source.length;
22120
22603
  for (let i = 0; i < fc.items.length; ++i) {
22121
22604
  const collItem = fc.items[i];
@@ -22195,14 +22678,12 @@ query GetEurekaVizSnapshots(
22195
22678
  else {
22196
22679
  // item is a key+value pair
22197
22680
  // key value
22198
- ctx.atKey = true;
22199
22681
  const keyStart = props.end;
22200
22682
  const keyNode = key
22201
22683
  ? composeNode(ctx, key, props, onError)
22202
22684
  : composeEmptyNode(ctx, keyStart, start, null, props, onError);
22203
22685
  if (isBlock(key))
22204
22686
  onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
22205
- ctx.atKey = false;
22206
22687
  // value properties
22207
22688
  const valueProps = resolveProps(sep ?? [], {
22208
22689
  flow: fcName,
@@ -22358,8 +22839,8 @@ query GetEurekaVizSnapshots(
22358
22839
  tag = kt;
22359
22840
  }
22360
22841
  else {
22361
- if (kt) {
22362
- onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection ?? 'scalar'}`, true);
22842
+ if (kt?.collection) {
22843
+ onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
22363
22844
  }
22364
22845
  else {
22365
22846
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
@@ -22800,16 +23281,11 @@ query GetEurekaVizSnapshots(
22800
23281
  const tagName = tagToken
22801
23282
  ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
22802
23283
  : null;
22803
- let tag;
22804
- if (ctx.options.stringKeys && ctx.atKey) {
22805
- tag = ctx.schema[SCALAR$1];
22806
- }
22807
- else if (tagName)
22808
- tag = findScalarTagByName(ctx.schema, value, tagName, tagToken, onError);
22809
- else if (token.type === 'scalar')
22810
- tag = findScalarTagByTest(ctx, value, token, onError);
22811
- else
22812
- tag = ctx.schema[SCALAR$1];
23284
+ const tag = tagToken && tagName
23285
+ ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
23286
+ : token.type === 'scalar'
23287
+ ? findScalarTagByTest(ctx, value, token, onError)
23288
+ : ctx.schema[SCALAR$1];
22813
23289
  let scalar;
22814
23290
  try {
22815
23291
  const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
@@ -22857,9 +23333,8 @@ query GetEurekaVizSnapshots(
22857
23333
  onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
22858
23334
  return schema[SCALAR$1];
22859
23335
  }
22860
- function findScalarTagByTest({ atKey, directives, schema }, value, token, onError) {
22861
- const tag = schema.tags.find(tag => (tag.default === true || (atKey && tag.default === 'key')) &&
22862
- tag.test?.test(value)) || schema[SCALAR$1];
23336
+ function findScalarTagByTest({ directives, schema }, value, token, onError) {
23337
+ const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
22863
23338
  if (schema.compat) {
22864
23339
  const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
22865
23340
  schema[SCALAR$1];
@@ -22875,7 +23350,8 @@ query GetEurekaVizSnapshots(
22875
23350
 
22876
23351
  function emptyScalarPosition(offset, before, pos) {
22877
23352
  if (before) {
22878
- pos ?? (pos = before.length);
23353
+ if (pos === null)
23354
+ pos = before.length;
22879
23355
  for (let i = pos - 1; i >= 0; --i) {
22880
23356
  let st = before[i];
22881
23357
  switch (st.type) {
@@ -22900,7 +23376,6 @@ query GetEurekaVizSnapshots(
22900
23376
 
22901
23377
  const CN = { composeNode, composeEmptyNode };
22902
23378
  function composeNode(ctx, token, props, onError) {
22903
- const atKey = ctx.atKey;
22904
23379
  const { spaceBefore, comment, anchor, tag } = props;
22905
23380
  let node;
22906
23381
  let isSrcToken = true;
@@ -22936,14 +23411,6 @@ query GetEurekaVizSnapshots(
22936
23411
  }
22937
23412
  if (anchor && node.anchor === '')
22938
23413
  onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
22939
- if (atKey &&
22940
- ctx.options.stringKeys &&
22941
- (!isScalar$1(node) ||
22942
- typeof node.value !== 'string' ||
22943
- (node.tag && node.tag !== 'tag:yaml.org,2002:str'))) {
22944
- const msg = 'With stringKeys, all keys must be strings';
22945
- onError(tag ?? token, 'NON_STRING_KEY', msg);
22946
- }
22947
23414
  if (spaceBefore)
22948
23415
  node.spaceBefore = true;
22949
23416
  if (comment) {
@@ -22996,7 +23463,6 @@ query GetEurekaVizSnapshots(
22996
23463
  const opts = Object.assign({ _directives: directives }, options);
22997
23464
  const doc = new Document(undefined, opts);
22998
23465
  const ctx = {
22999
- atKey: false,
23000
23466
  atRoot: true,
23001
23467
  directives: doc.directives,
23002
23468
  options: doc.options,
@@ -25131,20 +25597,7 @@ query GetEurekaVizSnapshots(
25131
25597
  default: {
25132
25598
  const bv = this.startBlockValue(map);
25133
25599
  if (bv) {
25134
- if (bv.type === 'block-seq') {
25135
- if (!it.explicitKey &&
25136
- it.sep &&
25137
- !includesToken(it.sep, 'newline')) {
25138
- yield* this.pop({
25139
- type: 'error',
25140
- offset: this.offset,
25141
- message: 'Unexpected block-seq-ind on same line with key',
25142
- source: this.source
25143
- });
25144
- return;
25145
- }
25146
- }
25147
- else if (atMapIndent) {
25600
+ if (atMapIndent && bv.type !== 'block-seq') {
25148
25601
  map.items.push({ start });
25149
25602
  }
25150
25603
  this.stack.push(bv);
@@ -25515,8 +25968,6 @@ query GetEurekaVizSnapshots(
25515
25968
  if (!keepUndefined)
25516
25969
  return undefined;
25517
25970
  }
25518
- if (isDocument(value) && !_replacer)
25519
- return value.toString(options);
25520
25971
  return new Document(value, _replacer, options).toString(options);
25521
25972
  }
25522
25973
 
@@ -25604,6 +26055,7 @@ query GetEurekaVizSnapshots(
25604
26055
  exports.SageEmbed = SageEmbed;
25605
26056
  exports.SearchBarEmbed = SearchBarEmbed;
25606
26057
  exports.SearchEmbed = SearchEmbed;
26058
+ exports.SpotterAgentEmbed = SpotterAgentEmbed;
25607
26059
  exports.SpotterEmbed = SpotterEmbed;
25608
26060
  exports.getSessionInfo = getSessionInfo;
25609
26061
  exports.useEmbedRef = useEmbedRef;