/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import { c as B } from "../../chunks/runtime.js";
import { css as C, html as D } from "lit";
import { u as z } from "../../chunks/useT9n.js";
import { LitElement as $ } from "@arcgis/lumina";
import { createRef as k, ref as I } from "lit-html/directives/ref.js";
import * as d from "gojs";
import { g as A } from "../../chunks/getItemIcon.js";
import "../solution-item-accordion/customElement.js";
const P = C`#filter-bar{background-color:var(--calcite-color-foreground-1);position:absolute;top:16px;right:196px;z-index:100;box-shadow:var(--calcite-shadow-sm)}#filteredViewButtonDiv{padding:8px}#filteredViewButtonLabel{--calcite-label-margin-bottom: 0}#graph-navigation-bar{background-color:var(--calcite-color-foreground-1);position:absolute;top:16px;right:16px;z-index:100}#graph-navigation-controls{position:absolute;top:0;right:0;box-shadow:var(--calcite-shadow-sm)}.z-index-1{z-index:1}#diagram-panel{--calcite-panel-space: 0px}#diagram-shell-panel{--calcite-color-background: var(--calcite-color-foreground-1);padding:16px}`, _ = 15, V = 15, H = 10, u = new d.Size(220, 48), O = 1, G = 8, S = new d.Size(48, 48), M = new d.Size(16, 16), v = new d.Size(153, 17), R = '400 0.75rem "Avenir Next", Avenir, "Helvetica Neue", sans-serif', F = '500 0.75rem "Avenir Next", Avenir, "Helvetica Neue", sans-serif', K = "val(--calcite-color-background)", W = p("--calcite-color-border-1"), N = p("--calcite-color-foreground-1"), g = p("--calcite-color-text-1"), T = p("--calcite-color-border-input"), j = p("--calcite-color-foreground-1"), f = 1, b = 0.3, w = 1, x = 0.2, Z = 1;
function q(o) {
  const t = document.createElement("div");
  t.style.width = "100%", t.style.height = "100%", o.appendChild(t);
  const e = new d.Diagram(
    t,
    // create a Diagram for the HTML Div element
    {
      click: ie,
      // handle diagram clicks
      contentAlignment: d.Spot.Center,
      // align document to the center of the viewport
      dragSelectingTool: null,
      // disable drag selection
      hoverDelay: 50,
      // milliseconds before mouse-hover displays information
      initialAutoScale: d.AutoScale.Uniform,
      // automatic zoom-to-fit
      layout: new d.LayeredDigraphLayout({
        columnSpacing: _,
        layerSpacing: V
      }),
      padding: H,
      scrollMode: d.ScrollMode.Infinite,
      // allow infinite scrolling--beyond document bounds
      "toolManager.hoverDelay": 50,
      // 50 milliseconds before tooltip appears
      "toolManager.mouseWheelBehavior": d.WheelMode.Zoom
      // mouse wheel zooms instead of scrolls vertically
    }
  );
  e.nodeTemplate = new d.Node("Auto", {
    click: oe,
    movable: !1,
    opacity: f,
    toolTip: new d.Adornment("Auto", {
      isShadowed: !0,
      margin: new d.Margin(12, 16, 6, 16),
      // top, right, bottom, left
      padding: 0,
      shadowBlur: 16,
      shadowColor: se(g, 0.05),
      shadowOffset: new d.Point(0, 0)
    }).add(new d.Panel("Vertical", { background: j, margin: 0 }).add(new d.TextBlock({ margin: 14, stroke: g }).bind("text", "title")))
  }).bind("text", "title").add(
    new d.Shape({
      desiredSize: u,
      fill: N,
      geometryString: te(
        u.width,
        u.height,
        G,
        S.width,
        !!N
      ),
      height: u.height,
      portId: "",
      stroke: W,
      strokeWidth: O,
      width: u.width
    })
  ).add(
    // Node content
    new d.Panel("Horizontal", {
      alignment: d.Spot.Left,
      stretch: d.Stretch.Horizontal
    }).add(
      // Icon panel
      new d.Panel("Horizontal", {
        alignment: d.Spot.Left,
        desiredSize: S,
        margin: 1
      }).add(
        new d.Panel("Horizontal", {
          alignment: d.Spot.Center,
          margin: 16
        }).add(
          new d.Picture({
            desiredSize: M
          }).bind("source", "", (i) => A(i.itemType, i.itemTypeKeywords))
        )
      ),
      // Label
      new d.Panel("Horizontal", {
        alignment: d.Spot.Right,
        margin: new d.Margin(4, 8, 0, 8)
        // top, right, bottom, left
      }).add(
        new d.Panel("Vertical", {}).add(
          // First line
          new d.TextBlock({
            alignment: d.Spot.Left,
            desiredSize: v,
            font: F,
            overflow: d.TextOverflow.Ellipsis,
            stroke: g,
            wrap: d.Wrap.None
          }).bind("text", "title"),
          // Second line
          new d.TextBlock({
            alignment: d.Spot.Left,
            desiredSize: v,
            font: R,
            overflow: d.TextOverflow.Ellipsis,
            stroke: g,
            wrap: d.Wrap.None
          }).bind("text", "itemTypeForDisplay")
        )
      )
    )
  ), e.commandHandler.zoomFactor = 1.05, e.setDivBackground(K);
  const r = e.toolManager.clickSelectingTool;
  r.standardMouseSelect = function() {
  };
  const s = e.toolManager.draggingTool;
  return s.isEnabled = !1, e.linkTemplate = new d.Link({
    corner: 5,
    movable: !1,
    routing: d.Routing.Orthogonal,
    selectable: !1
  }).add(
    new d.Shape({
      // the link path shape
      opacity: w,
      stroke: T
    }),
    new d.Shape({
      // the 'to' arrowhead
      fill: T,
      opacity: w,
      stroke: null,
      toArrow: "Standard"
    })
  ), e;
}
function m(o, t) {
  o.model = new d.GraphLinksModel(t.nodes, t.links, {
    linkFromPortIdProperty: "fromPort",
    linkToPortIdProperty: "toPort"
  });
}
function Y(o, t, e, r = !0) {
  if (r) {
    const c = ne(o, e);
    c.addEventListener(
      "calciteSwitchChange",
      () => document.dispatchEvent(new CustomEvent("filteredViewChanged", { detail: c.checked }))
    );
  }
  const { resetButton: s, centerButton: i, zoomInButton: n, zoomOutButton: a } = ae(o, e);
  s.addEventListener("click", () => de(t)), i.addEventListener("click", () => t.zoomToFit()), n.addEventListener("click", () => t.commandHandler.increaseZoom()), a.addEventListener("click", () => t.commandHandler.decreaseZoom());
}
function J(o, t, e) {
  const r = q(o);
  return m(r, t), Y(o, r, e), r;
}
function E(o) {
  const t = /* @__PURE__ */ new Set(), e = /* @__PURE__ */ new Set();
  function r(i) {
    i.findLinksInto().each(
      (n) => {
        e.add(n);
        const a = n.fromNode;
        a && !t.has(a) && (t.add(a), r(a));
      }
    );
  }
  r(o);
  function s(i) {
    i.findLinksOutOf().each(
      (n) => {
        e.add(n);
        const a = n.toNode;
        a && !t.has(a) && (t.add(a), s(a));
      }
    );
  }
  return s(o), { connectedNodes: t, connectedLinks: e };
}
function Q(o, t = !1, e) {
  const r = [], s = o.map((n) => {
    if (n.type !== "Group") {
      const a = ee(n);
      return X(n, a, t, e);
    } else {
      r.push(n.id);
      return;
    }
  }).filter((n) => n !== void 0), i = [];
  return s.forEach((n) => {
    (o.find((c) => c.id === n.itemId)?.dependencies || []).forEach((c) => {
      const h = s.find((l) => l?.itemId === c);
      h && i.push({
        from: h.key,
        fromSpot: d.Spot.AllSides,
        to: n.key,
        toSpot: d.Spot.AllSides
      });
    });
  }), { nodes: s, links: i, groupPseudoNodes: r };
}
function U(o, t, e, r = !0) {
  const s = o.diagram;
  if (!s)
    return;
  const i = {};
  if (r) {
    for (const n of s.nodes)
      i[n.key] = n === o ? f : b;
    for (const n of s.links) {
      const a = `${n.fromNode?.key}-${n.toNode?.key}`;
      i[a] = x;
    }
    {
      const { connectedNodes: n, connectedLinks: a } = E(o);
      for (const c of n)
        i[c.key] = f;
      for (const c of a) {
        const h = `${c.fromNode?.key}-${c.toNode?.key}`;
        i[h] = Z;
      }
    }
  }
  if (e && (e.adornedObject = o), r) {
    const n = new d.Animation();
    n.duration = 1;
    for (const a of s.nodes)
      n.add(a, "opacity", a.opacity, i[a.key]);
    for (const a of s.links) {
      const c = `${a.fromNode?.key}-${a.toNode?.key}`;
      n.add(a, "opacity", a.opacity, i[c]);
    }
    n.start();
  }
}
function L(o, t, e, r, s = !0) {
  if (o.length === 0)
    return;
  const i = t[0].diagram;
  if (!i)
    return;
  const n = {};
  if (s) {
    for (const a of i.nodes) {
      const c = o.includes(a.key);
      n[a.key] = !e || c ? f : b;
    }
    for (const a of i.links) {
      const c = `${a.fromNode?.key}-${a.toNode?.key}`;
      n[c] = e ? x : w;
    }
  }
  if (Object.keys(r).forEach((a) => {
    r[a].adornedObject = null;
  }), s) {
    const a = new d.Animation();
    a.duration = 1;
    for (const c of i.nodes)
      a.add(c, "opacity", c.opacity, n[c.key]);
    for (const c of i.links) {
      const h = `${c.fromNode?.key}-${c.toNode?.key}`;
      a.add(c, "opacity", c.opacity, n[h]);
    }
    a.start();
  }
}
function X(o, t, e = !1, r) {
  return {
    key: t,
    title: o.title,
    itemId: o.id,
    itemType: o.type,
    itemTypeForDisplay: re(o.type, o.typeKeywords),
    itemTypeKeywords: o.typeKeywords,
    group: o.type,
    url: e ? `${r}?id=${o.id}` : void 0
  };
}
function ee(o) {
  return o.id;
}
function te(o, t, e, r = 0, s = !1) {
  let i = "";
  s && (i += "F");
  const n = o - 2 * e, a = t - 2 * e;
  return i += " M0 0", i += ` h${n}`, i += ` a${e} ${e} 0 0 1 ${e} ${e}`, i += ` v${a}`, i += ` a${e} ${e} 0 0 1 ${-e} ${e}`, i += ` h${-n}`, i += ` a${e} ${e} 0 0 1 ${-e} ${-e}`, i += ` v${-a}`, i += ` a${e} ${e} 0 0 1 ${e} ${-e}`, r > 0 && (i += ` M${r - e} 0 v${t}`), i;
}
function ie() {
  document.dispatchEvent(new CustomEvent("clickInDiagram"));
}
function oe(o, t) {
  const e = t.part;
  e instanceof d.Node && (e.selectionAdorned = !1, document.dispatchEvent(new CustomEvent("clickOnNode", { detail: e })));
}
function ne(o, t) {
  const e = document.createElement("calcite-switch");
  e.id = "filteredViewButton", e.label = t.filteredView;
  const r = document.createElement("calcite-label");
  r.id = "filteredViewButtonLabel", r.setAttribute("layout", "inline"), r.innerHTML = t.filteredView, r.appendChild(e);
  const s = document.createElement("div");
  s.id = "filteredViewButtonDiv", s.appendChild(r);
  const i = document.createElement("calcite-action-bar");
  i.id = "filter-bar-controls", i.layout = "horizontal", i.expandDisabled = !0, i.appendChild(s);
  const n = document.createElement("div");
  return n.id = "filter-bar", o.appendChild(n), n.appendChild(i), e;
}
function ae(o, t) {
  const e = document.createElement("calcite-action");
  e.icon = "reset", e.id = "showHideGrayedOutButton";
  const r = document.createElement("calcite-tooltip");
  r.id = "resetButtonTooltip", r.innerHTML = t.reset, r.overlayPositioning = "fixed", r.placement = "bottom", r.referenceElement = e.id;
  const s = document.createElement("calcite-action");
  s.icon = "zoom-to-object", s.id = "centerButton";
  const i = document.createElement("calcite-tooltip");
  i.id = "centerButtonTooltip", i.innerHTML = t.centerDiagram, i.overlayPositioning = "fixed", i.placement = "bottom", i.referenceElement = s.id;
  const n = document.createElement("calcite-action");
  n.icon = "plus", n.id = "zoomInButton";
  const a = document.createElement("calcite-tooltip");
  a.id = "zoomInButtonTooltip", a.innerHTML = t.zoomIn, a.overlayPositioning = "fixed", a.placement = "bottom", a.referenceElement = n.id;
  const c = document.createElement("calcite-action");
  c.appearance = "solid", c.icon = "minus", c.id = "zoomOutButton";
  const h = document.createElement("calcite-tooltip");
  h.id = "zoomOutButtonTooltip", h.innerHTML = t.zoomOut, h.overlayPositioning = "fixed", h.placement = "bottom", h.referenceElement = c.id;
  const l = document.createElement("calcite-action-bar");
  l.id = "graph-navigation-controls", l.layout = "horizontal", l.expandDisabled = !0, l.appendChild(e), l.appendChild(r), l.appendChild(s), l.appendChild(i), l.appendChild(n), l.appendChild(a), l.appendChild(c), l.appendChild(h);
  const y = document.createElement("div");
  return y.id = "graph-navigation-bar", o.appendChild(y), y.appendChild(l), { resetButton: e, centerButton: s, zoomInButton: n, zoomOutButton: c };
}
function re(o, t) {
  let e = o;
  if (o === "Feature Service") {
    const r = t.indexOf("View Service") > -1, s = t.indexOf("Table") > -1;
    e = r && s ? "Table (hosted, view)" : s ? "Table (hosted)" : r ? "Feature Layer (hosted, view)" : "Feature Layer (hosted)";
  }
  return o === "Web Mapping Application" && (e = t.indexOf("configurableApp") > -1 ? "Instant App" : e), e = o === "Geoprocessing Service" ? "Tool" : e, e = o === "Feed" ? "Feed (hosted)" : e, e = o === "Real Time Analytic" ? "Real Time Analytic (hosted)" : e, e = o === "Big Data Analytic" ? "Big Data Analytic (hosted)" : e, e = o === "Vector Tile Service" ? "Tile Layer" : e, e;
}
function de(o) {
  o.zoomToFit(), document.dispatchEvent(new CustomEvent("reset"));
}
function p(o) {
  const t = document.body;
  return getComputedStyle(t).getPropertyValue(o).trim();
}
function se(o, t) {
  if (o = o.replace(/^#/, ""), o.length === 3 && (o = o.split("").map((i) => i + i).join("")), o.length !== 6)
    throw new Error("Invalid hex color");
  const e = parseInt(o.slice(0, 2), 16), r = parseInt(o.slice(2, 4), 16), s = parseInt(o.slice(4, 6), 16);
  return `rgba(${e}, ${r}, ${s}, ${t})`;
}
const ce = 8, le = 15, he = ue("--calcite-color-brand"), me = 4;
function ue(o) {
  const t = document.documentElement;
  return getComputedStyle(t).getPropertyValue(o).trim();
}
class pe {
  /**
   * Creates a new instance of the SolutionDisplay class.
   * @param indexPanel The Calcite panel element to use as the index panel.
   * @param diagramPanel The Calcite panel element to use as the diagram panel.
   * @param diagramTranslations Translation strings for the diagram.
   * @param diagramKey The license to use for the diagram.
   * @example &lt;caption>Expected environment&lt;/caption>
   *   &lt;calcite-shell>
   *     &lt;calcite-shell-panel id='indexPanel' slot='panel-start' width-scale='m'/>
   *     &lt;calcite-panel id='diagramPanel' style='display:flex;'/>
   *   &lt;/calcite-shell>
   */
  constructor(t, e, r, s) {
    this.indexPanel = t, this.diagramPanel = e, this.diagramTranslations = r, this.diagramKey = s, this.currentSelectedGroupId = "", this.currentSelectedItemId = "", this.diagramNeedsRedraw = !1, this.usefilteredView = !1, this.handle_clickInDiagram = (i) => {
      i.stopImmediatePropagation(), (this.currentSelectedGroupId || this.currentSelectedItemId) && (this.currentSelectedGroupId = "", this.currentSelectedItemId = "", this.diagramNeedsRedraw = this.usefilteredView, this.redraw());
    }, this.handle_clickOnNode = (i) => {
      i.stopImmediatePropagation();
      const n = i.detail.data.key;
      this.redraw(n, n === this.currentSelectedItemId);
    }, this.handle_filteredViewChanged = (i) => {
      this.usefilteredView = i.detail, this.diagramNeedsRedraw = !!this.currentSelectedGroupId || !!this.currentSelectedItemId, this.redraw(this.currentSelectedItemId || this.currentSelectedGroupId);
    }, this.handle_reset = (i) => {
      i.stopImmediatePropagation(), this.reset();
    }, this.handle_solutionItemSelect = (i) => {
      i.stopImmediatePropagation();
      const n = i.detail.itemId;
      this.redraw(n, n === this.currentSelectedItemId || n === this.currentSelectedGroupId, !1);
    }, d.Diagram.licenseKey === "" && (d.Diagram.licenseKey = s ?? "");
  }
  /**
   * Creates the index and diagram for the given collection of template info.
   * @param collection The collection of template info to display.
   * @param typeKeywords The collection type keywords for the solution.
   * @returns A promise that resolves when the index and diagram have been created.
   */
  create(t, e) {
    this.collection = t, this.index = document.createElement("solution-item-accordion"), this.index.linkType = "action", this.index.listSelectionMode = "single", this.index.typeKeywords = e, this.index.style.overflowY = "auto", this.indexPanel.appendChild(this.index), this.index.templateInfos = t, this.allNodesAndLinks = Q(t), this.diagram = J(
      this.diagramPanel,
      this.allNodesAndLinks,
      this.diagramTranslations
    ), this.diagram.addDiagramListener("LayoutCompleted", () => {
      setTimeout(() => {
        this.diagram.zoomToFit();
      }, 1e3);
    }), d.Link.setRoutingParameter(44, 600942), this.createNodeHighlighters(), document.addEventListener("clickInDiagram", this.handle_clickInDiagram), document.addEventListener("clickOnNode", this.handle_clickOnNode), document.addEventListener("filteredViewChanged", this.handle_filteredViewChanged), document.addEventListener("reset", this.handle_reset), this.index.addEventListener("solutionItemSelect", this.handle_solutionItemSelect);
  }
  /**
   * Destroys the index and diagram; removes all event listeners.
   */
  dispose() {
    document.removeEventListener("clickInDiagram", this.handle_clickInDiagram), document.removeEventListener("clickOnNode", this.handle_clickOnNode), document.removeEventListener("filteredViewChanged", this.handle_filteredViewChanged), document.removeEventListener("reset", this.handle_reset), this.index.removeEventListener("solutionItemSelect", this.handle_solutionItemSelect), this.indexPanel.innerHTML = "", this.diagramPanel.innerHTML = "";
  }
  // ---------------------------------------------------------------------------------------------------------------- //
  /**
   * Clears all selections in the index and diagram.
   * @param alsoCollapseAllAccordionItems Whether to collapse all accordion items in the index
   */
  clearSelections(t = !0) {
    this.index.deselectAll(), t && this.index.collapseAll();
    const e = this.getNodesFromDiagram(this.diagram), r = e.map((s) => s.data.key);
    L(r, e, !1, this.diagramNodeHighlighterIndex);
  }
  /**
   * Creates indicies into the diagram's nodes and node highlighters.
   * Rebuilds this.diagramNodeIndex and this.diagramNodeHighlighterIndex.
   */
  createNodeHighlighters() {
    this.diagramNodeIndex = {}, this.diagramNodeHighlighterIndex = {}, this.getNodesFromDiagram(this.diagram).forEach((e) => {
      this.diagramNodeIndex[e.data.key] = e;
      const r = new d.Adornment("Auto", {
        background: "transparent",
        margin: 2
      });
      r.add(new d.Shape("RoundedRectangle", {
        fill: "transparent",
        parameter1: ce,
        parameter2: le,
        stroke: he,
        strokeWidth: me
      })), r.add(new d.Placeholder({
        margin: 1
      })), this.diagramNodeHighlighterIndex[e.data.key] = r;
    });
  }
  /**
   * Retrieves a node from the diagram by its id.
   * @param diagram The diagram to search
   * @param id Id of node to find
   * @returns Node matching the given id, or undefined if not found
   */
  getNodeById(t) {
    return this.diagramNodeIndex[t];
  }
  /**
   * Retrieves all nodes from the diagram.
   * @param diagram The diagram to search
   * @returns Array of nodes in the diagram
   */
  getNodesFromDiagram(t) {
    const e = [], r = t.nodes.iterator;
    for (; r.next(); )
      e.push(r.value);
    return e;
  }
  /**
   * Selects an item to highlight or unhighlight.
   * @param id Id of selected item
   * @param toggleSelection Whether to toggle the selection state of the item
   * @param alsoCollapseAllAccordionItems Whether to collapse all accordion items in the index
   */
  redraw(t = "", e = !1, r = !0) {
    const s = this.allNodesAndLinks.groupPseudoNodes.includes(t);
    this.diagramNeedsRedraw && (m(this.diagram, this.allNodesAndLinks), this.createNodeHighlighters(), this.diagramNeedsRedraw = !1);
    let i = !1;
    if (this.clearSelections(r), !!t) {
      if (s) {
        if (this.currentSelectedItemId = "", this.currentSelectedGroupId !== t ? this.currentSelectedGroupId = t : e && (this.currentSelectedGroupId = this.currentSelectedGroupId ? "" : t, i = this.usefilteredView && !this.currentSelectedGroupId), this.currentSelectedGroupId) {
          this.usefilteredView && (m(this.diagram, this.allNodesAndLinks), this.createNodeHighlighters());
          const n = this.collection.filter((c) => c.id === t)[0], a = n.dependencies.map((c) => this.diagramNodeIndex[c]);
          if (this.usefilteredView) {
            const c = a.map((h) => h.data);
            m(this.diagram, { nodes: c, links: [] });
          } else
            L(n.dependencies, a, !0, this.diagramNodeHighlighterIndex);
          this.index.selectItem(this.currentSelectedGroupId);
        }
      } else {
        this.currentSelectedGroupId = "", this.currentSelectedItemId !== t ? this.currentSelectedItemId = t : e && (this.currentSelectedItemId = this.currentSelectedItemId ? "" : t, i = this.usefilteredView && !this.currentSelectedItemId);
        let n = this.getNodeById(t);
        if ((!n || this.usefilteredView) && (m(this.diagram, this.allNodesAndLinks), this.createNodeHighlighters(), n = this.getNodeById(t), !n))
          return;
        if (this.currentSelectedItemId) {
          if (this.usefilteredView) {
            const a = E(n);
            a.connectedNodes.add(n);
            const c = Array.from(a.connectedNodes).map((l) => l.data), h = Array.from(a.connectedLinks).map((l) => l.data);
            if (m(this.diagram, { nodes: c, links: h }), this.createNodeHighlighters(), n = this.getNodeById(t), !n)
              return;
          }
          n && setTimeout(() => U(n, !0, this.diagramNodeHighlighterIndex[t]), 1), this.index.selectItem(this.currentSelectedItemId);
        }
      }
      i && this.reset();
    }
  }
  /**
   * Clears all selections in the index and diagram.
   */
  reset() {
    this.diagramNeedsRedraw = !1, this.currentSelectedGroupId = "", this.currentSelectedItemId = "", m(this.diagram, this.allNodesAndLinks), this.createNodeHighlighters(), this.clearSelections();
  }
}
class ge extends $ {
  constructor() {
    super(...arguments), this.diagramKey = "", this.templateInfoGraph = [], this.typeKeywords = [], this._diagramPanel = k(), this._diagramShell = k(), this._translations = z({ name: "solution-item-diagram", blocking: !0 });
  }
  static {
    this.properties = { diagramKey: 1, templateInfoGraph: 0, typeKeywords: 0, _diagramPanel: 16, _diagramShell: 16, _translations: 16 };
  }
  static {
    this.styles = P;
  }
  updated() {
    if (this.solutionDisplay && (this.solutionDisplay.dispose(), this.solutionDisplay = void 0), this.templateInfoGraph.length > 0) {
      const t = {
        centerDiagram: this._translations.graphTranslations.centerDiagram,
        filteredView: this._translations.graphTranslations.filteredView,
        reset: this._translations.graphTranslations.reset,
        zoomIn: this._translations.graphTranslations.zoomIn,
        zoomOut: this._translations.graphTranslations.zoomOut
      };
      this.solutionDisplay = new pe(this._diagramShell.value, this._diagramPanel.value, t, this.diagramKey), this.solutionDisplay.create(this.templateInfoGraph, this.typeKeywords);
    }
    requestAnimationFrame(() => this._preventDiagramScrollbars());
  }
  disconnectedCallback() {
    super.disconnectedCallback(), this.solutionDisplay && (this.solutionDisplay.dispose(), this.solutionDisplay = void 0);
  }
  render() {
    return D`<calcite-shell><calcite-shell-panel id=diagram-shell-panel slot=panel-start ${I(this._diagramShell)}></calcite-shell-panel><calcite-panel class="z-index-1" id=diagram-panel slot=panel-bottom ${I(this._diagramPanel)}></calcite-panel></calcite-shell>`;
  }
  _preventDiagramScrollbars() {
    if (!this._diagramPanel.value)
      return;
    const t = this._diagramPanel.value.shadowRoot;
    if (!t)
      return;
    const e = t.querySelector(".content-wrapper");
    e instanceof HTMLElement && (e.style.overflow = "hidden");
  }
}
B("solution-item-diagram", ge);
export {
  ge as SolutionItemDiagram
};
