"use strict";
/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
(self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([["vendors-node_modules_mermaid_dist_stateDiagram-v2-8daeecfe_js"],{

/***/ "../node_modules/mermaid/dist/stateDiagram-v2-8daeecfe.js":
/*!****************************************************************!*\
  !*** ../node_modules/mermaid/dist/stateDiagram-v2-8daeecfe.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   diagram: () => (/* binding */ diagram)\n/* harmony export */ });\n/* harmony import */ var _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./styles-401768ef.js */ \"../node_modules/mermaid/dist/styles-401768ef.js\");\n/* harmony import */ var dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dagre-d3-es/src/graphlib/index.js */ \"../node_modules/dagre-d3-es/src/graphlib/index.js\");\n/* harmony import */ var d3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3 */ \"../node_modules/d3/src/index.js\");\n/* harmony import */ var _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./mermaid-04fb0060.js */ \"../node_modules/mermaid/dist/mermaid-04fb0060.js\");\n/* harmony import */ var _index_0980fb80_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./index-0980fb80.js */ \"../node_modules/mermaid/dist/index-0980fb80.js\");\n/* harmony import */ var ts_dedent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ts-dedent */ \"../node_modules/ts-dedent/esm/index.js\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! dayjs */ \"../node_modules/dayjs/dayjs.min.js\");\n/* harmony import */ var dayjs__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(dayjs__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _braintree_sanitize_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @braintree/sanitize-url */ \"../node_modules/@braintree/sanitize-url/dist/index.js\");\n/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! dompurify */ \"../node_modules/dompurify/dist/purify.js\");\n/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var dagre_d3_es_src_dagre_index_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! dagre-d3-es/src/dagre/index.js */ \"../node_modules/dagre-d3-es/src/dagre/index.js\");\n/* harmony import */ var dagre_d3_es_src_graphlib_json_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! dagre-d3-es/src/graphlib/json.js */ \"../node_modules/dagre-d3-es/src/graphlib/json.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst SHAPE_STATE = \"rect\";\nconst SHAPE_STATE_WITH_DESC = \"rectWithTitle\";\nconst SHAPE_START = \"start\";\nconst SHAPE_END = \"end\";\nconst SHAPE_DIVIDER = \"divider\";\nconst SHAPE_GROUP = \"roundedWithTitle\";\nconst SHAPE_NOTE = \"note\";\nconst SHAPE_NOTEGROUP = \"noteGroup\";\nconst CSS_DIAGRAM = \"statediagram\";\nconst CSS_STATE = \"state\";\nconst CSS_DIAGRAM_STATE = `${CSS_DIAGRAM}-${CSS_STATE}`;\nconst CSS_EDGE = \"transition\";\nconst CSS_NOTE = \"note\";\nconst CSS_NOTE_EDGE = \"note-edge\";\nconst CSS_EDGE_NOTE_EDGE = `${CSS_EDGE} ${CSS_NOTE_EDGE}`;\nconst CSS_DIAGRAM_NOTE = `${CSS_DIAGRAM}-${CSS_NOTE}`;\nconst CSS_CLUSTER = \"cluster\";\nconst CSS_DIAGRAM_CLUSTER = `${CSS_DIAGRAM}-${CSS_CLUSTER}`;\nconst CSS_CLUSTER_ALT = \"cluster-alt\";\nconst CSS_DIAGRAM_CLUSTER_ALT = `${CSS_DIAGRAM}-${CSS_CLUSTER_ALT}`;\nconst PARENT = \"parent\";\nconst NOTE = \"note\";\nconst DOMID_STATE = \"state\";\nconst DOMID_TYPE_SPACER = \"----\";\nconst NOTE_ID = `${DOMID_TYPE_SPACER}${NOTE}`;\nconst PARENT_ID = `${DOMID_TYPE_SPACER}${PARENT}`;\nconst G_EDGE_STYLE = \"fill:none\";\nconst G_EDGE_ARROWHEADSTYLE = \"fill: #333\";\nconst G_EDGE_LABELPOS = \"c\";\nconst G_EDGE_LABELTYPE = \"text\";\nconst G_EDGE_THICKNESS = \"normal\";\nlet nodeDb = {};\nlet graphItemCount = 0;\nconst setConf = function(cnf) {\n  const keys = Object.keys(cnf);\n  for (const key of keys) {\n    cnf[key];\n  }\n};\nconst getClasses = function(text, diagramObj) {\n  diagramObj.db.extract(diagramObj.db.getRootDocV2());\n  return diagramObj.db.getClasses();\n};\nfunction getClassesFromDbInfo(dbInfoItem) {\n  if (dbInfoItem === void 0 || dbInfoItem === null) {\n    return \"\";\n  } else {\n    if (dbInfoItem.classes) {\n      return dbInfoItem.classes.join(\" \");\n    } else {\n      return \"\";\n    }\n  }\n}\nfunction stateDomId(itemId = \"\", counter = 0, type = \"\", typeSpacer = DOMID_TYPE_SPACER) {\n  const typeStr = type !== null && type.length > 0 ? `${typeSpacer}${type}` : \"\";\n  return `${DOMID_STATE}-${itemId}${typeStr}-${counter}`;\n}\nconst setupNode = (g, parent, parsedItem, diagramStates, diagramDb, altFlag) => {\n  const itemId = parsedItem.id;\n  const classStr = getClassesFromDbInfo(diagramStates[itemId]);\n  if (itemId !== \"root\") {\n    let shape = SHAPE_STATE;\n    if (parsedItem.start === true) {\n      shape = SHAPE_START;\n    }\n    if (parsedItem.start === false) {\n      shape = SHAPE_END;\n    }\n    if (parsedItem.type !== _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.D) {\n      shape = parsedItem.type;\n    }\n    if (!nodeDb[itemId]) {\n      nodeDb[itemId] = {\n        id: itemId,\n        shape,\n        description: _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.e.sanitizeText(itemId, (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.c)()),\n        classes: `${classStr} ${CSS_DIAGRAM_STATE}`\n      };\n    }\n    const newNode = nodeDb[itemId];\n    if (parsedItem.description) {\n      if (Array.isArray(newNode.description)) {\n        newNode.shape = SHAPE_STATE_WITH_DESC;\n        newNode.description.push(parsedItem.description);\n      } else {\n        if (newNode.description.length > 0) {\n          newNode.shape = SHAPE_STATE_WITH_DESC;\n          if (newNode.description === itemId) {\n            newNode.description = [parsedItem.description];\n          } else {\n            newNode.description = [newNode.description, parsedItem.description];\n          }\n        } else {\n          newNode.shape = SHAPE_STATE;\n          newNode.description = parsedItem.description;\n        }\n      }\n      newNode.description = _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.e.sanitizeTextOrArray(newNode.description, (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.c)());\n    }\n    if (newNode.description.length === 1 && newNode.shape === SHAPE_STATE_WITH_DESC) {\n      newNode.shape = SHAPE_STATE;\n    }\n    if (!newNode.type && parsedItem.doc) {\n      _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.info(\"Setting cluster for \", itemId, getDir(parsedItem));\n      newNode.type = \"group\";\n      newNode.dir = getDir(parsedItem);\n      newNode.shape = parsedItem.type === _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.a ? SHAPE_DIVIDER : SHAPE_GROUP;\n      newNode.classes = newNode.classes + \" \" + CSS_DIAGRAM_CLUSTER + \" \" + (altFlag ? CSS_DIAGRAM_CLUSTER_ALT : \"\");\n    }\n    const nodeData = {\n      labelStyle: \"\",\n      shape: newNode.shape,\n      labelText: newNode.description,\n      // typeof newNode.description === 'object'\n      //   ? newNode.description[0]\n      //   : newNode.description,\n      classes: newNode.classes,\n      style: \"\",\n      //styles.style,\n      id: itemId,\n      dir: newNode.dir,\n      domId: stateDomId(itemId, graphItemCount),\n      type: newNode.type,\n      padding: 15\n      //getConfig().flowchart.padding\n    };\n    nodeData.centerLabel = true;\n    if (parsedItem.note) {\n      const noteData = {\n        labelStyle: \"\",\n        shape: SHAPE_NOTE,\n        labelText: parsedItem.note.text,\n        classes: CSS_DIAGRAM_NOTE,\n        // useHtmlLabels: false,\n        style: \"\",\n        // styles.style,\n        id: itemId + NOTE_ID + \"-\" + graphItemCount,\n        domId: stateDomId(itemId, graphItemCount, NOTE),\n        type: newNode.type,\n        padding: 15\n        //getConfig().flowchart.padding\n      };\n      const groupData = {\n        labelStyle: \"\",\n        shape: SHAPE_NOTEGROUP,\n        labelText: parsedItem.note.text,\n        classes: newNode.classes,\n        style: \"\",\n        // styles.style,\n        id: itemId + PARENT_ID,\n        domId: stateDomId(itemId, graphItemCount, PARENT),\n        type: \"group\",\n        padding: 0\n        //getConfig().flowchart.padding\n      };\n      graphItemCount++;\n      const parentNodeId = itemId + PARENT_ID;\n      g.setNode(parentNodeId, groupData);\n      g.setNode(noteData.id, noteData);\n      g.setNode(itemId, nodeData);\n      g.setParent(itemId, parentNodeId);\n      g.setParent(noteData.id, parentNodeId);\n      let from = itemId;\n      let to = noteData.id;\n      if (parsedItem.note.position === \"left of\") {\n        from = noteData.id;\n        to = itemId;\n      }\n      g.setEdge(from, to, {\n        arrowhead: \"none\",\n        arrowType: \"\",\n        style: G_EDGE_STYLE,\n        labelStyle: \"\",\n        classes: CSS_EDGE_NOTE_EDGE,\n        arrowheadStyle: G_EDGE_ARROWHEADSTYLE,\n        labelpos: G_EDGE_LABELPOS,\n        labelType: G_EDGE_LABELTYPE,\n        thickness: G_EDGE_THICKNESS\n      });\n    } else {\n      g.setNode(itemId, nodeData);\n    }\n  }\n  if (parent && parent.id !== \"root\") {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.trace(\"Setting node \", itemId, \" to be child of its parent \", parent.id);\n    g.setParent(itemId, parent.id);\n  }\n  if (parsedItem.doc) {\n    _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.trace(\"Adding nodes children \");\n    setupDoc(g, parsedItem, parsedItem.doc, diagramStates, diagramDb, !altFlag);\n  }\n};\nconst setupDoc = (g, parentParsedItem, doc, diagramStates, diagramDb, altFlag) => {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.trace(\"items\", doc);\n  doc.forEach((item) => {\n    switch (item.stmt) {\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.b:\n        setupNode(g, parentParsedItem, item, diagramStates, diagramDb, altFlag);\n        break;\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.D:\n        setupNode(g, parentParsedItem, item, diagramStates, diagramDb, altFlag);\n        break;\n      case _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.S:\n        {\n          setupNode(g, parentParsedItem, item.state1, diagramStates, diagramDb, altFlag);\n          setupNode(g, parentParsedItem, item.state2, diagramStates, diagramDb, altFlag);\n          const edgeData = {\n            id: \"edge\" + graphItemCount,\n            arrowhead: \"normal\",\n            arrowTypeEnd: \"arrow_barb\",\n            style: G_EDGE_STYLE,\n            labelStyle: \"\",\n            label: _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.e.sanitizeText(item.description, (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.c)()),\n            arrowheadStyle: G_EDGE_ARROWHEADSTYLE,\n            labelpos: G_EDGE_LABELPOS,\n            labelType: G_EDGE_LABELTYPE,\n            thickness: G_EDGE_THICKNESS,\n            classes: CSS_EDGE\n          };\n          g.setEdge(item.state1.id, item.state2.id, edgeData, graphItemCount);\n          graphItemCount++;\n        }\n        break;\n    }\n  });\n};\nconst getDir = (parsedItem, defaultDir = _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.c) => {\n  let dir = defaultDir;\n  if (parsedItem.doc) {\n    for (let i = 0; i < parsedItem.doc.length; i++) {\n      const parsedItemDoc = parsedItem.doc[i];\n      if (parsedItemDoc.stmt === \"dir\") {\n        dir = parsedItemDoc.value;\n      }\n    }\n  }\n  return dir;\n};\nconst draw = async function(text, id, _version, diag) {\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.info(\"Drawing state diagram (v2)\", id);\n  nodeDb = {};\n  diag.db.getDirection();\n  const { securityLevel, state: conf } = (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.c)();\n  const nodeSpacing = conf.nodeSpacing || 50;\n  const rankSpacing = conf.rankSpacing || 50;\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.info(diag.db.getRootDocV2());\n  diag.db.extract(diag.db.getRootDocV2());\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.info(diag.db.getRootDocV2());\n  const diagramStates = diag.db.getStates();\n  const g = new dagre_d3_es_src_graphlib_index_js__WEBPACK_IMPORTED_MODULE_0__.Graph({\n    multigraph: true,\n    compound: true\n  }).setGraph({\n    rankdir: getDir(diag.db.getRootDocV2()),\n    nodesep: nodeSpacing,\n    ranksep: rankSpacing,\n    marginx: 8,\n    marginy: 8\n  }).setDefaultEdgeLabel(function() {\n    return {};\n  });\n  setupNode(g, void 0, diag.db.getRootDocV2(), diagramStates, diag.db, true);\n  let sandboxElement;\n  if (securityLevel === \"sandbox\") {\n    sandboxElement = (0,d3__WEBPACK_IMPORTED_MODULE_1__.select)(\"#i\" + id);\n  }\n  const root = securityLevel === \"sandbox\" ? (0,d3__WEBPACK_IMPORTED_MODULE_1__.select)(sandboxElement.nodes()[0].contentDocument.body) : (0,d3__WEBPACK_IMPORTED_MODULE_1__.select)(\"body\");\n  const svg = root.select(`[id=\"${id}\"]`);\n  const element = root.select(\"#\" + id + \" g\");\n  await (0,_index_0980fb80_js__WEBPACK_IMPORTED_MODULE_10__.r)(element, g, [\"barb\"], CSS_DIAGRAM, id);\n  const padding = 8;\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.u.insertTitle(svg, \"statediagramTitleText\", conf.titleTopMargin, diag.db.getDiagramTitle());\n  const bounds = svg.node().getBBox();\n  const width = bounds.width + padding * 2;\n  const height = bounds.height + padding * 2;\n  svg.attr(\"class\", CSS_DIAGRAM);\n  const svgBounds = svg.node().getBBox();\n  (0,_mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.i)(svg, height, width, conf.useMaxWidth);\n  const vBox = `${svgBounds.x - padding} ${svgBounds.y - padding} ${width} ${height}`;\n  _mermaid_04fb0060_js__WEBPACK_IMPORTED_MODULE_9__.l.debug(`viewBox ${vBox}`);\n  svg.attr(\"viewBox\", vBox);\n  const labels = document.querySelectorAll('[id=\"' + id + '\"] .edgeLabel .label');\n  for (const label of labels) {\n    const dim = label.getBBox();\n    const rect = document.createElementNS(\"http://www.w3.org/2000/svg\", SHAPE_STATE);\n    rect.setAttribute(\"rx\", 0);\n    rect.setAttribute(\"ry\", 0);\n    rect.setAttribute(\"width\", dim.width);\n    rect.setAttribute(\"height\", dim.height);\n    label.insertBefore(rect, label.firstChild);\n  }\n};\nconst renderer = {\n  setConf,\n  getClasses,\n  draw\n};\nconst diagram = {\n  parser: _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.p,\n  db: _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d,\n  renderer,\n  styles: _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.s,\n  init: (cnf) => {\n    if (!cnf.state) {\n      cnf.state = {};\n    }\n    cnf.state.arrowMarkerAbsolute = cnf.arrowMarkerAbsolute;\n    _styles_401768ef_js__WEBPACK_IMPORTED_MODULE_8__.d.clear();\n  }\n};\n\n\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/mermaid/dist/stateDiagram-v2-8daeecfe.js?");

/***/ })

}]);