/*
 * 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_jupyterlab_notebook_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/notebook/lib/actions.js":
/*!***********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/actions.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"KernelError\": () => (/* binding */ KernelError),\n/* harmony export */   \"NotebookActions\": () => (/* binding */ NotebookActions)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/cells */ \"webpack/sharing/consume/default/@jupyterlab/cells/@jupyterlab/cells\");\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/domutils */ \"webpack/sharing/consume/default/@lumino/domutils/@lumino/domutils\");\n/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_domutils__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_7__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n\n\n\n/**\n * The mimetype used for Jupyter cell data.\n */\nconst JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';\nclass KernelError extends Error {\n    /**\n     * Construct the kernel error.\n     */\n    constructor(content) {\n        const errorContent = content;\n        const errorName = errorContent.ename;\n        const errorValue = errorContent.evalue;\n        super(`KernelReplyNotOK: ${errorName} ${errorValue}`);\n        this.errorName = errorName;\n        this.errorValue = errorValue;\n        this.traceback = errorContent.traceback;\n        Object.setPrototypeOf(this, KernelError.prototype);\n    }\n}\n/**\n * A collection of actions that run against notebooks.\n *\n * #### Notes\n * All of the actions are a no-op if there is no model on the notebook.\n * The actions set the widget `mode` to `'command'` unless otherwise specified.\n * The actions will preserve the selection on the notebook widget unless\n * otherwise specified.\n */\nclass NotebookActions {\n    /**\n     * A signal that emits whenever a cell completes execution.\n     */\n    static get executed() {\n        return Private.executed;\n    }\n    /**\n     * A signal that emits whenever a cell execution is scheduled.\n     */\n    static get executionScheduled() {\n        return Private.executionScheduled;\n    }\n    /**\n     * A signal that emits whenever a cell execution is scheduled.\n     */\n    static get selectionExecuted() {\n        return Private.selectionExecuted;\n    }\n    /**\n     * A private constructor for the `NotebookActions` class.\n     *\n     * #### Notes\n     * This class can never be instantiated. Its static member `executed` will be\n     * merged with the `NotebookActions` namespace. The reason it exists as a\n     * standalone class is because at run time, the `Private.executed` variable\n     * does not yet exist, so it needs to be referenced via a getter.\n     */\n    constructor() {\n        // Intentionally empty.\n    }\n}\n/**\n * A namespace for `NotebookActions` static methods.\n */\n(function (NotebookActions) {\n    /**\n     * Split the active cell into two or more cells.\n     *\n     * @param notebook The target notebook widget.\n     *\n     * #### Notes\n     * It will preserve the existing mode.\n     * The last cell will be activated if no selection is found.\n     * If text was selected, the cell containing the selection will\n     * be activated.\n     * The existing selection will be cleared.\n     * The activated cell will have focus and the cursor will\n     * remain in the initial position.\n     * The leading whitespace in the second cell will be removed.\n     * If there is no content, two empty cells will be created.\n     * Both cells will have the same type as the original cell.\n     * This action can be undone.\n     */\n    function splitCell(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.deselectAll();\n        const nbModel = notebook.model;\n        const index = notebook.activeCellIndex;\n        const child = notebook.widgets[index];\n        const editor = child.editor;\n        const selections = editor.getSelections();\n        const orig = child.model.value.text;\n        const offsets = [0];\n        let start = -1;\n        let end = -1;\n        for (let i = 0; i < selections.length; i++) {\n            // append start and end to handle selections\n            // cursors will have same start and end\n            start = editor.getOffsetAt(selections[i].start);\n            end = editor.getOffsetAt(selections[i].end);\n            if (start < end) {\n                offsets.push(start);\n                offsets.push(end);\n            }\n            else if (end < start) {\n                offsets.push(end);\n                offsets.push(start);\n            }\n            else {\n                offsets.push(start);\n            }\n        }\n        offsets.push(orig.length);\n        const clones = [];\n        for (let i = 0; i + 1 < offsets.length; i++) {\n            const clone = Private.cloneCell(nbModel, child.model);\n            clones.push(clone);\n        }\n        for (let i = 0; i < clones.length; i++) {\n            if (i !== clones.length - 1 && clones[i].type === 'code') {\n                clones[i].outputs.clear();\n            }\n            clones[i].value.text = orig\n                .slice(offsets[i], offsets[i + 1])\n                .replace(/^\\n+/, '')\n                .replace(/\\n+$/, '');\n        }\n        const cells = nbModel.cells;\n        cells.beginCompoundOperation();\n        for (let i = 0; i < clones.length; i++) {\n            if (i === 0) {\n                cells.set(index, clones[i]);\n            }\n            else {\n                cells.insert(index + i, clones[i]);\n            }\n        }\n        cells.endCompoundOperation();\n        // If there is a selection the selected cell will be activated\n        const activeCellDelta = start !== end ? 2 : 1;\n        notebook.activeCellIndex = index + clones.length - activeCellDelta;\n        const focusedEditor = notebook.activeCell.editor;\n        focusedEditor.focus();\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.splitCell = splitCell;\n    /**\n     * Merge the selected cells.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param mergeAbove - If only one cell is selected, indicates whether to merge it\n     *    with the cell above (true) or below (false, default).\n     *\n     * #### Notes\n     * The widget mode will be preserved.\n     * If only one cell is selected and `mergeAbove` is true, the above cell will be selected.\n     * If only one cell is selected and `mergeAbove` is false, the below cell will be selected.\n     * If the active cell is a code cell, its outputs will be cleared.\n     * This action can be undone.\n     * The final cell will have the same type as the active cell.\n     * If the active cell is a markdown cell, it will be unrendered.\n     */\n    function mergeCells(notebook, mergeAbove = false) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const toMerge = [];\n        const toDelete = [];\n        const model = notebook.model;\n        const cells = model.cells;\n        const primary = notebook.activeCell;\n        const active = notebook.activeCellIndex;\n        const attachments = {};\n        // Get the cells to merge.\n        notebook.widgets.forEach((child, index) => {\n            if (notebook.isSelectedOrActive(child)) {\n                toMerge.push(child.model.value.text);\n                if (index !== active) {\n                    toDelete.push(child.model);\n                }\n                // Collect attachments if the cell is a markdown cell or a raw cell\n                const model = child.model;\n                if ((0,_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.isRawCellModel)(model) || (0,_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.isMarkdownCellModel)(model)) {\n                    for (const key of model.attachments.keys) {\n                        attachments[key] = model.attachments.get(key).toJSON();\n                    }\n                }\n            }\n        });\n        // Check for only a single cell selected.\n        if (toMerge.length === 1) {\n            // Merge with the cell above when mergeAbove is true\n            if (mergeAbove === true) {\n                // Bail if it is the first cell.\n                if (active === 0) {\n                    return;\n                }\n                // Otherwise merge with the previous cell.\n                const cellModel = cells.get(active - 1);\n                toMerge.unshift(cellModel.value.text);\n                toDelete.push(cellModel);\n            }\n            else if (mergeAbove === false) {\n                // Bail if it is the last cell.\n                if (active === cells.length - 1) {\n                    return;\n                }\n                // Otherwise merge with the next cell.\n                const cellModel = cells.get(active + 1);\n                toMerge.push(cellModel.value.text);\n                toDelete.push(cellModel);\n            }\n        }\n        notebook.deselectAll();\n        // Create a new cell for the source to preserve history.\n        const newModel = Private.cloneCell(model, primary.model);\n        newModel.value.text = toMerge.join('\\n\\n');\n        if ((0,_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.isCodeCellModel)(newModel)) {\n            newModel.outputs.clear();\n        }\n        else if ((0,_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.isMarkdownCellModel)(newModel) || (0,_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.isRawCellModel)(newModel)) {\n            newModel.attachments.fromJSON(attachments);\n        }\n        // Make the changes while preserving history.\n        cells.beginCompoundOperation();\n        cells.set(active, newModel);\n        toDelete.forEach(cell => {\n            cells.removeValue(cell);\n        });\n        cells.endCompoundOperation();\n        // If the original cell is a markdown cell, make sure\n        // the new cell is unrendered.\n        if (primary instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.MarkdownCell) {\n            notebook.activeCell.rendered = false;\n        }\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.mergeCells = mergeCells;\n    /**\n     * Delete the selected cells.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The cell after the last selected cell will be activated.\n     * It will add a code cell if all cells are deleted.\n     * This action can be undone.\n     */\n    function deleteCells(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        Private.deleteCells(notebook);\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.deleteCells = deleteCells;\n    /**\n     * Insert a new code cell above the active cell.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The widget mode will be preserved.\n     * This action can be undone.\n     * The existing selection will be cleared.\n     * The new cell will the active cell.\n     */\n    function insertAbove(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const model = notebook.model;\n        const cell = model.contentFactory.createCell(notebook.notebookConfig.defaultCell, {});\n        const active = notebook.activeCellIndex;\n        model.cells.insert(active, cell);\n        // Make the newly inserted cell active.\n        notebook.activeCellIndex = active;\n        notebook.deselectAll();\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.insertAbove = insertAbove;\n    /**\n     * Insert a new code cell below the active cell.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The widget mode will be preserved.\n     * This action can be undone.\n     * The existing selection will be cleared.\n     * The new cell will be the active cell.\n     */\n    function insertBelow(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const model = notebook.model;\n        const cell = model.contentFactory.createCell(notebook.notebookConfig.defaultCell, {});\n        model.cells.insert(notebook.activeCellIndex + 1, cell);\n        // Make the newly inserted cell active.\n        notebook.activeCellIndex++;\n        notebook.deselectAll();\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.insertBelow = insertBelow;\n    /**\n     * Move the selected cell(s) down.\n     *\n     * @param notebook = The target notebook widget.\n     */\n    function moveDown(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const cells = notebook.model.cells;\n        const widgets = notebook.widgets;\n        cells.beginCompoundOperation();\n        for (let i = cells.length - 2; i > -1; i--) {\n            if (notebook.isSelectedOrActive(widgets[i])) {\n                if (!notebook.isSelectedOrActive(widgets[i + 1])) {\n                    cells.move(i, i + 1);\n                    if (notebook.activeCellIndex === i) {\n                        notebook.activeCellIndex++;\n                    }\n                    notebook.select(widgets[i + 1]);\n                    notebook.deselect(widgets[i]);\n                }\n            }\n        }\n        cells.endCompoundOperation();\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.moveDown = moveDown;\n    /**\n     * Move the selected cell(s) up.\n     *\n     * @param widget - The target notebook widget.\n     */\n    function moveUp(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const cells = notebook.model.cells;\n        const widgets = notebook.widgets;\n        cells.beginCompoundOperation();\n        for (let i = 1; i < cells.length; i++) {\n            if (notebook.isSelectedOrActive(widgets[i])) {\n                if (!notebook.isSelectedOrActive(widgets[i - 1])) {\n                    cells.move(i, i - 1);\n                    if (notebook.activeCellIndex === i) {\n                        notebook.activeCellIndex--;\n                    }\n                    notebook.select(widgets[i - 1]);\n                    notebook.deselect(widgets[i]);\n                }\n            }\n        }\n        cells.endCompoundOperation();\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.moveUp = moveUp;\n    /**\n     * Change the selected cell type(s).\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param value - The target cell type.\n     *\n     * #### Notes\n     * It should preserve the widget mode.\n     * This action can be undone.\n     * The existing selection will be cleared.\n     * Any cells converted to markdown will be unrendered.\n     */\n    function changeCellType(notebook, value) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        Private.changeCellType(notebook, value);\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.changeCellType = changeCellType;\n    /**\n     * Run the selected cell(s).\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param sessionContext - The optional client session object.\n     *\n     * #### Notes\n     * The last selected cell will be activated, but not scrolled into view.\n     * The existing selection will be cleared.\n     * An execution error will prevent the remaining code cells from executing.\n     * All markdown cells will be rendered.\n     */\n    function run(notebook, sessionContext) {\n        if (!notebook.model || !notebook.activeCell) {\n            return Promise.resolve(false);\n        }\n        const state = Private.getState(notebook);\n        const promise = Private.runSelected(notebook, sessionContext);\n        Private.handleRunState(notebook, state, false);\n        return promise;\n    }\n    NotebookActions.run = run;\n    /**\n     * Run the selected cell(s) and advance to the next cell.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param sessionContext - The optional client session object.\n     *\n     * #### Notes\n     * The existing selection will be cleared.\n     * The cell after the last selected cell will be activated and scrolled into view.\n     * An execution error will prevent the remaining code cells from executing.\n     * All markdown cells will be rendered.\n     * If the last selected cell is the last cell, a new code cell\n     * will be created in `'edit'` mode.  The new cell creation can be undone.\n     */\n    function runAndAdvance(notebook, sessionContext) {\n        if (!notebook.model || !notebook.activeCell) {\n            return Promise.resolve(false);\n        }\n        const state = Private.getState(notebook);\n        const promise = Private.runSelected(notebook, sessionContext);\n        const model = notebook.model;\n        if (notebook.activeCellIndex === notebook.widgets.length - 1) {\n            const cell = model.contentFactory.createCell(notebook.notebookConfig.defaultCell, {});\n            // Do not use push here, as we want an widget insertion\n            // to make sure no placeholder widget is rendered.\n            model.cells.insert(notebook.widgets.length, cell);\n            notebook.activeCellIndex++;\n            notebook.mode = 'edit';\n        }\n        else {\n            notebook.activeCellIndex++;\n        }\n        Private.handleRunState(notebook, state, true);\n        return promise;\n    }\n    NotebookActions.runAndAdvance = runAndAdvance;\n    /**\n     * Run the selected cell(s) and insert a new code cell.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param sessionContext - The optional client session object.\n     *\n     * #### Notes\n     * An execution error will prevent the remaining code cells from executing.\n     * All markdown cells will be rendered.\n     * The widget mode will be set to `'edit'` after running.\n     * The existing selection will be cleared.\n     * The cell insert can be undone.\n     * The new cell will be scrolled into view.\n     */\n    function runAndInsert(notebook, sessionContext) {\n        if (!notebook.model || !notebook.activeCell) {\n            return Promise.resolve(false);\n        }\n        const state = Private.getState(notebook);\n        const promise = Private.runSelected(notebook, sessionContext);\n        const model = notebook.model;\n        const cell = model.contentFactory.createCell(notebook.notebookConfig.defaultCell, {});\n        model.cells.insert(notebook.activeCellIndex + 1, cell);\n        notebook.activeCellIndex++;\n        notebook.mode = 'edit';\n        Private.handleRunState(notebook, state, true);\n        return promise;\n    }\n    NotebookActions.runAndInsert = runAndInsert;\n    /**\n     * Run all of the cells in the notebook.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param sessionContext - The optional client session object.\n     *\n     * #### Notes\n     * The existing selection will be cleared.\n     * An execution error will prevent the remaining code cells from executing.\n     * All markdown cells will be rendered.\n     * The last cell in the notebook will be activated and scrolled into view.\n     */\n    function runAll(notebook, sessionContext) {\n        if (!notebook.model || !notebook.activeCell) {\n            return Promise.resolve(false);\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(child => {\n            notebook.select(child);\n        });\n        const promise = Private.runSelected(notebook, sessionContext);\n        Private.handleRunState(notebook, state, true);\n        return promise;\n    }\n    NotebookActions.runAll = runAll;\n    function renderAllMarkdown(notebook, sessionContext) {\n        if (!notebook.model || !notebook.activeCell) {\n            return Promise.resolve(false);\n        }\n        const previousIndex = notebook.activeCellIndex;\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach((child, index) => {\n            if (child.model.type === 'markdown') {\n                notebook.select(child);\n                // This is to make sure that the activeCell\n                // does not get executed\n                notebook.activeCellIndex = index;\n            }\n        });\n        if (notebook.activeCell.model.type !== 'markdown') {\n            return Promise.resolve(true);\n        }\n        const promise = Private.runSelected(notebook, sessionContext);\n        notebook.activeCellIndex = previousIndex;\n        Private.handleRunState(notebook, state, true);\n        return promise;\n    }\n    NotebookActions.renderAllMarkdown = renderAllMarkdown;\n    /**\n     * Run all of the cells before the currently active cell (exclusive).\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param sessionContext - The optional client session object.\n     *\n     * #### Notes\n     * The existing selection will be cleared.\n     * An execution error will prevent the remaining code cells from executing.\n     * All markdown cells will be rendered.\n     * The currently active cell will remain selected.\n     */\n    function runAllAbove(notebook, sessionContext) {\n        const { activeCell, activeCellIndex, model } = notebook;\n        if (!model || !activeCell || activeCellIndex < 1) {\n            return Promise.resolve(false);\n        }\n        const state = Private.getState(notebook);\n        notebook.activeCellIndex--;\n        notebook.deselectAll();\n        for (let i = 0; i < notebook.activeCellIndex; ++i) {\n            notebook.select(notebook.widgets[i]);\n        }\n        const promise = Private.runSelected(notebook, sessionContext);\n        notebook.activeCellIndex++;\n        Private.handleRunState(notebook, state, true);\n        return promise;\n    }\n    NotebookActions.runAllAbove = runAllAbove;\n    /**\n     * Run all of the cells after the currently active cell (inclusive).\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param sessionContext - The optional client session object.\n     *\n     * #### Notes\n     * The existing selection will be cleared.\n     * An execution error will prevent the remaining code cells from executing.\n     * All markdown cells will be rendered.\n     * The last cell in the notebook will be activated and scrolled into view.\n     */\n    function runAllBelow(notebook, sessionContext) {\n        if (!notebook.model || !notebook.activeCell) {\n            return Promise.resolve(false);\n        }\n        const state = Private.getState(notebook);\n        notebook.deselectAll();\n        for (let i = notebook.activeCellIndex; i < notebook.widgets.length; ++i) {\n            notebook.select(notebook.widgets[i]);\n        }\n        const promise = Private.runSelected(notebook, sessionContext);\n        Private.handleRunState(notebook, state, true);\n        return promise;\n    }\n    NotebookActions.runAllBelow = runAllBelow;\n    /**\n     * Replaces the selection in the active cell of the notebook.\n     *\n     * @param notebook - The target notebook widget.\n     * @param text - The text to replace the selection.\n     */\n    function replaceSelection(notebook, text) {\n        var _a, _b;\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        (_b = (_a = notebook.activeCell.editor).replaceSelection) === null || _b === void 0 ? void 0 : _b.call(_a, text);\n    }\n    NotebookActions.replaceSelection = replaceSelection;\n    /**\n     * Select the above the active cell.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The widget mode will be preserved.\n     * This is a no-op if the first cell is the active cell.\n     * This will skip any collapsed cells.\n     * The existing selection will be cleared.\n     */\n    function selectAbove(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        if (notebook.activeCellIndex === 0) {\n            return;\n        }\n        let possibleNextCellIndex = notebook.activeCellIndex - 1;\n        // find first non hidden cell above current cell\n        while (possibleNextCellIndex >= 0) {\n            const possibleNextCell = notebook.widgets[possibleNextCellIndex];\n            if (!possibleNextCell.inputHidden && !possibleNextCell.isHidden) {\n                break;\n            }\n            possibleNextCellIndex -= 1;\n        }\n        const state = Private.getState(notebook);\n        notebook.activeCellIndex = possibleNextCellIndex;\n        notebook.deselectAll();\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.selectAbove = selectAbove;\n    /**\n     * Select the cell below the active cell.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The widget mode will be preserved.\n     * This is a no-op if the last cell is the active cell.\n     * This will skip any collapsed cells.\n     * The existing selection will be cleared.\n     */\n    function selectBelow(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        let maxCellIndex = notebook.widgets.length - 1;\n        // Find last non-hidden cell\n        while (notebook.widgets[maxCellIndex].isHidden ||\n            notebook.widgets[maxCellIndex].inputHidden) {\n            maxCellIndex -= 1;\n        }\n        if (notebook.activeCellIndex === maxCellIndex) {\n            return;\n        }\n        let possibleNextCellIndex = notebook.activeCellIndex + 1;\n        // find first non hidden cell below current cell\n        while (possibleNextCellIndex < maxCellIndex) {\n            let possibleNextCell = notebook.widgets[possibleNextCellIndex];\n            if (!possibleNextCell.inputHidden && !possibleNextCell.isHidden) {\n                break;\n            }\n            possibleNextCellIndex += 1;\n        }\n        const state = Private.getState(notebook);\n        notebook.activeCellIndex = possibleNextCellIndex;\n        notebook.deselectAll();\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.selectBelow = selectBelow;\n    /**\n     * Extend the selection to the cell above.\n     *\n     * @param notebook - The target notebook widget.\n     * @param toTop - If true, denotes selection to extend to the top.\n     *\n     * #### Notes\n     * This is a no-op if the first cell is the active cell.\n     * The new cell will be activated.\n     */\n    function extendSelectionAbove(notebook, toTop = false) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        // Do not wrap around.\n        if (notebook.activeCellIndex === 0) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.mode = 'command';\n        // Check if toTop is true, if yes, selection is made to the top.\n        if (toTop) {\n            notebook.extendContiguousSelectionTo(0);\n        }\n        else {\n            notebook.extendContiguousSelectionTo(notebook.activeCellIndex - 1);\n        }\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.extendSelectionAbove = extendSelectionAbove;\n    /**\n     * Extend the selection to the cell below.\n     *\n     * @param notebook - The target notebook widget.\n     * @param toBottom - If true, denotes selection to extend to the bottom.\n     *\n     * #### Notes\n     * This is a no-op if the last cell is the active cell.\n     * The new cell will be activated.\n     */\n    function extendSelectionBelow(notebook, toBottom = false) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        // Do not wrap around.\n        if (notebook.activeCellIndex === notebook.widgets.length - 1) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.mode = 'command';\n        // Check if toBottom is true, if yes selection is made to the bottom.\n        if (toBottom) {\n            notebook.extendContiguousSelectionTo(notebook.widgets.length - 1);\n        }\n        else {\n            notebook.extendContiguousSelectionTo(notebook.activeCellIndex + 1);\n        }\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.extendSelectionBelow = extendSelectionBelow;\n    /**\n     * Select all of the cells of the notebook.\n     *\n     * @param notebook - the target notebook widget.\n     */\n    function selectAll(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        notebook.widgets.forEach(child => {\n            notebook.select(child);\n        });\n    }\n    NotebookActions.selectAll = selectAll;\n    /**\n     * Deselect all of the cells of the notebook.\n     *\n     * @param notebook - the target notebook widget.\n     */\n    function deselectAll(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        notebook.deselectAll();\n    }\n    NotebookActions.deselectAll = deselectAll;\n    /**\n     * Copy the selected cell data to a clipboard.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function copy(notebook) {\n        Private.copyOrCut(notebook, false);\n    }\n    NotebookActions.copy = copy;\n    /**\n     * Cut the selected cell data to a clipboard.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * This action can be undone.\n     * A new code cell is added if all cells are cut.\n     */\n    function cut(notebook) {\n        Private.copyOrCut(notebook, true);\n    }\n    NotebookActions.cut = cut;\n    /**\n     * Paste cells from the application clipboard.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param mode - the mode of the paste operation: 'below' pastes cells\n     *   below the active cell, 'above' pastes cells above the active cell,\n     *   and 'replace' removes the currently selected cells and pastes cells\n     *   in their place.\n     *\n     * #### Notes\n     * The last pasted cell becomes the active cell.\n     * This is a no-op if there is no cell data on the clipboard.\n     * This action can be undone.\n     */\n    function paste(notebook, mode = 'below') {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const clipboard = _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Clipboard.getInstance();\n        if (!clipboard.hasData(JUPYTER_CELL_MIME)) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const values = clipboard.getData(JUPYTER_CELL_MIME);\n        const model = notebook.model;\n        notebook.mode = 'command';\n        const newCells = values.map(cell => {\n            switch (cell.cell_type) {\n                case 'code':\n                    return model.contentFactory.createCodeCell({ cell });\n                case 'markdown':\n                    return model.contentFactory.createMarkdownCell({ cell });\n                default:\n                    return model.contentFactory.createRawCell({ cell });\n            }\n        });\n        const cells = notebook.model.cells;\n        let index;\n        cells.beginCompoundOperation();\n        // Set the starting index of the paste operation depending upon the mode.\n        switch (mode) {\n            case 'below':\n                index = notebook.activeCellIndex;\n                break;\n            case 'above':\n                index = notebook.activeCellIndex - 1;\n                break;\n            case 'replace': {\n                // Find the cells to delete.\n                const toDelete = [];\n                notebook.widgets.forEach((child, index) => {\n                    const deletable = child.model.metadata.get('deletable') !== false;\n                    if (notebook.isSelectedOrActive(child) && deletable) {\n                        toDelete.push(index);\n                    }\n                });\n                // If cells are not deletable, we may not have anything to delete.\n                if (toDelete.length > 0) {\n                    // Delete the cells as one undo event.\n                    toDelete.reverse().forEach(i => {\n                        cells.remove(i);\n                    });\n                }\n                index = toDelete[0];\n                break;\n            }\n            default:\n                break;\n        }\n        newCells.forEach(cell => {\n            cells.insert(++index, cell);\n        });\n        cells.endCompoundOperation();\n        notebook.activeCellIndex += newCells.length;\n        notebook.deselectAll();\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.paste = paste;\n    /**\n     * Undo a cell action.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * This is a no-op if if there are no cell actions to undo.\n     */\n    function undo(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.mode = 'command';\n        notebook.model.sharedModel.undo();\n        notebook.deselectAll();\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.undo = undo;\n    /**\n     * Redo a cell action.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * This is a no-op if there are no cell actions to redo.\n     */\n    function redo(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.mode = 'command';\n        notebook.model.sharedModel.redo();\n        notebook.deselectAll();\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.redo = redo;\n    /**\n     * Toggle the line number of all cells.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The original state is based on the state of the active cell.\n     * The `mode` of the widget will be preserved.\n     */\n    function toggleAllLineNumbers(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const config = notebook.editorConfig;\n        const lineNumbers = !(config.code.lineNumbers &&\n            config.markdown.lineNumbers &&\n            config.raw.lineNumbers);\n        const newConfig = {\n            code: Object.assign(Object.assign({}, config.code), { lineNumbers }),\n            markdown: Object.assign(Object.assign({}, config.markdown), { lineNumbers }),\n            raw: Object.assign(Object.assign({}, config.raw), { lineNumbers })\n        };\n        notebook.editorConfig = newConfig;\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.toggleAllLineNumbers = toggleAllLineNumbers;\n    /**\n     * Clear the code outputs of the selected cells.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The widget `mode` will be preserved.\n     */\n    function clearOutputs(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.each)(notebook.model.cells, (cell, index) => {\n            const child = notebook.widgets[index];\n            if (notebook.isSelectedOrActive(child) && cell.type === 'code') {\n                cell.clearExecution();\n                child.outputHidden = false;\n            }\n        });\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.clearOutputs = clearOutputs;\n    /**\n     * Clear all the code outputs on the widget.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The widget `mode` will be preserved.\n     */\n    function clearAllOutputs(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.each)(notebook.model.cells, (cell, index) => {\n            const child = notebook.widgets[index];\n            if (cell.type === 'code') {\n                cell.clearExecution();\n                child.outputHidden = false;\n            }\n        });\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.clearAllOutputs = clearAllOutputs;\n    /**\n     * Hide the code on selected code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function hideCode(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {\n                cell.inputHidden = true;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.hideCode = hideCode;\n    /**\n     * Show the code on selected code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function showCode(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {\n                cell.inputHidden = false;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.showCode = showCode;\n    /**\n     * Hide the code on all code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function hideAllCode(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (cell.model.type === 'code') {\n                cell.inputHidden = true;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.hideAllCode = hideAllCode;\n    /**\n     * Show the code on all code cells.\n     *\n     * @param widget - The target notebook widget.\n     */\n    function showAllCode(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (cell.model.type === 'code') {\n                cell.inputHidden = false;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.showAllCode = showAllCode;\n    /**\n     * Hide the output on selected code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function hideOutput(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {\n                cell.outputHidden = true;\n            }\n        });\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.hideOutput = hideOutput;\n    /**\n     * Show the output on selected code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function showOutput(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {\n                cell.outputHidden = false;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.showOutput = showOutput;\n    /**\n     * Hide the output on all code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function hideAllOutputs(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (cell.model.type === 'code') {\n                cell.outputHidden = true;\n            }\n        });\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.hideAllOutputs = hideAllOutputs;\n    /**\n     * Show the output on all code cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function showAllOutputs(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (cell.model.type === 'code') {\n                cell.outputHidden = false;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.showAllOutputs = showAllOutputs;\n    /**\n     * Enable output scrolling for all selected cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function enableOutputScrolling(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {\n                cell.outputsScrolled = true;\n            }\n        });\n        Private.handleState(notebook, state, true);\n    }\n    NotebookActions.enableOutputScrolling = enableOutputScrolling;\n    /**\n     * Disable output scrolling for all selected cells.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function disableOutputScrolling(notebook) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        notebook.widgets.forEach(cell => {\n            if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {\n                cell.outputsScrolled = false;\n            }\n        });\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.disableOutputScrolling = disableOutputScrolling;\n    /**\n     * Go to the last cell that is run or current if it is running.\n     *\n     * Note: This requires execution timing to be toggled on or this will have\n     * no effect.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function selectLastRunCell(notebook) {\n        let latestTime = null;\n        let latestCellIdx = null;\n        notebook.widgets.forEach((cell, cellIndx) => {\n            if (cell.model.type === 'code') {\n                const execution = cell.model.metadata.get('execution');\n                if (execution &&\n                    _lumino_coreutils__WEBPACK_IMPORTED_MODULE_4__.JSONExt.isObject(execution) &&\n                    execution['iopub.status.busy'] !== undefined) {\n                    // The busy status is used as soon as a request is received:\n                    // https://jupyter-client.readthedocs.io/en/stable/messaging.html\n                    const timestamp = execution['iopub.status.busy'].toString();\n                    if (timestamp) {\n                        const startTime = new Date(timestamp);\n                        if (!latestTime || startTime >= latestTime) {\n                            latestTime = startTime;\n                            latestCellIdx = cellIndx;\n                        }\n                    }\n                }\n            }\n        });\n        if (latestCellIdx !== null) {\n            notebook.activeCellIndex = latestCellIdx;\n        }\n    }\n    NotebookActions.selectLastRunCell = selectLastRunCell;\n    /**\n     * Set the markdown header level.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param level - The header level.\n     *\n     * #### Notes\n     * All selected cells will be switched to markdown.\n     * The level will be clamped between 1 and 6.\n     * If there is an existing header, it will be replaced.\n     * There will always be one blank space after the header.\n     * The cells will be unrendered.\n     */\n    function setMarkdownHeader(notebook, level) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = Private.getState(notebook);\n        const cells = notebook.model.cells;\n        level = Math.min(Math.max(level, 1), 6);\n        notebook.widgets.forEach((child, index) => {\n            if (notebook.isSelectedOrActive(child)) {\n                Private.setMarkdownHeader(cells.get(index), level);\n            }\n        });\n        Private.changeCellType(notebook, 'markdown');\n        Private.handleState(notebook, state);\n    }\n    NotebookActions.setMarkdownHeader = setMarkdownHeader;\n    /**\n     * Collapse all cells in given notebook.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function collapseAll(notebook) {\n        for (const cell of notebook.widgets) {\n            if (NotebookActions.getHeadingInfo(cell).isHeading) {\n                NotebookActions.setHeadingCollapse(cell, true, notebook);\n                NotebookActions.setCellCollapse(cell, true);\n            }\n        }\n    }\n    NotebookActions.collapseAll = collapseAll;\n    /**\n     * Un-collapse all cells in given notebook.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function expandAllHeadings(notebook) {\n        for (const cell of notebook.widgets) {\n            if (NotebookActions.getHeadingInfo(cell).isHeading) {\n                NotebookActions.setHeadingCollapse(cell, false, notebook);\n                // similar to collapseAll.\n                NotebookActions.setCellCollapse(cell, false);\n            }\n        }\n    }\n    NotebookActions.expandAllHeadings = expandAllHeadings;\n    function findNearestParentHeader(cell, notebook) {\n        const index = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.findIndex)(notebook.widgets, (possibleCell, index) => {\n            return cell.model.id === possibleCell.model.id;\n        });\n        if (index === -1) {\n            return;\n        }\n        // Finds the nearest header above the given cell. If the cell is a header itself, it does not return itself;\n        // this can be checked directly by calling functions.\n        if (index >= notebook.widgets.length) {\n            return;\n        }\n        let childHeaderInfo = getHeadingInfo(notebook.widgets[index]);\n        for (let cellN = index - 1; cellN >= 0; cellN--) {\n            if (cellN < notebook.widgets.length) {\n                let hInfo = getHeadingInfo(notebook.widgets[cellN]);\n                if (hInfo.isHeading &&\n                    hInfo.headingLevel < childHeaderInfo.headingLevel) {\n                    return notebook.widgets[cellN];\n                }\n            }\n        }\n        // else no parent header found.\n        return;\n    }\n    /**\n     * Finds the \"parent\" heading of the given cell and expands.\n     * Used for the case that a cell becomes active that is within a collapsed heading.\n     * @param cell - \"Child\" cell that has become the active cell\n     * @param notebook - The target notebook widget.\n     */\n    function expandParent(cell, notebook) {\n        let nearestParentCell = findNearestParentHeader(cell, notebook);\n        if (!nearestParentCell) {\n            return;\n        }\n        if (!getHeadingInfo(nearestParentCell).collapsed &&\n            !nearestParentCell.isHidden) {\n            return;\n        }\n        if (nearestParentCell.isHidden) {\n            expandParent(nearestParentCell, notebook);\n        }\n        if (getHeadingInfo(nearestParentCell).collapsed) {\n            setHeadingCollapse(nearestParentCell, false, notebook);\n        }\n    }\n    NotebookActions.expandParent = expandParent;\n    /**\n     * Finds the next heading that isn't a child of the given markdown heading.\n     * @param cell - \"Child\" cell that has become the active cell\n     * @param notebook - The target notebook widget.\n     */\n    function findNextParentHeading(cell, notebook) {\n        let index = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.findIndex)(notebook.widgets, (possibleCell, index) => {\n            return cell.model.id === possibleCell.model.id;\n        });\n        if (index === -1) {\n            return -1;\n        }\n        let childHeaderInfo = getHeadingInfo(cell);\n        for (index = index + 1; index < notebook.widgets.length; index++) {\n            let hInfo = getHeadingInfo(notebook.widgets[index]);\n            if (hInfo.isHeading &&\n                hInfo.headingLevel <= childHeaderInfo.headingLevel) {\n                return index;\n            }\n        }\n        // else no parent header found. return the index of the last cell\n        return notebook.widgets.length;\n    }\n    NotebookActions.findNextParentHeading = findNextParentHeading;\n    /**\n     * Set the given cell and ** all \"child\" cells **\n     * to the given collapse / expand if cell is\n     * a markdown header.\n     *\n     * @param cell - The cell\n     * @param collapsing - Whether to collapse or expand the cell\n     * @param notebook - The target notebook widget.\n     */\n    function setHeadingCollapse(cell, collapsing, notebook) {\n        const which = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.findIndex)(notebook.widgets, (possibleCell, index) => {\n            return cell.model.id === possibleCell.model.id;\n        });\n        if (which === -1) {\n            return -1;\n        }\n        if (!notebook.widgets.length) {\n            return which + 1;\n        }\n        let selectedHeadingInfo = NotebookActions.getHeadingInfo(cell);\n        if (cell.isHidden ||\n            !(cell instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.MarkdownCell) ||\n            !selectedHeadingInfo.isHeading) {\n            // otherwise collapsing and uncollapsing already hidden stuff can\n            // cause some funny looking bugs.\n            return which + 1;\n        }\n        let localCollapsed = false;\n        let localCollapsedLevel = 0;\n        // iterate through all cells after the active cell.\n        let cellNum;\n        for (cellNum = which + 1; cellNum < notebook.widgets.length; cellNum++) {\n            let subCell = notebook.widgets[cellNum];\n            let subCellHeadingInfo = NotebookActions.getHeadingInfo(subCell);\n            if (subCellHeadingInfo.isHeading &&\n                subCellHeadingInfo.headingLevel <= selectedHeadingInfo.headingLevel) {\n                // then reached an equivalent or higher heading level than the\n                // original the end of the collapse.\n                cellNum -= 1;\n                break;\n            }\n            if (localCollapsed &&\n                subCellHeadingInfo.isHeading &&\n                subCellHeadingInfo.headingLevel <= localCollapsedLevel) {\n                // then reached the end of the local collapsed, so unset NotebookActions.\n                localCollapsed = false;\n            }\n            if (collapsing || localCollapsed) {\n                // then no extra handling is needed for further locally collapsed\n                // headings.\n                subCell.setHidden(true);\n                continue;\n            }\n            if (subCellHeadingInfo.collapsed && subCellHeadingInfo.isHeading) {\n                localCollapsed = true;\n                localCollapsedLevel = subCellHeadingInfo.headingLevel;\n                // but don't collapse the locally collapsed heading, so continue to\n                // expand the heading. This will get noticed in the next round.\n            }\n            subCell.setHidden(false);\n        }\n        if (cellNum === notebook.widgets.length) {\n            cell.numberChildNodes = cellNum - which - 1;\n        }\n        else {\n            cell.numberChildNodes = cellNum - which;\n        }\n        NotebookActions.setCellCollapse(cell, collapsing);\n        return cellNum + 1;\n    }\n    NotebookActions.setHeadingCollapse = setHeadingCollapse;\n    /**\n     * Toggles the collapse state of the active cell of the given notebook\n     * and ** all of its \"child\" cells ** if the cell is a heading.\n     *\n     * @param notebook - The target notebook widget.\n     */\n    function toggleCurrentHeadingCollapse(notebook) {\n        if (!notebook.activeCell || notebook.activeCellIndex === undefined) {\n            return;\n        }\n        let headingInfo = NotebookActions.getHeadingInfo(notebook.activeCell);\n        if (headingInfo.isHeading) {\n            // Then toggle!\n            NotebookActions.setHeadingCollapse(notebook.activeCell, !headingInfo.collapsed, notebook);\n        }\n        _lumino_domutils__WEBPACK_IMPORTED_MODULE_5__.ElementExt.scrollIntoViewIfNeeded(notebook.node, notebook.activeCell.node);\n    }\n    NotebookActions.toggleCurrentHeadingCollapse = toggleCurrentHeadingCollapse;\n    /**\n     * If cell is a markdown heading, sets the headingCollapsed field,\n     * and otherwise hides the cell.\n     *\n     * @param cell - The cell to collapse / expand\n     * @param collapsing - Whether to collapse or expand the given cell\n     */\n    function setCellCollapse(cell, collapsing) {\n        if (cell instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.MarkdownCell) {\n            cell.headingCollapsed = collapsing;\n        }\n        else {\n            cell.setHidden(collapsing);\n        }\n    }\n    NotebookActions.setCellCollapse = setCellCollapse;\n    /**\n     * If given cell is a markdown heading, returns the heading level.\n     * If given cell is not markdown, returns 7 (there are only 6 levels of markdown headings)\n     *\n     * @param cell - The target cell widget.\n     */\n    function getHeadingInfo(cell) {\n        if (!(cell instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.MarkdownCell)) {\n            return { isHeading: false, headingLevel: 7 };\n        }\n        let level = cell.headingInfo.level;\n        let collapsed = cell.headingCollapsed;\n        return { isHeading: level > 0, headingLevel: level, collapsed: collapsed };\n    }\n    NotebookActions.getHeadingInfo = getHeadingInfo;\n    /**\n     * Trust the notebook after prompting the user.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @returns a promise that resolves when the transaction is finished.\n     *\n     * #### Notes\n     * No dialog will be presented if the notebook is already trusted.\n     */\n    function trust(notebook, translator) {\n        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        if (!notebook.model) {\n            return Promise.resolve();\n        }\n        // Do nothing if already trusted.\n        const cells = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.toArray)(notebook.model.cells);\n        const trusted = cells.every(cell => cell.trusted);\n        // FIXME\n        const trustMessage = (react__WEBPACK_IMPORTED_MODULE_7__.createElement(\"p\", null,\n            trans.__('A trusted Jupyter notebook may execute hidden malicious code when you open it.'),\n            react__WEBPACK_IMPORTED_MODULE_7__.createElement(\"br\", null),\n            trans.__('Selecting trust will re-render this notebook in a trusted state.'),\n            react__WEBPACK_IMPORTED_MODULE_7__.createElement(\"br\", null),\n            trans.__('For more information, see'),\n            ' ',\n            react__WEBPACK_IMPORTED_MODULE_7__.createElement(\"a\", { href: \"https://jupyter-server.readthedocs.io/en/stable/operators/security.html\", target: \"_blank\", rel: \"noopener noreferrer\" }, trans.__('the Jupyter security documentation'))));\n        if (trusted) {\n            return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                body: trans.__('Notebook is already trusted'),\n                buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({ label: trans.__('Ok') })]\n            }).then(() => undefined);\n        }\n        return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n            body: trustMessage,\n            title: trans.__('Trust this notebook?'),\n            buttons: [\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.cancelButton({ label: trans.__('Cancel') }),\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.warnButton({ label: trans.__('Ok') })\n            ] // FIXME?\n        }).then(result => {\n            if (result.button.accept) {\n                cells.forEach(cell => {\n                    cell.trusted = true;\n                });\n            }\n        });\n    }\n    NotebookActions.trust = trust;\n})(NotebookActions || (NotebookActions = {}));\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * A signal that emits whenever a cell completes execution.\n     */\n    Private.executed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_6__.Signal({});\n    /**\n     * A signal that emits whenever a cell execution is scheduled.\n     */\n    Private.executionScheduled = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_6__.Signal({});\n    /**\n     * A signal that emits when one notebook's cells are all executed.\n     */\n    Private.selectionExecuted = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_6__.Signal({});\n    /**\n     * Get the state of a widget before running an action.\n     */\n    function getState(notebook) {\n        return {\n            wasFocused: notebook.node.contains(document.activeElement),\n            activeCell: notebook.activeCell\n        };\n    }\n    Private.getState = getState;\n    /**\n     * Handle the state of a widget after running an action.\n     */\n    function handleState(notebook, state, scrollIfNeeded = false) {\n        const { activeCell, node } = notebook;\n        if (state.wasFocused || notebook.mode === 'edit') {\n            notebook.activate();\n        }\n        if (scrollIfNeeded && activeCell) {\n            _lumino_domutils__WEBPACK_IMPORTED_MODULE_5__.ElementExt.scrollIntoViewIfNeeded(node, activeCell.node);\n        }\n    }\n    Private.handleState = handleState;\n    /**\n     * Handle the state of a widget after running a run action.\n     */\n    function handleRunState(notebook, state, scroll = false) {\n        if (state.wasFocused || notebook.mode === 'edit') {\n            notebook.activate();\n        }\n        if (scroll && state.activeCell) {\n            // Scroll to the top of the previous active cell output.\n            const rect = state.activeCell.inputArea.node.getBoundingClientRect();\n            notebook.scrollToPosition(rect.bottom, 45);\n        }\n    }\n    Private.handleRunState = handleRunState;\n    /**\n     * Clone a cell model.\n     */\n    function cloneCell(model, cell) {\n        switch (cell.type) {\n            case 'code':\n                // TODO why isn't modeldb or id passed here?\n                return model.contentFactory.createCodeCell({ cell: cell.toJSON() });\n            case 'markdown':\n                // TODO why isn't modeldb or id passed here?\n                return model.contentFactory.createMarkdownCell({ cell: cell.toJSON() });\n            default:\n                // TODO why isn't modeldb or id passed here?\n                return model.contentFactory.createRawCell({ cell: cell.toJSON() });\n        }\n    }\n    Private.cloneCell = cloneCell;\n    /**\n     * Run the selected cells.\n     */\n    function runSelected(notebook, sessionContext) {\n        notebook.mode = 'command';\n        let lastIndex = notebook.activeCellIndex;\n        const selected = notebook.widgets.filter((child, index) => {\n            const active = notebook.isSelectedOrActive(child);\n            if (active) {\n                lastIndex = index;\n            }\n            return active;\n        });\n        notebook.activeCellIndex = lastIndex;\n        notebook.deselectAll();\n        return Promise.all(selected.map(child => runCell(notebook, child, sessionContext)))\n            .then(results => {\n            if (notebook.isDisposed) {\n                return false;\n            }\n            Private.selectionExecuted.emit({\n                notebook,\n                lastCell: notebook.widgets[lastIndex]\n            });\n            // Post an update request.\n            notebook.update();\n            return results.every(result => result);\n        })\n            .catch(reason => {\n            if (reason.message.startsWith('KernelReplyNotOK')) {\n                selected.map(cell => {\n                    // Remove '*' prompt from cells that didn't execute\n                    if (cell.model.type === 'code' &&\n                        cell.model.executionCount == null) {\n                        cell.setPrompt('');\n                    }\n                });\n            }\n            else {\n                throw reason;\n            }\n            Private.selectionExecuted.emit({\n                notebook,\n                lastCell: notebook.widgets[lastIndex]\n            });\n            notebook.update();\n            return false;\n        });\n    }\n    Private.runSelected = runSelected;\n    /**\n     * Run a cell.\n     */\n    function runCell(notebook, cell, sessionContext, translator) {\n        var _a, _b, _c;\n        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        switch (cell.model.type) {\n            case 'markdown':\n                cell.rendered = true;\n                cell.inputHidden = false;\n                Private.executed.emit({ notebook, cell, success: true });\n                break;\n            case 'code':\n                if (sessionContext) {\n                    if (sessionContext.isTerminating) {\n                        void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                            title: trans.__('Kernel Terminating'),\n                            body: trans.__('The kernel for %1 appears to be terminating. You can not run any cell for now.', (_a = sessionContext.session) === null || _a === void 0 ? void 0 : _a.path),\n                            buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({ label: trans.__('Ok') })]\n                        });\n                        break;\n                    }\n                    const deletedCells = (_c = (_b = notebook.model) === null || _b === void 0 ? void 0 : _b.deletedCells) !== null && _c !== void 0 ? _c : [];\n                    Private.executionScheduled.emit({ notebook, cell });\n                    return _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.CodeCell.execute(cell, sessionContext, {\n                        deletedCells,\n                        recordTiming: notebook.notebookConfig.recordTiming\n                    })\n                        .then(reply => {\n                        deletedCells.splice(0, deletedCells.length);\n                        if (cell.isDisposed) {\n                            return false;\n                        }\n                        if (!reply) {\n                            return true;\n                        }\n                        if (reply.content.status === 'ok') {\n                            const content = reply.content;\n                            if (content.payload && content.payload.length) {\n                                handlePayload(content, notebook, cell);\n                            }\n                            return true;\n                        }\n                        else {\n                            throw new KernelError(reply.content);\n                        }\n                    })\n                        .catch(reason => {\n                        if (cell.isDisposed || reason.message.startsWith('Canceled')) {\n                            return false;\n                        }\n                        Private.executed.emit({ notebook, cell, success: false, error: reason });\n                        throw reason;\n                    })\n                        .then(ran => {\n                        if (ran) {\n                            Private.executed.emit({ notebook, cell, success: true });\n                        }\n                        return ran;\n                    });\n                }\n                cell.model.clearExecution();\n                break;\n            default:\n                break;\n        }\n        return Promise.resolve(true);\n    }\n    /**\n     * Handle payloads from an execute reply.\n     *\n     * #### Notes\n     * Payloads are deprecated and there are no official interfaces for them in\n     * the kernel type definitions.\n     * See [Payloads (DEPRECATED)](https://jupyter-client.readthedocs.io/en/latest/messaging.html#payloads-deprecated).\n     */\n    function handlePayload(content, notebook, cell) {\n        var _a;\n        const setNextInput = (_a = content.payload) === null || _a === void 0 ? void 0 : _a.filter(i => {\n            return i.source === 'set_next_input';\n        })[0];\n        if (!setNextInput) {\n            return;\n        }\n        const text = setNextInput.text;\n        const replace = setNextInput.replace;\n        if (replace) {\n            cell.model.value.text = text;\n            return;\n        }\n        // Create a new code cell and add as the next cell.\n        const newCell = notebook.model.contentFactory.createCodeCell({});\n        const cells = notebook.model.cells;\n        const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.ArrayExt.firstIndexOf((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.toArray)(cells), cell.model);\n        newCell.value.text = text;\n        if (index === -1) {\n            cells.push(newCell);\n        }\n        else {\n            cells.insert(index + 1, newCell);\n        }\n    }\n    /**\n     * Copy or cut the selected cell data to the application clipboard.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param cut - Whether to copy or cut.\n     */\n    function copyOrCut(notebook, cut) {\n        if (!notebook.model || !notebook.activeCell) {\n            return;\n        }\n        const state = getState(notebook);\n        const clipboard = _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Clipboard.getInstance();\n        notebook.mode = 'command';\n        clipboard.clear();\n        const data = notebook.widgets\n            .filter(cell => notebook.isSelectedOrActive(cell))\n            .map(cell => cell.model.toJSON())\n            .map(cellJSON => {\n            if (cellJSON.metadata.deletable !== undefined) {\n                delete cellJSON.metadata.deletable;\n            }\n            return cellJSON;\n        });\n        clipboard.setData(JUPYTER_CELL_MIME, data);\n        if (cut) {\n            deleteCells(notebook);\n        }\n        else {\n            notebook.deselectAll();\n        }\n        handleState(notebook, state);\n    }\n    Private.copyOrCut = copyOrCut;\n    /**\n     * Change the selected cell type(s).\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * @param value - The target cell type.\n     *\n     * #### Notes\n     * It should preserve the widget mode.\n     * This action can be undone.\n     * The existing selection will be cleared.\n     * Any cells converted to markdown will be unrendered.\n     */\n    function changeCellType(notebook, value) {\n        const model = notebook.model;\n        const cells = model.cells;\n        cells.beginCompoundOperation();\n        notebook.widgets.forEach((child, index) => {\n            if (!notebook.isSelectedOrActive(child)) {\n                return;\n            }\n            if (child.model.type !== value) {\n                const cell = child.model.toJSON();\n                let newCell;\n                switch (value) {\n                    case 'code':\n                        newCell = model.contentFactory.createCodeCell({ cell });\n                        break;\n                    case 'markdown':\n                        newCell = model.contentFactory.createMarkdownCell({ cell });\n                        if (child.model.type === 'code') {\n                            newCell.trusted = false;\n                        }\n                        break;\n                    default:\n                        newCell = model.contentFactory.createRawCell({ cell });\n                        if (child.model.type === 'code') {\n                            newCell.trusted = false;\n                        }\n                }\n                cells.set(index, newCell);\n            }\n            if (value === 'markdown') {\n                // Fetch the new widget and unrender it.\n                child = notebook.widgets[index];\n                child.rendered = false;\n            }\n        });\n        cells.endCompoundOperation();\n        notebook.deselectAll();\n    }\n    Private.changeCellType = changeCellType;\n    /**\n     * Delete the selected cells.\n     *\n     * @param notebook - The target notebook widget.\n     *\n     * #### Notes\n     * The cell after the last selected cell will be activated.\n     * If the last cell is deleted, then the previous one will be activated.\n     * It will add a code cell if all cells are deleted.\n     * This action can be undone.\n     */\n    function deleteCells(notebook) {\n        const model = notebook.model;\n        const cells = model.cells;\n        const toDelete = [];\n        notebook.mode = 'command';\n        // Find the cells to delete.\n        notebook.widgets.forEach((child, index) => {\n            const deletable = child.model.metadata.get('deletable') !== false;\n            if (notebook.isSelectedOrActive(child) && deletable) {\n                toDelete.push(index);\n                model.deletedCells.push(child.model.id);\n            }\n        });\n        // If cells are not deletable, we may not have anything to delete.\n        if (toDelete.length > 0) {\n            // Delete the cells as one undo event.\n            cells.beginCompoundOperation();\n            // Delete cells in reverse order to maintain the correct indices.\n            toDelete.reverse().forEach(index => {\n                cells.remove(index);\n            });\n            // Add a new cell if the notebook is empty. This is done\n            // within the compound operation to make the deletion of\n            // a notebook's last cell undoable.\n            if (!cells.length) {\n                cells.push(model.contentFactory.createCell(notebook.notebookConfig.defaultCell, {}));\n            }\n            cells.endCompoundOperation();\n            // Select the *first* interior cell not deleted or the cell\n            // *after* the last selected cell.\n            // Note: The activeCellIndex is clamped to the available cells,\n            // so if the last cell is deleted the previous cell will be activated.\n            // The *first* index is the index of the last cell in the initial\n            // toDelete list due to the `reverse` operation above.\n            notebook.activeCellIndex = toDelete[0] - toDelete.length + 1;\n        }\n        // Deselect any remaining, undeletable cells. Do this even if we don't\n        // delete anything so that users are aware *something* happened.\n        notebook.deselectAll();\n    }\n    Private.deleteCells = deleteCells;\n    /**\n     * Set the markdown header level of a cell.\n     */\n    function setMarkdownHeader(cell, level) {\n        // Remove existing header or leading white space.\n        let source = cell.value.text;\n        const regex = /^(#+\\s*)|^(\\s*)/;\n        const newHeader = Array(level + 1).join('#') + ' ';\n        const matches = regex.exec(source);\n        if (matches) {\n            source = source.slice(matches[0].length);\n        }\n        cell.value.text = newHeader + source;\n    }\n    Private.setMarkdownHeader = setMarkdownHeader;\n})(Private || (Private = {}));\n//# sourceMappingURL=actions.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/actions.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/celllist.js":
/*!************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/celllist.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CellList\": () => (/* binding */ CellList)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/observables */ \"webpack/sharing/consume/default/@jupyterlab/observables/@jupyterlab/observables\");\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/shared-models */ \"webpack/sharing/consume/default/@jupyterlab/shared-models/@jupyterlab/shared-models\");\n/* harmony import */ var _jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_3__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n/**\n * A cell list object that supports undo/redo.\n */\nclass CellList {\n    /**\n     * Construct the cell list.\n     */\n    constructor(modelDB, factory, model) {\n        /**\n         * Prevents that the modeldb event handler is executed when the shared-model event handler is executed and vice-versa.\n         */\n        this._mutex = _jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_1__.createMutex();\n        this._isDisposed = false;\n        this._changed = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal(this);\n        this._factory = factory;\n        this._cellOrder = modelDB.createList('cellOrder');\n        this._cellMap = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_0__.ObservableMap();\n        this._cellOrder.changed.connect(this._onOrderChanged, this);\n        this.nbmodel = model;\n        this.nbmodel.changed.connect(this.onSharedModelChanged, this);\n        this.changed.connect(this.onModelDBChanged, this);\n    }\n    onModelDBChanged(self, change) {\n        this._mutex(() => {\n            const nbmodel = this.nbmodel;\n            nbmodel.transact(() => {\n                if (change.type === 'set' || change.type === 'remove') {\n                    nbmodel.deleteCellRange(change.oldIndex, change.oldIndex + change.oldValues.length);\n                }\n                if (change.type === 'set' ||\n                    change.type === 'add' ||\n                    change.type === 'move') {\n                    const cells = change.newValues.map(cell => {\n                        return cell.sharedModel.clone();\n                    });\n                    let insertLocation = change.newIndex;\n                    if (change.type === 'move' && insertLocation > change.oldIndex) {\n                        insertLocation += change.oldValues.length;\n                    }\n                    nbmodel.insertCells(insertLocation, cells);\n                    change.newValues.forEach((cell, index) => {\n                        cell.switchSharedModel(cells[index], false);\n                    });\n                }\n                if (change.type === 'move') {\n                    let from = change.oldIndex;\n                    if (from >= change.newIndex) {\n                        from += change.oldValues.length;\n                    }\n                    nbmodel.deleteCellRange(from, from + change.oldValues.length);\n                }\n            });\n        });\n    }\n    onSharedModelChanged(self, change) {\n        this._mutex(() => {\n            var _a;\n            let currpos = 0;\n            (_a = change.cellsChange) === null || _a === void 0 ? void 0 : _a.forEach(delta => {\n                if (delta.insert != null) {\n                    const cells = delta.insert.map(nbcell => {\n                        const cell = this._factory.createCell(nbcell.cell_type, {});\n                        cell.switchSharedModel(nbcell, true);\n                        return cell;\n                    });\n                    this.insertAll(currpos, cells);\n                    currpos += delta.insert.length;\n                }\n                else if (delta.delete != null) {\n                    this.removeRange(currpos, currpos + delta.delete);\n                }\n                else if (delta.retain != null) {\n                    currpos += delta.retain;\n                }\n            });\n        });\n    }\n    /**\n     * A signal emitted when the cell list has changed.\n     */\n    get changed() {\n        return this._changed;\n    }\n    /**\n     * Test whether the cell list has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Test whether the list is empty.\n     *\n     * @returns `true` if the cell list is empty, `false` otherwise.\n     *\n     * #### Notes\n     * This is a read-only property.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * No changes.\n     */\n    get isEmpty() {\n        return this._cellOrder.length === 0;\n    }\n    /**\n     * Get the length of the cell list.\n     *\n     * @return The number of cells in the cell list.\n     *\n     * #### Notes\n     * This is a read-only property.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * No changes.\n     */\n    get length() {\n        return this._cellOrder.length;\n    }\n    /**\n     * Create an iterator over the cells in the cell list.\n     *\n     * @returns A new iterator starting at the front of the cell list.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * No changes.\n     */\n    iter() {\n        const arr = [];\n        for (const id of (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.toArray)(this._cellOrder)) {\n            arr.push(this._cellMap.get(id));\n        }\n        return new _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.ArrayIterator(arr);\n    }\n    /**\n     * Dispose of the resources held by the cell list.\n     */\n    dispose() {\n        if (this._isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal.clearData(this);\n        // Clean up the cell map and cell order objects.\n        for (const cell of this._cellMap.values()) {\n            cell.dispose();\n        }\n        this._cellMap.dispose();\n        this._cellOrder.dispose();\n    }\n    /**\n     * Get the cell at the specified index.\n     *\n     * @param index - The positive integer index of interest.\n     *\n     * @returns The cell at the specified index.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * No changes.\n     *\n     * #### Undefined Behavior\n     * An `index` which is non-integral or out of range.\n     */\n    get(index) {\n        return this._cellMap.get(this._cellOrder.get(index));\n    }\n    /**\n     * Set the cell at the specified index.\n     *\n     * @param index - The positive integer index of interest.\n     *\n     * @param cell - The cell to set at the specified index.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * No changes.\n     *\n     * #### Undefined Behavior\n     * An `index` which is non-integral or out of range.\n     *\n     * #### Notes\n     * This should be considered to transfer ownership of the\n     * cell to the `CellList`. As such, `cell.dispose()` should\n     * not be called by other actors.\n     */\n    set(index, cell) {\n        // Set the internal data structures.\n        this._cellMap.set(cell.id, cell);\n        this._cellOrder.set(index, cell.id);\n    }\n    /**\n     * Add a cell to the back of the cell list.\n     *\n     * @param cell - The cell to add to the back of the cell list.\n     *\n     * @returns The new length of the cell list.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * No changes.\n     *\n     * #### Notes\n     * This should be considered to transfer ownership of the\n     * cell to the `CellList`. As such, `cell.dispose()` should\n     * not be called by other actors.\n     */\n    push(cell) {\n        // Set the internal data structures.\n        this._cellMap.set(cell.id, cell);\n        const num = this._cellOrder.push(cell.id);\n        return num;\n    }\n    /**\n     * Insert a cell into the cell list at a specific index.\n     *\n     * @param index - The index at which to insert the cell.\n     *\n     * @param cell - The cell to set at the specified index.\n     *\n     * @returns The new length of the cell list.\n     *\n     * #### Complexity\n     * Linear.\n     *\n     * #### Iterator Validity\n     * No changes.\n     *\n     * #### Notes\n     * The `index` will be clamped to the bounds of the cell list.\n     *\n     * #### Undefined Behavior\n     * An `index` which is non-integral.\n     *\n     * #### Notes\n     * This should be considered to transfer ownership of the\n     * cell to the `CellList`. As such, `cell.dispose()` should\n     * not be called by other actors.\n     */\n    insert(index, cell) {\n        // Set the internal data structures.\n        this._cellMap.set(cell.id, cell);\n        this._cellOrder.insert(index, cell.id);\n    }\n    /**\n     * Remove the first occurrence of a cell from the cell list.\n     *\n     * @param cell - The cell of interest.\n     *\n     * @returns The index of the removed cell, or `-1` if the cell\n     *   is not contained in the cell list.\n     *\n     * #### Complexity\n     * Linear.\n     *\n     * #### Iterator Validity\n     * Iterators pointing at the removed cell and beyond are invalidated.\n     */\n    removeValue(cell) {\n        const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.ArrayExt.findFirstIndex((0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.toArray)(this._cellOrder), id => this._cellMap.get(id) === cell);\n        this.remove(index);\n        return index;\n    }\n    /**\n     * Remove and return the cell at a specific index.\n     *\n     * @param index - The index of the cell of interest.\n     *\n     * @returns The cell at the specified index, or `undefined` if the\n     *   index is out of range.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * Iterators pointing at the removed cell and beyond are invalidated.\n     *\n     * #### Undefined Behavior\n     * An `index` which is non-integral.\n     */\n    remove(index) {\n        const id = this._cellOrder.get(index);\n        this._cellOrder.remove(index);\n        const cell = this._cellMap.get(id);\n        return cell;\n    }\n    /**\n     * Remove all cells from the cell list.\n     *\n     * #### Complexity\n     * Linear.\n     *\n     * #### Iterator Validity\n     * All current iterators are invalidated.\n     */\n    clear() {\n        this._cellOrder.clear();\n    }\n    /**\n     * Move a cell from one index to another.\n     *\n     * @parm fromIndex - The index of the element to move.\n     *\n     * @param toIndex - The index to move the element to.\n     *\n     * #### Complexity\n     * Constant.\n     *\n     * #### Iterator Validity\n     * Iterators pointing at the lesser of the `fromIndex` and the `toIndex`\n     * and beyond are invalidated.\n     *\n     * #### Undefined Behavior\n     * A `fromIndex` or a `toIndex` which is non-integral.\n     */\n    move(fromIndex, toIndex) {\n        this._cellOrder.move(fromIndex, toIndex);\n    }\n    /**\n     * Push a set of cells to the back of the cell list.\n     *\n     * @param cells - An iterable or array-like set of cells to add.\n     *\n     * @returns The new length of the cell list.\n     *\n     * #### Complexity\n     * Linear.\n     *\n     * #### Iterator Validity\n     * No changes.\n     *\n     * #### Notes\n     * This should be considered to transfer ownership of the\n     * cells to the `CellList`. As such, `cell.dispose()` should\n     * not be called by other actors.\n     */\n    pushAll(cells) {\n        const newValues = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.toArray)(cells);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(newValues, cell => {\n            // Set the internal data structures.\n            this._cellMap.set(cell.id, cell);\n            this._cellOrder.push(cell.id);\n        });\n        return this.length;\n    }\n    /**\n     * Insert a set of items into the cell list at the specified index.\n     *\n     * @param index - The index at which to insert the cells.\n     *\n     * @param cells - The cells to insert at the specified index.\n     *\n     * @returns The new length of the cell list.\n     *\n     * #### Complexity.\n     * Linear.\n     *\n     * #### Iterator Validity\n     * No changes.\n     *\n     * #### Notes\n     * The `index` will be clamped to the bounds of the cell list.\n     *\n     * #### Undefined Behavior.\n     * An `index` which is non-integral.\n     *\n     * #### Notes\n     * This should be considered to transfer ownership of the\n     * cells to the `CellList`. As such, `cell.dispose()` should\n     * not be called by other actors.\n     */\n    insertAll(index, cells) {\n        const newValues = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.toArray)(cells);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(newValues, cell => {\n            this._cellMap.set(cell.id, cell);\n            // @todo it looks like this compound operation shoult start before the `each` loop.\n            this._cellOrder.beginCompoundOperation();\n            this._cellOrder.insert(index++, cell.id);\n            this._cellOrder.endCompoundOperation();\n        });\n        return this.length;\n    }\n    /**\n     * Remove a range of items from the cell list.\n     *\n     * @param startIndex - The start index of the range to remove (inclusive).\n     *\n     * @param endIndex - The end index of the range to remove (exclusive).\n     *\n     * @returns The new length of the cell list.\n     *\n     * #### Complexity\n     * Linear.\n     *\n     * #### Iterator Validity\n     * Iterators pointing to the first removed cell and beyond are invalid.\n     *\n     * #### Undefined Behavior\n     * A `startIndex` or `endIndex` which is non-integral.\n     */\n    removeRange(startIndex, endIndex) {\n        this._cellOrder.removeRange(startIndex, endIndex);\n        return this.length;\n    }\n    /**\n     * Whether the object can redo changes.\n     */\n    get canRedo() {\n        return this.nbmodel.canRedo();\n    }\n    /**\n     * Whether the object can undo changes.\n     */\n    get canUndo() {\n        return this.nbmodel.canUndo();\n    }\n    /**\n     * Begin a compound operation.\n     *\n     * @param isUndoAble - Whether the operation is undoable.\n     *   The default is `true`.\n     */\n    beginCompoundOperation(isUndoAble) {\n        this._cellOrder.beginCompoundOperation(isUndoAble);\n    }\n    /**\n     * End a compound operation.\n     */\n    endCompoundOperation() {\n        this._cellOrder.endCompoundOperation();\n    }\n    /**\n     * Undo an operation.\n     */\n    undo() {\n        this.nbmodel.undo();\n    }\n    /**\n     * Redo an operation.\n     */\n    redo() {\n        this.nbmodel.redo();\n    }\n    /**\n     * Clear the change stack.\n     */\n    clearUndo() {\n        this.nbmodel.clearUndoHistory();\n    }\n    _onOrderChanged(order, change) {\n        if (change.type === 'add' || change.type === 'set') {\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(change.newValues, id => {\n                const existingCell = this._cellMap.get(id);\n                if (existingCell == null) {\n                    const cellDB = this._factory.modelDB;\n                    const cellType = cellDB.createValue(id + '.type');\n                    let cell;\n                    switch (cellType.get()) {\n                        case 'code':\n                            cell = this._factory.createCodeCell({ id: id });\n                            break;\n                        case 'markdown':\n                            cell = this._factory.createMarkdownCell({ id: id });\n                            break;\n                        default:\n                            cell = this._factory.createRawCell({ id: id });\n                            break;\n                    }\n                    this._cellMap.set(id, cell);\n                }\n                else if (!existingCell.sharedModel.isStandalone) {\n                    this._mutex(() => {\n                        // it does already exist, probably because it was deleted previously and we introduced it\n                        // copy it to a fresh codecell instance\n                        const cell = existingCell.toJSON();\n                        let freshCell = null;\n                        switch (cell.cell_type) {\n                            case 'code':\n                                freshCell = this._factory.createCodeCell({ cell });\n                                break;\n                            case 'markdown':\n                                freshCell = this._factory.createMarkdownCell({ cell });\n                                break;\n                            default:\n                                freshCell = this._factory.createRawCell({ cell });\n                                break;\n                        }\n                        this._cellMap.set(id, freshCell);\n                    });\n                }\n            });\n        }\n        const newValues = [];\n        const oldValues = [];\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(change.newValues, id => {\n            newValues.push(this._cellMap.get(id));\n        });\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(change.oldValues, id => {\n            oldValues.push(this._cellMap.get(id));\n        });\n        this._changed.emit({\n            type: change.type,\n            oldIndex: change.oldIndex,\n            newIndex: change.newIndex,\n            oldValues,\n            newValues\n        });\n    }\n}\n//# sourceMappingURL=celllist.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/celllist.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/default-toolbar.js":
/*!*******************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/default-toolbar.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"ToolbarItems\": () => (/* binding */ ToolbarItems),\n/* harmony export */   \"CellTypeSwitcher\": () => (/* binding */ CellTypeSwitcher)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/ui-components */ \"webpack/sharing/consume/default/@jupyterlab/ui-components/@jupyterlab/ui-components\");\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./actions */ \"../node_modules/@jupyterlab/notebook/lib/actions.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n/**\n * The class name added to toolbar cell type dropdown wrapper.\n */\nconst TOOLBAR_CELLTYPE_CLASS = 'jp-Notebook-toolbarCellType';\n/**\n * The class name added to toolbar cell type dropdown.\n */\nconst TOOLBAR_CELLTYPE_DROPDOWN_CLASS = 'jp-Notebook-toolbarCellTypeDropdown';\n/**\n * A namespace for the default toolbar items.\n */\nvar ToolbarItems;\n(function (ToolbarItems) {\n    /**\n     * Create save button toolbar item.\n     */\n    function createSaveButton(panel, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        function onClick() {\n            if (panel.context.model.readOnly) {\n                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                    title: trans.__('Cannot Save'),\n                    body: trans.__('Document is read-only'),\n                    buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({ label: trans.__('Ok') })]\n                });\n            }\n            void panel.context.save().then(() => {\n                if (!panel.isDisposed) {\n                    return panel.context.createCheckpoint();\n                }\n            });\n        }\n        return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.addToolbarButtonClass)(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ReactWidget.create(react__WEBPACK_IMPORTED_MODULE_3__.createElement(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.UseSignal, { signal: panel.context.fileChanged }, () => (react__WEBPACK_IMPORTED_MODULE_3__.createElement(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButtonComponent, { icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.saveIcon, onClick: onClick, tooltip: trans.__('Save the notebook contents and create checkpoint'), enabled: !!(panel &&\n                panel.context &&\n                panel.context.contentsModel &&\n                panel.context.contentsModel.writable) })))));\n    }\n    ToolbarItems.createSaveButton = createSaveButton;\n    /**\n     * Create an insert toolbar item.\n     */\n    function createInsertButton(panel, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.addIcon,\n            onClick: () => {\n                _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.insertBelow(panel.content);\n            },\n            tooltip: trans.__('Insert a cell below')\n        });\n    }\n    ToolbarItems.createInsertButton = createInsertButton;\n    /**\n     * Create a cut toolbar item.\n     */\n    function createCutButton(panel, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.cutIcon,\n            onClick: () => {\n                _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.cut(panel.content);\n            },\n            tooltip: trans.__('Cut the selected cells')\n        });\n    }\n    ToolbarItems.createCutButton = createCutButton;\n    /**\n     * Create a copy toolbar item.\n     */\n    function createCopyButton(panel, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.copyIcon,\n            onClick: () => {\n                _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.copy(panel.content);\n            },\n            tooltip: trans.__('Copy the selected cells')\n        });\n    }\n    ToolbarItems.createCopyButton = createCopyButton;\n    /**\n     * Create a paste toolbar item.\n     */\n    function createPasteButton(panel, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.pasteIcon,\n            onClick: () => {\n                _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.paste(panel.content);\n            },\n            tooltip: trans.__('Paste cells from the clipboard')\n        });\n    }\n    ToolbarItems.createPasteButton = createPasteButton;\n    /**\n     * Create a run toolbar item.\n     */\n    function createRunButton(panel, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.runIcon,\n            onClick: () => {\n                void _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.runAndAdvance(panel.content, panel.sessionContext);\n            },\n            tooltip: trans.__('Run the selected cells and advance')\n        });\n    }\n    ToolbarItems.createRunButton = createRunButton;\n    /**\n     * Create a restart run all toolbar item\n     */\n    function createRestartRunAllButton(panel, dialogs, translator) {\n        const trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        return new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ToolbarButton({\n            icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.fastForwardIcon,\n            onClick: () => {\n                void (dialogs !== null && dialogs !== void 0 ? dialogs : _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.sessionContextDialogs)\n                    .restart(panel.sessionContext, translator)\n                    .then(restarted => {\n                    if (restarted) {\n                        void _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.runAll(panel.content, panel.sessionContext);\n                    }\n                    return restarted;\n                });\n            },\n            tooltip: trans.__('Restart the kernel, then re-run the whole notebook')\n        });\n    }\n    ToolbarItems.createRestartRunAllButton = createRestartRunAllButton;\n    /**\n     * Create a cell type switcher item.\n     *\n     * #### Notes\n     * It will display the type of the current active cell.\n     * If more than one cell is selected but are of different types,\n     * it will display `'-'`.\n     * When the user changes the cell type, it will change the\n     * cell types of the selected cells.\n     * It can handle a change to the context.\n     */\n    function createCellTypeItem(panel, translator) {\n        return new CellTypeSwitcher(panel.content, translator);\n    }\n    ToolbarItems.createCellTypeItem = createCellTypeItem;\n    /**\n     * Get the default toolbar items for panel\n     */\n    function getDefaultItems(panel, sessionDialogs, translator) {\n        return [\n            { name: 'save', widget: createSaveButton(panel, translator) },\n            { name: 'insert', widget: createInsertButton(panel, translator) },\n            { name: 'cut', widget: createCutButton(panel, translator) },\n            { name: 'copy', widget: createCopyButton(panel, translator) },\n            { name: 'paste', widget: createPasteButton(panel, translator) },\n            { name: 'run', widget: createRunButton(panel, translator) },\n            {\n                name: 'interrupt',\n                widget: _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Toolbar.createInterruptButton(panel.sessionContext, translator)\n            },\n            {\n                name: 'restart',\n                widget: _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Toolbar.createRestartButton(panel.sessionContext, sessionDialogs, translator)\n            },\n            {\n                name: 'restart-and-run',\n                widget: createRestartRunAllButton(panel, sessionDialogs, translator)\n            },\n            { name: 'cellType', widget: createCellTypeItem(panel, translator) },\n            { name: 'spacer', widget: _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Toolbar.createSpacerItem() },\n            {\n                name: 'kernelName',\n                widget: _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Toolbar.createKernelNameItem(panel.sessionContext, sessionDialogs, translator)\n            },\n            {\n                name: 'kernelStatus',\n                widget: _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Toolbar.createKernelStatusItem(panel.sessionContext, translator)\n            }\n        ];\n    }\n    ToolbarItems.getDefaultItems = getDefaultItems;\n})(ToolbarItems || (ToolbarItems = {}));\n/**\n * A toolbar widget that switches cell types.\n */\nclass CellTypeSwitcher extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.ReactWidget {\n    /**\n     * Construct a new cell type switcher.\n     */\n    constructor(widget, translator) {\n        super();\n        /**\n         * Handle `change` events for the HTMLSelect component.\n         */\n        this.handleChange = (event) => {\n            if (event.target.value !== '-') {\n                _actions__WEBPACK_IMPORTED_MODULE_4__.NotebookActions.changeCellType(this._notebook, event.target.value);\n                this._notebook.activate();\n            }\n        };\n        /**\n         * Handle `keydown` events for the HTMLSelect component.\n         */\n        this.handleKeyDown = (event) => {\n            if (event.keyCode === 13) {\n                this._notebook.activate();\n            }\n        };\n        this._trans = (translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator).load('jupyterlab');\n        this.addClass(TOOLBAR_CELLTYPE_CLASS);\n        this._notebook = widget;\n        if (widget.model) {\n            this.update();\n        }\n        widget.activeCellChanged.connect(this.update, this);\n        // Follow a change in the selection.\n        widget.selectionChanged.connect(this.update, this);\n    }\n    render() {\n        let value = '-';\n        if (this._notebook.activeCell) {\n            value = this._notebook.activeCell.model.type;\n        }\n        for (const widget of this._notebook.widgets) {\n            if (this._notebook.isSelectedOrActive(widget)) {\n                if (widget.model.type !== value) {\n                    value = '-';\n                    break;\n                }\n            }\n        }\n        return (react__WEBPACK_IMPORTED_MODULE_3__.createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.HTMLSelect, { className: TOOLBAR_CELLTYPE_DROPDOWN_CLASS, onChange: this.handleChange, onKeyDown: this.handleKeyDown, value: value, \"aria-label\": this._trans.__('Cell type'), title: this._trans.__('Select the cell type') },\n            react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"option\", { value: \"-\" }, \"-\"),\n            react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"option\", { value: \"code\" }, this._trans.__('Code')),\n            react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"option\", { value: \"markdown\" }, this._trans.__('Markdown')),\n            react__WEBPACK_IMPORTED_MODULE_3__.createElement(\"option\", { value: \"raw\" }, this._trans.__('Raw'))));\n    }\n}\n//# sourceMappingURL=default-toolbar.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/default-toolbar.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/index.js":
/*!*********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/index.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"KernelError\": () => (/* reexport safe */ _actions__WEBPACK_IMPORTED_MODULE_0__.KernelError),\n/* harmony export */   \"NotebookActions\": () => (/* reexport safe */ _actions__WEBPACK_IMPORTED_MODULE_0__.NotebookActions),\n/* harmony export */   \"CellTypeSwitcher\": () => (/* reexport safe */ _default_toolbar__WEBPACK_IMPORTED_MODULE_1__.CellTypeSwitcher),\n/* harmony export */   \"ToolbarItems\": () => (/* reexport safe */ _default_toolbar__WEBPACK_IMPORTED_MODULE_1__.ToolbarItems),\n/* harmony export */   \"NotebookModel\": () => (/* reexport safe */ _model__WEBPACK_IMPORTED_MODULE_2__.NotebookModel),\n/* harmony export */   \"NotebookModelFactory\": () => (/* reexport safe */ _modelfactory__WEBPACK_IMPORTED_MODULE_3__.NotebookModelFactory),\n/* harmony export */   \"CommandEditStatus\": () => (/* reexport safe */ _modestatus__WEBPACK_IMPORTED_MODULE_4__.CommandEditStatus),\n/* harmony export */   \"NotebookTools\": () => (/* reexport safe */ _notebooktools__WEBPACK_IMPORTED_MODULE_5__.NotebookTools),\n/* harmony export */   \"NotebookPanel\": () => (/* reexport safe */ _panel__WEBPACK_IMPORTED_MODULE_6__.NotebookPanel),\n/* harmony export */   \"INotebookTools\": () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_7__.INotebookTools),\n/* harmony export */   \"INotebookTracker\": () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_7__.INotebookTracker),\n/* harmony export */   \"INotebookWidgetFactory\": () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_7__.INotebookWidgetFactory),\n/* harmony export */   \"NotebookTracker\": () => (/* reexport safe */ _tracker__WEBPACK_IMPORTED_MODULE_8__.NotebookTracker),\n/* harmony export */   \"NotebookTrustStatus\": () => (/* reexport safe */ _truststatus__WEBPACK_IMPORTED_MODULE_9__.NotebookTrustStatus),\n/* harmony export */   \"Notebook\": () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_10__.Notebook),\n/* harmony export */   \"StaticNotebook\": () => (/* reexport safe */ _widget__WEBPACK_IMPORTED_MODULE_10__.StaticNotebook),\n/* harmony export */   \"NotebookWidgetFactory\": () => (/* reexport safe */ _widgetfactory__WEBPACK_IMPORTED_MODULE_11__.NotebookWidgetFactory)\n/* harmony export */ });\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./actions */ \"../node_modules/@jupyterlab/notebook/lib/actions.js\");\n/* harmony import */ var _default_toolbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./default-toolbar */ \"../node_modules/@jupyterlab/notebook/lib/default-toolbar.js\");\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./model */ \"../node_modules/@jupyterlab/notebook/lib/model.js\");\n/* harmony import */ var _modelfactory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./modelfactory */ \"../node_modules/@jupyterlab/notebook/lib/modelfactory.js\");\n/* harmony import */ var _modestatus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modestatus */ \"../node_modules/@jupyterlab/notebook/lib/modestatus.js\");\n/* harmony import */ var _notebooktools__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./notebooktools */ \"../node_modules/@jupyterlab/notebook/lib/notebooktools.js\");\n/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./panel */ \"../node_modules/@jupyterlab/notebook/lib/panel.js\");\n/* harmony import */ var _tokens__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./tokens */ \"../node_modules/@jupyterlab/notebook/lib/tokens.js\");\n/* harmony import */ var _tracker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./tracker */ \"../node_modules/@jupyterlab/notebook/lib/tracker.js\");\n/* harmony import */ var _truststatus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./truststatus */ \"../node_modules/@jupyterlab/notebook/lib/truststatus.js\");\n/* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./widget */ \"../node_modules/@jupyterlab/notebook/lib/widget.js\");\n/* harmony import */ var _widgetfactory__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./widgetfactory */ \"../node_modules/@jupyterlab/notebook/lib/widgetfactory.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module notebook\n */\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/model.js":
/*!*********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/model.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookModel\": () => (/* binding */ NotebookModel)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/cells */ \"webpack/sharing/consume/default/@jupyterlab/cells/@jupyterlab/cells\");\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/nbformat */ \"webpack/sharing/consume/default/@jupyterlab/nbformat/@jupyterlab/nbformat\");\n/* harmony import */ var _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/observables */ \"webpack/sharing/consume/default/@jupyterlab/observables/@jupyterlab/observables\");\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_observables__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/shared-models */ \"webpack/sharing/consume/default/@jupyterlab/shared-models/@jupyterlab/shared-models\");\n/* harmony import */ var _jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _celllist__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./celllist */ \"../node_modules/@jupyterlab/notebook/lib/celllist.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n\n\n\n\n/**\n * An implementation of a notebook Model.\n */\nclass NotebookModel {\n    /**\n     * Construct a new notebook model.\n     */\n    constructor(options = {}) {\n        /**\n         * The shared notebook model.\n         */\n        this.sharedModel = _jupyterlab_shared_models__WEBPACK_IMPORTED_MODULE_4__.YNotebook.create();\n        this._dirty = false;\n        this._readOnly = false;\n        this._contentChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._stateChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._nbformat = _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2__.MAJOR_VERSION;\n        this._nbformatMinor = _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2__.MINOR_VERSION;\n        this._isDisposed = false;\n        if (options.modelDB) {\n            this.modelDB = options.modelDB;\n        }\n        else {\n            this.modelDB = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_3__.ModelDB();\n        }\n        this._isInitialized = options.isInitialized === false ? false : true;\n        const factory = options.contentFactory || NotebookModel.defaultContentFactory;\n        this.contentFactory = factory.clone(this.modelDB.view('cells'));\n        this._cells = new _celllist__WEBPACK_IMPORTED_MODULE_8__.CellList(this.modelDB, this.contentFactory, this.sharedModel);\n        this._trans = (options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_5__.nullTranslator).load('jupyterlab');\n        this._cells.changed.connect(this._onCellsChanged, this);\n        // Handle initial metadata.\n        const metadata = this.modelDB.createMap('metadata');\n        if (!metadata.has('language_info')) {\n            const name = options.languagePreference || '';\n            metadata.set('language_info', { name });\n        }\n        this._ensureMetadata();\n        metadata.changed.connect(this.triggerContentChange, this);\n        this._deletedCells = [];\n        this.sharedModel.changed.connect(this._onStateChanged, this);\n    }\n    /**\n     * A signal emitted when the document content changes.\n     */\n    get contentChanged() {\n        return this._contentChanged;\n    }\n    /**\n     * A signal emitted when the document state changes.\n     */\n    get stateChanged() {\n        return this._stateChanged;\n    }\n    /**\n     * The dirty state of the document.\n     */\n    get dirty() {\n        return this._dirty;\n    }\n    set dirty(newValue) {\n        if (newValue === this._dirty) {\n            return;\n        }\n        const oldValue = this._dirty;\n        this._dirty = newValue;\n        this.triggerStateChange({ name: 'dirty', oldValue, newValue });\n    }\n    /**\n     * The read only state of the document.\n     */\n    get readOnly() {\n        return this._readOnly;\n    }\n    set readOnly(newValue) {\n        if (newValue === this._readOnly) {\n            return;\n        }\n        const oldValue = this._readOnly;\n        this._readOnly = newValue;\n        this.triggerStateChange({ name: 'readOnly', oldValue, newValue });\n    }\n    /**\n     * The metadata associated with the notebook.\n     */\n    get metadata() {\n        return this.modelDB.get('metadata');\n    }\n    /**\n     * Get the observable list of notebook cells.\n     */\n    get cells() {\n        return this._cells;\n    }\n    /**\n     * The major version number of the nbformat.\n     */\n    get nbformat() {\n        return this._nbformat;\n    }\n    /**\n     * The minor version number of the nbformat.\n     */\n    get nbformatMinor() {\n        return this._nbformatMinor;\n    }\n    /**\n     * The default kernel name of the document.\n     */\n    get defaultKernelName() {\n        const spec = this.metadata.get('kernelspec');\n        return spec ? spec.name : '';\n    }\n    /**\n     * A list of deleted cells for the notebook..\n     */\n    get deletedCells() {\n        return this._deletedCells;\n    }\n    /**\n     * If the model is initialized or not.\n     */\n    get isInitialized() {\n        return this._isInitialized;\n    }\n    /**\n     * The default kernel language of the document.\n     */\n    get defaultKernelLanguage() {\n        const info = this.metadata.get('language_info');\n        return info ? info.name : '';\n    }\n    /**\n     * Dispose of the resources held by the model.\n     */\n    dispose() {\n        // Do nothing if already disposed.\n        if (this.isDisposed) {\n            return;\n        }\n        const cells = this.cells;\n        this._cells = null;\n        cells.dispose();\n        this._isDisposed = true;\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal.clearData(this);\n    }\n    /**\n     * Serialize the model to a string.\n     */\n    toString() {\n        return JSON.stringify(this.toJSON());\n    }\n    /**\n     * Deserialize the model from a string.\n     *\n     * #### Notes\n     * Should emit a [contentChanged] signal.\n     */\n    fromString(value) {\n        this.fromJSON(JSON.parse(value));\n    }\n    /**\n     * Serialize the model to JSON.\n     */\n    toJSON() {\n        var _a, _b;\n        const cells = [];\n        for (let i = 0; i < ((_b = (_a = this.cells) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0); i++) {\n            const cell = this.cells.get(i).toJSON();\n            if (this._nbformat === 4 && this._nbformatMinor <= 4) {\n                // strip cell ids if we have notebook format 4.0-4.4\n                delete cell.id;\n            }\n            cells.push(cell);\n        }\n        this._ensureMetadata();\n        const metadata = this.sharedModel.getMetadata();\n        for (const key of this.metadata.keys()) {\n            metadata[key] = JSON.parse(JSON.stringify(this.metadata.get(key)));\n        }\n        return {\n            metadata,\n            nbformat_minor: this._nbformatMinor,\n            nbformat: this._nbformat,\n            cells\n        };\n    }\n    /**\n     * Deserialize the model from JSON.\n     *\n     * #### Notes\n     * Should emit a [contentChanged] signal.\n     */\n    fromJSON(value) {\n        const cells = [];\n        const factory = this.contentFactory;\n        const useId = value.nbformat === 4 && value.nbformat_minor >= 5;\n        for (const cell of value.cells) {\n            const options = { cell };\n            if (useId) {\n                options.id = cell.id;\n            }\n            switch (cell.cell_type) {\n                case 'code':\n                    cells.push(factory.createCodeCell(options));\n                    break;\n                case 'markdown':\n                    cells.push(factory.createMarkdownCell(options));\n                    break;\n                case 'raw':\n                    cells.push(factory.createRawCell(options));\n                    break;\n                default:\n                    continue;\n            }\n        }\n        this.cells.beginCompoundOperation();\n        this.cells.clear();\n        this.cells.pushAll(cells);\n        this.cells.endCompoundOperation();\n        this.sharedModel.nbformat_minor =\n            _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2__.MINOR_VERSION;\n        this.sharedModel.nbformat = _jupyterlab_nbformat__WEBPACK_IMPORTED_MODULE_2__.MAJOR_VERSION;\n        const origNbformat = value.metadata.orig_nbformat;\n        if (value.nbformat !== this._nbformat) {\n            this.sharedModel.nbformat = value.nbformat;\n        }\n        if (value.nbformat_minor > this._nbformatMinor) {\n            this.sharedModel.nbformat_minor =\n                value.nbformat_minor;\n        }\n        // Alert the user if the format changes.\n        if (origNbformat !== undefined && this._nbformat !== origNbformat) {\n            const newer = this._nbformat > origNbformat;\n            let msg;\n            if (newer) {\n                msg = this._trans.__(`This notebook has been converted from an older notebook format (v%1)\nto the current notebook format (v%2).\nThe next time you save this notebook, the current notebook format (vthis._nbformat) will be used.\n'Older versions of Jupyter may not be able to read the new format.' To preserve the original format version,\nclose the notebook without saving it.`, origNbformat, this._nbformat);\n            }\n            else {\n                msg = this._trans.__(`This notebook has been converted from an newer notebook format (v%1)\nto the current notebook format (v%2).\nThe next time you save this notebook, the current notebook format (v%2) will be used.\nSome features of the original notebook may not be available.' To preserve the original format version,\nclose the notebook without saving it.`, origNbformat, this._nbformat);\n            }\n            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                title: this._trans.__('Notebook converted'),\n                body: msg,\n                buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({ label: this._trans.__('Ok') })]\n            });\n        }\n        // Update the metadata.\n        this.metadata.clear();\n        const metadata = value.metadata;\n        for (const key in metadata) {\n            // orig_nbformat is not intended to be stored per spec.\n            if (key === 'orig_nbformat') {\n                continue;\n            }\n            this.metadata.set(key, metadata[key]);\n        }\n        this._ensureMetadata();\n        this.dirty = true;\n    }\n    /**\n     * Initialize the model with its current state.\n     *\n     * # Notes\n     * Adds an empty code cell if the model is empty\n     * and clears undo state.\n     */\n    initialize() {\n        if (!this.cells.length) {\n            const factory = this.contentFactory;\n            this.cells.push(factory.createCodeCell({}));\n        }\n        this._isInitialized = true;\n        this.cells.clearUndo();\n    }\n    /**\n     * Handle a change in the cells list.\n     */\n    _onCellsChanged(list, change) {\n        switch (change.type) {\n            case 'add':\n                change.newValues.forEach(cell => {\n                    cell.contentChanged.connect(this.triggerContentChange, this);\n                });\n                break;\n            case 'remove':\n                break;\n            case 'set':\n                change.newValues.forEach(cell => {\n                    cell.contentChanged.connect(this.triggerContentChange, this);\n                });\n                break;\n            default:\n                break;\n        }\n        this.triggerContentChange();\n    }\n    _onStateChanged(sender, changes) {\n        if (changes.stateChange) {\n            changes.stateChange.forEach(value => {\n                if (value.name === 'nbformat') {\n                    this._nbformat = value.newValue;\n                }\n                if (value.name === 'nbformatMinor') {\n                    this._nbformatMinor = value.newValue;\n                }\n                if (value.name === 'dirty') {\n                    this._dirty = value.newValue;\n                }\n                this.triggerStateChange(value);\n            });\n        }\n    }\n    /**\n     * Make sure we have the required metadata fields.\n     */\n    _ensureMetadata() {\n        const metadata = this.metadata;\n        if (!metadata.has('language_info')) {\n            metadata.set('language_info', { name: '' });\n        }\n        if (!metadata.has('kernelspec')) {\n            metadata.set('kernelspec', { name: '', display_name: '' });\n        }\n    }\n    /**\n     * Trigger a state change signal.\n     */\n    triggerStateChange(args) {\n        this._stateChanged.emit(args);\n    }\n    /**\n     * Trigger a content changed signal.\n     */\n    triggerContentChange() {\n        this._contentChanged.emit(void 0);\n        this.dirty = true;\n    }\n    /**\n     * Whether the model is disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n}\n/**\n * The namespace for the `NotebookModel` class statics.\n */\n(function (NotebookModel) {\n    /**\n     * The default implementation of an `IContentFactory`.\n     */\n    class ContentFactory {\n        /**\n         * Create a new cell model factory.\n         */\n        constructor(options) {\n            this.codeCellContentFactory =\n                options.codeCellContentFactory || _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.CodeCellModel.defaultContentFactory;\n            this.modelDB = options.modelDB;\n        }\n        /**\n         * Create a new cell by cell type.\n         *\n         * @param type:  the type of the cell to create.\n         *\n         * @param options: the cell creation options.\n         *\n         * #### Notes\n         * This method is intended to be a convenience method to programmatically\n         * call the other cell creation methods in the factory.\n         */\n        createCell(type, options) {\n            switch (type) {\n                case 'code':\n                    return this.createCodeCell(options);\n                case 'markdown':\n                    return this.createMarkdownCell(options);\n                case 'raw':\n                default:\n                    return this.createRawCell(options);\n            }\n        }\n        /**\n         * Create a new code cell.\n         *\n         * @param source - The data to use for the original source data.\n         *\n         * @returns A new code cell. If a source cell is provided, the\n         *   new cell will be initialized with the data from the source.\n         *   If the contentFactory is not provided, the instance\n         *   `codeCellContentFactory` will be used.\n         */\n        createCodeCell(options) {\n            if (options.contentFactory) {\n                options.contentFactory = this.codeCellContentFactory;\n            }\n            if (this.modelDB) {\n                if (!options.id) {\n                    options.id = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__.UUID.uuid4();\n                }\n                options.modelDB = this.modelDB.view(options.id);\n            }\n            return new _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.CodeCellModel(options);\n        }\n        /**\n         * Create a new markdown cell.\n         *\n         * @param source - The data to use for the original source data.\n         *\n         * @returns A new markdown cell. If a source cell is provided, the\n         *   new cell will be initialized with the data from the source.\n         */\n        createMarkdownCell(options) {\n            if (this.modelDB) {\n                if (!options.id) {\n                    options.id = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__.UUID.uuid4();\n                }\n                options.modelDB = this.modelDB.view(options.id);\n            }\n            return new _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.MarkdownCellModel(options);\n        }\n        /**\n         * Create a new raw cell.\n         *\n         * @param source - The data to use for the original source data.\n         *\n         * @returns A new raw cell. If a source cell is provided, the\n         *   new cell will be initialized with the data from the source.\n         */\n        createRawCell(options) {\n            if (this.modelDB) {\n                if (!options.id) {\n                    options.id = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__.UUID.uuid4();\n                }\n                options.modelDB = this.modelDB.view(options.id);\n            }\n            return new _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.RawCellModel(options);\n        }\n        /**\n         * Clone the content factory with a new IModelDB.\n         */\n        clone(modelDB) {\n            return new ContentFactory({\n                modelDB: modelDB,\n                codeCellContentFactory: this.codeCellContentFactory\n            });\n        }\n    }\n    NotebookModel.ContentFactory = ContentFactory;\n    /**\n     * The default `ContentFactory` instance.\n     */\n    NotebookModel.defaultContentFactory = new ContentFactory({});\n})(NotebookModel || (NotebookModel = {}));\n//# sourceMappingURL=model.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/model.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/modelfactory.js":
/*!****************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/modelfactory.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookModelFactory\": () => (/* binding */ NotebookModelFactory)\n/* harmony export */ });\n/* harmony import */ var _model__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./model */ \"../node_modules/@jupyterlab/notebook/lib/model.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * A model factory for notebooks.\n */\nclass NotebookModelFactory {\n    /**\n     * Construct a new notebook model factory.\n     */\n    constructor(options) {\n        this._disposed = false;\n        const codeCellContentFactory = options.codeCellContentFactory;\n        this.contentFactory =\n            options.contentFactory ||\n                new _model__WEBPACK_IMPORTED_MODULE_0__.NotebookModel.ContentFactory({ codeCellContentFactory });\n    }\n    /**\n     * The name of the model.\n     */\n    get name() {\n        return 'notebook';\n    }\n    /**\n     * The content type of the file.\n     */\n    get contentType() {\n        return 'notebook';\n    }\n    /**\n     * The format of the file.\n     */\n    get fileFormat() {\n        return 'json';\n    }\n    /**\n     * Get whether the model factory has been disposed.\n     */\n    get isDisposed() {\n        return this._disposed;\n    }\n    /**\n     * Dispose of the model factory.\n     */\n    dispose() {\n        this._disposed = true;\n    }\n    /**\n     * Create a new model for a given path.\n     *\n     * @param languagePreference - An optional kernel language preference.\n     *\n     * @returns A new document model.\n     */\n    createNew(languagePreference, modelDB, isInitialized) {\n        const contentFactory = this.contentFactory;\n        return new _model__WEBPACK_IMPORTED_MODULE_0__.NotebookModel({\n            languagePreference,\n            contentFactory,\n            modelDB,\n            isInitialized\n        });\n    }\n    /**\n     * Get the preferred kernel language given a path.\n     */\n    preferredLanguage(path) {\n        return '';\n    }\n}\n//# sourceMappingURL=modelfactory.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/modelfactory.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/modestatus.js":
/*!**************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/modestatus.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"CommandEditStatus\": () => (/* binding */ CommandEditStatus)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/statusbar */ \"webpack/sharing/consume/default/@jupyterlab/statusbar/@jupyterlab/statusbar\");\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n/**\n * A pure function for rendering a Command/Edit mode component.\n *\n * @param props: the props for rendering the component.\n *\n * @returns a tsx component for command/edit mode.\n */\nfunction CommandEditComponent(props) {\n    const trans = (props.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator).load('jupyterlab');\n    return (react__WEBPACK_IMPORTED_MODULE_3__.createElement(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_1__.TextItem, { source: trans.__('Mode: %1', props.modeNames[props.notebookMode]) }));\n}\n/**\n * StatusBar item to display which notebook mode user is in.\n */\nclass CommandEditStatus extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.VDomRenderer {\n    /**\n     * Construct a new CommandEdit status item.\n     */\n    constructor(translator) {\n        super(new CommandEditStatus.Model());\n        this.translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        this._trans = this.translator.load('jupyterlab');\n        this._modeNames = {\n            command: this._trans.__('Command'),\n            edit: this._trans.__('Edit')\n        };\n    }\n    /**\n     * Render the CommandEdit status item.\n     */\n    render() {\n        if (!this.model) {\n            return null;\n        }\n        this.node.title = this._trans.__('Notebook is in %1 mode', this._modeNames[this.model.notebookMode]);\n        return (react__WEBPACK_IMPORTED_MODULE_3__.createElement(CommandEditComponent, { notebookMode: this.model.notebookMode, translator: this.translator, modeNames: this._modeNames }));\n    }\n}\n/**\n * A namespace for CommandEdit statics.\n */\n(function (CommandEditStatus) {\n    /**\n     * A VDomModel for the CommandEdit renderer.\n     */\n    class Model extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.VDomModel {\n        constructor() {\n            super(...arguments);\n            /**\n             * On a change to the notebook, update the mode.\n             */\n            this._onChanged = (_notebook) => {\n                const oldMode = this._notebookMode;\n                if (this._notebook) {\n                    this._notebookMode = _notebook.mode;\n                }\n                else {\n                    this._notebookMode = 'command';\n                }\n                this._triggerChange(oldMode, this._notebookMode);\n            };\n            this._notebookMode = 'command';\n            this._notebook = null;\n        }\n        /**\n         * The current mode of the current notebook.\n         */\n        get notebookMode() {\n            return this._notebookMode;\n        }\n        /**\n         * Set the current notebook for the model.\n         */\n        set notebook(notebook) {\n            const oldNotebook = this._notebook;\n            if (oldNotebook !== null) {\n                oldNotebook.stateChanged.disconnect(this._onChanged, this);\n                oldNotebook.activeCellChanged.disconnect(this._onChanged, this);\n                oldNotebook.modelContentChanged.disconnect(this._onChanged, this);\n            }\n            const oldMode = this._notebookMode;\n            this._notebook = notebook;\n            if (this._notebook === null) {\n                this._notebookMode = 'command';\n            }\n            else {\n                this._notebookMode = this._notebook.mode;\n                this._notebook.stateChanged.connect(this._onChanged, this);\n                this._notebook.activeCellChanged.connect(this._onChanged, this);\n                this._notebook.modelContentChanged.connect(this._onChanged, this);\n            }\n            this._triggerChange(oldMode, this._notebookMode);\n        }\n        /**\n         * Trigger a state change for the renderer.\n         */\n        _triggerChange(oldState, newState) {\n            if (oldState !== newState) {\n                this.stateChanged.emit(void 0);\n            }\n        }\n    }\n    CommandEditStatus.Model = Model;\n})(CommandEditStatus || (CommandEditStatus = {}));\n//# sourceMappingURL=modestatus.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/modestatus.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/notebooktools.js":
/*!*****************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/notebooktools.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookTools\": () => (/* binding */ NotebookTools)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/codeeditor */ \"webpack/sharing/consume/default/@jupyterlab/codeeditor/@jupyterlab/codeeditor\");\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/observables */ \"webpack/sharing/consume/default/@jupyterlab/observables/@jupyterlab/observables\");\n/* harmony import */ var _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_observables__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/messaging */ \"webpack/sharing/consume/default/@lumino/messaging/@lumino/messaging\");\n/* harmony import */ var _lumino_messaging__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_messaging__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/virtualdom */ \"webpack/sharing/consume/default/@lumino/virtualdom/@lumino/virtualdom\");\n/* harmony import */ var _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_7__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n\n\n\nclass RankedPanel extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget {\n    constructor() {\n        super();\n        this._items = [];\n        this.layout = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.PanelLayout();\n        this.addClass('jp-RankedPanel');\n    }\n    addWidget(widget, rank) {\n        const rankItem = { widget, rank };\n        const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.ArrayExt.upperBound(this._items, rankItem, Private.itemCmp);\n        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.ArrayExt.insert(this._items, index, rankItem);\n        const layout = this.layout;\n        layout.insertWidget(index, widget);\n    }\n    /**\n     * Handle the removal of a child\n     *\n     */\n    onChildRemoved(msg) {\n        const index = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.ArrayExt.findFirstIndex(this._items, item => item.widget === msg.child);\n        if (index !== -1) {\n            _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.ArrayExt.removeAt(this._items, index);\n        }\n    }\n}\n/**\n * A widget that provides metadata tools.\n */\nclass NotebookTools extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget {\n    /**\n     * Construct a new NotebookTools object.\n     */\n    constructor(options) {\n        super();\n        this.addClass('jp-NotebookTools');\n        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator;\n        this._trans = this.translator.load('jupyterlab');\n        this._commonTools = new RankedPanel();\n        this._advancedTools = new RankedPanel();\n        this._advancedTools.title.label = this._trans.__('Advanced Tools');\n        const layout = (this.layout = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.PanelLayout());\n        layout.addWidget(this._commonTools);\n        layout.addWidget(new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Collapse({ widget: this._advancedTools }));\n        this._tracker = options.tracker;\n        this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged, this);\n        this._tracker.activeCellChanged.connect(this._onActiveCellChanged, this);\n        this._tracker.selectionChanged.connect(this._onSelectionChanged, this);\n        this._onActiveNotebookPanelChanged();\n        this._onActiveCellChanged();\n        this._onSelectionChanged();\n    }\n    /**\n     * The active cell widget.\n     */\n    get activeCell() {\n        return this._tracker.activeCell;\n    }\n    /**\n     * The currently selected cells.\n     */\n    get selectedCells() {\n        const panel = this._tracker.currentWidget;\n        if (!panel) {\n            return [];\n        }\n        const notebook = panel.content;\n        return notebook.widgets.filter(cell => notebook.isSelectedOrActive(cell));\n    }\n    /**\n     * The current notebook.\n     */\n    get activeNotebookPanel() {\n        return this._tracker.currentWidget;\n    }\n    /**\n     * Add a cell tool item.\n     */\n    addItem(options) {\n        var _a;\n        const tool = options.tool;\n        const rank = (_a = options.rank) !== null && _a !== void 0 ? _a : 100;\n        let section;\n        if (options.section === 'advanced') {\n            section = this._advancedTools;\n        }\n        else {\n            section = this._commonTools;\n        }\n        tool.addClass('jp-NotebookTools-tool');\n        section.addWidget(tool, rank);\n        // TODO: perhaps the necessary notebookTools functionality should be\n        // consolidated into a single object, rather than a broad reference to this.\n        tool.notebookTools = this;\n        // Trigger the tool to update its active notebook and cell.\n        _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(tool, NotebookTools.ActiveNotebookPanelMessage);\n        _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(tool, NotebookTools.ActiveCellMessage);\n    }\n    /**\n     * Handle a change to the notebook panel.\n     */\n    _onActiveNotebookPanelChanged() {\n        if (this._prevActiveNotebookModel &&\n            !this._prevActiveNotebookModel.isDisposed) {\n            this._prevActiveNotebookModel.metadata.changed.disconnect(this._onActiveNotebookPanelMetadataChanged, this);\n        }\n        const activeNBModel = this.activeNotebookPanel && this.activeNotebookPanel.content\n            ? this.activeNotebookPanel.content.model\n            : null;\n        this._prevActiveNotebookModel = activeNBModel;\n        if (activeNBModel) {\n            activeNBModel.metadata.changed.connect(this._onActiveNotebookPanelMetadataChanged, this);\n        }\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.each)(this._toolChildren(), widget => {\n            _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(widget, NotebookTools.ActiveNotebookPanelMessage);\n        });\n    }\n    /**\n     * Handle a change to the active cell.\n     */\n    _onActiveCellChanged() {\n        if (this._prevActiveCell && !this._prevActiveCell.isDisposed) {\n            this._prevActiveCell.metadata.changed.disconnect(this._onActiveCellMetadataChanged, this);\n        }\n        const activeCell = this.activeCell ? this.activeCell.model : null;\n        this._prevActiveCell = activeCell;\n        if (activeCell) {\n            activeCell.metadata.changed.connect(this._onActiveCellMetadataChanged, this);\n        }\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.each)(this._toolChildren(), widget => {\n            _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(widget, NotebookTools.ActiveCellMessage);\n        });\n    }\n    /**\n     * Handle a change in the selection.\n     */\n    _onSelectionChanged() {\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.each)(this._toolChildren(), widget => {\n            _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(widget, NotebookTools.SelectionMessage);\n        });\n    }\n    /**\n     * Handle a change in the active cell metadata.\n     */\n    _onActiveNotebookPanelMetadataChanged(sender, args) {\n        const message = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_2__.ObservableJSON.ChangeMessage('activenotebookpanel-metadata-changed', args);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.each)(this._toolChildren(), widget => {\n            _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(widget, message);\n        });\n    }\n    /**\n     * Handle a change in the notebook model metadata.\n     */\n    _onActiveCellMetadataChanged(sender, args) {\n        const message = new _jupyterlab_observables__WEBPACK_IMPORTED_MODULE_2__.ObservableJSON.ChangeMessage('activecell-metadata-changed', args);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.each)(this._toolChildren(), widget => {\n            _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.sendMessage(widget, message);\n        });\n    }\n    _toolChildren() {\n        return (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.chain)(this._commonTools.children(), this._advancedTools.children());\n    }\n}\n/**\n * The namespace for NotebookTools class statics.\n */\n(function (NotebookTools) {\n    /**\n     * A singleton conflatable `'activenotebookpanel-changed'` message.\n     */\n    NotebookTools.ActiveNotebookPanelMessage = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.ConflatableMessage('activenotebookpanel-changed');\n    /**\n     * A singleton conflatable `'activecell-changed'` message.\n     */\n    NotebookTools.ActiveCellMessage = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.ConflatableMessage('activecell-changed');\n    /**\n     * A singleton conflatable `'selection-changed'` message.\n     */\n    NotebookTools.SelectionMessage = new _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.ConflatableMessage('selection-changed');\n    /**\n     * The base notebook tool, meant to be subclassed.\n     */\n    class Tool extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget {\n        dispose() {\n            super.dispose();\n            if (this.notebookTools) {\n                this.notebookTools = null;\n            }\n        }\n        /**\n         * Process a message sent to the widget.\n         *\n         * @param msg - The message sent to the widget.\n         */\n        processMessage(msg) {\n            super.processMessage(msg);\n            switch (msg.type) {\n                case 'activenotebookpanel-changed':\n                    this.onActiveNotebookPanelChanged(msg);\n                    break;\n                case 'activecell-changed':\n                    this.onActiveCellChanged(msg);\n                    break;\n                case 'selection-changed':\n                    this.onSelectionChanged(msg);\n                    break;\n                case 'activecell-metadata-changed':\n                    this.onActiveCellMetadataChanged(msg);\n                    break;\n                case 'activenotebookpanel-metadata-changed':\n                    this.onActiveNotebookPanelMetadataChanged(msg);\n                    break;\n                default:\n                    break;\n            }\n        }\n        /**\n         * Handle a change to the notebook panel.\n         *\n         * #### Notes\n         * The default implementation is a no-op.\n         */\n        onActiveNotebookPanelChanged(msg) {\n            /* no-op */\n        }\n        /**\n         * Handle a change to the active cell.\n         *\n         * #### Notes\n         * The default implementation is a no-op.\n         */\n        onActiveCellChanged(msg) {\n            /* no-op */\n        }\n        /**\n         * Handle a change to the selection.\n         *\n         * #### Notes\n         * The default implementation is a no-op.\n         */\n        onSelectionChanged(msg) {\n            /* no-op */\n        }\n        /**\n         * Handle a change to the metadata of the active cell.\n         *\n         * #### Notes\n         * The default implementation is a no-op.\n         */\n        onActiveCellMetadataChanged(msg) {\n            /* no-op */\n        }\n        /**\n         * Handle a change to the metadata of the active cell.\n         *\n         * #### Notes\n         * The default implementation is a no-op.\n         */\n        onActiveNotebookPanelMetadataChanged(msg) {\n            /* no-op */\n        }\n    }\n    NotebookTools.Tool = Tool;\n    /**\n     * A cell tool displaying the active cell contents.\n     */\n    class ActiveCellTool extends Tool {\n        /**\n         * Construct a new active cell tool.\n         */\n        constructor() {\n            super();\n            this._model = new _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.CodeEditor.Model();\n            this.addClass('jp-ActiveCellTool');\n            this.addClass('jp-InputArea');\n            this.layout = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.PanelLayout();\n        }\n        /**\n         * Dispose of the resources used by the tool.\n         */\n        dispose() {\n            if (this._model === null) {\n                return;\n            }\n            this._model.dispose();\n            this._model = null;\n            super.dispose();\n        }\n        /**\n         * Handle a change to the active cell.\n         */\n        onActiveCellChanged() {\n            const activeCell = this.notebookTools.activeCell;\n            const layout = this.layout;\n            const count = layout.widgets.length;\n            for (let i = 0; i < count; i++) {\n                layout.widgets[0].dispose();\n            }\n            if (this._cellModel && !this._cellModel.isDisposed) {\n                this._cellModel.value.changed.disconnect(this._onValueChanged, this);\n                this._cellModel.mimeTypeChanged.disconnect(this._onMimeTypeChanged, this);\n            }\n            if (!activeCell) {\n                const cell = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget();\n                cell.addClass('jp-InputArea-editor');\n                cell.addClass('jp-InputArea-editor');\n                layout.addWidget(cell);\n                this._cellModel = null;\n                return;\n            }\n            const promptNode = activeCell.promptNode\n                ? activeCell.promptNode.cloneNode(true)\n                : undefined;\n            const prompt = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget({ node: promptNode });\n            const factory = activeCell.contentFactory.editorFactory;\n            const cellModel = (this._cellModel = activeCell.model);\n            cellModel.value.changed.connect(this._onValueChanged, this);\n            cellModel.mimeTypeChanged.connect(this._onMimeTypeChanged, this);\n            this._model.value.text = cellModel.value.text.split('\\n')[0];\n            this._model.mimeType = cellModel.mimeType;\n            const model = this._model;\n            const editorWidget = new _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.CodeEditorWrapper({ model, factory });\n            editorWidget.addClass('jp-InputArea-editor');\n            editorWidget.addClass('jp-InputArea-editor');\n            editorWidget.editor.setOption('readOnly', true);\n            layout.addWidget(prompt);\n            layout.addWidget(editorWidget);\n        }\n        /**\n         * Handle a change to the current editor value.\n         */\n        _onValueChanged() {\n            this._model.value.text = this._cellModel.value.text.split('\\n')[0];\n        }\n        /**\n         * Handle a change to the current editor mimetype.\n         */\n        _onMimeTypeChanged() {\n            this._model.mimeType = this._cellModel.mimeType;\n        }\n    }\n    NotebookTools.ActiveCellTool = ActiveCellTool;\n    /**\n     * A raw metadata editor.\n     */\n    class MetadataEditorTool extends Tool {\n        /**\n         * Construct a new raw metadata tool.\n         */\n        constructor(options) {\n            super();\n            const { editorFactory } = options;\n            this.addClass('jp-MetadataEditorTool');\n            const layout = (this.layout = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.PanelLayout());\n            this.editor = new _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.JSONEditor({\n                editorFactory\n            });\n            this.editor.title.label = options.label || 'Edit Metadata';\n            const titleNode = new _lumino_widgets__WEBPACK_IMPORTED_MODULE_7__.Widget({ node: document.createElement('label') });\n            titleNode.node.textContent = options.label || 'Edit Metadata';\n            layout.addWidget(titleNode);\n            layout.addWidget(this.editor);\n        }\n    }\n    NotebookTools.MetadataEditorTool = MetadataEditorTool;\n    /**\n     * A notebook metadata editor\n     */\n    class NotebookMetadataEditorTool extends MetadataEditorTool {\n        constructor(options) {\n            const translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator;\n            const trans = translator.load('jupyterlab');\n            options.label = options.label || trans.__('Notebook Metadata');\n            super(options);\n        }\n        /**\n         * Handle a change to the notebook.\n         */\n        onActiveNotebookPanelChanged(msg) {\n            this._update();\n        }\n        /**\n         * Handle a change to the notebook metadata.\n         */\n        onActiveNotebookPanelMetadataChanged(msg) {\n            this._update();\n        }\n        _update() {\n            var _a, _b;\n            const nb = this.notebookTools.activeNotebookPanel &&\n                this.notebookTools.activeNotebookPanel.content;\n            this.editor.source = (_b = (_a = nb === null || nb === void 0 ? void 0 : nb.model) === null || _a === void 0 ? void 0 : _a.metadata) !== null && _b !== void 0 ? _b : null;\n        }\n    }\n    NotebookTools.NotebookMetadataEditorTool = NotebookMetadataEditorTool;\n    /**\n     * A cell metadata editor\n     */\n    class CellMetadataEditorTool extends MetadataEditorTool {\n        constructor(options) {\n            const translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator;\n            const trans = translator.load('jupyterlab');\n            options.label = options.label || trans.__('Cell Metadata');\n            super(options);\n        }\n        /**\n         * Handle a change to the active cell.\n         */\n        onActiveCellChanged(msg) {\n            this._update();\n        }\n        /**\n         * Handle a change to the active cell metadata.\n         */\n        onActiveCellMetadataChanged(msg) {\n            this._update();\n        }\n        _update() {\n            const cell = this.notebookTools.activeCell;\n            this.editor.source = cell ? cell.model.metadata : null;\n        }\n    }\n    NotebookTools.CellMetadataEditorTool = CellMetadataEditorTool;\n    /**\n     * A cell tool that provides a selection for a given metadata key.\n     */\n    class KeySelector extends Tool {\n        /**\n         * Construct a new KeySelector.\n         */\n        constructor(options) {\n            // TODO: use react\n            super({ node: Private.createSelectorNode(options) });\n            /**\n             * Get the value for the data.\n             */\n            this._getValue = (cell) => {\n                let value = cell.model.metadata.get(this.key);\n                if (value === undefined) {\n                    value = this._default;\n                }\n                return value;\n            };\n            /**\n             * Set the value for the data.\n             */\n            this._setValue = (cell, value) => {\n                if (value === this._default) {\n                    cell.model.metadata.delete(this.key);\n                }\n                else {\n                    cell.model.metadata.set(this.key, value);\n                }\n            };\n            this._changeGuard = false;\n            this.addClass('jp-KeySelector');\n            this.key = options.key;\n            this._default = options.default;\n            this._validCellTypes = options.validCellTypes || [];\n            this._getter = options.getter || this._getValue;\n            this._setter = options.setter || this._setValue;\n        }\n        /**\n         * The select node for the widget.\n         */\n        get selectNode() {\n            return this.node.getElementsByTagName('select')[0];\n        }\n        /**\n         * Handle the DOM events for the widget.\n         *\n         * @param event - The DOM event sent to the widget.\n         *\n         * #### Notes\n         * This method implements the DOM `EventListener` interface and is\n         * called in response to events on the notebook panel's node. It should\n         * not be called directly by user code.\n         */\n        handleEvent(event) {\n            switch (event.type) {\n                case 'change':\n                    this.onValueChanged();\n                    break;\n                default:\n                    break;\n            }\n        }\n        /**\n         * Handle `after-attach` messages for the widget.\n         */\n        onAfterAttach(msg) {\n            const node = this.selectNode;\n            node.addEventListener('change', this);\n        }\n        /**\n         * Handle `before-detach` messages for the widget.\n         */\n        onBeforeDetach(msg) {\n            const node = this.selectNode;\n            node.removeEventListener('change', this);\n        }\n        /**\n         * Handle a change to the active cell.\n         */\n        onActiveCellChanged(msg) {\n            const select = this.selectNode;\n            const activeCell = this.notebookTools.activeCell;\n            if (!activeCell) {\n                select.disabled = true;\n                select.value = '';\n                return;\n            }\n            const cellType = activeCell.model.type;\n            if (this._validCellTypes.length &&\n                this._validCellTypes.indexOf(cellType) === -1) {\n                select.value = '';\n                select.disabled = true;\n                return;\n            }\n            select.disabled = false;\n            this._changeGuard = true;\n            const getter = this._getter;\n            select.value = JSON.stringify(getter(activeCell));\n            this._changeGuard = false;\n        }\n        /**\n         * Handle a change to the metadata of the active cell.\n         */\n        onActiveCellMetadataChanged(msg) {\n            if (this._changeGuard) {\n                return;\n            }\n            const select = this.selectNode;\n            const cell = this.notebookTools.activeCell;\n            if (msg.args.key === this.key && cell) {\n                this._changeGuard = true;\n                const getter = this._getter;\n                select.value = JSON.stringify(getter(cell));\n                this._changeGuard = false;\n            }\n        }\n        /**\n         * Handle a change to the value.\n         */\n        onValueChanged() {\n            const activeCell = this.notebookTools.activeCell;\n            if (!activeCell || this._changeGuard) {\n                return;\n            }\n            this._changeGuard = true;\n            const select = this.selectNode;\n            const setter = this._setter;\n            setter(activeCell, JSON.parse(select.value));\n            this._changeGuard = false;\n        }\n    }\n    NotebookTools.KeySelector = KeySelector;\n    /**\n     * Create a slideshow selector.\n     */\n    function createSlideShowSelector(translator) {\n        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        trans.__('');\n        const options = {\n            key: 'slideshow',\n            title: trans.__('Slide Type'),\n            optionValueArray: [\n                ['-', null],\n                [trans.__('Slide'), 'slide'],\n                [trans.__('Sub-Slide'), 'subslide'],\n                [trans.__('Fragment'), 'fragment'],\n                [trans.__('Skip'), 'skip'],\n                [trans.__('Notes'), 'notes']\n            ],\n            getter: cell => {\n                const value = cell.model.metadata.get('slideshow');\n                return value && value['slide_type'];\n            },\n            setter: (cell, value) => {\n                let data = cell.model.metadata.get('slideshow') || Object.create(null);\n                if (value === null) {\n                    // Make a shallow copy so we aren't modifying the original metadata.\n                    data = Object.assign({}, data);\n                    delete data.slide_type;\n                }\n                else {\n                    data = Object.assign(Object.assign({}, data), { slide_type: value });\n                }\n                if (Object.keys(data).length > 0) {\n                    cell.model.metadata.set('slideshow', data);\n                }\n                else {\n                    cell.model.metadata.delete('slideshow');\n                }\n            }\n        };\n        return new KeySelector(options);\n    }\n    NotebookTools.createSlideShowSelector = createSlideShowSelector;\n    /**\n     * Create an nbconvert selector.\n     */\n    function createNBConvertSelector(optionValueArray, translator) {\n        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        return new KeySelector({\n            key: 'raw_mimetype',\n            title: trans.__('Raw NBConvert Format'),\n            optionValueArray: optionValueArray,\n            validCellTypes: ['raw']\n        });\n    }\n    NotebookTools.createNBConvertSelector = createNBConvertSelector;\n})(NotebookTools || (NotebookTools = {}));\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * A comparator function for widget rank items.\n     */\n    function itemCmp(first, second) {\n        return first.rank - second.rank;\n    }\n    Private.itemCmp = itemCmp;\n    /**\n     * Create the node for a KeySelector.\n     */\n    function createSelectorNode(options) {\n        const name = options.key;\n        const title = options.title || name[0].toLocaleUpperCase() + name.slice(1);\n        const optionNodes = [];\n        let value;\n        let option;\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.each)(options.optionValueArray, item => {\n            option = item[0];\n            value = JSON.stringify(item[1]);\n            optionNodes.push(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__.h.option({ value }, option));\n        });\n        const node = _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__.VirtualDOM.realize(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__.h.div({}, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__.h.label(title, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_6__.h.select({}, optionNodes))));\n        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Styling.styleNode(node);\n        return node;\n    }\n    Private.createSelectorNode = createSelectorNode;\n})(Private || (Private = {}));\n//# sourceMappingURL=notebooktools.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/notebooktools.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/panel.js":
/*!*********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/panel.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookPanel\": () => (/* binding */ NotebookPanel)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/cells */ \"webpack/sharing/consume/default/@jupyterlab/cells/@jupyterlab/cells\");\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/docregistry */ \"webpack/sharing/consume/default/@jupyterlab/docregistry/@jupyterlab/docregistry\");\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./widget */ \"../node_modules/@jupyterlab/notebook/lib/widget.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n\n\n\n/**\n * The class name added to notebook panels.\n */\nconst NOTEBOOK_PANEL_CLASS = 'jp-NotebookPanel';\nconst NOTEBOOK_PANEL_TOOLBAR_CLASS = 'jp-NotebookPanel-toolbar';\nconst NOTEBOOK_PANEL_NOTEBOOK_CLASS = 'jp-NotebookPanel-notebook';\n/**\n * The class name to add when the document is loaded for the search box.\n */\nconst SEARCH_DOCUMENT_LOADED_CLASS = 'jp-DocumentSearch-document-loaded';\n/**\n * A widget that hosts a notebook toolbar and content area.\n *\n * #### Notes\n * The widget keeps the document metadata in sync with the current\n * kernel on the context.\n */\nclass NotebookPanel extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_3__.DocumentWidget {\n    /**\n     * Construct a new notebook panel.\n     */\n    constructor(options) {\n        super(options);\n        /**\n         * Whether we are currently in a series of autorestarts we have already\n         * notified the user about.\n         */\n        this._autorestarting = false;\n        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_4__.nullTranslator;\n        this._trans = this.translator.load('jupyterlab');\n        // Set up CSS classes\n        this.addClass(NOTEBOOK_PANEL_CLASS);\n        this.toolbar.addClass(NOTEBOOK_PANEL_TOOLBAR_CLASS);\n        this.content.addClass(NOTEBOOK_PANEL_NOTEBOOK_CLASS);\n        // Set up things related to the context\n        this.content.model = this.context.model;\n        this.context.sessionContext.kernelChanged.connect(this._onKernelChanged, this);\n        this.context.sessionContext.statusChanged.connect(this._onSessionStatusChanged, this);\n        this.content.fullyRendered.connect(this._onFullyRendered, this);\n        this.context.saveState.connect(this._onSave, this);\n        void this.revealed.then(() => {\n            if (this.isDisposed) {\n                // this widget has already been disposed, bail\n                return;\n            }\n            // Set the document edit mode on initial open if it looks like a new document.\n            if (this.content.widgets.length === 1) {\n                const cellModel = this.content.widgets[0].model;\n                if (cellModel.type === 'code' && cellModel.value.text === '') {\n                    this.content.mode = 'edit';\n                }\n            }\n        });\n    }\n    _onSave(sender, state) {\n        if (state === 'started' && this.model) {\n            // Find markdown cells\n            const { cells } = this.model;\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_5__.each)(cells, cell => {\n                if ((0,_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_1__.isMarkdownCellModel)(cell)) {\n                    for (const key of cell.attachments.keys) {\n                        if (!cell.value.text.includes(key)) {\n                            cell.attachments.remove(key);\n                        }\n                    }\n                }\n            });\n        }\n    }\n    /**\n     * The session context used by the panel.\n     */\n    get sessionContext() {\n        return this.context.sessionContext;\n    }\n    /**\n     * The model for the widget.\n     */\n    get model() {\n        return this.content.model;\n    }\n    /**\n     * Update the options for the current notebook panel.\n     *\n     * @param config new options to set\n     */\n    setConfig(config) {\n        this.content.editorConfig = config.editorConfig;\n        this.content.notebookConfig = config.notebookConfig;\n        // Update kernel shutdown behavior\n        const kernelPreference = this.context.sessionContext.kernelPreference;\n        this.context.sessionContext.kernelPreference = Object.assign(Object.assign({}, kernelPreference), { shutdownOnDispose: config.kernelShutdown });\n    }\n    /**\n     * Set URI fragment identifier.\n     */\n    setFragment(fragment) {\n        void this.context.ready.then(() => {\n            this.content.setFragment(fragment);\n        });\n    }\n    /**\n     * Dispose of the resources used by the widget.\n     */\n    dispose() {\n        this.content.dispose();\n        super.dispose();\n    }\n    /**\n     * Prints the notebook by converting to HTML with nbconvert.\n     */\n    [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Printing.symbol]() {\n        return async () => {\n            // Save before generating HTML\n            if (this.context.model.dirty && !this.context.model.readOnly) {\n                await this.context.save();\n            }\n            await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Printing.printURL(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PageConfig.getNBConvertURL({\n                format: 'html',\n                download: false,\n                path: this.context.path\n            }));\n        };\n    }\n    /**\n     * Handle a fully rendered signal notebook.\n     */\n    _onFullyRendered(notebook, fullyRendered) {\n        fullyRendered\n            ? this.removeClass(SEARCH_DOCUMENT_LOADED_CLASS)\n            : this.addClass(SEARCH_DOCUMENT_LOADED_CLASS);\n    }\n    /**\n     * Handle a change in the kernel by updating the document metadata.\n     */\n    _onKernelChanged(sender, args) {\n        if (!this.model || !args.newValue) {\n            return;\n        }\n        const { newValue } = args;\n        void newValue.info.then(info => {\n            var _a;\n            if (this.model &&\n                ((_a = this.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel) === newValue) {\n                this._updateLanguage(info.language_info);\n            }\n        });\n        void this._updateSpec(newValue);\n    }\n    _onSessionStatusChanged(sender, status) {\n        var _a;\n        // If the status is autorestarting, and we aren't already in a series of\n        // autorestarts, show the dialog.\n        if (status === 'autorestarting' && !this._autorestarting) {\n            // The kernel died and the server is restarting it. We notify the user so\n            // they know why their kernel state is gone.\n            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                title: this._trans.__('Kernel Restarting'),\n                body: this._trans.__('The kernel for %1 appears to have died. It will restart automatically.', (_a = this.sessionContext.session) === null || _a === void 0 ? void 0 : _a.path),\n                buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({ label: this._trans.__('Ok') })]\n            });\n            this._autorestarting = true;\n        }\n        else if (status === 'restarting') {\n            // Another autorestart attempt will first change the status to\n            // restarting, then to autorestarting again, so we don't reset the\n            // autorestarting status if the status is 'restarting'.\n            /* no-op */\n        }\n        else {\n            this._autorestarting = false;\n        }\n    }\n    /**\n     * Update the kernel language.\n     */\n    _updateLanguage(language) {\n        this.model.metadata.set('language_info', language);\n    }\n    /**\n     * Update the kernel spec.\n     */\n    async _updateSpec(kernel) {\n        const spec = await kernel.spec;\n        if (this.isDisposed) {\n            return;\n        }\n        this.model.metadata.set('kernelspec', {\n            name: kernel.name,\n            display_name: spec === null || spec === void 0 ? void 0 : spec.display_name,\n            language: spec === null || spec === void 0 ? void 0 : spec.language\n        });\n    }\n}\n/**\n * A namespace for `NotebookPanel` statics.\n */\n(function (NotebookPanel) {\n    /**\n     * The default implementation of an `IContentFactory`.\n     */\n    class ContentFactory extends _widget__WEBPACK_IMPORTED_MODULE_7__.Notebook.ContentFactory {\n        /**\n         * Create a new content area for the panel.\n         */\n        createNotebook(options) {\n            return new _widget__WEBPACK_IMPORTED_MODULE_7__.Notebook(options);\n        }\n    }\n    NotebookPanel.ContentFactory = ContentFactory;\n    /**\n     * Default content factory for the notebook panel.\n     */\n    NotebookPanel.defaultContentFactory = new ContentFactory();\n    /* tslint:disable */\n    /**\n     * The notebook renderer token.\n     */\n    NotebookPanel.IContentFactory = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_6__.Token('@jupyterlab/notebook:IContentFactory');\n    /* tslint:enable */\n})(NotebookPanel || (NotebookPanel = {}));\n//# sourceMappingURL=panel.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/panel.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/tokens.js":
/*!**********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/tokens.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"INotebookWidgetFactory\": () => (/* binding */ INotebookWidgetFactory),\n/* harmony export */   \"INotebookTools\": () => (/* binding */ INotebookTools),\n/* harmony export */   \"INotebookTracker\": () => (/* binding */ INotebookTracker)\n/* harmony export */ });\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/* tslint:disable */\n/**\n * The notebook widget factory token.\n */\nconst INotebookWidgetFactory = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/notebook:INotebookWidgetFactory');\n/* tslint:enable */\n/* tslint:disable */\n/**\n * The notebook tools token.\n */\nconst INotebookTools = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/notebook:INotebookTools');\n/* tslint:disable */\n/**\n * The notebook tracker token.\n */\nconst INotebookTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/notebook:INotebookTracker');\n//# sourceMappingURL=tokens.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/tokens.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/tracker.js":
/*!***********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/tracker.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookTracker\": () => (/* binding */ NotebookTracker)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_1__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\nclass NotebookTracker extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.WidgetTracker {\n    constructor() {\n        super(...arguments);\n        this._activeCell = null;\n        this._activeCellChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(this);\n        this._selectionChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_1__.Signal(this);\n    }\n    /**\n     * The currently focused cell.\n     *\n     * #### Notes\n     * This is a read-only property. If there is no cell with the focus, then this\n     * value is `null`.\n     */\n    get activeCell() {\n        const widget = this.currentWidget;\n        if (!widget) {\n            return null;\n        }\n        return widget.content.activeCell || null;\n    }\n    /**\n     * A signal emitted when the current active cell changes.\n     *\n     * #### Notes\n     * If there is no cell with the focus, then `null` will be emitted.\n     */\n    get activeCellChanged() {\n        return this._activeCellChanged;\n    }\n    /**\n     * A signal emitted when the selection state changes.\n     */\n    get selectionChanged() {\n        return this._selectionChanged;\n    }\n    /**\n     * Add a new notebook panel to the tracker.\n     *\n     * @param panel - The notebook panel being added.\n     */\n    add(panel) {\n        const promise = super.add(panel);\n        panel.content.activeCellChanged.connect(this._onActiveCellChanged, this);\n        panel.content.selectionChanged.connect(this._onSelectionChanged, this);\n        return promise;\n    }\n    /**\n     * Dispose of the resources held by the tracker.\n     */\n    dispose() {\n        this._activeCell = null;\n        super.dispose();\n    }\n    /**\n     * Handle the current change event.\n     */\n    onCurrentChanged(widget) {\n        // Store an internal reference to active cell to prevent false positives.\n        const activeCell = this.activeCell;\n        if (activeCell && activeCell === this._activeCell) {\n            return;\n        }\n        this._activeCell = activeCell;\n        if (!widget) {\n            return;\n        }\n        // Since the notebook has changed, immediately signal an active cell change\n        this._activeCellChanged.emit(widget.content.activeCell || null);\n    }\n    _onActiveCellChanged(sender, cell) {\n        // Check if the active cell change happened for the current notebook.\n        if (this.currentWidget && this.currentWidget.content === sender) {\n            this._activeCell = cell || null;\n            this._activeCellChanged.emit(this._activeCell);\n        }\n    }\n    _onSelectionChanged(sender) {\n        // Check if the selection change happened for the current notebook.\n        if (this.currentWidget && this.currentWidget.content === sender) {\n            this._selectionChanged.emit(void 0);\n        }\n    }\n}\n//# sourceMappingURL=tracker.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/tracker.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/truststatus.js":
/*!***************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/truststatus.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookTrustStatus\": () => (/* binding */ NotebookTrustStatus)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/ui-components */ \"webpack/sharing/consume/default/@jupyterlab/ui-components/@jupyterlab/ui-components\");\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_4__);\n\n\n\n\n\n/**\n * Determine the notebook trust status message.\n */\nfunction cellTrust(props, translator) {\n    translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;\n    const trans = translator.load('jupyterlab');\n    if (props.trustedCells === props.totalCells) {\n        return [\n            trans.__('Notebook trusted: %1 of %2 cells trusted.', props.trustedCells, props.totalCells),\n            'jp-StatusItem-trusted'\n        ];\n    }\n    else if (props.activeCellTrusted) {\n        return [\n            trans.__('Active cell trusted: %1 of %2 cells trusted.', props.trustedCells, props.totalCells),\n            'jp-StatusItem-trusted'\n        ];\n    }\n    else {\n        return [\n            trans.__('Notebook not trusted: %1 of %2 cells trusted.', props.trustedCells, props.totalCells),\n            'jp-StatusItem-untrusted'\n        ];\n    }\n}\n/**\n * A pure function for a notebook trust status component.\n *\n * @param props: the props for the component.\n *\n * @returns a tsx component for notebook trust.\n */\nfunction NotebookTrustComponent(props) {\n    if (props.allCellsTrusted) {\n        return react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.trustedIcon.react, { top: '2px', stylesheet: 'statusBar' });\n    }\n    else {\n        return react__WEBPACK_IMPORTED_MODULE_4___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.notTrustedIcon.react, { top: '2px', stylesheet: 'statusBar' });\n    }\n}\n/**\n * The NotebookTrust status item.\n */\nclass NotebookTrustStatus extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.VDomRenderer {\n    /**\n     * Construct a new status item.\n     */\n    constructor(translator) {\n        super(new NotebookTrustStatus.Model());\n        this.translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;\n    }\n    /**\n     * Render the NotebookTrust status item.\n     */\n    render() {\n        if (!this.model) {\n            return null;\n        }\n        this.node.title = cellTrust(this.model, this.translator)[0];\n        return (react__WEBPACK_IMPORTED_MODULE_4___default().createElement(\"div\", null,\n            react__WEBPACK_IMPORTED_MODULE_4___default().createElement(NotebookTrustComponent, { allCellsTrusted: this.model.trustedCells === this.model.totalCells, activeCellTrusted: this.model.activeCellTrusted, totalCells: this.model.totalCells, trustedCells: this.model.trustedCells })));\n    }\n}\n/**\n * A namespace for NotebookTrust statics.\n */\n(function (NotebookTrustStatus) {\n    /**\n     * A VDomModel for the NotebookTrust status item.\n     */\n    class Model extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.VDomModel {\n        constructor() {\n            super(...arguments);\n            this._trustedCells = 0;\n            this._totalCells = 0;\n            this._activeCellTrusted = false;\n            this._notebook = null;\n        }\n        /**\n         * The number of trusted cells in the current notebook.\n         */\n        get trustedCells() {\n            return this._trustedCells;\n        }\n        /**\n         * The total number of cells in the current notebook.\n         */\n        get totalCells() {\n            return this._totalCells;\n        }\n        /**\n         * Whether the active cell is trusted.\n         */\n        get activeCellTrusted() {\n            return this._activeCellTrusted;\n        }\n        /**\n         * The current notebook for the model.\n         */\n        get notebook() {\n            return this._notebook;\n        }\n        set notebook(model) {\n            const oldNotebook = this._notebook;\n            if (oldNotebook !== null) {\n                oldNotebook.activeCellChanged.disconnect(this._onActiveCellChanged, this);\n                oldNotebook.modelContentChanged.disconnect(this._onModelChanged, this);\n            }\n            const oldState = this._getAllState();\n            this._notebook = model;\n            if (this._notebook === null) {\n                this._trustedCells = 0;\n                this._totalCells = 0;\n                this._activeCellTrusted = false;\n            }\n            else {\n                // Add listeners\n                this._notebook.activeCellChanged.connect(this._onActiveCellChanged, this);\n                this._notebook.modelContentChanged.connect(this._onModelChanged, this);\n                // Derive values\n                if (this._notebook.activeCell !== undefined) {\n                    this._activeCellTrusted = this._notebook.activeCell.model.trusted;\n                }\n                else {\n                    this._activeCellTrusted = false;\n                }\n                const { total, trusted } = this._deriveCellTrustState(this._notebook.model);\n                this._totalCells = total;\n                this._trustedCells = trusted;\n            }\n            this._triggerChange(oldState, this._getAllState());\n        }\n        /**\n         * When the notebook model changes, update the trust state.\n         */\n        _onModelChanged(notebook) {\n            const oldState = this._getAllState();\n            const { total, trusted } = this._deriveCellTrustState(notebook.model);\n            this._totalCells = total;\n            this._trustedCells = trusted;\n            this._triggerChange(oldState, this._getAllState());\n        }\n        /**\n         * When the active cell changes, update the trust state.\n         */\n        _onActiveCellChanged(model, cell) {\n            const oldState = this._getAllState();\n            if (cell) {\n                this._activeCellTrusted = cell.model.trusted;\n            }\n            else {\n                this._activeCellTrusted = false;\n            }\n            this._triggerChange(oldState, this._getAllState());\n        }\n        /**\n         * Given a notebook model, figure out how many of the cells are trusted.\n         */\n        _deriveCellTrustState(model) {\n            if (model === null) {\n                return { total: 0, trusted: 0 };\n            }\n            const cells = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.toArray)(model.cells);\n            const trusted = cells.reduce((accum, current) => {\n                if (current.trusted) {\n                    return accum + 1;\n                }\n                else {\n                    return accum;\n                }\n            }, 0);\n            const total = cells.length;\n            return {\n                total,\n                trusted\n            };\n        }\n        /**\n         * Get the current state of the model.\n         */\n        _getAllState() {\n            return [this._trustedCells, this._totalCells, this.activeCellTrusted];\n        }\n        /**\n         * Trigger a change in the renderer.\n         */\n        _triggerChange(oldState, newState) {\n            if (oldState[0] !== newState[0] ||\n                oldState[1] !== newState[1] ||\n                oldState[2] !== newState[2]) {\n                this.stateChanged.emit(void 0);\n            }\n        }\n    }\n    NotebookTrustStatus.Model = Model;\n})(NotebookTrustStatus || (NotebookTrustStatus = {}));\n//# sourceMappingURL=truststatus.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/truststatus.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/widget.js":
/*!**********************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/widget.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"StaticNotebook\": () => (/* binding */ StaticNotebook),\n/* harmony export */   \"Notebook\": () => (/* binding */ Notebook)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/cells */ \"webpack/sharing/consume/default/@jupyterlab/cells/@jupyterlab/cells\");\n/* harmony import */ var _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/codeeditor */ \"webpack/sharing/consume/default/@jupyterlab/codeeditor/@jupyterlab/codeeditor\");\n/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/domutils */ \"webpack/sharing/consume/default/@lumino/domutils/@lumino/domutils\");\n/* harmony import */ var _lumino_domutils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_domutils__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/dragdrop */ \"webpack/sharing/consume/default/@lumino/dragdrop/@lumino/dragdrop\");\n/* harmony import */ var _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_dragdrop__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @lumino/properties */ \"webpack/sharing/consume/default/@lumino/properties/@lumino/properties\");\n/* harmony import */ var _lumino_properties__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_lumino_properties__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @lumino/virtualdom */ \"webpack/sharing/consume/default/@lumino/virtualdom/@lumino/virtualdom\");\n/* harmony import */ var _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _actions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./actions */ \"../node_modules/@jupyterlab/notebook/lib/actions.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The data attribute added to a widget that has an active kernel.\n */\nconst KERNEL_USER = 'jpKernelUser';\n/**\n * The data attribute added to a widget that can run code.\n */\nconst CODE_RUNNER = 'jpCodeRunner';\n/**\n * The data attribute added to a widget that can undo.\n */\nconst UNDOER = 'jpUndoer';\n/**\n * The class name added to notebook widgets.\n */\nconst NB_CLASS = 'jp-Notebook';\n/**\n * The class name added to notebook widget cells.\n */\nconst NB_CELL_CLASS = 'jp-Notebook-cell';\n/**\n * The class name added to a notebook in edit mode.\n */\nconst EDIT_CLASS = 'jp-mod-editMode';\n/**\n * The class name added to a notebook in command mode.\n */\nconst COMMAND_CLASS = 'jp-mod-commandMode';\n/**\n * The class name added to the active cell.\n */\nconst ACTIVE_CLASS = 'jp-mod-active';\n/**\n * The class name added to selected cells.\n */\nconst SELECTED_CLASS = 'jp-mod-selected';\n/**\n * The class name added to an active cell when there are other selected cells.\n */\nconst OTHER_SELECTED_CLASS = 'jp-mod-multiSelected';\n/**\n * The class name added to unconfined images.\n */\nconst UNCONFINED_CLASS = 'jp-mod-unconfined';\n/**\n * The class name added to a drop target.\n */\nconst DROP_TARGET_CLASS = 'jp-mod-dropTarget';\n/**\n * The class name added to a drop source.\n */\nconst DROP_SOURCE_CLASS = 'jp-mod-dropSource';\n/**\n * The class name added to drag images.\n */\nconst DRAG_IMAGE_CLASS = 'jp-dragImage';\n/**\n * The class name added to singular drag images\n */\nconst SINGLE_DRAG_IMAGE_CLASS = 'jp-dragImage-singlePrompt';\n/**\n * The class name added to the drag image cell content.\n */\nconst CELL_DRAG_CONTENT_CLASS = 'jp-dragImage-content';\n/**\n * The class name added to the drag image cell content.\n */\nconst CELL_DRAG_PROMPT_CLASS = 'jp-dragImage-prompt';\n/**\n * The class name added to the drag image cell content.\n */\nconst CELL_DRAG_MULTIPLE_BACK = 'jp-dragImage-multipleBack';\n/**\n * The mimetype used for Jupyter cell data.\n */\nconst JUPYTER_CELL_MIME = 'application/vnd.jupyter.cells';\n/**\n * The threshold in pixels to start a drag event.\n */\nconst DRAG_THRESHOLD = 5;\n/**\n * The class attached to the heading collapser button\n */\nconst HEADING_COLLAPSER_CLASS = 'jp-collapseHeadingButton';\nif (window.requestIdleCallback === undefined) {\n    // On Safari, requestIdleCallback is not available, so we use replacement functions for `idleCallbacks`\n    // See: https://developer.mozilla.org/en-US/docs/Web/API/Background_Tasks_API#falling_back_to_settimeout\n    window.requestIdleCallback = function (handler) {\n        let startTime = Date.now();\n        return setTimeout(function () {\n            handler({\n                didTimeout: false,\n                timeRemaining: function () {\n                    return Math.max(0, 50.0 - (Date.now() - startTime));\n                }\n            });\n        }, 1);\n    };\n    window.cancelIdleCallback = function (id) {\n        clearTimeout(id);\n    };\n}\n/**\n * A widget which renders static non-interactive notebooks.\n *\n * #### Notes\n * The widget model must be set separately and can be changed\n * at any time.  Consumers of the widget must account for a\n * `null` model, and may want to listen to the `modelChanged`\n * signal.\n */\nclass StaticNotebook extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_9__.Widget {\n    /**\n     * Construct a notebook widget.\n     */\n    constructor(options) {\n        super();\n        this._editorConfig = StaticNotebook.defaultEditorConfig;\n        this._notebookConfig = StaticNotebook.defaultNotebookConfig;\n        this._mimetype = 'text/plain';\n        this._model = null;\n        this._modelChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._modelContentChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._fullyRendered = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._placeholderCellRendered = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._renderedCellsCount = 0;\n        this.addClass(NB_CLASS);\n        this.node.dataset[KERNEL_USER] = 'true';\n        this.node.dataset[UNDOER] = 'true';\n        this.node.dataset[CODE_RUNNER] = 'true';\n        this.rendermime = options.rendermime;\n        this.layout = new Private.NotebookPanelLayout();\n        this.contentFactory =\n            options.contentFactory || StaticNotebook.defaultContentFactory;\n        this.editorConfig =\n            options.editorConfig || StaticNotebook.defaultEditorConfig;\n        this.notebookConfig =\n            options.notebookConfig || StaticNotebook.defaultNotebookConfig;\n        this._mimetypeService = options.mimeTypeService;\n        // Section for the virtual-notebook behavior.\n        this._toRenderMap = new Map();\n        this._cellsArray = new Array();\n        if ('IntersectionObserver' in window) {\n            this._observer = new IntersectionObserver((entries, observer) => {\n                entries.forEach(o => {\n                    if (o.isIntersecting) {\n                        observer.unobserve(o.target);\n                        const ci = this._toRenderMap.get(o.target.id);\n                        if (ci) {\n                            const { cell, index } = ci;\n                            this._renderPlaceholderCell(cell, index);\n                        }\n                    }\n                });\n            }, {\n                root: this.node,\n                threshold: 1,\n                rootMargin: `${this.notebookConfig.observedTopMargin} 0px ${this.notebookConfig.observedBottomMargin} 0px`\n            });\n        }\n    }\n    /**\n     * A signal emitted when the notebook is fully rendered.\n     */\n    get fullyRendered() {\n        return this._fullyRendered;\n    }\n    /**\n     * A signal emitted when the a placeholder cell is rendered.\n     */\n    get placeholderCellRendered() {\n        return this._placeholderCellRendered;\n    }\n    /**\n     * A signal emitted when the model of the notebook changes.\n     */\n    get modelChanged() {\n        return this._modelChanged;\n    }\n    /**\n     * A signal emitted when the model content changes.\n     *\n     * #### Notes\n     * This is a convenience signal that follows the current model.\n     */\n    get modelContentChanged() {\n        return this._modelContentChanged;\n    }\n    /**\n     * The model for the widget.\n     */\n    get model() {\n        return this._model;\n    }\n    set model(newValue) {\n        newValue = newValue || null;\n        if (this._model === newValue) {\n            return;\n        }\n        const oldValue = this._model;\n        this._model = newValue;\n        if (oldValue && oldValue.modelDB.isCollaborative) {\n            void oldValue.modelDB.connected.then(() => {\n                oldValue.modelDB.collaborators.changed.disconnect(this._onCollaboratorsChanged, this);\n            });\n        }\n        if (newValue && newValue.modelDB.isCollaborative) {\n            void newValue.modelDB.connected.then(() => {\n                newValue.modelDB.collaborators.changed.connect(this._onCollaboratorsChanged, this);\n            });\n        }\n        // Trigger private, protected, and public changes.\n        this._onModelChanged(oldValue, newValue);\n        this.onModelChanged(oldValue, newValue);\n        this._modelChanged.emit(void 0);\n    }\n    /**\n     * Get the mimetype for code cells.\n     */\n    get codeMimetype() {\n        return this._mimetype;\n    }\n    /**\n     * A read-only sequence of the widgets in the notebook.\n     */\n    get widgets() {\n        return this.layout.widgets;\n    }\n    /**\n     * A configuration object for cell editor settings.\n     */\n    get editorConfig() {\n        return this._editorConfig;\n    }\n    set editorConfig(value) {\n        this._editorConfig = value;\n        this._updateEditorConfig();\n    }\n    /**\n     * A configuration object for notebook settings.\n     */\n    get notebookConfig() {\n        return this._notebookConfig;\n    }\n    set notebookConfig(value) {\n        this._notebookConfig = value;\n        this._updateNotebookConfig();\n    }\n    /**\n     * Dispose of the resources held by the widget.\n     */\n    dispose() {\n        // Do nothing if already disposed.\n        if (this.isDisposed) {\n            return;\n        }\n        this._model = null;\n        super.dispose();\n    }\n    /**\n     * Handle a new model.\n     *\n     * #### Notes\n     * This method is called after the model change has been handled\n     * internally and before the `modelChanged` signal is emitted.\n     * The default implementation is a no-op.\n     */\n    onModelChanged(oldValue, newValue) {\n        // No-op.\n    }\n    /**\n     * Handle changes to the notebook model content.\n     *\n     * #### Notes\n     * The default implementation emits the `modelContentChanged` signal.\n     */\n    onModelContentChanged(model, args) {\n        this._modelContentChanged.emit(void 0);\n    }\n    /**\n     * Handle changes to the notebook model metadata.\n     *\n     * #### Notes\n     * The default implementation updates the mimetypes of the code cells\n     * when the `language_info` metadata changes.\n     */\n    onMetadataChanged(sender, args) {\n        switch (args.key) {\n            case 'language_info':\n                this._updateMimetype();\n                break;\n            default:\n                break;\n        }\n    }\n    /**\n     * Handle a cell being inserted.\n     *\n     * The default implementation is a no-op\n     */\n    onCellInserted(index, cell) {\n        // This is a no-op.\n    }\n    /**\n     * Handle a cell being moved.\n     *\n     * The default implementation is a no-op\n     */\n    onCellMoved(fromIndex, toIndex) {\n        // This is a no-op.\n    }\n    /**\n     * Handle a cell being removed.\n     *\n     * The default implementation is a no-op\n     */\n    onCellRemoved(index, cell) {\n        // This is a no-op.\n    }\n    /**\n     * Handle a new model on the widget.\n     */\n    _onModelChanged(oldValue, newValue) {\n        const layout = this.layout;\n        if (oldValue) {\n            oldValue.cells.changed.disconnect(this._onCellsChanged, this);\n            oldValue.metadata.changed.disconnect(this.onMetadataChanged, this);\n            oldValue.contentChanged.disconnect(this.onModelContentChanged, this);\n            // TODO: reuse existing cell widgets if possible. Remember to initially\n            // clear the history of each cell if we do this.\n            while (layout.widgets.length) {\n                this._removeCell(0);\n            }\n        }\n        if (!newValue) {\n            this._mimetype = 'text/plain';\n            return;\n        }\n        this._updateMimetype();\n        const cells = newValue.cells;\n        if (!cells.length && newValue.isInitialized) {\n            cells.push(newValue.contentFactory.createCell(this.notebookConfig.defaultCell, {}));\n        }\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(cells, (cell, i) => {\n            this._insertCell(i, cell, 'set');\n        });\n        cells.changed.connect(this._onCellsChanged, this);\n        newValue.contentChanged.connect(this.onModelContentChanged, this);\n        newValue.metadata.changed.connect(this.onMetadataChanged, this);\n    }\n    /**\n     * Handle a change cells event.\n     */\n    _onCellsChanged(sender, args) {\n        let index = 0;\n        switch (args.type) {\n            case 'add':\n                index = args.newIndex;\n                // eslint-disable-next-line no-case-declarations\n                const insertType = args.oldIndex == -1 ? 'push' : 'insert';\n                (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(args.newValues, value => {\n                    this._insertCell(index++, value, insertType);\n                });\n                break;\n            case 'move':\n                this._moveCell(args.oldIndex, args.newIndex);\n                break;\n            case 'remove':\n                (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(args.oldValues, value => {\n                    this._removeCell(args.oldIndex);\n                });\n                // Add default cell if there are no cells remaining.\n                if (!sender.length) {\n                    const model = this.model;\n                    // Add the cell in a new context to avoid triggering another\n                    // cell changed event during the handling of this signal.\n                    requestAnimationFrame(() => {\n                        if (model && !model.isDisposed && !model.cells.length) {\n                            model.cells.push(model.contentFactory.createCell(this.notebookConfig.defaultCell, {}));\n                        }\n                    });\n                }\n                break;\n            case 'set':\n                // TODO: reuse existing widgets if possible.\n                index = args.newIndex;\n                (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(args.newValues, value => {\n                    // Note: this ordering (insert then remove)\n                    // is important for getting the active cell\n                    // index for the editable notebook correct.\n                    this._insertCell(index, value, 'set');\n                    this._removeCell(index + 1);\n                    index++;\n                });\n                break;\n            default:\n                return;\n        }\n    }\n    /**\n     * Create a cell widget and insert into the notebook.\n     */\n    _insertCell(index, cell, insertType) {\n        let widget;\n        switch (cell.type) {\n            case 'code':\n                widget = this._createCodeCell(cell);\n                widget.model.mimeType = this._mimetype;\n                break;\n            case 'markdown':\n                widget = this._createMarkdownCell(cell);\n                if (cell.value.text === '') {\n                    widget.rendered = false;\n                }\n                break;\n            default:\n                widget = this._createRawCell(cell);\n        }\n        widget.addClass(NB_CELL_CLASS);\n        const layout = this.layout;\n        this._cellsArray.push(widget);\n        if (this._observer &&\n            insertType === 'push' &&\n            this._renderedCellsCount >=\n                this.notebookConfig.numberCellsToRenderDirectly &&\n            cell.type !== 'markdown') {\n            // We have an observer and we are have been asked to push (not to insert).\n            // and we are above the number of cells to render directly, then\n            // we will add a placeholder and let the intersection observer or the\n            // idle browser render those placeholder cells.\n            this._toRenderMap.set(widget.model.id, { index: index, cell: widget });\n            const placeholder = this._createPlaceholderCell(cell, index);\n            placeholder.node.id = widget.model.id;\n            layout.insertWidget(index, placeholder);\n            this.onCellInserted(index, placeholder);\n            this._fullyRendered.emit(false);\n            this._observer.observe(placeholder.node);\n        }\n        else {\n            // We have no intersection observer, or we insert, or we are below\n            // the number of cells to render directly, so we render directly.\n            layout.insertWidget(index, widget);\n            this._incrementRenderedCount();\n            this.onCellInserted(index, widget);\n        }\n        if (this._observer && this.notebookConfig.renderCellOnIdle) {\n            const renderPlaceholderCells = this._renderPlaceholderCells.bind(this);\n            window.requestIdleCallback(renderPlaceholderCells, {\n                timeout: 1000\n            });\n        }\n    }\n    _renderPlaceholderCells(deadline) {\n        if (this._renderedCellsCount < this._cellsArray.length &&\n            this._renderedCellsCount >=\n                this.notebookConfig.numberCellsToRenderDirectly) {\n            const index = this._renderedCellsCount;\n            const cell = this._cellsArray[index];\n            this._renderPlaceholderCell(cell, index);\n        }\n    }\n    _renderPlaceholderCell(cell, index) {\n        const pl = this.layout;\n        pl.removeWidgetAt(index);\n        pl.insertWidget(index, cell);\n        this._toRenderMap.delete(cell.model.id);\n        this._incrementRenderedCount();\n        this.onCellInserted(index, cell);\n        this._placeholderCellRendered.emit(cell);\n    }\n    /**\n     * Create a code cell widget from a code cell model.\n     */\n    _createCodeCell(model) {\n        const rendermime = this.rendermime;\n        const contentFactory = this.contentFactory;\n        const editorConfig = this.editorConfig.code;\n        const options = {\n            editorConfig,\n            model,\n            rendermime,\n            contentFactory,\n            updateEditorOnShow: false,\n            placeholder: false,\n            maxNumberOutputs: this.notebookConfig.maxNumberOutputs\n        };\n        const cell = this.contentFactory.createCodeCell(options, this);\n        cell.syncCollapse = true;\n        cell.syncEditable = true;\n        cell.syncScrolled = true;\n        return cell;\n    }\n    /**\n     * Create a markdown cell widget from a markdown cell model.\n     */\n    _createMarkdownCell(model) {\n        const rendermime = this.rendermime;\n        const contentFactory = this.contentFactory;\n        const editorConfig = this.editorConfig.markdown;\n        const options = {\n            editorConfig,\n            model,\n            rendermime,\n            contentFactory,\n            updateEditorOnShow: false,\n            placeholder: false\n        };\n        const cell = this.contentFactory.createMarkdownCell(options, this);\n        cell.syncCollapse = true;\n        cell.syncEditable = true;\n        return cell;\n    }\n    /**\n     * Create a placeholder cell widget from a raw cell model.\n     */\n    _createPlaceholderCell(model, index) {\n        const contentFactory = this.contentFactory;\n        const editorConfig = this.editorConfig.raw;\n        const options = {\n            editorConfig,\n            model,\n            contentFactory,\n            updateEditorOnShow: false,\n            placeholder: true\n        };\n        const cell = this.contentFactory.createRawCell(options, this);\n        cell.node.innerHTML = `\n      <div class=\"jp-Cell-Placeholder\">\n        <div class=\"jp-Cell-Placeholder-wrapper\">\n        </div>\n      </div>`;\n        cell.inputHidden = true;\n        cell.syncCollapse = true;\n        cell.syncEditable = true;\n        return cell;\n    }\n    /**\n     * Create a raw cell widget from a raw cell model.\n     */\n    _createRawCell(model) {\n        const contentFactory = this.contentFactory;\n        const editorConfig = this.editorConfig.raw;\n        const options = {\n            editorConfig,\n            model,\n            contentFactory,\n            updateEditorOnShow: false,\n            placeholder: false\n        };\n        const cell = this.contentFactory.createRawCell(options, this);\n        cell.syncCollapse = true;\n        cell.syncEditable = true;\n        return cell;\n    }\n    /**\n     * Move a cell widget.\n     */\n    _moveCell(fromIndex, toIndex) {\n        const layout = this.layout;\n        layout.insertWidget(toIndex, layout.widgets[fromIndex]);\n        this.onCellMoved(fromIndex, toIndex);\n    }\n    /**\n     * Remove a cell widget.\n     */\n    _removeCell(index) {\n        const layout = this.layout;\n        const widget = layout.widgets[index];\n        widget.parent = null;\n        this.onCellRemoved(index, widget);\n        widget.dispose();\n    }\n    /**\n     * Update the mimetype of the notebook.\n     */\n    _updateMimetype() {\n        var _a;\n        const info = (_a = this._model) === null || _a === void 0 ? void 0 : _a.metadata.get('language_info');\n        if (!info) {\n            return;\n        }\n        this._mimetype = this._mimetypeService.getMimeTypeByLanguage(info);\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(this.widgets, widget => {\n            if (widget.model.type === 'code') {\n                widget.model.mimeType = this._mimetype;\n            }\n        });\n    }\n    /**\n     * Handle an update to the collaborators.\n     */\n    _onCollaboratorsChanged() {\n        var _a, _b, _c;\n        // If there are selections corresponding to non-collaborators,\n        // they are stale and should be removed.\n        for (let i = 0; i < this.widgets.length; i++) {\n            const cell = this.widgets[i];\n            for (const key of cell.model.selections.keys()) {\n                if (false === ((_c = (_b = (_a = this._model) === null || _a === void 0 ? void 0 : _a.modelDB) === null || _b === void 0 ? void 0 : _b.collaborators) === null || _c === void 0 ? void 0 : _c.has(key))) {\n                    cell.model.selections.delete(key);\n                }\n            }\n        }\n    }\n    /**\n     * Update editor settings for notebook cells.\n     */\n    _updateEditorConfig() {\n        for (let i = 0; i < this.widgets.length; i++) {\n            const cell = this.widgets[i];\n            let config;\n            switch (cell.model.type) {\n                case 'code':\n                    config = this._editorConfig.code;\n                    break;\n                case 'markdown':\n                    config = this._editorConfig.markdown;\n                    break;\n                default:\n                    config = this._editorConfig.raw;\n                    break;\n            }\n            let editorOptions = {};\n            Object.keys(config).forEach((key) => {\n                var _a;\n                editorOptions[key] = (_a = config[key]) !== null && _a !== void 0 ? _a : null;\n            });\n            cell.editor.setOptions(editorOptions);\n            cell.editor.refresh();\n        }\n    }\n    /**\n     * Apply updated notebook settings.\n     */\n    _updateNotebookConfig() {\n        // Apply scrollPastEnd setting.\n        this.toggleClass('jp-mod-scrollPastEnd', this._notebookConfig.scrollPastEnd);\n    }\n    _incrementRenderedCount() {\n        if (this._toRenderMap.size === 0) {\n            this._fullyRendered.emit(true);\n        }\n        this._renderedCellsCount++;\n    }\n}\n/**\n * The namespace for the `StaticNotebook` class statics.\n */\n(function (StaticNotebook) {\n    /**\n     * Default configuration options for cell editors.\n     */\n    StaticNotebook.defaultEditorConfig = {\n        code: Object.assign(Object.assign({}, _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.CodeEditor.defaultConfig), { lineWrap: 'off', matchBrackets: true, autoClosingBrackets: false }),\n        markdown: Object.assign(Object.assign({}, _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.CodeEditor.defaultConfig), { lineWrap: 'on', matchBrackets: false, autoClosingBrackets: false }),\n        raw: Object.assign(Object.assign({}, _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.CodeEditor.defaultConfig), { lineWrap: 'on', matchBrackets: false, autoClosingBrackets: false })\n    };\n    /**\n     * Default configuration options for notebooks.\n     */\n    StaticNotebook.defaultNotebookConfig = {\n        scrollPastEnd: true,\n        defaultCell: 'code',\n        recordTiming: false,\n        numberCellsToRenderDirectly: 20,\n        renderCellOnIdle: true,\n        observedTopMargin: '1000px',\n        observedBottomMargin: '1000px',\n        maxNumberOutputs: 50\n    };\n    /**\n     * The default implementation of an `IContentFactory`.\n     */\n    class ContentFactory extends _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.Cell.ContentFactory {\n        /**\n         * Create a new code cell widget.\n         *\n         * #### Notes\n         * If no cell content factory is passed in with the options, the one on the\n         * notebook content factory is used.\n         */\n        createCodeCell(options, parent) {\n            if (!options.contentFactory) {\n                options.contentFactory = this;\n            }\n            return new _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.CodeCell(options).initializeState();\n        }\n        /**\n         * Create a new markdown cell widget.\n         *\n         * #### Notes\n         * If no cell content factory is passed in with the options, the one on the\n         * notebook content factory is used.\n         */\n        createMarkdownCell(options, parent) {\n            if (!options.contentFactory) {\n                options.contentFactory = this;\n            }\n            return new _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.MarkdownCell(options).initializeState();\n        }\n        /**\n         * Create a new raw cell widget.\n         *\n         * #### Notes\n         * If no cell content factory is passed in with the options, the one on the\n         * notebook content factory is used.\n         */\n        createRawCell(options, parent) {\n            if (!options.contentFactory) {\n                options.contentFactory = this;\n            }\n            return new _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.RawCell(options).initializeState();\n        }\n    }\n    StaticNotebook.ContentFactory = ContentFactory;\n    /**\n     * Default content factory for the static notebook widget.\n     */\n    StaticNotebook.defaultContentFactory = new ContentFactory();\n})(StaticNotebook || (StaticNotebook = {}));\n/**\n * A notebook widget that supports interactivity.\n */\nclass Notebook extends StaticNotebook {\n    /**\n     * Construct a notebook widget.\n     */\n    constructor(options) {\n        super(Private.processNotebookOptions(options));\n        this._activeCellIndex = -1;\n        this._activeCell = null;\n        this._mode = 'command';\n        this._drag = null;\n        this._fragment = '';\n        this._dragData = null;\n        this._mouseMode = null;\n        this._activeCellChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._stateChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._selectionChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._checkCacheOnNextResize = false;\n        this.node.tabIndex = 0; // Allow the widget to take focus.\n        // Allow the node to scroll while dragging items.\n        this.node.setAttribute('data-lm-dragscroll', 'true');\n    }\n    /**\n     * A signal emitted when the active cell changes.\n     *\n     * #### Notes\n     * This can be due to the active index changing or the\n     * cell at the active index changing.\n     */\n    get activeCellChanged() {\n        return this._activeCellChanged;\n    }\n    /**\n     * A signal emitted when the state of the notebook changes.\n     */\n    get stateChanged() {\n        return this._stateChanged;\n    }\n    /**\n     * A signal emitted when the selection state of the notebook changes.\n     */\n    get selectionChanged() {\n        return this._selectionChanged;\n    }\n    /**\n     * The interactivity mode of the notebook.\n     */\n    get mode() {\n        return this._mode;\n    }\n    set mode(newValue) {\n        const activeCell = this.activeCell;\n        if (!activeCell) {\n            newValue = 'command';\n        }\n        if (newValue === this._mode) {\n            this._ensureFocus();\n            return;\n        }\n        // Post an update request.\n        this.update();\n        const oldValue = this._mode;\n        this._mode = newValue;\n        if (newValue === 'edit') {\n            // Edit mode deselects all cells.\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(this.widgets, widget => {\n                this.deselect(widget);\n            });\n            //  Edit mode unrenders an active markdown widget.\n            if (activeCell instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.MarkdownCell) {\n                activeCell.rendered = false;\n            }\n            activeCell.inputHidden = false;\n        }\n        else {\n            // Focus on the notebook document, which blurs the active cell.\n            this.node.focus();\n        }\n        this._stateChanged.emit({ name: 'mode', oldValue, newValue });\n        this._ensureFocus();\n    }\n    /**\n     * The active cell index of the notebook.\n     *\n     * #### Notes\n     * The index will be clamped to the bounds of the notebook cells.\n     */\n    get activeCellIndex() {\n        if (!this.model) {\n            return -1;\n        }\n        return this.model.cells.length ? this._activeCellIndex : -1;\n    }\n    set activeCellIndex(newValue) {\n        const oldValue = this._activeCellIndex;\n        if (!this.model || !this.model.cells.length) {\n            newValue = -1;\n        }\n        else {\n            newValue = Math.max(newValue, 0);\n            newValue = Math.min(newValue, this.model.cells.length - 1);\n        }\n        this._activeCellIndex = newValue;\n        const cell = this.widgets[newValue];\n        if (cell !== this._activeCell) {\n            // Post an update request.\n            this.update();\n            this._activeCell = cell;\n            this._activeCellChanged.emit(cell);\n        }\n        if (this.mode === 'edit' && cell instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.MarkdownCell) {\n            cell.rendered = false;\n        }\n        this._ensureFocus();\n        if (newValue === oldValue) {\n            return;\n        }\n        this._trimSelections();\n        this._stateChanged.emit({ name: 'activeCellIndex', oldValue, newValue });\n    }\n    /**\n     * Get the active cell widget.\n     *\n     * #### Notes\n     * This is a cell or `null` if there is no active cell.\n     */\n    get activeCell() {\n        return this._activeCell;\n    }\n    /**\n     * Dispose of the resources held by the widget.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._activeCell = null;\n        super.dispose();\n    }\n    /**\n     * Select a cell widget.\n     *\n     * #### Notes\n     * It is a no-op if the value does not change.\n     * It will emit the `selectionChanged` signal.\n     */\n    select(widget) {\n        if (Private.selectedProperty.get(widget)) {\n            return;\n        }\n        Private.selectedProperty.set(widget, true);\n        this._selectionChanged.emit(void 0);\n        this.update();\n    }\n    /**\n     * Deselect a cell widget.\n     *\n     * #### Notes\n     * It is a no-op if the value does not change.\n     * It will emit the `selectionChanged` signal.\n     */\n    deselect(widget) {\n        if (!Private.selectedProperty.get(widget)) {\n            return;\n        }\n        Private.selectedProperty.set(widget, false);\n        this._selectionChanged.emit(void 0);\n        this.update();\n    }\n    /**\n     * Whether a cell is selected.\n     */\n    isSelected(widget) {\n        return Private.selectedProperty.get(widget);\n    }\n    /**\n     * Whether a cell is selected or is the active cell.\n     */\n    isSelectedOrActive(widget) {\n        if (widget === this._activeCell) {\n            return true;\n        }\n        return Private.selectedProperty.get(widget);\n    }\n    /**\n     * Deselect all of the cells.\n     */\n    deselectAll() {\n        let changed = false;\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(this.widgets, widget => {\n            if (Private.selectedProperty.get(widget)) {\n                changed = true;\n            }\n            Private.selectedProperty.set(widget, false);\n        });\n        if (changed) {\n            this._selectionChanged.emit(void 0);\n        }\n        // Make sure we have a valid active cell.\n        this.activeCellIndex = this.activeCellIndex; // eslint-disable-line\n        this.update();\n    }\n    /**\n     * Move the head of an existing contiguous selection to extend the selection.\n     *\n     * @param index - The new head of the existing selection.\n     *\n     * #### Notes\n     * If there is no existing selection, the active cell is considered an\n     * existing one-cell selection.\n     *\n     * If the new selection is a single cell, that cell becomes the active cell\n     * and all cells are deselected.\n     *\n     * There is no change if there are no cells (i.e., activeCellIndex is -1).\n     */\n    extendContiguousSelectionTo(index) {\n        let { head, anchor } = this.getContiguousSelection();\n        let i;\n        // Handle the case of no current selection.\n        if (anchor === null || head === null) {\n            if (index === this.activeCellIndex) {\n                // Already collapsed selection, nothing more to do.\n                return;\n            }\n            // We will start a new selection below.\n            head = this.activeCellIndex;\n            anchor = this.activeCellIndex;\n        }\n        // Move the active cell. We do this before the collapsing shortcut below.\n        this.activeCellIndex = index;\n        // Make sure the index is valid, according to the rules for setting and clipping the\n        // active cell index. This may change the index.\n        index = this.activeCellIndex;\n        // Collapse the selection if it is only the active cell.\n        if (index === anchor) {\n            this.deselectAll();\n            return;\n        }\n        let selectionChanged = false;\n        if (head < index) {\n            if (head < anchor) {\n                Private.selectedProperty.set(this.widgets[head], false);\n                selectionChanged = true;\n            }\n            // Toggle everything strictly between head and index except anchor.\n            for (i = head + 1; i < index; i++) {\n                if (i !== anchor) {\n                    Private.selectedProperty.set(this.widgets[i], !Private.selectedProperty.get(this.widgets[i]));\n                    selectionChanged = true;\n                }\n            }\n        }\n        else if (index < head) {\n            if (anchor < head) {\n                Private.selectedProperty.set(this.widgets[head], false);\n                selectionChanged = true;\n            }\n            // Toggle everything strictly between index and head except anchor.\n            for (i = index + 1; i < head; i++) {\n                if (i !== anchor) {\n                    Private.selectedProperty.set(this.widgets[i], !Private.selectedProperty.get(this.widgets[i]));\n                    selectionChanged = true;\n                }\n            }\n        }\n        // Anchor and index should *always* be selected.\n        if (!Private.selectedProperty.get(this.widgets[anchor])) {\n            selectionChanged = true;\n        }\n        Private.selectedProperty.set(this.widgets[anchor], true);\n        if (!Private.selectedProperty.get(this.widgets[index])) {\n            selectionChanged = true;\n        }\n        Private.selectedProperty.set(this.widgets[index], true);\n        if (selectionChanged) {\n            this._selectionChanged.emit(void 0);\n        }\n    }\n    /**\n     * Get the head and anchor of a contiguous cell selection.\n     *\n     * The head of a contiguous selection is always the active cell.\n     *\n     * If there are no cells selected, `{head: null, anchor: null}` is returned.\n     *\n     * Throws an error if the currently selected cells do not form a contiguous\n     * selection.\n     */\n    getContiguousSelection() {\n        const cells = this.widgets;\n        const first = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.ArrayExt.findFirstIndex(cells, c => this.isSelected(c));\n        // Return early if no cells are selected.\n        if (first === -1) {\n            return { head: null, anchor: null };\n        }\n        const last = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.ArrayExt.findLastIndex(cells, c => this.isSelected(c), -1, first);\n        // Check that the selection is contiguous.\n        for (let i = first; i <= last; i++) {\n            if (!this.isSelected(cells[i])) {\n                throw new Error('Selection not contiguous');\n            }\n        }\n        // Check that the active cell is one of the endpoints of the selection.\n        const activeIndex = this.activeCellIndex;\n        if (first !== activeIndex && last !== activeIndex) {\n            throw new Error('Active cell not at endpoint of selection');\n        }\n        // Determine the head and anchor of the selection.\n        if (first === activeIndex) {\n            return { head: first, anchor: last };\n        }\n        else {\n            return { head: last, anchor: first };\n        }\n    }\n    /**\n     * Scroll so that the given position is centered.\n     *\n     * @param position - The vertical position in the notebook widget.\n     *\n     * @param threshold - An optional threshold for the scroll (0-50, defaults to\n     * 25).\n     *\n     * #### Notes\n     * If the position is within the threshold percentage of the widget height,\n     * measured from the center of the widget, the scroll position will not be\n     * changed. A threshold of 0 means we will always scroll so the position is\n     * centered, and a threshold of 50 means scrolling only happens if position is\n     * outside the current window.\n     */\n    scrollToPosition(position, threshold = 25) {\n        const node = this.node;\n        const ar = node.getBoundingClientRect();\n        const delta = position - ar.top - ar.height / 2;\n        if (Math.abs(delta) > (ar.height * threshold) / 100) {\n            node.scrollTop += delta;\n        }\n    }\n    /**\n     * Scroll so that the given cell is in view. Selects and activates cell.\n     *\n     * @param cell - A cell in the notebook widget.\n     *\n     */\n    scrollToCell(cell) {\n        // use Phosphor to scroll\n        _lumino_domutils__WEBPACK_IMPORTED_MODULE_4__.ElementExt.scrollIntoViewIfNeeded(this.node, cell.node);\n        // change selection and active cell:\n        this.deselectAll();\n        this.select(cell);\n        cell.activate();\n    }\n    /**\n     * Set URI fragment identifier.\n     */\n    setFragment(fragment) {\n        // Wait all cells are rendered then set fragment and update.\n        void Promise.all(this.widgets.map(widget => widget.ready)).then(() => {\n            this._fragment = fragment;\n            this.update();\n        });\n    }\n    /**\n     * Handle the DOM events for the widget.\n     *\n     * @param event - The DOM event sent to the widget.\n     *\n     * #### Notes\n     * This method implements the DOM `EventListener` interface and is\n     * called in response to events on the notebook panel's node. It should\n     * not be called directly by user code.\n     */\n    handleEvent(event) {\n        if (!this.model) {\n            return;\n        }\n        switch (event.type) {\n            case 'contextmenu':\n                if (event.eventPhase === Event.CAPTURING_PHASE) {\n                    this._evtContextMenuCapture(event);\n                }\n                break;\n            case 'mousedown':\n                if (event.eventPhase === Event.CAPTURING_PHASE) {\n                    this._evtMouseDownCapture(event);\n                }\n                else {\n                    this._evtMouseDown(event);\n                }\n                break;\n            case 'mouseup':\n                if (event.currentTarget === document) {\n                    this._evtDocumentMouseup(event);\n                }\n                break;\n            case 'mousemove':\n                if (event.currentTarget === document) {\n                    this._evtDocumentMousemove(event);\n                }\n                break;\n            case 'keydown':\n                this._ensureFocus(true);\n                break;\n            case 'dblclick':\n                this._evtDblClick(event);\n                break;\n            case 'focusin':\n                this._evtFocusIn(event);\n                break;\n            case 'focusout':\n                this._evtFocusOut(event);\n                break;\n            case 'lm-dragenter':\n                this._evtDragEnter(event);\n                break;\n            case 'lm-dragleave':\n                this._evtDragLeave(event);\n                break;\n            case 'lm-dragover':\n                this._evtDragOver(event);\n                break;\n            case 'lm-drop':\n                this._evtDrop(event);\n                break;\n            default:\n                break;\n        }\n    }\n    /**\n     * Handle `after-attach` messages for the widget.\n     */\n    onAfterAttach(msg) {\n        super.onAfterAttach(msg);\n        const node = this.node;\n        node.addEventListener('contextmenu', this, true);\n        node.addEventListener('mousedown', this, true);\n        node.addEventListener('mousedown', this);\n        node.addEventListener('keydown', this);\n        node.addEventListener('dblclick', this);\n        node.addEventListener('focusin', this);\n        node.addEventListener('focusout', this);\n        // Capture drag events for the notebook widget\n        // in order to preempt the drag/drop handlers in the\n        // code editor widgets, which can take text data.\n        node.addEventListener('lm-dragenter', this, true);\n        node.addEventListener('lm-dragleave', this, true);\n        node.addEventListener('lm-dragover', this, true);\n        node.addEventListener('lm-drop', this, true);\n    }\n    /**\n     * Handle `before-detach` messages for the widget.\n     */\n    onBeforeDetach(msg) {\n        const node = this.node;\n        node.removeEventListener('contextmenu', this, true);\n        node.removeEventListener('mousedown', this, true);\n        node.removeEventListener('mousedown', this);\n        node.removeEventListener('keydown', this);\n        node.removeEventListener('dblclick', this);\n        node.removeEventListener('focusin', this);\n        node.removeEventListener('focusout', this);\n        node.removeEventListener('lm-dragenter', this, true);\n        node.removeEventListener('lm-dragleave', this, true);\n        node.removeEventListener('lm-dragover', this, true);\n        node.removeEventListener('lm-drop', this, true);\n        document.removeEventListener('mousemove', this, true);\n        document.removeEventListener('mouseup', this, true);\n    }\n    /**\n     * A message handler invoked on an `'after-show'` message.\n     */\n    onAfterShow(msg) {\n        this._checkCacheOnNextResize = true;\n    }\n    /**\n     * A message handler invoked on a `'resize'` message.\n     */\n    onResize(msg) {\n        if (!this._checkCacheOnNextResize) {\n            return super.onResize(msg);\n        }\n        this._checkCacheOnNextResize = false;\n        const cache = this._cellLayoutStateCache;\n        const width = parseInt(this.node.style.width, 10);\n        if (cache) {\n            if (width === cache.width) {\n                // Cache identical, do nothing\n                return;\n            }\n        }\n        // Update cache\n        this._cellLayoutStateCache = { width };\n        // Fallback:\n        for (const w of this.widgets) {\n            if (w instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.Cell) {\n                w.editorWidget.update();\n            }\n        }\n    }\n    /**\n     * A message handler invoked on an `'before-hide'` message.\n     */\n    onBeforeHide(msg) {\n        // Update cache\n        const width = parseInt(this.node.style.width, 10);\n        this._cellLayoutStateCache = { width };\n    }\n    /**\n     * Handle `'activate-request'` messages.\n     */\n    onActivateRequest(msg) {\n        this._ensureFocus(true);\n    }\n    /**\n     * Handle `update-request` messages sent to the widget.\n     */\n    onUpdateRequest(msg) {\n        const activeCell = this.activeCell;\n        // Set the appropriate classes on the cells.\n        if (this.mode === 'edit') {\n            this.addClass(EDIT_CLASS);\n            this.removeClass(COMMAND_CLASS);\n        }\n        else {\n            this.addClass(COMMAND_CLASS);\n            this.removeClass(EDIT_CLASS);\n        }\n        if (activeCell) {\n            activeCell.addClass(ACTIVE_CLASS);\n        }\n        let count = 0;\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(this.widgets, widget => {\n            if (widget !== activeCell) {\n                widget.removeClass(ACTIVE_CLASS);\n            }\n            widget.removeClass(OTHER_SELECTED_CLASS);\n            if (this.isSelectedOrActive(widget)) {\n                widget.addClass(SELECTED_CLASS);\n                count++;\n            }\n            else {\n                widget.removeClass(SELECTED_CLASS);\n            }\n        });\n        if (count > 1) {\n            activeCell === null || activeCell === void 0 ? void 0 : activeCell.addClass(OTHER_SELECTED_CLASS);\n        }\n        if (this._fragment) {\n            let el;\n            try {\n                el = this.node.querySelector(this._fragment);\n            }\n            catch (error) {\n                console.warn('Unable to set URI fragment identifier', error);\n            }\n            if (el) {\n                el.scrollIntoView();\n            }\n            this._fragment = '';\n        }\n    }\n    /**\n     * Handle a cell being inserted.\n     */\n    onCellInserted(index, cell) {\n        if (this.model && this.model.modelDB.isCollaborative) {\n            const modelDB = this.model.modelDB;\n            void modelDB.connected.then(() => {\n                if (!cell.isDisposed) {\n                    // Setup the selection style for collaborators.\n                    const localCollaborator = modelDB.collaborators.localCollaborator;\n                    cell.editor.uuid = localCollaborator.sessionId;\n                    cell.editor.selectionStyle = Object.assign(Object.assign({}, _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_1__.CodeEditor.defaultSelectionStyle), { color: localCollaborator.color });\n                }\n            });\n        }\n        cell.editor.edgeRequested.connect(this._onEdgeRequest, this);\n        // If the insertion happened above, increment the active cell\n        // index, otherwise it stays the same.\n        this.activeCellIndex =\n            index <= this.activeCellIndex\n                ? this.activeCellIndex + 1\n                : this.activeCellIndex;\n    }\n    /**\n     * Handle a cell being moved.\n     */\n    onCellMoved(fromIndex, toIndex) {\n        const i = this.activeCellIndex;\n        if (fromIndex === i) {\n            this.activeCellIndex = toIndex;\n        }\n        else if (fromIndex < i && i <= toIndex) {\n            this.activeCellIndex--;\n        }\n        else if (toIndex <= i && i < fromIndex) {\n            this.activeCellIndex++;\n        }\n    }\n    /**\n     * Handle a cell being removed.\n     */\n    onCellRemoved(index, cell) {\n        // If the removal happened above, decrement the active\n        // cell index, otherwise it stays the same.\n        this.activeCellIndex =\n            index <= this.activeCellIndex\n                ? this.activeCellIndex - 1\n                : this.activeCellIndex;\n        if (this.isSelected(cell)) {\n            this._selectionChanged.emit(void 0);\n        }\n    }\n    /**\n     * Handle a new model.\n     */\n    onModelChanged(oldValue, newValue) {\n        super.onModelChanged(oldValue, newValue);\n        // Try to set the active cell index to 0.\n        // It will be set to `-1` if there is no new model or the model is empty.\n        this.activeCellIndex = 0;\n    }\n    /**\n     * Handle edge request signals from cells.\n     */\n    _onEdgeRequest(editor, location) {\n        const prev = this.activeCellIndex;\n        if (location === 'top') {\n            this.activeCellIndex--;\n            // Move the cursor to the first position on the last line.\n            if (this.activeCellIndex < prev) {\n                const editor = this.activeCell.editor;\n                const lastLine = editor.lineCount - 1;\n                editor.setCursorPosition({ line: lastLine, column: 0 });\n            }\n        }\n        else if (location === 'bottom') {\n            this.activeCellIndex++;\n            // Move the cursor to the first character.\n            if (this.activeCellIndex > prev) {\n                const editor = this.activeCell.editor;\n                editor.setCursorPosition({ line: 0, column: 0 });\n            }\n        }\n        this.mode = 'edit';\n    }\n    /**\n     * Ensure that the notebook has proper focus.\n     */\n    _ensureFocus(force = false) {\n        const activeCell = this.activeCell;\n        if (this.mode === 'edit' && activeCell) {\n            if (!activeCell.editor.hasFocus()) {\n                activeCell.editor.focus();\n            }\n        }\n        if (force && !this.node.contains(document.activeElement)) {\n            this.node.focus();\n        }\n    }\n    /**\n     * Find the cell index containing the target html element.\n     *\n     * #### Notes\n     * Returns -1 if the cell is not found.\n     */\n    _findCell(node) {\n        // Trace up the DOM hierarchy to find the root cell node.\n        // Then find the corresponding child and select it.\n        let n = node;\n        while (n && n !== this.node) {\n            if (n.classList.contains(NB_CELL_CLASS)) {\n                const i = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.ArrayExt.findFirstIndex(this.widgets, widget => widget.node === n);\n                if (i !== -1) {\n                    return i;\n                }\n                break;\n            }\n            n = n.parentElement;\n        }\n        return -1;\n    }\n    /**\n     * Find the target of html mouse event and cell index containing this target.\n     *\n     * #### Notes\n     * Returned index is -1 if the cell is not found.\n     */\n    _findEventTargetAndCell(event) {\n        let target = event.target;\n        let index = this._findCell(target);\n        if (index === -1) {\n            // `event.target` sometimes gives an orphaned node in Firefox 57, which\n            // can have `null` anywhere in its parent line. If we fail to find a cell\n            // using `event.target`, try again using a target reconstructed from the\n            // position of the click event.\n            target = document.elementFromPoint(event.clientX, event.clientY);\n            index = this._findCell(target);\n        }\n        return [target, index];\n    }\n    /**\n     * Handle `contextmenu` event.\n     */\n    _evtContextMenuCapture(event) {\n        // Allow the event to propagate un-modified if the user\n        // is holding the shift-key (and probably requesting\n        // the native context menu).\n        if (event.shiftKey) {\n            return;\n        }\n        const [target, index] = this._findEventTargetAndCell(event);\n        const widget = this.widgets[index];\n        if (widget && widget.editorWidget.node.contains(target)) {\n            // Prevent CodeMirror from focusing the editor.\n            // TODO: find an editor-agnostic solution.\n            event.preventDefault();\n        }\n    }\n    /**\n     * Handle `mousedown` event in the capture phase for the widget.\n     */\n    _evtMouseDownCapture(event) {\n        const { button, shiftKey } = event;\n        const [target, index] = this._findEventTargetAndCell(event);\n        const widget = this.widgets[index];\n        // On OS X, the context menu may be triggered with ctrl-left-click. In\n        // Firefox, ctrl-left-click gives an event with button 2, but in Chrome,\n        // ctrl-left-click gives an event with button 0 with the ctrl modifier.\n        if (button === 2 &&\n            !shiftKey &&\n            widget &&\n            widget.editorWidget.node.contains(target)) {\n            this.mode = 'command';\n            // Prevent CodeMirror from focusing the editor.\n            // TODO: find an editor-agnostic solution.\n            event.preventDefault();\n        }\n    }\n    /**\n     * Handle `mousedown` events for the widget.\n     */\n    _evtMouseDown(event) {\n        var _a;\n        const { button, shiftKey } = event;\n        // We only handle main or secondary button actions.\n        if (!(button === 0 || button === 2)) {\n            return;\n        }\n        // Shift right-click gives the browser default behavior.\n        if (shiftKey && button === 2) {\n            return;\n        }\n        const [target, index] = this._findEventTargetAndCell(event);\n        const widget = this.widgets[index];\n        let targetArea;\n        if (widget) {\n            if (widget.editorWidget.node.contains(target)) {\n                targetArea = 'input';\n            }\n            else if (widget.promptNode.contains(target)) {\n                targetArea = 'prompt';\n            }\n            else {\n                targetArea = 'cell';\n            }\n        }\n        else {\n            targetArea = 'notebook';\n        }\n        // Make sure we go to command mode if the click isn't in the cell editor If\n        // we do click in the cell editor, the editor handles the focus event to\n        // switch to edit mode.\n        if (targetArea !== 'input') {\n            this.mode = 'command';\n        }\n        if (targetArea === 'notebook') {\n            this.deselectAll();\n        }\n        else if (targetArea === 'prompt' || targetArea === 'cell') {\n            // We don't want to prevent the default selection behavior\n            // if there is currently text selected in an output.\n            const hasSelection = ((_a = window.getSelection()) !== null && _a !== void 0 ? _a : '').toString() !== '';\n            if (button === 0 && shiftKey && !hasSelection) {\n                // Prevent browser selecting text in prompt or output\n                event.preventDefault();\n                // Shift-click - extend selection\n                try {\n                    this.extendContiguousSelectionTo(index);\n                }\n                catch (e) {\n                    console.error(e);\n                    this.deselectAll();\n                    return;\n                }\n                // Enter selecting mode\n                this._mouseMode = 'select';\n                document.addEventListener('mouseup', this, true);\n                document.addEventListener('mousemove', this, true);\n            }\n            else if (button === 0 && !shiftKey) {\n                // Prepare to start a drag if we are on the drag region.\n                if (targetArea === 'prompt') {\n                    // Prepare for a drag start\n                    this._dragData = {\n                        pressX: event.clientX,\n                        pressY: event.clientY,\n                        index: index\n                    };\n                    // Enter possible drag mode\n                    this._mouseMode = 'couldDrag';\n                    document.addEventListener('mouseup', this, true);\n                    document.addEventListener('mousemove', this, true);\n                    event.preventDefault();\n                }\n                if (!this.isSelectedOrActive(widget)) {\n                    this.deselectAll();\n                    this.activeCellIndex = index;\n                }\n            }\n            else if (button === 2) {\n                if (!this.isSelectedOrActive(widget)) {\n                    this.deselectAll();\n                    this.activeCellIndex = index;\n                }\n                event.preventDefault();\n            }\n        }\n        else if (targetArea === 'input') {\n            if (button === 2 && !this.isSelectedOrActive(widget)) {\n                this.deselectAll();\n                this.activeCellIndex = index;\n            }\n        }\n        // If we didn't set focus above, make sure we get focus now.\n        this._ensureFocus(true);\n    }\n    /**\n     * Handle the `'mouseup'` event on the document.\n     */\n    _evtDocumentMouseup(event) {\n        event.preventDefault();\n        event.stopPropagation();\n        // Remove the event listeners we put on the document\n        document.removeEventListener('mousemove', this, true);\n        document.removeEventListener('mouseup', this, true);\n        if (this._mouseMode === 'couldDrag') {\n            // We didn't end up dragging if we are here, so treat it as a click event.\n            const [, index] = this._findEventTargetAndCell(event);\n            this.deselectAll();\n            this.activeCellIndex = index;\n        }\n        this._mouseMode = null;\n    }\n    /**\n     * Handle the `'mousemove'` event for the widget.\n     */\n    _evtDocumentMousemove(event) {\n        event.preventDefault();\n        event.stopPropagation();\n        // If in select mode, update the selection\n        switch (this._mouseMode) {\n            case 'select': {\n                const target = event.target;\n                const index = this._findCell(target);\n                if (index !== -1) {\n                    this.extendContiguousSelectionTo(index);\n                }\n                break;\n            }\n            case 'couldDrag': {\n                // Check for a drag initialization.\n                const data = this._dragData;\n                const dx = Math.abs(event.clientX - data.pressX);\n                const dy = Math.abs(event.clientY - data.pressY);\n                if (dx >= DRAG_THRESHOLD || dy >= DRAG_THRESHOLD) {\n                    this._mouseMode = null;\n                    this._startDrag(data.index, event.clientX, event.clientY);\n                }\n                break;\n            }\n            default:\n                break;\n        }\n    }\n    /**\n     * Handle the `'lm-dragenter'` event for the widget.\n     */\n    _evtDragEnter(event) {\n        if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n            return;\n        }\n        event.preventDefault();\n        event.stopPropagation();\n        const target = event.target;\n        const index = this._findCell(target);\n        if (index === -1) {\n            return;\n        }\n        const widget = this.layout.widgets[index];\n        widget.node.classList.add(DROP_TARGET_CLASS);\n    }\n    /**\n     * Handle the `'lm-dragleave'` event for the widget.\n     */\n    _evtDragLeave(event) {\n        if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n            return;\n        }\n        event.preventDefault();\n        event.stopPropagation();\n        const elements = this.node.getElementsByClassName(DROP_TARGET_CLASS);\n        if (elements.length) {\n            elements[0].classList.remove(DROP_TARGET_CLASS);\n        }\n    }\n    /**\n     * Handle the `'lm-dragover'` event for the widget.\n     */\n    _evtDragOver(event) {\n        if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n            return;\n        }\n        event.preventDefault();\n        event.stopPropagation();\n        event.dropAction = event.proposedAction;\n        const elements = this.node.getElementsByClassName(DROP_TARGET_CLASS);\n        if (elements.length) {\n            elements[0].classList.remove(DROP_TARGET_CLASS);\n        }\n        const target = event.target;\n        const index = this._findCell(target);\n        if (index === -1) {\n            return;\n        }\n        const widget = this.layout.widgets[index];\n        widget.node.classList.add(DROP_TARGET_CLASS);\n    }\n    /**\n     * Handle the `'lm-drop'` event for the widget.\n     */\n    _evtDrop(event) {\n        if (!event.mimeData.hasData(JUPYTER_CELL_MIME)) {\n            return;\n        }\n        event.preventDefault();\n        event.stopPropagation();\n        if (event.proposedAction === 'none') {\n            event.dropAction = 'none';\n            return;\n        }\n        let target = event.target;\n        while (target && target.parentElement) {\n            if (target.classList.contains(DROP_TARGET_CLASS)) {\n                target.classList.remove(DROP_TARGET_CLASS);\n                break;\n            }\n            target = target.parentElement;\n        }\n        // Model presence should be checked before calling event handlers\n        const model = this.model;\n        const source = event.source;\n        if (source === this) {\n            // Handle the case where we are moving cells within\n            // the same notebook.\n            event.dropAction = 'move';\n            const toMove = event.mimeData.getData('internal:cells');\n            // For collapsed markdown headings with hidden \"child\" cells, move all\n            // child cells as well as the markdown heading.\n            const cell = toMove[toMove.length - 1];\n            if (cell instanceof _jupyterlab_cells__WEBPACK_IMPORTED_MODULE_0__.MarkdownCell && cell.headingCollapsed) {\n                const nextParent = _actions__WEBPACK_IMPORTED_MODULE_10__.NotebookActions.findNextParentHeading(cell, source);\n                if (nextParent > 0) {\n                    const index = (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.findIndex)(source.widgets, (possibleCell) => {\n                        return cell.model.id === possibleCell.model.id;\n                    });\n                    toMove.push(...source.widgets.slice(index + 1, nextParent));\n                }\n            }\n            // Compute the to/from indices for the move.\n            let fromIndex = _lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.ArrayExt.firstIndexOf(this.widgets, toMove[0]);\n            let toIndex = this._findCell(target);\n            // This check is needed for consistency with the view.\n            if (toIndex !== -1 && toIndex > fromIndex) {\n                toIndex -= 1;\n            }\n            else if (toIndex === -1) {\n                // If the drop is within the notebook but not on any cell,\n                // most often this means it is past the cell areas, so\n                // set it to move the cells to the end of the notebook.\n                toIndex = this.widgets.length - 1;\n            }\n            // Don't move if we are within the block of selected cells.\n            if (toIndex >= fromIndex && toIndex < fromIndex + toMove.length) {\n                return;\n            }\n            // Move the cells one by one\n            model.cells.beginCompoundOperation();\n            if (fromIndex < toIndex) {\n                (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(toMove, cellWidget => {\n                    model.cells.move(fromIndex, toIndex);\n                });\n            }\n            else if (fromIndex > toIndex) {\n                (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(toMove, cellWidget => {\n                    model.cells.move(fromIndex++, toIndex++);\n                });\n            }\n            model.cells.endCompoundOperation();\n        }\n        else {\n            // Handle the case where we are copying cells between\n            // notebooks.\n            event.dropAction = 'copy';\n            // Find the target cell and insert the copied cells.\n            let index = this._findCell(target);\n            if (index === -1) {\n                index = this.widgets.length;\n            }\n            const start = index;\n            const values = event.mimeData.getData(JUPYTER_CELL_MIME);\n            const factory = model.contentFactory;\n            // Insert the copies of the original cells.\n            model.cells.beginCompoundOperation();\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(values, (cell) => {\n                let value;\n                switch (cell.cell_type) {\n                    case 'code':\n                        value = factory.createCodeCell({ cell });\n                        break;\n                    case 'markdown':\n                        value = factory.createMarkdownCell({ cell });\n                        break;\n                    default:\n                        value = factory.createRawCell({ cell });\n                        break;\n                }\n                model.cells.insert(index++, value);\n            });\n            model.cells.endCompoundOperation();\n            // Select the inserted cells.\n            this.deselectAll();\n            this.activeCellIndex = start;\n            this.extendContiguousSelectionTo(index - 1);\n        }\n    }\n    /**\n     * Start a drag event.\n     */\n    _startDrag(index, clientX, clientY) {\n        var _a;\n        const cells = this.model.cells;\n        const selected = [];\n        const toMove = [];\n        (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(this.widgets, (widget, i) => {\n            const cell = cells.get(i);\n            if (this.isSelectedOrActive(widget)) {\n                widget.addClass(DROP_SOURCE_CLASS);\n                selected.push(cell.toJSON());\n                toMove.push(widget);\n            }\n        });\n        const activeCell = this.activeCell;\n        let dragImage = null;\n        let countString;\n        if ((activeCell === null || activeCell === void 0 ? void 0 : activeCell.model.type) === 'code') {\n            const executionCount = activeCell.model\n                .executionCount;\n            countString = ' ';\n            if (executionCount) {\n                countString = executionCount.toString();\n            }\n        }\n        else {\n            countString = '';\n        }\n        // Create the drag image.\n        dragImage = Private.createDragImage(selected.length, countString, (_a = activeCell === null || activeCell === void 0 ? void 0 : activeCell.model.value.text.split('\\n')[0].slice(0, 26)) !== null && _a !== void 0 ? _a : '');\n        // Set up the drag event.\n        this._drag = new _lumino_dragdrop__WEBPACK_IMPORTED_MODULE_5__.Drag({\n            mimeData: new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_3__.MimeData(),\n            dragImage,\n            supportedActions: 'copy-move',\n            proposedAction: 'copy',\n            source: this\n        });\n        this._drag.mimeData.setData(JUPYTER_CELL_MIME, selected);\n        // Add mimeData for the fully reified cell widgets, for the\n        // case where the target is in the same notebook and we\n        // can just move the cells.\n        this._drag.mimeData.setData('internal:cells', toMove);\n        // Add mimeData for the text content of the selected cells,\n        // allowing for drag/drop into plain text fields.\n        const textContent = toMove.map(cell => cell.model.value.text).join('\\n');\n        this._drag.mimeData.setData('text/plain', textContent);\n        // Remove mousemove and mouseup listeners and start the drag.\n        document.removeEventListener('mousemove', this, true);\n        document.removeEventListener('mouseup', this, true);\n        this._mouseMode = null;\n        void this._drag.start(clientX, clientY).then(action => {\n            if (this.isDisposed) {\n                return;\n            }\n            this._drag = null;\n            (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_2__.each)(toMove, widget => {\n                widget.removeClass(DROP_SOURCE_CLASS);\n            });\n        });\n    }\n    /**\n     * Handle `focus` events for the widget.\n     */\n    _evtFocusIn(event) {\n        const target = event.target;\n        const index = this._findCell(target);\n        if (index !== -1) {\n            const widget = this.widgets[index];\n            // If the editor itself does not have focus, ensure command mode.\n            if (!widget.editorWidget.node.contains(target)) {\n                this.mode = 'command';\n            }\n            this.activeCellIndex = index;\n            // If the editor has focus, ensure edit mode.\n            const node = widget.editorWidget.node;\n            if (node.contains(target)) {\n                this.mode = 'edit';\n            }\n            this.activeCellIndex = index;\n        }\n        else {\n            // No cell has focus, ensure command mode.\n            this.mode = 'command';\n        }\n    }\n    /**\n     * Handle `focusout` events for the notebook.\n     */\n    _evtFocusOut(event) {\n        const relatedTarget = event.relatedTarget;\n        // Bail if the window is losing focus, to preserve edit mode. This test\n        // assumes that we explicitly focus things rather than calling blur()\n        if (!relatedTarget) {\n            return;\n        }\n        // Bail if the item gaining focus is another cell,\n        // and we should not be entering command mode.\n        const index = this._findCell(relatedTarget);\n        if (index !== -1) {\n            const widget = this.widgets[index];\n            if (widget.editorWidget.node.contains(relatedTarget)) {\n                return;\n            }\n        }\n        // Otherwise enter command mode if not already.\n        if (this.mode !== 'command') {\n            this.mode = 'command';\n            // Switching to command mode currently focuses the notebook element, so\n            // refocus the relatedTarget so the focus actually switches as intended.\n            if (relatedTarget) {\n                relatedTarget.focus();\n            }\n        }\n    }\n    /**\n     * Handle `dblclick` events for the widget.\n     */\n    _evtDblClick(event) {\n        const model = this.model;\n        if (!model) {\n            return;\n        }\n        this.deselectAll();\n        const [target, index] = this._findEventTargetAndCell(event);\n        if (event.target.classList.contains(HEADING_COLLAPSER_CLASS)) {\n            return;\n        }\n        if (index === -1) {\n            return;\n        }\n        this.activeCellIndex = index;\n        if (model.cells.get(index).type === 'markdown') {\n            const widget = this.widgets[index];\n            widget.rendered = false;\n        }\n        else if (target.localName === 'img') {\n            target.classList.toggle(UNCONFINED_CLASS);\n        }\n    }\n    /**\n     * Remove selections from inactive cells to avoid\n     * spurious cursors.\n     */\n    _trimSelections() {\n        for (let i = 0; i < this.widgets.length; i++) {\n            if (i !== this._activeCellIndex) {\n                const cell = this.widgets[i];\n                cell.model.selections.delete(cell.editor.uuid);\n            }\n        }\n    }\n}\n/**\n * The namespace for the `Notebook` class statics.\n */\n(function (Notebook) {\n    /**\n     * The default implementation of a notebook content factory..\n     *\n     * #### Notes\n     * Override methods on this class to customize the default notebook factory\n     * methods that create notebook content.\n     */\n    class ContentFactory extends StaticNotebook.ContentFactory {\n    }\n    Notebook.ContentFactory = ContentFactory;\n    Notebook.defaultContentFactory = new ContentFactory();\n})(Notebook || (Notebook = {}));\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * An attached property for the selected state of a cell.\n     */\n    Private.selectedProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'selected',\n        create: () => false\n    });\n    /**\n     * A custom panel layout for the notebook.\n     */\n    class NotebookPanelLayout extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_9__.PanelLayout {\n        /**\n         * A message handler invoked on an `'update-request'` message.\n         *\n         * #### Notes\n         * This is a reimplementation of the base class method,\n         * and is a no-op.\n         */\n        onUpdateRequest(msg) {\n            // This is a no-op.\n        }\n    }\n    Private.NotebookPanelLayout = NotebookPanelLayout;\n    /**\n     * Create a cell drag image.\n     */\n    function createDragImage(count, promptNumber, cellContent) {\n        if (count > 1) {\n            if (promptNumber !== '') {\n                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.realize(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: DRAG_IMAGE_CLASS }, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_PROMPT_CLASS }, '[' + promptNumber + ']:'), _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent)), _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: CELL_DRAG_MULTIPLE_BACK }, '')));\n            }\n            else {\n                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.realize(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: DRAG_IMAGE_CLASS }, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_PROMPT_CLASS }), _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent)), _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: CELL_DRAG_MULTIPLE_BACK }, '')));\n            }\n        }\n        else {\n            if (promptNumber !== '') {\n                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.realize(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: `${DRAG_IMAGE_CLASS} ${SINGLE_DRAG_IMAGE_CLASS}` }, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_PROMPT_CLASS }, '[' + promptNumber + ']:'), _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent))));\n            }\n            else {\n                return _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.VirtualDOM.realize(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div(_lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.div({ className: `${DRAG_IMAGE_CLASS} ${SINGLE_DRAG_IMAGE_CLASS}` }, _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_PROMPT_CLASS }), _lumino_virtualdom__WEBPACK_IMPORTED_MODULE_8__.h.span({ className: CELL_DRAG_CONTENT_CLASS }, cellContent))));\n            }\n        }\n    }\n    Private.createDragImage = createDragImage;\n    /**\n     * Process the `IOptions` passed to the notebook widget.\n     *\n     * #### Notes\n     * This defaults the content factory to that in the `Notebook` namespace.\n     */\n    function processNotebookOptions(options) {\n        if (options.contentFactory) {\n            return options;\n        }\n        else {\n            return {\n                rendermime: options.rendermime,\n                languagePreference: options.languagePreference,\n                contentFactory: Notebook.defaultContentFactory,\n                mimeTypeService: options.mimeTypeService\n            };\n        }\n    }\n    Private.processNotebookOptions = processNotebookOptions;\n})(Private || (Private = {}));\n//# sourceMappingURL=widget.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/widget.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/notebook/lib/widgetfactory.js":
/*!*****************************************************************!*\
  !*** ../node_modules/@jupyterlab/notebook/lib/widgetfactory.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   \"NotebookWidgetFactory\": () => (/* binding */ NotebookWidgetFactory)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/docregistry */ \"webpack/sharing/consume/default/@jupyterlab/docregistry/@jupyterlab/docregistry\");\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _default_toolbar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./default-toolbar */ \"../node_modules/@jupyterlab/notebook/lib/default-toolbar.js\");\n/* harmony import */ var _panel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./panel */ \"../node_modules/@jupyterlab/notebook/lib/panel.js\");\n/* harmony import */ var _widget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./widget */ \"../node_modules/@jupyterlab/notebook/lib/widget.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n\n/**\n * A widget factory for notebook panels.\n */\nclass NotebookWidgetFactory extends _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_1__.ABCWidgetFactory {\n    /**\n     * Construct a new notebook widget factory.\n     *\n     * @param options - The options used to construct the factory.\n     */\n    constructor(options) {\n        super(options);\n        this.rendermime = options.rendermime;\n        this.contentFactory =\n            options.contentFactory || _panel__WEBPACK_IMPORTED_MODULE_2__.NotebookPanel.defaultContentFactory;\n        this.mimeTypeService = options.mimeTypeService;\n        this._editorConfig =\n            options.editorConfig || _widget__WEBPACK_IMPORTED_MODULE_3__.StaticNotebook.defaultEditorConfig;\n        this._notebookConfig =\n            options.notebookConfig || _widget__WEBPACK_IMPORTED_MODULE_3__.StaticNotebook.defaultNotebookConfig;\n        this._sessionDialogs = options.sessionDialogs || _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.sessionContextDialogs;\n    }\n    /**\n     * A configuration object for cell editor settings.\n     */\n    get editorConfig() {\n        return this._editorConfig;\n    }\n    set editorConfig(value) {\n        this._editorConfig = value;\n    }\n    /**\n     * A configuration object for notebook settings.\n     */\n    get notebookConfig() {\n        return this._notebookConfig;\n    }\n    set notebookConfig(value) {\n        this._notebookConfig = value;\n    }\n    /**\n     * Create a new widget.\n     *\n     * #### Notes\n     * The factory will start the appropriate kernel.\n     */\n    createNewWidget(context, source) {\n        const nbOptions = {\n            rendermime: source\n                ? source.content.rendermime\n                : this.rendermime.clone({ resolver: context.urlResolver }),\n            contentFactory: this.contentFactory,\n            mimeTypeService: this.mimeTypeService,\n            editorConfig: source ? source.content.editorConfig : this._editorConfig,\n            notebookConfig: source\n                ? source.content.notebookConfig\n                : this._notebookConfig\n        };\n        const content = this.contentFactory.createNotebook(nbOptions);\n        return new _panel__WEBPACK_IMPORTED_MODULE_2__.NotebookPanel({ context, content });\n    }\n    /**\n     * Default factory for toolbar items to be added after the widget is created.\n     */\n    defaultToolbarFactory(widget) {\n        return _default_toolbar__WEBPACK_IMPORTED_MODULE_4__.ToolbarItems.getDefaultItems(widget, this._sessionDialogs, this.translator);\n    }\n}\n//# sourceMappingURL=widgetfactory.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/notebook/lib/widgetfactory.js?");

/***/ })

}]);