@luzmo/embed 7.1.0 → 7.2.1-es2021

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.
package/CHANGELOG.md CHANGED
@@ -2,12 +2,22 @@
2
2
 
3
3
  All notable changes to this project are documented in this file.
4
4
 
5
+ ## [7.2.1] - 2026-09-04
6
+
7
+ ### Fixed
8
+ - Fixed embedded dashboards failing to load in `editFull` mode when `appServer` is set without a trailing slash.
9
+
10
+ ## [7.2.0] - 2026-09-02
11
+
12
+ ### Added
13
+ - Added `getInsights()` to `<luzmo-embed-dashboard>` and `<luzmo-embed-viz-item>`.
14
+
5
15
  ## [7.1.0] - 2026-07-20
6
16
 
7
17
  ### Added
8
18
  - `error` event on `<luzmo-embed-dashboard>` and `<luzmo-embed-viz-item>`. Fires when the embed cannot be loaded or hits a fatal error (connectivity, permissions, invalid configuration, etc.), so you can handle it in your host app instead of showing a stuck loader.
9
19
 
10
- ## [7.0.0] - 2026-07-10
20
+ ## [7.0.0] - 2026-07-20
11
21
 
12
22
  ### Removed
13
23
  - Removed the `accentColor` property and `accent-color` attribute from `<luzmo-embed-dashboard>`.
package/index.cjs CHANGED
@@ -48,24 +48,23 @@ __export(index_exports, {
48
48
  getCachedJSONSchemas: () => getCachedJSONSchemas,
49
49
  getJSONSchemaUrl: () => getJSONSchemaUrl,
50
50
  luzmoRefParserOptions: () => luzmoRefParserOptions,
51
- preloadDashboard: () => import_shared_embed4.preloadDashboard,
52
- preloadIQ: () => import_shared_embed4.preloadIQ,
53
- preloadVizItem: () => import_shared_embed4.preloadVizItem,
54
- selectedDataUtils: () => import_shared_embed4.selectedDataUtils
51
+ preloadDashboard: () => import_shared_embed3.preloadDashboard,
52
+ preloadIQ: () => import_shared_embed3.preloadIQ,
53
+ preloadVizItem: () => import_shared_embed3.preloadVizItem,
54
+ selectedDataUtils: () => import_shared_embed3.selectedDataUtils
55
55
  });
56
56
  module.exports = __toCommonJS(index_exports);
57
- var import_shared_embed4 = require("@luzmo/shared-embed");
57
+ var import_shared_embed3 = require("@luzmo/shared-embed");
58
58
  var import_lit6 = require("lit");
59
59
 
60
60
  // libs/embed-libs/embed/src/lib/dashboard/dashboard-base.ts
61
61
  var SharedLib2 = __toESM(require("@luzmo/shared-embed"));
62
- var import_shared_embed = require("@luzmo/shared-embed");
63
62
  var import_lit2 = require("lit");
64
63
  var import_decorators = require("lit/decorators.js");
65
64
  var import_style_map = require("lit/directives/style-map.js");
66
65
 
67
66
  // libs/embed-libs/embed/package.json
68
- var version = "7.1.0";
67
+ var version = "7.2.1";
69
68
 
70
69
  // libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
71
70
  function buildEmbedErrorDetail(errorMsg) {
@@ -143,6 +142,22 @@ var _setEventHandler = () => {
143
142
  );
144
143
  break;
145
144
  }
145
+ case "insights": {
146
+ if (event.data.error) {
147
+ SharedLib.rejectPromise(
148
+ dashboardComponent,
149
+ event.data.requestId,
150
+ new Error(event.data.error.message)
151
+ );
152
+ } else {
153
+ SharedLib.resolvePromise(
154
+ dashboardComponent,
155
+ event.data.requestId,
156
+ event.data.summary
157
+ );
158
+ }
159
+ break;
160
+ }
146
161
  case "dashboardContext": {
147
162
  SharedLib.resolvePromise(
148
163
  dashboardComponent,
@@ -676,6 +691,16 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
676
691
  return;
677
692
  }
678
693
  if (this.isWebComponentViewMode()) {
694
+ if (changedProperties.has("editMode") && !this.dashboardReference) {
695
+ this.iframeLoaded = false;
696
+ if (this._loadTimeoutHandle) {
697
+ clearTimeout(this._loadTimeoutHandle);
698
+ this._loadTimeoutHandle = void 0;
699
+ }
700
+ this.params = this._setOptions();
701
+ this.initComponent();
702
+ return;
703
+ }
679
704
  if (this.dashboardReference) {
680
705
  for (const [propertyName] of changedProperties.entries()) {
681
706
  if (propertyName === "appSever") {
@@ -695,33 +720,46 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
695
720
  } else {
696
721
  for (const [propertyName] of changedProperties.entries()) {
697
722
  if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
698
- this.iframeLoaded = false;
699
- if (this._loadTimeoutHandle) {
700
- clearTimeout(this._loadTimeoutHandle);
701
- }
702
- this._loadTimeoutHandle = setTimeout(() => {
703
- console.warn(
704
- "Failed to load dashboard, appServer is likely down or unreachable."
705
- );
706
- }, 15 * 1e3);
707
- this.params = this._setOptions();
708
- SharedLib2._extendAndValidate(this);
709
- this._setupLoader();
710
- this._loaderStyles();
711
- this._iframeUrl = SharedLib2.createIframeUrl(this);
712
- if (this.iframe) {
713
- this._updateIframeUrl();
714
- }
715
- this.iframeStyle = SharedLib2.calculateIframeStyles(this);
723
+ this._reloadIframeContent();
716
724
  } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
717
725
  if (this.iframeLoaded) {
718
726
  this.setEditMode(this.editMode);
727
+ this.params = this._setOptions();
728
+ } else {
729
+ this._reloadIframeContent();
719
730
  }
720
- this.params = this._setOptions();
721
731
  }
722
732
  }
723
733
  }
724
734
  }
735
+ _reloadIframeContent() {
736
+ this.params = this._setOptions();
737
+ SharedLib2._extendAndValidate(this);
738
+ this._setupLoader();
739
+ if (this.params.error) {
740
+ if (this._loadTimeoutHandle) {
741
+ clearTimeout(this._loadTimeoutHandle);
742
+ this._loadTimeoutHandle = void 0;
743
+ }
744
+ this._loaderStyles();
745
+ return;
746
+ }
747
+ this.iframeLoaded = false;
748
+ if (this._loadTimeoutHandle) {
749
+ clearTimeout(this._loadTimeoutHandle);
750
+ }
751
+ this._loadTimeoutHandle = setTimeout(() => {
752
+ console.warn(
753
+ "Failed to load dashboard, appServer is likely down or unreachable."
754
+ );
755
+ }, 15 * 1e3);
756
+ this._loaderStyles();
757
+ this._iframeUrl = SharedLib2.createIframeUrl(this);
758
+ if (this.iframe) {
759
+ this._updateIframeUrl();
760
+ }
761
+ this.iframeStyle = SharedLib2.calculateIframeStyles(this);
762
+ }
725
763
  // Set params
726
764
  _setOptions() {
727
765
  const defaultParameters = {
@@ -923,7 +961,7 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
923
961
  `;
924
962
  }
925
963
  return import_lit2.html`
926
- <div class="${import_shared_embed.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${import_shared_embed.luzmoEmbedContainerClass}-ede`}">
964
+ <div class="${SharedLib2.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${SharedLib2.luzmoEmbedContainerClass}-ede`}">
927
965
  <div
928
966
  class="dashboard-container"
929
967
  style=${(0, import_style_map.styleMap)(Object.assign({}, this._containerStyle, {
@@ -961,6 +999,15 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
961
999
  }
962
1000
  return Promise.reject();
963
1001
  }
1002
+ getInsights(options) {
1003
+ if (this.isWebComponentViewMode() && this.dashboardReference) {
1004
+ return this.dashboardReference.getInsights(options);
1005
+ }
1006
+ if (!this.isWebComponentViewMode()) {
1007
+ return SharedLib2.getInsights(this, this.iframe, options);
1008
+ }
1009
+ return Promise.reject(new Error("getInsights is not available: dashboard reference is not ready."));
1010
+ }
964
1011
  getDashboardContext() {
965
1012
  if (this.isWebComponentViewMode() && this.dashboardReference) {
966
1013
  return this.dashboardReference.getDashboardContext();
@@ -1065,14 +1112,14 @@ var LuzmoDashboard = class extends import_lit2.LitElement {
1065
1112
  return Promise.reject();
1066
1113
  }
1067
1114
  isWebComponentViewMode() {
1068
- return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
1115
+ return this.embedMode === "webComponent" && (this.editMode === "view" || this.editMode === void 0);
1069
1116
  }
1070
1117
  };
1071
1118
  __decorateClass([
1072
1119
  (0, import_decorators.query)(".dashboard-container")
1073
1120
  ], LuzmoDashboard.prototype, "container", 2);
1074
1121
  __decorateClass([
1075
- (0, import_decorators.query)(`.${import_shared_embed.luzmoEmbedContainerClass}`)
1122
+ (0, import_decorators.query)(`.${SharedLib2.luzmoEmbedContainerClass}`)
1076
1123
  ], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
1077
1124
  __decorateClass([
1078
1125
  (0, import_decorators.query)("iframe")
@@ -1265,22 +1312,6 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1265
1312
  this.libVersion = version + "-wc-luzmo";
1266
1313
  this.postInitCallQueue = [];
1267
1314
  }
1268
- static {
1269
- // Static styles to set host display to block, else it is not shown at all for some reason.
1270
- this.styles = import_lit3.css`
1271
- :host {
1272
- display: block;
1273
- width: 100%;
1274
- height: 100%;
1275
- }
1276
-
1277
- luzmo-embed-viz-item {
1278
- width: 100%;
1279
- height: 1000%;
1280
- display: block;
1281
- }
1282
- `;
1283
- }
1284
1315
  createRenderRoot() {
1285
1316
  if (!this.style.display) {
1286
1317
  this.style.display = "block";
@@ -1321,6 +1352,9 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1321
1352
  getData() {
1322
1353
  return this.chartElement.getData();
1323
1354
  }
1355
+ getInsights(options) {
1356
+ return this.chartElement.getInsights(options);
1357
+ }
1324
1358
  refreshData() {
1325
1359
  return this.chartElement.refreshData();
1326
1360
  }
@@ -1417,6 +1451,20 @@ var LuzmoBaseVizItem = class extends import_lit3.LitElement {
1417
1451
  return import_lit3.html` `;
1418
1452
  }
1419
1453
  };
1454
+ // Static styles to set host display to block, else it is not shown at all for some reason.
1455
+ LuzmoBaseVizItem.styles = import_lit3.css`
1456
+ :host {
1457
+ display: block;
1458
+ width: 100%;
1459
+ height: 100%;
1460
+ }
1461
+
1462
+ luzmo-embed-viz-item {
1463
+ width: 100%;
1464
+ height: 1000%;
1465
+ display: block;
1466
+ }
1467
+ `;
1420
1468
  __decorateClass([
1421
1469
  (0, import_decorators2.property)()
1422
1470
  ], LuzmoBaseVizItem.prototype, "appServer", 2);
@@ -1485,7 +1533,7 @@ if (!customElements.get("luzmo-embed-viz-item")) {
1485
1533
  }
1486
1534
 
1487
1535
  // libs/embed-libs/embed/src/lib/iq-components/luzmo-iq-chat.ts
1488
- var import_shared_embed2 = require("@luzmo/shared-embed");
1536
+ var import_shared_embed = require("@luzmo/shared-embed");
1489
1537
  var import_lit4 = require("lit");
1490
1538
  var import_decorators3 = require("lit/decorators.js");
1491
1539
  var inputMap = {
@@ -1516,22 +1564,12 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
1516
1564
  this.remoteEntryServer = "http://localhost:4202/";
1517
1565
  this.aydHost = "https://ayd.luzmo.com/";
1518
1566
  }
1519
- static {
1520
- // Static styles to set host display to block, else it is not shown at all for some reason.
1521
- this.styles = import_lit4.css`
1522
- :host {
1523
- display: block;
1524
- width: 100%;
1525
- height: 100%;
1526
- }
1527
- `;
1528
- }
1529
1567
  createRenderRoot() {
1530
1568
  return this;
1531
1569
  }
1532
1570
  async firstUpdated(_changedProperties) {
1533
1571
  super.firstUpdated(_changedProperties);
1534
- await (0, import_shared_embed2.loadLibrary)(this.calculatedAppServer, "IQApp");
1572
+ await (0, import_shared_embed.loadLibrary)(this.calculatedAppServer, "IQApp");
1535
1573
  this.createAndAppendElement();
1536
1574
  }
1537
1575
  get calculatedAppServer() {
@@ -1554,7 +1592,7 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
1554
1592
  for (const key in inputMap) {
1555
1593
  const value = this[key];
1556
1594
  if (value) {
1557
- const attributeValue = ["appServer", "apiHost", "aydHost"].includes(key) ? (0, import_shared_embed2.removeTrailingSlash)(value) : value;
1595
+ const attributeValue = ["appServer", "apiHost", "aydHost"].includes(key) ? (0, import_shared_embed.removeTrailingSlash)(value) : value;
1558
1596
  this.chartElement.setAttribute(
1559
1597
  inputMap[key],
1560
1598
  typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
@@ -1576,7 +1614,7 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
1576
1614
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1577
1615
  }
1578
1616
  } else {
1579
- await (0, import_shared_embed2.loadLibrary)(this.calculatedAppServer, "IQApp");
1617
+ await (0, import_shared_embed.loadLibrary)(this.calculatedAppServer, "IQApp");
1580
1618
  this.createAndAppendElement();
1581
1619
  }
1582
1620
  }
@@ -1603,6 +1641,14 @@ var LuzmoIQEmbedChatComponent = class extends import_lit4.LitElement {
1603
1641
  observer.observe(embedChat, { childList: true, subtree: true });
1604
1642
  }
1605
1643
  };
1644
+ // Static styles to set host display to block, else it is not shown at all for some reason.
1645
+ LuzmoIQEmbedChatComponent.styles = import_lit4.css`
1646
+ :host {
1647
+ display: block;
1648
+ width: 100%;
1649
+ height: 100%;
1650
+ }
1651
+ `;
1606
1652
  __decorateClass([
1607
1653
  (0, import_decorators3.property)()
1608
1654
  ], LuzmoIQEmbedChatComponent.prototype, "appServer", 2);
@@ -1655,7 +1701,7 @@ if (!customElements.get(embedChatTag)) {
1655
1701
  // libs/embed-libs/embed/src/lib/iq-components/luzmo-iq-answer.ts
1656
1702
  var import_lit5 = require("lit");
1657
1703
  var import_decorators4 = require("lit/decorators.js");
1658
- var import_shared_embed3 = require("@luzmo/shared-embed");
1704
+ var import_shared_embed2 = require("@luzmo/shared-embed");
1659
1705
  var inputMap2 = {
1660
1706
  aiEndPoint: "ai-end-point",
1661
1707
  appServer: "app-server",
@@ -1677,22 +1723,12 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
1677
1723
  this.libVersion = version + "-wc-luzmo";
1678
1724
  this.remoteEntryServer = "http://localhost:4202";
1679
1725
  }
1680
- static {
1681
- // Static styles to set host display to block, else it is not shown at all for some reason.
1682
- this.styles = import_lit5.css`
1683
- :host {
1684
- display: block;
1685
- width: 100%;
1686
- height: 100%;
1687
- }
1688
- `;
1689
- }
1690
1726
  createRenderRoot() {
1691
1727
  return this;
1692
1728
  }
1693
1729
  async firstUpdated(_changedProperties) {
1694
1730
  super.firstUpdated(_changedProperties);
1695
- await (0, import_shared_embed3.loadLibrary)(this.calculatedAppServer, "IQApp");
1731
+ await (0, import_shared_embed2.loadLibrary)(this.calculatedAppServer, "IQApp");
1696
1732
  this.createAndAppendElement();
1697
1733
  }
1698
1734
  get calculatedAppServer() {
@@ -1712,7 +1748,7 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
1712
1748
  for (const key in inputMap2) {
1713
1749
  const value = this[key];
1714
1750
  if (value) {
1715
- const attributeValue = ["appServer", "apiHost"].includes(key) ? (0, import_shared_embed3.removeTrailingSlash)(value) : value;
1751
+ const attributeValue = ["appServer", "apiHost"].includes(key) ? (0, import_shared_embed2.removeTrailingSlash)(value) : value;
1716
1752
  this.chartElement.setAttribute(
1717
1753
  inputMap2[key],
1718
1754
  typeof attributeValue === "object" ? JSON.stringify(attributeValue) : attributeValue
@@ -1729,7 +1765,7 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
1729
1765
  this.chartElement.setAttribute(mappedAttributeName, attributeValue);
1730
1766
  }
1731
1767
  } else {
1732
- await (0, import_shared_embed3.loadLibrary)(this.calculatedAppServer, "IQApp");
1768
+ await (0, import_shared_embed2.loadLibrary)(this.calculatedAppServer, "IQApp");
1733
1769
  this.createAndAppendElement();
1734
1770
  }
1735
1771
  }
@@ -1737,6 +1773,14 @@ var LuzmoIQEmbedAnswerComponent = class extends import_lit5.LitElement {
1737
1773
  return import_lit5.html` `;
1738
1774
  }
1739
1775
  };
1776
+ // Static styles to set host display to block, else it is not shown at all for some reason.
1777
+ LuzmoIQEmbedAnswerComponent.styles = import_lit5.css`
1778
+ :host {
1779
+ display: block;
1780
+ width: 100%;
1781
+ height: 100%;
1782
+ }
1783
+ `;
1740
1784
  __decorateClass([
1741
1785
  (0, import_decorators4.property)()
1742
1786
  ], LuzmoIQEmbedAnswerComponent.prototype, "appServer", 2);
package/index.js CHANGED
@@ -15,15 +15,12 @@ import { LitElement as LitElement5 } from "lit";
15
15
 
16
16
  // libs/embed-libs/embed/src/lib/dashboard/dashboard-base.ts
17
17
  import * as SharedLib2 from "@luzmo/shared-embed";
18
- import {
19
- luzmoEmbedContainerClass
20
- } from "@luzmo/shared-embed";
21
18
  import { html, LitElement } from "lit";
22
19
  import { property, query, state } from "lit/decorators.js";
23
20
  import { styleMap } from "lit/directives/style-map.js";
24
21
 
25
22
  // libs/embed-libs/embed/package.json
26
- var version = "7.1.0";
23
+ var version = "7.2.1";
27
24
 
28
25
  // libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
29
26
  function buildEmbedErrorDetail(errorMsg) {
@@ -101,6 +98,22 @@ var _setEventHandler = () => {
101
98
  );
102
99
  break;
103
100
  }
101
+ case "insights": {
102
+ if (event.data.error) {
103
+ SharedLib.rejectPromise(
104
+ dashboardComponent,
105
+ event.data.requestId,
106
+ new Error(event.data.error.message)
107
+ );
108
+ } else {
109
+ SharedLib.resolvePromise(
110
+ dashboardComponent,
111
+ event.data.requestId,
112
+ event.data.summary
113
+ );
114
+ }
115
+ break;
116
+ }
104
117
  case "dashboardContext": {
105
118
  SharedLib.resolvePromise(
106
119
  dashboardComponent,
@@ -634,6 +647,16 @@ var LuzmoDashboard = class extends LitElement {
634
647
  return;
635
648
  }
636
649
  if (this.isWebComponentViewMode()) {
650
+ if (changedProperties.has("editMode") && !this.dashboardReference) {
651
+ this.iframeLoaded = false;
652
+ if (this._loadTimeoutHandle) {
653
+ clearTimeout(this._loadTimeoutHandle);
654
+ this._loadTimeoutHandle = void 0;
655
+ }
656
+ this.params = this._setOptions();
657
+ this.initComponent();
658
+ return;
659
+ }
637
660
  if (this.dashboardReference) {
638
661
  for (const [propertyName] of changedProperties.entries()) {
639
662
  if (propertyName === "appSever") {
@@ -653,33 +676,46 @@ var LuzmoDashboard = class extends LitElement {
653
676
  } else {
654
677
  for (const [propertyName] of changedProperties.entries()) {
655
678
  if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
656
- this.iframeLoaded = false;
657
- if (this._loadTimeoutHandle) {
658
- clearTimeout(this._loadTimeoutHandle);
659
- }
660
- this._loadTimeoutHandle = setTimeout(() => {
661
- console.warn(
662
- "Failed to load dashboard, appServer is likely down or unreachable."
663
- );
664
- }, 15 * 1e3);
665
- this.params = this._setOptions();
666
- SharedLib2._extendAndValidate(this);
667
- this._setupLoader();
668
- this._loaderStyles();
669
- this._iframeUrl = SharedLib2.createIframeUrl(this);
670
- if (this.iframe) {
671
- this._updateIframeUrl();
672
- }
673
- this.iframeStyle = SharedLib2.calculateIframeStyles(this);
679
+ this._reloadIframeContent();
674
680
  } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
675
681
  if (this.iframeLoaded) {
676
682
  this.setEditMode(this.editMode);
683
+ this.params = this._setOptions();
684
+ } else {
685
+ this._reloadIframeContent();
677
686
  }
678
- this.params = this._setOptions();
679
687
  }
680
688
  }
681
689
  }
682
690
  }
691
+ _reloadIframeContent() {
692
+ this.params = this._setOptions();
693
+ SharedLib2._extendAndValidate(this);
694
+ this._setupLoader();
695
+ if (this.params.error) {
696
+ if (this._loadTimeoutHandle) {
697
+ clearTimeout(this._loadTimeoutHandle);
698
+ this._loadTimeoutHandle = void 0;
699
+ }
700
+ this._loaderStyles();
701
+ return;
702
+ }
703
+ this.iframeLoaded = false;
704
+ if (this._loadTimeoutHandle) {
705
+ clearTimeout(this._loadTimeoutHandle);
706
+ }
707
+ this._loadTimeoutHandle = setTimeout(() => {
708
+ console.warn(
709
+ "Failed to load dashboard, appServer is likely down or unreachable."
710
+ );
711
+ }, 15 * 1e3);
712
+ this._loaderStyles();
713
+ this._iframeUrl = SharedLib2.createIframeUrl(this);
714
+ if (this.iframe) {
715
+ this._updateIframeUrl();
716
+ }
717
+ this.iframeStyle = SharedLib2.calculateIframeStyles(this);
718
+ }
683
719
  // Set params
684
720
  _setOptions() {
685
721
  const defaultParameters = {
@@ -881,7 +917,7 @@ var LuzmoDashboard = class extends LitElement {
881
917
  `;
882
918
  }
883
919
  return html`
884
- <div class="${luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${luzmoEmbedContainerClass}-ede`}">
920
+ <div class="${SharedLib2.luzmoEmbedContainerClass} ${this.isWebComponentViewMode() ? "" : `${SharedLib2.luzmoEmbedContainerClass}-ede`}">
885
921
  <div
886
922
  class="dashboard-container"
887
923
  style=${styleMap(Object.assign({}, this._containerStyle, {
@@ -919,6 +955,15 @@ var LuzmoDashboard = class extends LitElement {
919
955
  }
920
956
  return Promise.reject();
921
957
  }
958
+ getInsights(options) {
959
+ if (this.isWebComponentViewMode() && this.dashboardReference) {
960
+ return this.dashboardReference.getInsights(options);
961
+ }
962
+ if (!this.isWebComponentViewMode()) {
963
+ return SharedLib2.getInsights(this, this.iframe, options);
964
+ }
965
+ return Promise.reject(new Error("getInsights is not available: dashboard reference is not ready."));
966
+ }
922
967
  getDashboardContext() {
923
968
  if (this.isWebComponentViewMode() && this.dashboardReference) {
924
969
  return this.dashboardReference.getDashboardContext();
@@ -1023,14 +1068,14 @@ var LuzmoDashboard = class extends LitElement {
1023
1068
  return Promise.reject();
1024
1069
  }
1025
1070
  isWebComponentViewMode() {
1026
- return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
1071
+ return this.embedMode === "webComponent" && (this.editMode === "view" || this.editMode === void 0);
1027
1072
  }
1028
1073
  };
1029
1074
  __decorateClass([
1030
1075
  query(".dashboard-container")
1031
1076
  ], LuzmoDashboard.prototype, "container", 2);
1032
1077
  __decorateClass([
1033
- query(`.${luzmoEmbedContainerClass}`)
1078
+ query(`.${SharedLib2.luzmoEmbedContainerClass}`)
1034
1079
  ], LuzmoDashboard.prototype, "luzmoEmbedContainer", 2);
1035
1080
  __decorateClass([
1036
1081
  query("iframe")
@@ -1223,22 +1268,6 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1223
1268
  this.libVersion = version + "-wc-luzmo";
1224
1269
  this.postInitCallQueue = [];
1225
1270
  }
1226
- static {
1227
- // Static styles to set host display to block, else it is not shown at all for some reason.
1228
- this.styles = css2`
1229
- :host {
1230
- display: block;
1231
- width: 100%;
1232
- height: 100%;
1233
- }
1234
-
1235
- luzmo-embed-viz-item {
1236
- width: 100%;
1237
- height: 1000%;
1238
- display: block;
1239
- }
1240
- `;
1241
- }
1242
1271
  createRenderRoot() {
1243
1272
  if (!this.style.display) {
1244
1273
  this.style.display = "block";
@@ -1279,6 +1308,9 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1279
1308
  getData() {
1280
1309
  return this.chartElement.getData();
1281
1310
  }
1311
+ getInsights(options) {
1312
+ return this.chartElement.getInsights(options);
1313
+ }
1282
1314
  refreshData() {
1283
1315
  return this.chartElement.refreshData();
1284
1316
  }
@@ -1375,6 +1407,20 @@ var LuzmoBaseVizItem = class extends LitElement2 {
1375
1407
  return html2` `;
1376
1408
  }
1377
1409
  };
1410
+ // Static styles to set host display to block, else it is not shown at all for some reason.
1411
+ LuzmoBaseVizItem.styles = css2`
1412
+ :host {
1413
+ display: block;
1414
+ width: 100%;
1415
+ height: 100%;
1416
+ }
1417
+
1418
+ luzmo-embed-viz-item {
1419
+ width: 100%;
1420
+ height: 1000%;
1421
+ display: block;
1422
+ }
1423
+ `;
1378
1424
  __decorateClass([
1379
1425
  property2()
1380
1426
  ], LuzmoBaseVizItem.prototype, "appServer", 2);
@@ -1474,16 +1520,6 @@ var LuzmoIQEmbedChatComponent = class extends LitElement3 {
1474
1520
  this.remoteEntryServer = "http://localhost:4202/";
1475
1521
  this.aydHost = "https://ayd.luzmo.com/";
1476
1522
  }
1477
- static {
1478
- // Static styles to set host display to block, else it is not shown at all for some reason.
1479
- this.styles = css3`
1480
- :host {
1481
- display: block;
1482
- width: 100%;
1483
- height: 100%;
1484
- }
1485
- `;
1486
- }
1487
1523
  createRenderRoot() {
1488
1524
  return this;
1489
1525
  }
@@ -1561,6 +1597,14 @@ var LuzmoIQEmbedChatComponent = class extends LitElement3 {
1561
1597
  observer.observe(embedChat, { childList: true, subtree: true });
1562
1598
  }
1563
1599
  };
1600
+ // Static styles to set host display to block, else it is not shown at all for some reason.
1601
+ LuzmoIQEmbedChatComponent.styles = css3`
1602
+ :host {
1603
+ display: block;
1604
+ width: 100%;
1605
+ height: 100%;
1606
+ }
1607
+ `;
1564
1608
  __decorateClass([
1565
1609
  property3()
1566
1610
  ], LuzmoIQEmbedChatComponent.prototype, "appServer", 2);
@@ -1635,16 +1679,6 @@ var LuzmoIQEmbedAnswerComponent = class extends LitElement4 {
1635
1679
  this.libVersion = version + "-wc-luzmo";
1636
1680
  this.remoteEntryServer = "http://localhost:4202";
1637
1681
  }
1638
- static {
1639
- // Static styles to set host display to block, else it is not shown at all for some reason.
1640
- this.styles = css4`
1641
- :host {
1642
- display: block;
1643
- width: 100%;
1644
- height: 100%;
1645
- }
1646
- `;
1647
- }
1648
1682
  createRenderRoot() {
1649
1683
  return this;
1650
1684
  }
@@ -1695,6 +1729,14 @@ var LuzmoIQEmbedAnswerComponent = class extends LitElement4 {
1695
1729
  return html4` `;
1696
1730
  }
1697
1731
  };
1732
+ // Static styles to set host display to block, else it is not shown at all for some reason.
1733
+ LuzmoIQEmbedAnswerComponent.styles = css4`
1734
+ :host {
1735
+ display: block;
1736
+ width: 100%;
1737
+ height: 100%;
1738
+ }
1739
+ `;
1698
1740
  __decorateClass([
1699
1741
  property4()
1700
1742
  ], LuzmoIQEmbedAnswerComponent.prototype, "appServer", 2);
@@ -397,9 +397,10 @@ var createIframeUrl = (dashboardContent) => {
397
397
  }
398
398
  const keyTokenUrlAnchor = key && token ? "#" + key + ":" + token : "";
399
399
  searchString.push("version=" + (dashboardContent.libVersion || VERSION));
400
- const iframeUrl = itemEmbedding ? `${appServer}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
400
+ const appServerWithSlash = addTrailingSlash(appServer);
401
+ const iframeUrl = itemEmbedding ? `${appServerWithSlash}i/${dashboardId || dashboardSlug}/${itemId}?${encodeURIComponent(
401
402
  searchString.join("&")
402
- )}${keyTokenUrlAnchor}` : `${appServer}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
403
+ )}${keyTokenUrlAnchor}` : `${appServerWithSlash}i/${dashboardId || dashboardSlug}?${encodeURIComponent(
403
404
  searchString.join("&")
404
405
  )}${keyTokenUrlAnchor}`;
405
406
  return sanitizeUrl(iframeUrl);
@@ -821,6 +822,32 @@ var getFilters = (dashboardComponent, iframe) => {
821
822
  return Promise.reject(new Error("Cannot retrieve contentWindow."));
822
823
  };
823
824
 
825
+ // libs/embed-libs/shared-embed/src/lib/methods/get-insights.ts
826
+ var getInsights = (dashboardComponent, iframe, options = {}) => {
827
+ if (!iframe?.contentWindow) {
828
+ return Promise.reject(new Error("Cannot retrieve contentWindow."));
829
+ }
830
+ const requestId = uuidv4();
831
+ iframe.contentWindow.postMessage(
832
+ {
833
+ action: "getInsights",
834
+ options,
835
+ _version: dashboardComponent.libVersion,
836
+ requestId
837
+ },
838
+ "*"
839
+ );
840
+ return new Promise((resolve, reject) => {
841
+ dashboardComponent.promises[requestId] = { resolve, reject };
842
+ setTimeout(() => {
843
+ if (dashboardComponent.promises[requestId]) {
844
+ dashboardComponent.promises[requestId].reject(new Error("getInsights request timed out."));
845
+ delete dashboardComponent.promises[requestId];
846
+ }
847
+ }, 6e4);
848
+ });
849
+ };
850
+
824
851
  // libs/embed-libs/shared-embed/src/lib/methods/refresh-data.ts
825
852
  var refreshData = (dashboardComponent, iframe, itemId) => {
826
853
  if (iframe) {
@@ -1335,7 +1362,7 @@ var composeKeyWithSeparator = function(...args) {
1335
1362
  return `${sum}${SEPARATOR}${cur}`;
1336
1363
  }, "");
1337
1364
  };
1338
- var getResourceUrl = (module2, sourceUrl) => {
1365
+ function getResourceUrl(module2, sourceUrl) {
1339
1366
  if ("getPublicPath" in module2) {
1340
1367
  let publicPath;
1341
1368
  if (!module2.getPublicPath.startsWith("function")) publicPath = new Function(module2.getPublicPath)();
@@ -1348,7 +1375,7 @@ var getResourceUrl = (module2, sourceUrl) => {
1348
1375
  console.warn("Cannot get resource URL. If in debug mode, please ignore.", module2, sourceUrl);
1349
1376
  return "";
1350
1377
  }
1351
- };
1378
+ }
1352
1379
  var warn = (msg) => {
1353
1380
  console.warn(`${LOG_CATEGORY}: ${msg}`);
1354
1381
  };
@@ -2099,7 +2126,7 @@ function getGlobalFederationConstructor() {
2099
2126
  function setGlobalFederationConstructor(FederationConstructor, isDebug = isDebugMode()) {
2100
2127
  if (isDebug) {
2101
2128
  CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR__ = FederationConstructor;
2102
- CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.0";
2129
+ CurrentGlobal.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__ = "2.8.2";
2103
2130
  }
2104
2131
  }
2105
2132
  function getInfoWithoutType(target, key) {
@@ -2783,18 +2810,46 @@ var errorDescMap = {
2783
2810
 
2784
2811
  // node_modules/@module-federation/runtime-core/dist/utils/load.js
2785
2812
  var importCallback = ".then(callbacks[0]).catch(callbacks[1])";
2786
- async function loadEsmEntry({ entry, remoteEntryExports }) {
2813
+ var esmRemoteEntryLoadErrorMessages = [
2814
+ "Failed to fetch dynamically imported module",
2815
+ "Importing a module script failed",
2816
+ "error loading dynamically imported module"
2817
+ ];
2818
+ function isEsmRemoteEntryLoadError(err) {
2819
+ if (!(err instanceof TypeError)) return false;
2820
+ return esmRemoteEntryLoadErrorMessages.some((loadErrorMessage) => err.message.includes(loadErrorMessage));
2821
+ }
2822
+ function isEsmRemoteType(type) {
2823
+ return type === "esm" || type === "module";
2824
+ }
2825
+ async function loadEsmEntry({ entry, remoteEntryExports, name, getEntryUrl }) {
2787
2826
  return new Promise((resolve, reject) => {
2827
+ const rejectEntry = (loadError) => {
2828
+ if (isEsmRemoteEntryLoadError(loadError)) {
2829
+ const originalMsg = loadError instanceof Error ? loadError.message : String(loadError);
2830
+ try {
2831
+ error2(RUNTIME_008, runtimeDescMap, {
2832
+ remoteName: name,
2833
+ resourceUrl: url
2834
+ }, originalMsg);
2835
+ } catch (runtimeError) {
2836
+ reject(runtimeError);
2837
+ return;
2838
+ }
2839
+ }
2840
+ reject(loadError);
2841
+ };
2842
+ const url = getEntryUrl ? getEntryUrl(entry) : entry;
2788
2843
  try {
2789
- if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${entry}")${importCallback}`)([resolve, reject]);
2844
+ if (!remoteEntryExports) if (typeof FEDERATION_ALLOW_NEW_FUNCTION !== "undefined") new Function("callbacks", `import("${url}")${importCallback}`)([resolve, rejectEntry]);
2790
2845
  else import(
2791
2846
  /* webpackIgnore: true */
2792
2847
  /* @vite-ignore */
2793
- entry
2794
- ).then(resolve).catch(reject);
2848
+ url
2849
+ ).then(resolve).catch(rejectEntry);
2795
2850
  else resolve(remoteEntryExports);
2796
2851
  } catch (e7) {
2797
- error2(`Failed to load ESM entry from "${entry}". ${e7 instanceof Error ? e7.message : String(e7)}`);
2852
+ error2(`Failed to load ESM entry from "${url}". ${e7 instanceof Error ? e7.message : String(e7)}`);
2798
2853
  }
2799
2854
  });
2800
2855
  }
@@ -2850,29 +2905,25 @@ async function loadEntryScript({ name, globalName, entry, remoteInfo, loaderHook
2850
2905
  }
2851
2906
  async function loadEntryDom({ remoteInfo, remoteEntryExports, loaderHook, getEntryUrl, resourceContext }) {
2852
2907
  const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
2853
- switch (type) {
2854
- case "esm":
2855
- case "module":
2856
- return loadEsmEntry({
2857
- entry,
2858
- remoteEntryExports
2859
- });
2860
- case "system":
2861
- return loadSystemJsEntry({
2862
- entry,
2863
- remoteEntryExports
2864
- });
2865
- default:
2866
- return loadEntryScript({
2867
- entry,
2868
- globalName,
2869
- name,
2870
- remoteInfo,
2871
- loaderHook,
2872
- getEntryUrl,
2873
- resourceContext
2874
- });
2875
- }
2908
+ if (isEsmRemoteType(type)) return loadEsmEntry({
2909
+ entry,
2910
+ remoteEntryExports,
2911
+ name,
2912
+ getEntryUrl
2913
+ });
2914
+ if (type === "system") return loadSystemJsEntry({
2915
+ entry,
2916
+ remoteEntryExports
2917
+ });
2918
+ return loadEntryScript({
2919
+ entry,
2920
+ globalName,
2921
+ name,
2922
+ remoteInfo,
2923
+ loaderHook,
2924
+ getEntryUrl,
2925
+ resourceContext
2926
+ });
2876
2927
  }
2877
2928
  async function loadEntryNode({ remoteInfo, loaderHook, resourceContext }) {
2878
2929
  const { entry, entryGlobalName: globalName, name, type } = remoteInfo;
@@ -3190,7 +3241,7 @@ function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseCont
3190
3241
  results.push(waitForRemoteEntryPreload(host, remoteInfo, entryRemoteInfo, createResourceContext(baseContext, "remoteEntry")));
3191
3242
  });
3192
3243
  if (useLinkPreload) {
3193
- const defaultAttrs = {
3244
+ const defaultAttrs2 = {
3194
3245
  rel: "preload",
3195
3246
  as: "style"
3196
3247
  };
@@ -3199,12 +3250,12 @@ function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseCont
3199
3250
  host,
3200
3251
  remoteInfo,
3201
3252
  url: cssUrl,
3202
- attrs: defaultAttrs,
3253
+ attrs: defaultAttrs2,
3203
3254
  context: createResourceContext(baseContext, "css")
3204
3255
  }));
3205
3256
  });
3206
3257
  } else {
3207
- const defaultAttrs = {
3258
+ const defaultAttrs2 = {
3208
3259
  rel: "stylesheet",
3209
3260
  type: "text/css"
3210
3261
  };
@@ -3213,41 +3264,39 @@ function preloadAssets(remoteInfo, host, assets, useLinkPreload = true, baseCont
3213
3264
  host,
3214
3265
  remoteInfo,
3215
3266
  url: cssUrl,
3216
- attrs: defaultAttrs,
3267
+ attrs: defaultAttrs2,
3217
3268
  needDeleteLink: false,
3218
3269
  context: createResourceContext(baseContext, "css")
3219
3270
  }));
3220
3271
  });
3221
3272
  }
3273
+ let preloadJsAsset = waitForScriptPreload;
3274
+ let defaultAttrs = {
3275
+ fetchpriority: "high",
3276
+ type: "text/javascript"
3277
+ };
3222
3278
  if (useLinkPreload) {
3223
- const defaultAttrs = {
3279
+ preloadJsAsset = waitForLinkPreload;
3280
+ defaultAttrs = {
3224
3281
  rel: "preload",
3225
3282
  as: "script"
3226
3283
  };
3227
- jsAssetsWithoutEntry.forEach((jsUrl) => {
3228
- results.push(waitForLinkPreload({
3229
- host,
3230
- remoteInfo,
3231
- url: jsUrl,
3232
- attrs: defaultAttrs,
3233
- context: createResourceContext(baseContext, "js")
3234
- }));
3235
- });
3236
- } else {
3237
- const defaultAttrs = {
3238
- fetchpriority: "high",
3239
- type: remoteInfo?.type === "module" ? "module" : "text/javascript"
3284
+ } else if (isEsmRemoteType(remoteInfo.type)) {
3285
+ preloadJsAsset = waitForLinkPreload;
3286
+ defaultAttrs = {
3287
+ rel: "modulepreload",
3288
+ fetchpriority: "high"
3240
3289
  };
3241
- jsAssetsWithoutEntry.forEach((jsUrl) => {
3242
- results.push(waitForScriptPreload({
3243
- host,
3244
- remoteInfo,
3245
- url: jsUrl,
3246
- attrs: defaultAttrs,
3247
- context: createResourceContext(baseContext, "js")
3248
- }));
3249
- });
3250
3290
  }
3291
+ jsAssetsWithoutEntry.forEach((jsUrl) => {
3292
+ results.push(preloadJsAsset({
3293
+ host,
3294
+ remoteInfo,
3295
+ url: jsUrl,
3296
+ attrs: defaultAttrs,
3297
+ context: createResourceContext(baseContext, "js")
3298
+ }));
3299
+ });
3251
3300
  }
3252
3301
  return Promise.all(results);
3253
3302
  }
@@ -4990,7 +5039,7 @@ var ModuleFederation = class {
4990
5039
  beforeInitContainer: new AsyncWaterfallHook("beforeInitContainer"),
4991
5040
  initContainer: new AsyncWaterfallHook("initContainer")
4992
5041
  });
4993
- this.version = "2.8.0";
5042
+ this.version = "2.8.2";
4994
5043
  this.moduleCache = /* @__PURE__ */ new Map();
4995
5044
  this.loaderHook = new PluginSystem({
4996
5045
  getModuleInfo: new SyncHook(),
@@ -5881,7 +5930,7 @@ var o6 = e6(class extends i5 {
5881
5930
  });
5882
5931
 
5883
5932
  // libs/embed-libs/embed/package.json
5884
- var version = "7.1.0";
5933
+ var version = "7.2.1";
5885
5934
 
5886
5935
  // libs/embed-libs/embed/src/lib/helper/embed-error.utils.ts
5887
5936
  function buildEmbedErrorDetail(errorMsg) {
@@ -5956,6 +6005,22 @@ var _setEventHandler = () => {
5956
6005
  );
5957
6006
  break;
5958
6007
  }
6008
+ case "insights": {
6009
+ if (event.data.error) {
6010
+ rejectPromise(
6011
+ dashboardComponent,
6012
+ event.data.requestId,
6013
+ new Error(event.data.error.message)
6014
+ );
6015
+ } else {
6016
+ resolvePromise(
6017
+ dashboardComponent,
6018
+ event.data.requestId,
6019
+ event.data.summary
6020
+ );
6021
+ }
6022
+ break;
6023
+ }
5959
6024
  case "dashboardContext": {
5960
6025
  resolvePromise(
5961
6026
  dashboardComponent,
@@ -6488,6 +6553,16 @@ var LuzmoDashboard = class extends i4 {
6488
6553
  return;
6489
6554
  }
6490
6555
  if (this.isWebComponentViewMode()) {
6556
+ if (changedProperties.has("editMode") && !this.dashboardReference) {
6557
+ this.iframeLoaded = false;
6558
+ if (this._loadTimeoutHandle) {
6559
+ clearTimeout(this._loadTimeoutHandle);
6560
+ this._loadTimeoutHandle = void 0;
6561
+ }
6562
+ this.params = this._setOptions();
6563
+ this.initComponent();
6564
+ return;
6565
+ }
6491
6566
  if (this.dashboardReference) {
6492
6567
  for (const [propertyName] of changedProperties.entries()) {
6493
6568
  if (propertyName === "appSever") {
@@ -6507,33 +6582,46 @@ var LuzmoDashboard = class extends i4 {
6507
6582
  } else {
6508
6583
  for (const [propertyName] of changedProperties.entries()) {
6509
6584
  if (triggerProperties.has(propertyName) && propertyName !== "editMode") {
6510
- this.iframeLoaded = false;
6511
- if (this._loadTimeoutHandle) {
6512
- clearTimeout(this._loadTimeoutHandle);
6513
- }
6514
- this._loadTimeoutHandle = setTimeout(() => {
6515
- console.warn(
6516
- "Failed to load dashboard, appServer is likely down or unreachable."
6517
- );
6518
- }, 15 * 1e3);
6519
- this.params = this._setOptions();
6520
- _extendAndValidate(this);
6521
- this._setupLoader();
6522
- this._loaderStyles();
6523
- this._iframeUrl = createIframeUrl(this);
6524
- if (this.iframe) {
6525
- this._updateIframeUrl();
6526
- }
6527
- this.iframeStyle = calculateIframeStyles(this);
6585
+ this._reloadIframeContent();
6528
6586
  } else if (triggerProperties.has(propertyName) && propertyName === "editMode") {
6529
6587
  if (this.iframeLoaded) {
6530
6588
  this.setEditMode(this.editMode);
6589
+ this.params = this._setOptions();
6590
+ } else {
6591
+ this._reloadIframeContent();
6531
6592
  }
6532
- this.params = this._setOptions();
6533
6593
  }
6534
6594
  }
6535
6595
  }
6536
6596
  }
6597
+ _reloadIframeContent() {
6598
+ this.params = this._setOptions();
6599
+ _extendAndValidate(this);
6600
+ this._setupLoader();
6601
+ if (this.params.error) {
6602
+ if (this._loadTimeoutHandle) {
6603
+ clearTimeout(this._loadTimeoutHandle);
6604
+ this._loadTimeoutHandle = void 0;
6605
+ }
6606
+ this._loaderStyles();
6607
+ return;
6608
+ }
6609
+ this.iframeLoaded = false;
6610
+ if (this._loadTimeoutHandle) {
6611
+ clearTimeout(this._loadTimeoutHandle);
6612
+ }
6613
+ this._loadTimeoutHandle = setTimeout(() => {
6614
+ console.warn(
6615
+ "Failed to load dashboard, appServer is likely down or unreachable."
6616
+ );
6617
+ }, 15 * 1e3);
6618
+ this._loaderStyles();
6619
+ this._iframeUrl = createIframeUrl(this);
6620
+ if (this.iframe) {
6621
+ this._updateIframeUrl();
6622
+ }
6623
+ this.iframeStyle = calculateIframeStyles(this);
6624
+ }
6537
6625
  // Set params
6538
6626
  _setOptions() {
6539
6627
  const defaultParameters = {
@@ -6773,6 +6861,15 @@ var LuzmoDashboard = class extends i4 {
6773
6861
  }
6774
6862
  return Promise.reject();
6775
6863
  }
6864
+ getInsights(options) {
6865
+ if (this.isWebComponentViewMode() && this.dashboardReference) {
6866
+ return this.dashboardReference.getInsights(options);
6867
+ }
6868
+ if (!this.isWebComponentViewMode()) {
6869
+ return getInsights(this, this.iframe, options);
6870
+ }
6871
+ return Promise.reject(new Error("getInsights is not available: dashboard reference is not ready."));
6872
+ }
6776
6873
  getDashboardContext() {
6777
6874
  if (this.isWebComponentViewMode() && this.dashboardReference) {
6778
6875
  return this.dashboardReference.getDashboardContext();
@@ -6877,7 +6974,7 @@ var LuzmoDashboard = class extends i4 {
6877
6974
  return Promise.reject();
6878
6975
  }
6879
6976
  isWebComponentViewMode() {
6880
- return this.embedMode === "webComponent" && (this.params.editMode === "view" || this.params.editMode === void 0);
6977
+ return this.embedMode === "webComponent" && (this.editMode === "view" || this.editMode === void 0);
6881
6978
  }
6882
6979
  };
6883
6980
  __decorateClass([
@@ -7047,7 +7144,7 @@ if (!customElements.get("luzmo-embed-dashboard")) {
7047
7144
  }
7048
7145
 
7049
7146
  // libs/dashboard-contents-types/src/lib/shared/version.ts
7050
- var CONTENTS_VERSION = "0.1.100";
7147
+ var CONTENTS_VERSION = "0.1.103";
7051
7148
 
7052
7149
  // libs/embed-libs/embed/src/lib/viz-item/viz-item.base.ts
7053
7150
  var dashboardContentsVersion = CONTENTS_VERSION;
@@ -7076,22 +7173,6 @@ var LuzmoBaseVizItem = class extends i4 {
7076
7173
  this.libVersion = version + "-wc-luzmo";
7077
7174
  this.postInitCallQueue = [];
7078
7175
  }
7079
- static {
7080
- // Static styles to set host display to block, else it is not shown at all for some reason.
7081
- this.styles = i`
7082
- :host {
7083
- display: block;
7084
- width: 100%;
7085
- height: 100%;
7086
- }
7087
-
7088
- luzmo-embed-viz-item {
7089
- width: 100%;
7090
- height: 1000%;
7091
- display: block;
7092
- }
7093
- `;
7094
- }
7095
7176
  createRenderRoot() {
7096
7177
  if (!this.style.display) {
7097
7178
  this.style.display = "block";
@@ -7132,6 +7213,9 @@ var LuzmoBaseVizItem = class extends i4 {
7132
7213
  getData() {
7133
7214
  return this.chartElement.getData();
7134
7215
  }
7216
+ getInsights(options) {
7217
+ return this.chartElement.getInsights(options);
7218
+ }
7135
7219
  refreshData() {
7136
7220
  return this.chartElement.refreshData();
7137
7221
  }
@@ -7228,6 +7312,20 @@ var LuzmoBaseVizItem = class extends i4 {
7228
7312
  return b2` `;
7229
7313
  }
7230
7314
  };
7315
+ // Static styles to set host display to block, else it is not shown at all for some reason.
7316
+ LuzmoBaseVizItem.styles = i`
7317
+ :host {
7318
+ display: block;
7319
+ width: 100%;
7320
+ height: 100%;
7321
+ }
7322
+
7323
+ luzmo-embed-viz-item {
7324
+ width: 100%;
7325
+ height: 1000%;
7326
+ display: block;
7327
+ }
7328
+ `;
7231
7329
  __decorateClass([
7232
7330
  n4()
7233
7331
  ], LuzmoBaseVizItem.prototype, "appServer", 2);
@@ -7324,16 +7422,6 @@ var LuzmoIQEmbedChatComponent = class extends i4 {
7324
7422
  this.remoteEntryServer = "http://localhost:4202/";
7325
7423
  this.aydHost = "https://ayd.luzmo.com/";
7326
7424
  }
7327
- static {
7328
- // Static styles to set host display to block, else it is not shown at all for some reason.
7329
- this.styles = i`
7330
- :host {
7331
- display: block;
7332
- width: 100%;
7333
- height: 100%;
7334
- }
7335
- `;
7336
- }
7337
7425
  createRenderRoot() {
7338
7426
  return this;
7339
7427
  }
@@ -7411,6 +7499,14 @@ var LuzmoIQEmbedChatComponent = class extends i4 {
7411
7499
  observer.observe(embedChat, { childList: true, subtree: true });
7412
7500
  }
7413
7501
  };
7502
+ // Static styles to set host display to block, else it is not shown at all for some reason.
7503
+ LuzmoIQEmbedChatComponent.styles = i`
7504
+ :host {
7505
+ display: block;
7506
+ width: 100%;
7507
+ height: 100%;
7508
+ }
7509
+ `;
7414
7510
  __decorateClass([
7415
7511
  n4()
7416
7512
  ], LuzmoIQEmbedChatComponent.prototype, "appServer", 2);
@@ -7482,16 +7578,6 @@ var LuzmoIQEmbedAnswerComponent = class extends i4 {
7482
7578
  this.libVersion = version + "-wc-luzmo";
7483
7579
  this.remoteEntryServer = "http://localhost:4202";
7484
7580
  }
7485
- static {
7486
- // Static styles to set host display to block, else it is not shown at all for some reason.
7487
- this.styles = i`
7488
- :host {
7489
- display: block;
7490
- width: 100%;
7491
- height: 100%;
7492
- }
7493
- `;
7494
- }
7495
7581
  createRenderRoot() {
7496
7582
  return this;
7497
7583
  }
@@ -7542,6 +7628,14 @@ var LuzmoIQEmbedAnswerComponent = class extends i4 {
7542
7628
  return b2` `;
7543
7629
  }
7544
7630
  };
7631
+ // Static styles to set host display to block, else it is not shown at all for some reason.
7632
+ LuzmoIQEmbedAnswerComponent.styles = i`
7633
+ :host {
7634
+ display: block;
7635
+ width: 100%;
7636
+ height: 100%;
7637
+ }
7638
+ `;
7545
7639
  __decorateClass([
7546
7640
  n4()
7547
7641
  ], LuzmoIQEmbedAnswerComponent.prototype, "appServer", 2);
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@luzmo/embed",
3
- "version": "7.1.0",
3
+ "version": "7.2.1-es2021",
4
4
  "dependencies": {
5
5
  "lit": "^3.3.1",
6
- "@luzmo/shared-embed": "6.1.0"
6
+ "@luzmo/shared-embed": "6.2.1"
7
7
  },
8
8
  "keywords": [
9
+ "es2021",
10
+ "safari-compatible",
9
11
  "es6",
10
12
  "web-component",
11
13
  "lit",
@@ -21,5 +23,9 @@
21
23
  ],
22
24
  "module": "./index.js",
23
25
  "types": "./src/index.d.ts",
24
- "license": "SEE LICENSE IN LICENSE"
26
+ "license": "SEE LICENSE IN LICENSE",
27
+ "description": "ES2021 build for Safari < 16.3 compatibility",
28
+ "publishConfig": {
29
+ "tag": "es2021"
30
+ }
25
31
  }
@@ -1,7 +1,6 @@
1
1
  import type { FilterGroup } from '@luzmo/dashboard-contents-types';
2
2
  import * as SharedLib from '@luzmo/shared-embed';
3
- import { CombinedSelectedDataInput, DashboardInputs, LuzmoElement, PartialRecord, SupportedLanguage } from '@luzmo/shared-embed';
4
- import { LitElement, PropertyValues, TemplateResult } from 'lit';
3
+ import { LitElement, type PropertyValues, type TemplateResult } from 'lit';
5
4
  export declare class LuzmoDashboard extends LitElement implements SharedLib.WebComponentLuzmoDashboard {
6
5
  container: HTMLElement;
7
6
  luzmoEmbedContainer: HTMLElement;
@@ -26,7 +25,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
26
25
  timezoneId?: SharedLib.DashboardInputs['timezoneId'];
27
26
  apiHost?: SharedLib.DashboardInputs['apiHost'];
28
27
  itemDimensions: SharedLib.DashboardInputs['itemDimensions'];
29
- embedMode: DashboardInputs['embedMode'];
28
+ embedMode: SharedLib.DashboardInputs['embedMode'];
30
29
  _containerId: string;
31
30
  _iframeId: string;
32
31
  params: SharedLib.DashboardContentParams;
@@ -50,7 +49,7 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
50
49
  browserNotSupported: any[];
51
50
  libVersion: string;
52
51
  protected isLibraryLoaded: boolean;
53
- protected dashboardReference: LuzmoElement;
52
+ protected dashboardReference: SharedLib.LuzmoElement;
54
53
  currentAuthKey: string;
55
54
  currentAuthToken: string;
56
55
  isInitCalled: boolean;
@@ -74,8 +73,9 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
74
73
  firstUpdated(): void;
75
74
  initComponent(): void;
76
75
  setAllAttributes(): void;
77
- setAllAttributesOnElement(el: LuzmoElement): void;
76
+ setAllAttributesOnElement(el: SharedLib.LuzmoElement): void;
78
77
  updated(changedProperties: PropertyValues): void;
78
+ _reloadIframeContent(): void;
79
79
  _setOptions(): SharedLib.DashboardContentParams;
80
80
  _updateIframeUrl(): void;
81
81
  _setupLoader(): void;
@@ -92,8 +92,9 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
92
92
  getDashboards(): Promise<LuzmoDashboard[]>;
93
93
  getData(itemId: string): Promise<SharedLib.ItemData>;
94
94
  getFilters(): Promise<FilterGroup[]>;
95
+ getInsights(options?: SharedLib.GetInsightsOptions): Promise<string>;
95
96
  getDashboardContext(): Promise<SharedLib.DashboardContext | undefined>;
96
- setSelectedData<K extends CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SharedLib.SetSelectedData>;
97
+ setSelectedData<K extends SharedLib.CombinedSelectedDataInput>(itemId: string, filters: K): Promise<SharedLib.SetSelectedData>;
97
98
  setAuthorization(key: string, token: string): Promise<void>;
98
99
  refreshData(itemId?: string): Promise<void>;
99
100
  reloadDashboard(): Promise<void>;
@@ -102,6 +103,6 @@ export declare class LuzmoDashboard extends LitElement implements SharedLib.WebC
102
103
  addFilters(itemId: string, filters: FilterGroup[]): Promise<SharedLib.AddFilters>;
103
104
  setEditMode(editMode?: SharedLib.DashboardEditMode): Promise<SharedLib.SetEditMode>;
104
105
  setPreview(preview: boolean): Promise<SharedLib.SetPreview>;
105
- sendExportEmail(type?: SharedLib.SendExportEmailType, subject?: PartialRecord<SupportedLanguage, string>, message?: PartialRecord<SupportedLanguage, string>): Promise<void>;
106
+ sendExportEmail(type?: SharedLib.SendExportEmailType, subject?: SharedLib.PartialRecord<SharedLib.SupportedLanguage, string>, message?: SharedLib.PartialRecord<SharedLib.SupportedLanguage, string>): Promise<void>;
106
107
  isWebComponentViewMode(): boolean;
107
108
  }
@@ -1,5 +1,6 @@
1
- import { IQAnswerOptions, IQMessage } from '@luzmo/dashboard-contents-types';
2
- import { LitElement, PropertyValues } from 'lit';
1
+ import type { IQAnswerOptions, IQMessage } from '@luzmo/dashboard-contents-types';
2
+ import { LitElement } from 'lit';
3
+ import type { PropertyValues } from 'lit';
3
4
  import type { TemplateResult } from 'lit-html';
4
5
  export declare class LuzmoIQEmbedAnswerComponent extends LitElement {
5
6
  appServer?: string;
@@ -1,6 +1,7 @@
1
- import { VizItemExportType, FilterGroup, VizItemOptions, VizItemSlot, VizItemType } from '@luzmo/dashboard-contents-types';
1
+ import type { FilterGroup, VizItemExportType, VizItemOptions, VizItemSlot, VizItemType } from '@luzmo/dashboard-contents-types';
2
2
  import * as SharedLib from '@luzmo/shared-embed';
3
- import { LitElement, PropertyValues } from 'lit';
3
+ import { LitElement } from 'lit';
4
+ import type { PropertyValues } from 'lit';
4
5
  /**
5
6
  * The version of the dashboard contents that is linked to the current library.
6
7
  *
@@ -9,7 +10,7 @@ import { LitElement, PropertyValues } from 'lit';
9
10
  * together with this dashboard contents version are passed to the dashboard app (https://app.luzmo.com/dashboard-app/remoteEntry.js)
10
11
  * and if needed the migration will be applied on the dashboard app level.
11
12
  */
12
- export declare const dashboardContentsVersion = "0.1.100";
13
+ export declare const dashboardContentsVersion = "0.1.103";
13
14
  type FunctionCall = [(...args: any) => any, any[]];
14
15
  interface LuzmoVizItemComponentInterface extends HTMLElement {
15
16
  options?: VizItemOptions;
@@ -30,6 +31,7 @@ interface LuzmoVizItemComponentInterface extends HTMLElement {
30
31
  export: (type?: VizItemExportType) => Promise<string | void>;
31
32
  refreshData: () => void;
32
33
  getData: () => SharedLib.ItemData;
34
+ getInsights: (options?: SharedLib.GetInsightsOptions) => Promise<string>;
33
35
  setSelectedData: (selectedDataInput: SharedLib.SelectedDataInput) => SharedLib.SetSelectedData;
34
36
  setAuthorization: (key: string, token: string) => void;
35
37
  }
@@ -68,6 +70,7 @@ export declare class LuzmoBaseVizItem extends LitElement implements LuzmoVizItem
68
70
  getVizItemContext(): SharedLib.VizItemContext;
69
71
  export(type?: VizItemExportType): Promise<string | void>;
70
72
  getData(): SharedLib.ItemData;
73
+ getInsights(options?: SharedLib.GetInsightsOptions): Promise<string>;
71
74
  refreshData(): void;
72
75
  setSelectedData(selectedDataInput: SharedLib.SelectedDataInput): SharedLib.SetSelectedData;
73
76
  setAuthorization(key: string, token: string): void;