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

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   isValidFileName: () => (/* binding */ isValidFileName),\n/* harmony export */   renameDialog: () => (/* binding */ renameDialog),\n/* harmony export */   renameFile: () => (/* binding */ renameFile),\n/* harmony export */   shouldOverwrite: () => (/* binding */ shouldOverwrite)\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_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__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_widgets__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__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 * The class name added to file dialogs.\n */\nconst FILE_DIALOG_CLASS = 'jp-FileDialog';\n/**\n * The class name added for the new name label in the rename dialog\n */\nconst RENAME_NEW_NAME_TITLE_CLASS = 'jp-new-name-title';\n/**\n * Rename a file with a dialog.\n */\nfunction renameDialog(manager, context, translator) {\n    translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n    const trans = translator.load('jupyterlab');\n    const localPath = context.localPath.split('/');\n    const fileName = localPath.pop() || context.localPath;\n    return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n        title: trans.__('Rename File'),\n        body: new RenameHandler(fileName),\n        focusNodeSelector: 'input',\n        buttons: [\n            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.cancelButton(),\n            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({\n                label: trans.__('Rename'),\n                ariaLabel: trans.__('Rename File')\n            })\n        ]\n    }).then(result => {\n        if (!result.value) {\n            return null;\n        }\n        if (!isValidFileName(result.value)) {\n            void (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showErrorMessage)(trans.__('Rename Error'), Error(trans.__('\"%1\" is not a valid name for a file. Names must have nonzero length, and cannot include \"/\", \"\\\\\", or \":\"', result.value)));\n            return null;\n        }\n        return context.rename(result.value);\n    });\n}\n/**\n * Rename a file, asking for confirmation if it is overwriting another.\n */\nfunction renameFile(manager, oldPath, newPath) {\n    return manager.rename(oldPath, newPath).catch(error => {\n        if (error.response.status !== 409) {\n            // if it's not caused by an already existing file, rethrow\n            throw error;\n        }\n        // otherwise, ask for confirmation\n        return shouldOverwrite(newPath).then((value) => {\n            if (value) {\n                return manager.overwrite(oldPath, newPath);\n            }\n            return Promise.reject('File not renamed');\n        });\n    });\n}\n/**\n * Ask the user whether to overwrite a file.\n */\nfunction shouldOverwrite(path, translator) {\n    translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n    const trans = translator.load('jupyterlab');\n    const options = {\n        title: trans.__('Overwrite file?'),\n        body: trans.__('\"%1\" already exists, overwrite?', path),\n        buttons: [\n            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.cancelButton(),\n            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.warnButton({\n                label: trans.__('Overwrite'),\n                ariaLabel: trans.__('Overwrite Existing File')\n            })\n        ]\n    };\n    return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)(options).then(result => {\n        return Promise.resolve(result.button.accept);\n    });\n}\n/**\n * Test whether a name is a valid file name\n *\n * Disallows \"/\", \"\\\", and \":\" in file names, as well as names with zero length.\n */\nfunction isValidFileName(name) {\n    const validNameExp = /[\\/\\\\:]/;\n    return name.length > 0 && !validNameExp.test(name);\n}\n/**\n * A widget used to rename a file.\n */\nclass RenameHandler extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_3__.Widget {\n    /**\n     * Construct a new \"rename\" dialog.\n     */\n    constructor(oldPath) {\n        super({ node: Private.createRenameNode(oldPath) });\n        this.addClass(FILE_DIALOG_CLASS);\n        const ext = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.extname(oldPath);\n        const value = (this.inputNode.value = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.basename(oldPath));\n        this.inputNode.setSelectionRange(0, value.length - ext.length);\n    }\n    /**\n     * Get the input text node.\n     */\n    get inputNode() {\n        return this.node.getElementsByTagName('input')[0];\n    }\n    /**\n     * Get the value of the widget.\n     */\n    getValue() {\n        return this.inputNode.value;\n    }\n}\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * Create the node for a rename handler.\n     */\n    function createRenameNode(oldPath, translator) {\n        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        const body = document.createElement('div');\n        const existingLabel = document.createElement('label');\n        existingLabel.textContent = trans.__('File Path');\n        const existingPath = document.createElement('span');\n        existingPath.textContent = oldPath;\n        const nameTitle = document.createElement('label');\n        nameTitle.textContent = trans.__('New Name');\n        nameTitle.className = RENAME_NEW_NAME_TITLE_CLASS;\n        const name = document.createElement('input');\n        body.appendChild(existingLabel);\n        body.appendChild(existingPath);\n        body.appendChild(nameTitle);\n        body.appendChild(name);\n        return body;\n    }\n    Private.createRenameNode = createRenameNode;\n})(Private || (Private = {}));\n//# sourceMappingURL=dialogs.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/dialogs.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   DocumentManager: () => (/* reexport safe */ _manager__WEBPACK_IMPORTED_MODULE_1__.DocumentManager),\n/* harmony export */   DocumentWidgetManager: () => (/* reexport safe */ _widgetmanager__WEBPACK_IMPORTED_MODULE_6__.DocumentWidgetManager),\n/* harmony export */   IDocumentManager: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_5__.IDocumentManager),\n/* harmony export */   IDocumentWidgetOpener: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_5__.IDocumentWidgetOpener),\n/* harmony export */   IRecentsManager: () => (/* reexport safe */ _tokens__WEBPACK_IMPORTED_MODULE_5__.IRecentsManager),\n/* harmony export */   PathStatus: () => (/* reexport safe */ _pathstatus__WEBPACK_IMPORTED_MODULE_2__.PathStatus),\n/* harmony export */   RecentsManager: () => (/* reexport safe */ _recents__WEBPACK_IMPORTED_MODULE_7__.RecentsManager),\n/* harmony export */   SaveHandler: () => (/* reexport safe */ _savehandler__WEBPACK_IMPORTED_MODULE_3__.SaveHandler),\n/* harmony export */   SavingStatus: () => (/* reexport safe */ _savingstatus__WEBPACK_IMPORTED_MODULE_4__.SavingStatus),\n/* harmony export */   isValidFileName: () => (/* reexport safe */ _dialogs__WEBPACK_IMPORTED_MODULE_0__.isValidFileName),\n/* harmony export */   renameDialog: () => (/* reexport safe */ _dialogs__WEBPACK_IMPORTED_MODULE_0__.renameDialog),\n/* harmony export */   renameFile: () => (/* reexport safe */ _dialogs__WEBPACK_IMPORTED_MODULE_0__.renameFile),\n/* harmony export */   shouldOverwrite: () => (/* reexport safe */ _dialogs__WEBPACK_IMPORTED_MODULE_0__.shouldOverwrite)\n/* harmony export */ });\n/* harmony import */ var _dialogs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dialogs */ \"../node_modules/@jupyterlab/docmanager/lib/dialogs.js\");\n/* harmony import */ var _manager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./manager */ \"../node_modules/@jupyterlab/docmanager/lib/manager.js\");\n/* harmony import */ var _pathstatus__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./pathstatus */ \"../node_modules/@jupyterlab/docmanager/lib/pathstatus.js\");\n/* harmony import */ var _savehandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./savehandler */ \"../node_modules/@jupyterlab/docmanager/lib/savehandler.js\");\n/* harmony import */ var _savingstatus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./savingstatus */ \"../node_modules/@jupyterlab/docmanager/lib/savingstatus.js\");\n/* harmony import */ var _tokens__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tokens */ \"../node_modules/@jupyterlab/docmanager/lib/tokens.js\");\n/* harmony import */ var _widgetmanager__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./widgetmanager */ \"../node_modules/@jupyterlab/docmanager/lib/widgetmanager.js\");\n/* harmony import */ var _recents__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./recents */ \"../node_modules/@jupyterlab/docmanager/lib/recents.js\");\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n/**\n * @packageDocumentation\n * @module docmanager\n */\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/index.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   DocumentManager: () => (/* binding */ DocumentManager)\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_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/docregistry */ \"webpack/sharing/consume/default/@jupyterlab/docregistry/@jupyterlab/docregistry\");\n/* harmony import */ var _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docregistry__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_coreutils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__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 _savehandler__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./savehandler */ \"../node_modules/@jupyterlab/docmanager/lib/savehandler.js\");\n/* harmony import */ var _widgetmanager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./widgetmanager */ \"../node_modules/@jupyterlab/docmanager/lib/widgetmanager.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 * The document manager.\n *\n * #### Notes\n * The document manager is used to register model and widget creators,\n * and the file browser uses the document manager to create widgets. The\n * document manager maintains a context for each path and model type that is\n * open, and a list of widgets for each context. The document manager is in\n * control of the proper closing and disposal of the widgets and contexts.\n */\nclass DocumentManager {\n    /**\n     * Construct a new document manager.\n     */\n    constructor(options) {\n        var _a;\n        this._activateRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._contexts = [];\n        this._isDisposed = false;\n        this._autosave = true;\n        this._autosaveInterval = 120;\n        this._lastModifiedCheckMargin = 500;\n        this._renameUntitledFileOnSave = true;\n        this._stateChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator;\n        this.registry = options.registry;\n        this.services = options.manager;\n        this._dialogs =\n            (_a = options.sessionDialogs) !== null && _a !== void 0 ? _a : new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.SessionContextDialogs({ translator: options.translator });\n        this._isConnectedCallback = options.isConnectedCallback || (() => true);\n        this._opener = options.opener;\n        this._when = options.when || options.manager.ready;\n        const widgetManager = new _widgetmanager__WEBPACK_IMPORTED_MODULE_8__.DocumentWidgetManager({\n            registry: this.registry,\n            translator: this.translator,\n            recentsManager: options.recentsManager\n        });\n        widgetManager.activateRequested.connect(this._onActivateRequested, this);\n        widgetManager.stateChanged.connect(this._onWidgetStateChanged, this);\n        this._widgetManager = widgetManager;\n        this._setBusy = options.setBusy;\n    }\n    /**\n     * A signal emitted when one of the documents is activated.\n     */\n    get activateRequested() {\n        return this._activateRequested;\n    }\n    /**\n     * Whether to autosave documents.\n     */\n    get autosave() {\n        return this._autosave;\n    }\n    set autosave(value) {\n        if (this._autosave !== value) {\n            const oldValue = this._autosave;\n            this._autosave = value;\n            // For each existing context, start/stop the autosave handler as needed.\n            this._contexts.forEach(context => {\n                const handler = Private.saveHandlerProperty.get(context);\n                if (!handler) {\n                    return;\n                }\n                if (value === true && !handler.isActive) {\n                    handler.start();\n                }\n                else if (value === false && handler.isActive) {\n                    handler.stop();\n                }\n            });\n            this._stateChanged.emit({\n                name: 'autosave',\n                oldValue,\n                newValue: value\n            });\n        }\n    }\n    /**\n     * Determines the time interval for autosave in seconds.\n     */\n    get autosaveInterval() {\n        return this._autosaveInterval;\n    }\n    set autosaveInterval(value) {\n        if (this._autosaveInterval !== value) {\n            const oldValue = this._autosaveInterval;\n            this._autosaveInterval = value;\n            // For each existing context, set the save interval as needed.\n            this._contexts.forEach(context => {\n                const handler = Private.saveHandlerProperty.get(context);\n                if (!handler) {\n                    return;\n                }\n                handler.saveInterval = value || 120;\n            });\n            this._stateChanged.emit({\n                name: 'autosaveInterval',\n                oldValue,\n                newValue: value\n            });\n        }\n    }\n    /**\n     * Whether to ask confirmation to close a tab or not.\n     */\n    get confirmClosingDocument() {\n        return this._widgetManager.confirmClosingDocument;\n    }\n    set confirmClosingDocument(value) {\n        if (this._widgetManager.confirmClosingDocument !== value) {\n            const oldValue = this._widgetManager.confirmClosingDocument;\n            this._widgetManager.confirmClosingDocument = value;\n            this._stateChanged.emit({\n                name: 'confirmClosingDocument',\n                oldValue,\n                newValue: value\n            });\n        }\n    }\n    /**\n     * Defines max acceptable difference, in milliseconds, between last modified timestamps on disk and client\n     */\n    get lastModifiedCheckMargin() {\n        return this._lastModifiedCheckMargin;\n    }\n    set lastModifiedCheckMargin(value) {\n        if (this._lastModifiedCheckMargin !== value) {\n            const oldValue = this._lastModifiedCheckMargin;\n            this._lastModifiedCheckMargin = value;\n            // For each existing context, update the margin value.\n            this._contexts.forEach(context => {\n                context.lastModifiedCheckMargin = value;\n            });\n            this._stateChanged.emit({\n                name: 'lastModifiedCheckMargin',\n                oldValue,\n                newValue: value\n            });\n        }\n    }\n    /**\n     * Whether to ask the user to rename untitled file on first manual save.\n     */\n    get renameUntitledFileOnSave() {\n        return this._renameUntitledFileOnSave;\n    }\n    set renameUntitledFileOnSave(value) {\n        if (this._renameUntitledFileOnSave !== value) {\n            const oldValue = this._renameUntitledFileOnSave;\n            this._renameUntitledFileOnSave = value;\n            this._stateChanged.emit({\n                name: 'renameUntitledFileOnSave',\n                oldValue,\n                newValue: value\n            });\n        }\n    }\n    /**\n     * Signal triggered when an attribute changes.\n     */\n    get stateChanged() {\n        return this._stateChanged;\n    }\n    /**\n     * Get whether the document manager has been disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources held by the document manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        // Clear any listeners for our signals.\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal.clearData(this);\n        // Close all the widgets for our contexts and dispose the widget manager.\n        this._contexts.forEach(context => {\n            return this._widgetManager.closeWidgets(context);\n        });\n        this._widgetManager.dispose();\n        // Clear the context list.\n        this._contexts.length = 0;\n    }\n    /**\n     * Clone a widget.\n     *\n     * @param widget - The source widget.\n     *\n     * @returns A new widget or `undefined`.\n     *\n     * #### Notes\n     *  Uses the same widget factory and context as the source, or returns\n     *  `undefined` if the source widget is not managed by this manager.\n     */\n    cloneWidget(widget) {\n        return this._widgetManager.cloneWidget(widget);\n    }\n    /**\n     * Close all of the open documents.\n     *\n     * @returns A promise resolving when the widgets are closed.\n     */\n    closeAll() {\n        return Promise.all(this._contexts.map(context => this._widgetManager.closeWidgets(context))).then(() => undefined);\n    }\n    /**\n     * Close the widgets associated with a given path.\n     *\n     * @param path - The target path.\n     *\n     * @returns A promise resolving when the widgets are closed.\n     */\n    closeFile(path) {\n        const close = this._contextsForPath(path).map(c => this._widgetManager.closeWidgets(c));\n        return Promise.all(close).then(x => undefined);\n    }\n    /**\n     * Get the document context for a widget.\n     *\n     * @param widget - The widget of interest.\n     *\n     * @returns The context associated with the widget, or `undefined` if no such\n     * context exists.\n     */\n    contextForWidget(widget) {\n        return this._widgetManager.contextForWidget(widget);\n    }\n    /**\n     * Copy a file.\n     *\n     * @param fromFile - The full path of the original file.\n     *\n     * @param toDir - The full path to the target directory.\n     *\n     * @returns A promise which resolves to the contents of the file.\n     */\n    copy(fromFile, toDir) {\n        return this.services.contents.copy(fromFile, toDir);\n    }\n    /**\n     * Create a new file and return the widget used to view it.\n     *\n     * @param path - The file path to create.\n     *\n     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.\n     *\n     * @param kernel - An optional kernel name/id to override the default.\n     *\n     * @returns The created widget, or `undefined`.\n     *\n     * #### Notes\n     * This function will return `undefined` if a valid widget factory\n     * cannot be found.\n     */\n    createNew(path, widgetName = 'default', kernel) {\n        return this._createOrOpenDocument('create', path, widgetName, kernel);\n    }\n    /**\n     * Delete a file.\n     *\n     * @param path - The full path to the file to be deleted.\n     *\n     * @returns A promise which resolves when the file is deleted.\n     *\n     * #### Notes\n     * If there is a running session associated with the file and no other\n     * sessions are using the kernel, the session will be shut down.\n     */\n    deleteFile(path) {\n        return this.services.sessions\n            .stopIfNeeded(path)\n            .then(() => {\n            return this.services.contents.delete(path);\n        })\n            .then(() => {\n            this._contextsForPath(path).forEach(context => this._widgetManager.deleteWidgets(context));\n            return Promise.resolve(void 0);\n        });\n    }\n    /**\n     * Duplicate a file.\n     *\n     * @param path - The full path to the file to be duplicated.\n     *\n     * @returns A promise which resolves when the file is duplicated.\n     */\n    duplicate(path) {\n        const basePath = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.dirname(path);\n        return this.services.contents.copy(path, basePath);\n    }\n    /**\n     * See if a widget already exists for the given path and widget name.\n     *\n     * @param path - The file path to use.\n     *\n     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.\n     *\n     * @returns The found widget, or `undefined`.\n     *\n     * #### Notes\n     * This can be used to find an existing widget instead of opening\n     * a new widget.\n     */\n    findWidget(path, widgetName = 'default') {\n        const newPath = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.PathExt.normalize(path);\n        let widgetNames = [widgetName];\n        if (widgetName === 'default') {\n            const factory = this.registry.defaultWidgetFactory(newPath);\n            if (!factory) {\n                return undefined;\n            }\n            widgetNames = [factory.name];\n        }\n        else if (widgetName === null) {\n            widgetNames = this.registry\n                .preferredWidgetFactories(newPath)\n                .map(f => f.name);\n        }\n        for (const context of this._contextsForPath(newPath)) {\n            for (const widgetName of widgetNames) {\n                if (widgetName !== null) {\n                    const widget = this._widgetManager.findWidget(context, widgetName);\n                    if (widget) {\n                        return widget;\n                    }\n                }\n            }\n        }\n        return undefined;\n    }\n    /**\n     * Create a new untitled file.\n     *\n     * @param options - The file content creation options.\n     */\n    newUntitled(options) {\n        if (options.type === 'file') {\n            options.ext = options.ext || '.txt';\n        }\n        return this.services.contents.newUntitled(options);\n    }\n    /**\n     * Open a file and return the widget used to view it.\n     *\n     * @param path - The file path to open.\n     *\n     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.\n     *\n     * @param kernel - An optional kernel name/id to override the default.\n     *\n     * @returns The created widget, or `undefined`.\n     *\n     * #### Notes\n     * This function will return `undefined` if a valid widget factory\n     * cannot be found.\n     */\n    open(path, widgetName = 'default', kernel, options) {\n        return this._createOrOpenDocument('open', path, widgetName, kernel, options);\n    }\n    /**\n     * Open a file and return the widget used to view it.\n     * Reveals an already existing editor.\n     *\n     * @param path - The file path to open.\n     *\n     * @param widgetName - The name of the widget factory to use. 'default' will use the default widget.\n     *\n     * @param kernel - An optional kernel name/id to override the default.\n     *\n     * @returns The created widget, or `undefined`.\n     *\n     * #### Notes\n     * This function will return `undefined` if a valid widget factory\n     * cannot be found.\n     */\n    openOrReveal(path, widgetName = 'default', kernel, options) {\n        const widget = this.findWidget(path, widgetName);\n        if (widget) {\n            this._opener.open(widget, {\n                type: widgetName,\n                ...options\n            });\n            return widget;\n        }\n        return this.open(path, widgetName, kernel, options !== null && options !== void 0 ? options : {});\n    }\n    /**\n     * Overwrite a file.\n     *\n     * @param oldPath - The full path to the original file.\n     *\n     * @param newPath - The full path to the new file.\n     *\n     * @returns A promise containing the new file contents model.\n     */\n    overwrite(oldPath, newPath) {\n        // Cleanly overwrite the file by moving it, making sure the original does\n        // not exist, and then renaming to the new path.\n        const tempPath = `${newPath}.${_lumino_coreutils__WEBPACK_IMPORTED_MODULE_5__.UUID.uuid4()}`;\n        const cb = () => this.rename(tempPath, newPath);\n        return this.rename(oldPath, tempPath)\n            .then(() => {\n            return this.deleteFile(newPath);\n        })\n            .then(cb, cb);\n    }\n    /**\n     * Rename a file or directory.\n     *\n     * @param oldPath - The full path to the original file.\n     *\n     * @param newPath - The full path to the new file.\n     *\n     * @returns A promise containing the new file contents model.  The promise\n     * will reject if the newPath already exists.  Use [[overwrite]] to overwrite\n     * a file.\n     */\n    rename(oldPath, newPath) {\n        return this.services.contents.rename(oldPath, newPath);\n    }\n    /**\n     * Find a context for a given path and factory name.\n     */\n    _findContext(path, factoryName) {\n        const normalizedPath = this.services.contents.normalize(path);\n        return (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.find)(this._contexts, context => {\n            return (context.path === normalizedPath && context.factoryName === factoryName);\n        });\n    }\n    /**\n     * Get the contexts for a given path.\n     *\n     * #### Notes\n     * There may be more than one context for a given path if the path is open\n     * with multiple model factories (for example, a notebook can be open with a\n     * notebook model factory and a text model factory).\n     */\n    _contextsForPath(path) {\n        const normalizedPath = this.services.contents.normalize(path);\n        return this._contexts.filter(context => context.path === normalizedPath);\n    }\n    /**\n     * Create a context from a path and a model factory.\n     */\n    _createContext(path, factory, kernelPreference) {\n        // TODO: Make it impossible to open two different contexts for the same\n        // path. Or at least prompt the closing of all widgets associated with the\n        // old context before opening the new context. This will make things much\n        // more consistent for the users, at the cost of some confusion about what\n        // models are and why sometimes they cannot open the same file in different\n        // widgets that have different models.\n        // Allow options to be passed when adding a sibling.\n        const adopter = (widget, options) => {\n            this._widgetManager.adoptWidget(context, widget);\n            // TODO should we pass the type for layout customization\n            this._opener.open(widget, options);\n        };\n        const context = new _jupyterlab_docregistry__WEBPACK_IMPORTED_MODULE_2__.Context({\n            opener: adopter,\n            manager: this.services,\n            factory,\n            path,\n            kernelPreference,\n            setBusy: this._setBusy,\n            sessionDialogs: this._dialogs,\n            lastModifiedCheckMargin: this._lastModifiedCheckMargin,\n            translator: this.translator\n        });\n        const handler = new _savehandler__WEBPACK_IMPORTED_MODULE_9__.SaveHandler({\n            context,\n            isConnectedCallback: this._isConnectedCallback,\n            saveInterval: this.autosaveInterval\n        });\n        Private.saveHandlerProperty.set(context, handler);\n        void context.ready.then(() => {\n            if (this.autosave) {\n                handler.start();\n            }\n        });\n        context.disposed.connect(this._onContextDisposed, this);\n        this._contexts.push(context);\n        return context;\n    }\n    /**\n     * Handle a context disposal.\n     */\n    _onContextDisposed(context) {\n        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_4__.ArrayExt.removeFirstOf(this._contexts, context);\n    }\n    /**\n     * Get the widget factory for a given widget name.\n     */\n    _widgetFactoryFor(path, widgetName) {\n        const { registry } = this;\n        if (widgetName === 'default') {\n            const factory = registry.defaultWidgetFactory(path);\n            if (!factory) {\n                return undefined;\n            }\n            widgetName = factory.name;\n        }\n        return registry.getWidgetFactory(widgetName);\n    }\n    /**\n     * Creates a new document, or loads one from disk, depending on the `which` argument.\n     * If `which==='create'`, then it creates a new document. If `which==='open'`,\n     * then it loads the document from disk.\n     *\n     * The two cases differ in how the document context is handled, but the creation\n     * of the widget and launching of the kernel are identical.\n     */\n    _createOrOpenDocument(which, path, widgetName = 'default', kernel, options) {\n        const widgetFactory = this._widgetFactoryFor(path, widgetName);\n        if (!widgetFactory) {\n            return undefined;\n        }\n        const modelName = widgetFactory.modelName || 'text';\n        const factory = this.registry.getModelFactory(modelName);\n        if (!factory) {\n            return undefined;\n        }\n        // Handle the kernel preference.\n        const preference = this.registry.getKernelPreference(path, widgetFactory.name, kernel);\n        let context;\n        let ready = Promise.resolve(undefined);\n        // Handle the load-from-disk case\n        if (which === 'open') {\n            // Use an existing context if available.\n            context = this._findContext(path, factory.name) || null;\n            if (!context) {\n                context = this._createContext(path, factory, preference);\n                // Populate the model, either from disk or a\n                // model backend.\n                ready = this._when.then(() => context.initialize(false));\n            }\n        }\n        else if (which === 'create') {\n            context = this._createContext(path, factory, preference);\n            // Immediately save the contents to disk.\n            ready = this._when.then(() => context.initialize(true));\n        }\n        else {\n            throw new Error(`Invalid argument 'which': ${which}`);\n        }\n        const widget = this._widgetManager.createWidget(widgetFactory, context);\n        this._opener.open(widget, { type: widgetFactory.name, ...options });\n        // If the initial opening of the context fails, dispose of the widget.\n        ready.catch(err => {\n            console.error(`Failed to initialize the context with '${factory.name}' for ${path}`, err);\n            widget.close();\n        });\n        return widget;\n    }\n    /**\n     * Handle an activateRequested signal from the widget manager.\n     */\n    _onActivateRequested(sender, args) {\n        this._activateRequested.emit(args);\n    }\n    _onWidgetStateChanged(sender, args) {\n        if (args.name === 'confirmClosingDocument') {\n            this._stateChanged.emit(args);\n        }\n    }\n}\n/**\n * A namespace for private data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * An attached property for a context save handler.\n     */\n    Private.saveHandlerProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'saveHandler',\n        create: () => undefined\n    });\n})(Private || (Private = {}));\n//# sourceMappingURL=manager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/manager.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   PathStatus: () => (/* binding */ PathStatus)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__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_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// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n/**\n * A pure component for rendering a file path (or activity name).\n *\n * @param props - the props for the component.\n *\n * @returns a tsx component for a file path.\n */\nfunction PathStatusComponent(props) {\n    return react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_1__.TextItem, { source: props.name, title: props.fullPath });\n}\n/**\n * A status bar item for the current file path (or activity name).\n */\nclass PathStatus extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.VDomRenderer {\n    /**\n     * Construct a new PathStatus status item.\n     */\n    constructor(opts) {\n        super(new PathStatus.Model(opts.docManager));\n        this.node.title = this.model.path;\n    }\n    /**\n     * Render the status item.\n     */\n    render() {\n        return (react__WEBPACK_IMPORTED_MODULE_3___default().createElement(PathStatusComponent, { fullPath: this.model.path, name: this.model.name }));\n    }\n}\n/**\n * A namespace for PathStatus statics.\n */\n(function (PathStatus) {\n    /**\n     * A VDomModel for rendering the PathStatus status item.\n     */\n    class Model extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.VDomModel {\n        /**\n         * Construct a new model.\n         *\n         * @param docManager the application document manager. Used to check\n         *   whether the current widget is a document.\n         */\n        constructor(docManager) {\n            super();\n            /**\n             * React to a title change for the current widget.\n             */\n            this._onTitleChange = (title) => {\n                const oldState = this._getAllState();\n                this._name = title.label;\n                this._triggerChange(oldState, this._getAllState());\n            };\n            /**\n             * React to a path change for the current document.\n             */\n            this._onPathChange = (_documentModel, newPath) => {\n                const oldState = this._getAllState();\n                this._path = newPath;\n                this._name = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PathExt.basename(newPath);\n                this._triggerChange(oldState, this._getAllState());\n            };\n            this._path = '';\n            this._name = '';\n            this._widget = null;\n            this._docManager = docManager;\n        }\n        /**\n         * The current path for the application.\n         */\n        get path() {\n            return this._path;\n        }\n        /**\n         * The name of the current activity.\n         */\n        get name() {\n            return this._name;\n        }\n        /**\n         * The current widget for the application.\n         */\n        get widget() {\n            return this._widget;\n        }\n        set widget(widget) {\n            const oldWidget = this._widget;\n            if (oldWidget !== null) {\n                const oldContext = this._docManager.contextForWidget(oldWidget);\n                if (oldContext) {\n                    oldContext.pathChanged.disconnect(this._onPathChange);\n                }\n                else {\n                    oldWidget.title.changed.disconnect(this._onTitleChange);\n                }\n            }\n            const oldState = this._getAllState();\n            this._widget = widget;\n            if (this._widget === null) {\n                this._path = '';\n                this._name = '';\n            }\n            else {\n                const widgetContext = this._docManager.contextForWidget(this._widget);\n                if (widgetContext) {\n                    this._path = widgetContext.path;\n                    this._name = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PathExt.basename(widgetContext.path);\n                    widgetContext.pathChanged.connect(this._onPathChange);\n                }\n                else {\n                    this._path = '';\n                    this._name = this._widget.title.label;\n                    this._widget.title.changed.connect(this._onTitleChange);\n                }\n            }\n            this._triggerChange(oldState, this._getAllState());\n        }\n        /**\n         * Get the current state of the model.\n         */\n        _getAllState() {\n            return [this._path, this._name];\n        }\n        /**\n         * Trigger a state change to rerender.\n         */\n        _triggerChange(oldState, newState) {\n            if (oldState[0] !== newState[0] || oldState[1] !== newState[1]) {\n                this.stateChanged.emit(void 0);\n            }\n        }\n    }\n    PathStatus.Model = Model;\n})(PathStatus || (PathStatus = {}));\n//# sourceMappingURL=pathstatus.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/pathstatus.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   RecentsManager: () => (/* binding */ RecentsManager)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _lumino_polling__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lumino/polling */ \"webpack/sharing/consume/default/@lumino/polling/@lumino/polling\");\n/* harmony import */ var _lumino_polling__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_polling__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_2__);\n/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n\n\n/**\n * Manager for recently opened and closed documents.\n */\nclass RecentsManager {\n    constructor(options) {\n        this._recentsChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_2__.Signal(this);\n        this._recents = {\n            opened: [],\n            closed: []\n        };\n        this._isDisposed = false;\n        this._maxRecentsLength = 10;\n        this._saveDebouncer = new _lumino_polling__WEBPACK_IMPORTED_MODULE_1__.Debouncer(this._save.bind(this), 500);\n        this._stateDB = options.stateDB;\n        this._contentsManager = options.contents;\n        this.updateRootDir();\n        this._loadRecents().catch(r => {\n            console.error(`Failed to load recent list from state:\\n${r}`);\n        });\n    }\n    /**\n     * Whether the manager is disposed or not.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * List of recently opened items\n     */\n    get recentlyOpened() {\n        const recents = this._recents.opened || [];\n        return recents.filter(r => r.root === this._serverRoot);\n    }\n    /**\n     * List of recently opened items\n     */\n    get recentlyClosed() {\n        const recents = this._recents.closed || [];\n        return recents.filter(r => r.root === this._serverRoot);\n    }\n    /**\n     * Signal emitted when the recent list changes.\n     */\n    get changed() {\n        return this._recentsChanged;\n    }\n    /**\n     * Maximal number of recent items to list.\n     */\n    get maximalRecentsLength() {\n        return this._maxRecentsLength;\n    }\n    set maximalRecentsLength(value) {\n        this._maxRecentsLength = Math.round(Math.max(1, value));\n        let changed = false;\n        for (const type of ['opened', 'closed']) {\n            if (this._recents[type].length > this._maxRecentsLength) {\n                this._recents[type].length = this._maxRecentsLength;\n                changed = true;\n            }\n        }\n        if (changed) {\n            this._recentsChanged.emit(undefined);\n        }\n    }\n    /**\n     * Dispose recent manager resources\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_2__.Signal.clearData(this);\n        this._saveDebouncer.dispose();\n    }\n    /**\n     * Add a new path to the recent list.\n     */\n    addRecent(document, event) {\n        const recent = {\n            ...document,\n            root: this._serverRoot\n        };\n        const recents = this._recents[event];\n        // Check if it's already present; if so remove it\n        const existingIndex = recents.findIndex(r => r.path === document.path);\n        if (existingIndex >= 0) {\n            recents.splice(existingIndex, 1);\n        }\n        // Add to the front of the list\n        recents.unshift(recent);\n        this._setRecents(recents, event);\n        this._recentsChanged.emit(undefined);\n    }\n    /**\n     * Clear the recents list\n     */\n    clearRecents() {\n        this._setRecents([], 'opened');\n        this._setRecents([], 'closed');\n        this._recentsChanged.emit(undefined);\n    }\n    /**\n     * Remove the document from recents list.\n     */\n    removeRecent(document, event) {\n        this._removeRecent(document.path, [event]);\n    }\n    /**\n     * Check if the recent item is valid, remove if it from both lists if it is not.\n     */\n    async validate(recent) {\n        const valid = await this._isValid(recent);\n        if (!valid) {\n            this._removeRecent(recent.path);\n        }\n        return valid;\n    }\n    /**\n     * Set server root dir.\n     *\n     * Note: protected to allow unit-testing.\n     */\n    updateRootDir() {\n        this._serverRoot = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PageConfig.getOption('serverRoot');\n    }\n    /**\n     * Remove a path from both lists (opened and closed).\n     */\n    _removeRecent(path, lists = ['opened', 'closed']) {\n        let changed = false;\n        for (const type of lists) {\n            const recents = this._recents[type];\n            const newRecents = recents.filter(r => path !== r.path);\n            if (recents.length !== newRecents.length) {\n                this._setRecents(newRecents, type);\n                changed = true;\n            }\n        }\n        if (changed) {\n            this._recentsChanged.emit(undefined);\n        }\n    }\n    /**\n     * Check if the path of a given recent document exists.\n     */\n    async _isValid(recent) {\n        var _a;\n        try {\n            await this._contentsManager.get(recent.path, { content: false });\n        }\n        catch (e) {\n            if (((_a = e.response) === null || _a === void 0 ? void 0 : _a.status) === 404) {\n                return false;\n            }\n        }\n        return true;\n    }\n    /**\n     * Set the recent list\n     * @param recents The new recent list\n     */\n    _setRecents(recents, type) {\n        this._recents[type] = recents\n            .slice(0, this.maximalRecentsLength)\n            .sort((a, b) => {\n            if (a.root === b.root) {\n                return 0;\n            }\n            else {\n                return a.root !== this._serverRoot ? 1 : -1;\n            }\n        });\n        this._saveDebouncer.invoke().catch(console.warn);\n    }\n    /**\n     * Load the recent items from the state.\n     */\n    async _loadRecents() {\n        const recents = (await this._stateDB.fetch(Private.stateDBKey)) || {\n            opened: [],\n            closed: []\n        };\n        const allRecents = [...recents.opened, ...recents.closed];\n        const invalidPaths = new Set(await this._getInvalidPaths(allRecents));\n        for (const type of ['opened', 'closed']) {\n            this._setRecents(recents[type].filter(r => !invalidPaths.has(r.path)), type);\n        }\n        this._recentsChanged.emit(undefined);\n    }\n    /**\n     * Get the list of invalid path in recents.\n     */\n    async _getInvalidPaths(recents) {\n        const invalidPathsOrNulls = await Promise.all(recents.map(async (r) => {\n            if (await this._isValid(r)) {\n                return null;\n            }\n            else {\n                return r.path;\n            }\n        }));\n        return invalidPathsOrNulls.filter(x => typeof x === 'string');\n    }\n    /**\n     * Save the recent items to the state.\n     */\n    async _save() {\n        try {\n            await this._stateDB.save(Private.stateDBKey, this._recents);\n        }\n        catch (e) {\n            console.log('Saving recents failed', e);\n        }\n    }\n}\nvar Private;\n(function (Private) {\n    /**\n     * Key reserved in the state database.\n     */\n    Private.stateDBKey = 'docmanager:recents';\n})(Private || (Private = {}));\n//# sourceMappingURL=recents.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/recents.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   SaveHandler: () => (/* binding */ SaveHandler)\n/* harmony export */ });\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_0__);\n// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n/**\n * A class that manages the auto saving of a document.\n *\n * #### Notes\n * Implements https://github.com/ipython/ipython/wiki/IPEP-15:-Autosaving-the-IPython-Notebook.\n */\nclass SaveHandler {\n    /**\n     * Construct a new save handler.\n     */\n    constructor(options) {\n        this._autosaveTimer = -1;\n        this._minInterval = -1;\n        this._interval = -1;\n        this._isActive = false;\n        this._inDialog = false;\n        this._isDisposed = false;\n        this._multiplier = 10;\n        this._context = options.context;\n        this._isConnectedCallback = options.isConnectedCallback || (() => true);\n        const interval = options.saveInterval || 120;\n        this._minInterval = interval * 1000;\n        this._interval = this._minInterval;\n        // Restart the timer when the contents model is updated.\n        this._context.fileChanged.connect(this._setTimer, this);\n        this._context.disposed.connect(this.dispose, this);\n    }\n    /**\n     * The save interval used by the timer (in seconds).\n     */\n    get saveInterval() {\n        return this._interval / 1000;\n    }\n    set saveInterval(value) {\n        this._minInterval = this._interval = value * 1000;\n        if (this._isActive) {\n            this._setTimer();\n        }\n    }\n    /**\n     * Get whether the handler is active.\n     */\n    get isActive() {\n        return this._isActive;\n    }\n    /**\n     * Get whether the save handler is disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources used by the save handler.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        clearTimeout(this._autosaveTimer);\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_0__.Signal.clearData(this);\n    }\n    /**\n     * Start the autosaver.\n     */\n    start() {\n        this._isActive = true;\n        this._setTimer();\n    }\n    /**\n     * Stop the autosaver.\n     */\n    stop() {\n        this._isActive = false;\n        clearTimeout(this._autosaveTimer);\n    }\n    /**\n     * Set the timer.\n     */\n    _setTimer() {\n        clearTimeout(this._autosaveTimer);\n        if (!this._isActive) {\n            return;\n        }\n        this._autosaveTimer = window.setTimeout(() => {\n            if (this._isConnectedCallback()) {\n                this._save();\n            }\n        }, this._interval);\n    }\n    /**\n     * Handle an autosave timeout.\n     */\n    _save() {\n        const context = this._context;\n        // Trigger the next update.\n        this._setTimer();\n        if (!context) {\n            return;\n        }\n        // Bail if the model is not dirty or the file is not writable, or the dialog\n        // is already showing.\n        const writable = context.contentsModel && context.contentsModel.writable;\n        if (!writable || !context.model.dirty || this._inDialog) {\n            return;\n        }\n        const start = new Date().getTime();\n        context\n            .save()\n            .then(() => {\n            if (this.isDisposed) {\n                return;\n            }\n            const duration = new Date().getTime() - start;\n            // New save interval: higher of 10x save duration or min interval.\n            this._interval = Math.max(this._multiplier * duration, this._minInterval);\n            // Restart the update to pick up the new interval.\n            this._setTimer();\n        })\n            .catch(err => {\n            // If the user canceled the save, do nothing.\n            const { name } = err;\n            if (name === 'ModalCancelError' || name === 'ModalDuplicateError') {\n                return;\n            }\n            // Otherwise, log the error.\n            console.error('Error in Auto-Save', err.message);\n        });\n    }\n}\n//# sourceMappingURL=savehandler.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/savehandler.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   SavingStatus: () => (/* binding */ SavingStatus)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/statusbar */ \"webpack/sharing/consume/default/@jupyterlab/statusbar/@jupyterlab/statusbar\");\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__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// Copyright (c) Jupyter Development Team.\n// Distributed under the terms of the Modified BSD License.\n\n\n\n\n/**\n * A pure functional component for a Saving status item.\n *\n * @param props - the props for the component.\n *\n * @returns a tsx component for rendering the saving state.\n */\nfunction SavingStatusComponent(props) {\n    return react__WEBPACK_IMPORTED_MODULE_3___default().createElement(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0__.TextItem, { source: props.fileStatus });\n}\n/**\n * The amount of time (in ms) to retain the saving completed message\n * before hiding the status item.\n */\nconst SAVING_COMPLETE_MESSAGE_MILLIS = 2000;\n/**\n * A VDomRenderer for a saving status item.\n */\nclass SavingStatus extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.VDomRenderer {\n    /**\n     * Create a new SavingStatus item.\n     */\n    constructor(opts) {\n        super(new SavingStatus.Model(opts.docManager));\n        const translator = opts.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_1__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        this._statusMap = {\n            completed: trans.__('Saving completed'),\n            started: trans.__('Saving started'),\n            failed: trans.__('Saving failed')\n        };\n    }\n    /**\n     * Render the SavingStatus item.\n     */\n    render() {\n        if (this.model === null || this.model.status === null) {\n            return null;\n        }\n        else {\n            return (react__WEBPACK_IMPORTED_MODULE_3___default().createElement(SavingStatusComponent, { fileStatus: this._statusMap[this.model.status] }));\n        }\n    }\n}\n/**\n * A namespace for SavingStatus statics.\n */\n(function (SavingStatus) {\n    /**\n     * A VDomModel for the SavingStatus item.\n     */\n    class Model extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.VDomModel {\n        /**\n         * Create a new SavingStatus model.\n         */\n        constructor(docManager) {\n            super();\n            /**\n             * React to a saving status change from the current document widget.\n             */\n            this._onStatusChange = (_, newStatus) => {\n                this._status = newStatus;\n                if (this._status === 'completed') {\n                    setTimeout(() => {\n                        this._status = null;\n                        this.stateChanged.emit(void 0);\n                    }, SAVING_COMPLETE_MESSAGE_MILLIS);\n                    this.stateChanged.emit(void 0);\n                }\n                else {\n                    this.stateChanged.emit(void 0);\n                }\n            };\n            this._status = null;\n            this._widget = null;\n            this._status = null;\n            this.widget = null;\n            this._docManager = docManager;\n        }\n        /**\n         * The current status of the model.\n         */\n        get status() {\n            return this._status;\n        }\n        /**\n         * The current widget for the model. Any widget can be assigned,\n         * but it only has any effect if the widget is an IDocument widget\n         * known to the application document manager.\n         */\n        get widget() {\n            return this._widget;\n        }\n        set widget(widget) {\n            var _a, _b;\n            const oldWidget = this._widget;\n            if (oldWidget !== null) {\n                const oldContext = this._docManager.contextForWidget(oldWidget);\n                if (oldContext) {\n                    oldContext.saveState.disconnect(this._onStatusChange);\n                }\n                else if ((_a = this._widget.content) === null || _a === void 0 ? void 0 : _a.saveStateChanged) {\n                    this._widget.content.saveStateChanged.disconnect(this._onStatusChange);\n                }\n            }\n            this._widget = widget;\n            if (this._widget === null) {\n                this._status = null;\n            }\n            else {\n                const widgetContext = this._docManager.contextForWidget(this._widget);\n                if (widgetContext) {\n                    widgetContext.saveState.connect(this._onStatusChange);\n                }\n                else if ((_b = this._widget.content) === null || _b === void 0 ? void 0 : _b.saveStateChanged) {\n                    this._widget.content.saveStateChanged.connect(this._onStatusChange);\n                }\n            }\n        }\n    }\n    SavingStatus.Model = Model;\n})(SavingStatus || (SavingStatus = {}));\n//# sourceMappingURL=savingstatus.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/savingstatus.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   IDocumentManager: () => (/* binding */ IDocumentManager),\n/* harmony export */   IDocumentWidgetOpener: () => (/* binding */ IDocumentWidgetOpener),\n/* harmony export */   IRecentsManager: () => (/* binding */ IRecentsManager)\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/**\n * The document registry token.\n */\nconst IDocumentManager = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/docmanager:IDocumentManager', `A service for the manager for all\n  documents used by the application. Use this if you want to open and close documents,\n  create and delete files, and otherwise interact with the file system.`);\n/**\n * The document widget opener token.\n */\nconst IDocumentWidgetOpener = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/docmanager:IDocumentWidgetOpener', `A service to open a widget.`);\n/**\n * The recent documents database token.\n */\nconst IRecentsManager = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('@jupyterlab/docmanager:IRecentsManager', `A service providing information about recently opened and closed documents`);\n//# sourceMappingURL=tokens.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/tokens.js?");

/***/ }),

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

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */   DocumentWidgetManager: () => (/* binding */ DocumentWidgetManager)\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_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__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_disposable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @lumino/disposable */ \"webpack/sharing/consume/default/@lumino/disposable/@lumino/disposable\");\n/* harmony import */ var _lumino_disposable__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_lumino_disposable__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_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// 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 document widgets.\n */\nconst DOCUMENT_CLASS = 'jp-Document';\n/**\n * A class that maintains the lifecycle of file-backed widgets.\n */\nclass DocumentWidgetManager {\n    /**\n     * Construct a new document widget manager.\n     */\n    constructor(options) {\n        this._activateRequested = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._confirmClosingTab = false;\n        this._isDisposed = false;\n        this._stateChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal(this);\n        this._registry = options.registry;\n        this.translator = options.translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        this._recentsManager = options.recentsManager || null;\n    }\n    /**\n     * A signal emitted when one of the documents is activated.\n     */\n    get activateRequested() {\n        return this._activateRequested;\n    }\n    /**\n     * Whether to ask confirmation to close a tab or not.\n     */\n    get confirmClosingDocument() {\n        return this._confirmClosingTab;\n    }\n    set confirmClosingDocument(v) {\n        if (this._confirmClosingTab !== v) {\n            const oldValue = this._confirmClosingTab;\n            this._confirmClosingTab = v;\n            this._stateChanged.emit({\n                name: 'confirmClosingDocument',\n                oldValue,\n                newValue: v\n            });\n        }\n    }\n    /**\n     * Signal triggered when an attribute changes.\n     */\n    get stateChanged() {\n        return this._stateChanged;\n    }\n    /**\n     * Test whether the document widget manager is disposed.\n     */\n    get isDisposed() {\n        return this._isDisposed;\n    }\n    /**\n     * Dispose of the resources used by the widget manager.\n     */\n    dispose() {\n        if (this.isDisposed) {\n            return;\n        }\n        this._isDisposed = true;\n        _lumino_signaling__WEBPACK_IMPORTED_MODULE_7__.Signal.disconnectReceiver(this);\n    }\n    /**\n     * Create a widget for a document and handle its lifecycle.\n     *\n     * @param factory - The widget factory.\n     *\n     * @param context - The document context object.\n     *\n     * @returns A widget created by the factory.\n     *\n     * @throws If the factory is not registered.\n     */\n    createWidget(factory, context) {\n        const widget = factory.createNew(context);\n        this._initializeWidget(widget, factory, context);\n        return widget;\n    }\n    /**\n     * When a new widget is created, we need to hook it up\n     * with some signals, update the widget extensions (for\n     * this kind of widget) in the docregistry, among\n     * other things.\n     */\n    _initializeWidget(widget, factory, context) {\n        Private.factoryProperty.set(widget, factory);\n        // Handle widget extensions.\n        const disposables = new _lumino_disposable__WEBPACK_IMPORTED_MODULE_4__.DisposableSet();\n        for (const extender of this._registry.widgetExtensions(factory.name)) {\n            const disposable = extender.createNew(widget, context);\n            if (disposable) {\n                disposables.add(disposable);\n            }\n        }\n        Private.disposablesProperty.set(widget, disposables);\n        widget.disposed.connect(this._onWidgetDisposed, this);\n        this.adoptWidget(context, widget);\n        context.fileChanged.connect(this._onFileChanged, this);\n        context.pathChanged.connect(this._onPathChanged, this);\n        void context.ready.then(() => {\n            void this.setCaption(widget);\n        });\n    }\n    /**\n     * Install the message hook for the widget and add to list\n     * of known widgets.\n     *\n     * @param context - The document context object.\n     *\n     * @param widget - The widget to adopt.\n     */\n    adoptWidget(context, widget) {\n        const widgets = Private.widgetsProperty.get(context);\n        widgets.push(widget);\n        _lumino_messaging__WEBPACK_IMPORTED_MODULE_5__.MessageLoop.installMessageHook(widget, this);\n        widget.addClass(DOCUMENT_CLASS);\n        widget.title.closable = true;\n        widget.disposed.connect(this._widgetDisposed, this);\n        Private.contextProperty.set(widget, context);\n    }\n    /**\n     * See if a widget already exists for the given context and widget name.\n     *\n     * @param context - The document context object.\n     *\n     * @returns The found widget, or `undefined`.\n     *\n     * #### Notes\n     * This can be used to use an existing widget instead of opening\n     * a new widget.\n     */\n    findWidget(context, widgetName) {\n        const widgets = Private.widgetsProperty.get(context);\n        if (!widgets) {\n            return undefined;\n        }\n        return (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.find)(widgets, widget => {\n            const factory = Private.factoryProperty.get(widget);\n            if (!factory) {\n                return false;\n            }\n            return factory.name === widgetName;\n        });\n    }\n    /**\n     * Get the document context for a widget.\n     *\n     * @param widget - The widget of interest.\n     *\n     * @returns The context associated with the widget, or `undefined`.\n     */\n    contextForWidget(widget) {\n        return Private.contextProperty.get(widget);\n    }\n    /**\n     * Clone a widget.\n     *\n     * @param widget - The source widget.\n     *\n     * @returns A new widget or `undefined`.\n     *\n     * #### Notes\n     *  Uses the same widget factory and context as the source, or throws\n     *  if the source widget is not managed by this manager.\n     */\n    cloneWidget(widget) {\n        const context = Private.contextProperty.get(widget);\n        if (!context) {\n            return undefined;\n        }\n        const factory = Private.factoryProperty.get(widget);\n        if (!factory) {\n            return undefined;\n        }\n        const newWidget = factory.createNew(context, widget);\n        this._initializeWidget(newWidget, factory, context);\n        return newWidget;\n    }\n    /**\n     * Close the widgets associated with a given context.\n     *\n     * @param context - The document context object.\n     */\n    closeWidgets(context) {\n        const widgets = Private.widgetsProperty.get(context);\n        return Promise.all(widgets.map(widget => this.onClose(widget))).then(() => undefined);\n    }\n    /**\n     * Dispose of the widgets associated with a given context\n     * regardless of the widget's dirty state.\n     *\n     * @param context - The document context object.\n     */\n    deleteWidgets(context) {\n        const widgets = Private.widgetsProperty.get(context);\n        return Promise.all(widgets.map(widget => this.onDelete(widget))).then(() => undefined);\n    }\n    /**\n     * Filter a message sent to a message handler.\n     *\n     * @param handler - The target handler of the message.\n     *\n     * @param msg - The message dispatched to the handler.\n     *\n     * @returns `false` if the message should be filtered, of `true`\n     *   if the message should be dispatched to the handler as normal.\n     */\n    messageHook(handler, msg) {\n        switch (msg.type) {\n            case 'close-request':\n                void this.onClose(handler);\n                return false;\n            case 'activate-request': {\n                const widget = handler;\n                const context = this.contextForWidget(widget);\n                if (context) {\n                    context.ready\n                        .then(() => {\n                        // contentsModel is null until the context is ready\n                        this._recordAsRecentlyOpened(widget, context.contentsModel);\n                    })\n                        .catch(() => {\n                        console.warn('Could not record the recents status for', context);\n                    });\n                    this._activateRequested.emit(context.path);\n                }\n                break;\n            }\n            default:\n                break;\n        }\n        return true;\n    }\n    /**\n     * Set the caption for widget title.\n     *\n     * @param widget - The target widget.\n     */\n    async setCaption(widget) {\n        const trans = this.translator.load('jupyterlab');\n        const context = Private.contextProperty.get(widget);\n        if (!context) {\n            return;\n        }\n        const model = context.contentsModel;\n        if (!model) {\n            widget.title.caption = '';\n            return;\n        }\n        return context\n            .listCheckpoints()\n            .then((checkpoints) => {\n            if (widget.isDisposed) {\n                return;\n            }\n            const last = checkpoints[checkpoints.length - 1];\n            const checkpoint = last ? _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.Time.format(last.last_modified) : 'None';\n            let caption = trans.__('Name: %1\\nPath: %2\\n', model.name, model.path);\n            if (context.model.readOnly) {\n                caption += trans.__('Read-only');\n            }\n            else {\n                caption +=\n                    trans.__('Last Saved: %1\\n', _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_1__.Time.format(model.last_modified)) +\n                        trans.__('Last Checkpoint: %1', checkpoint);\n            }\n            widget.title.caption = caption;\n        });\n    }\n    /**\n     * Handle `'close-request'` messages.\n     *\n     * @param widget - The target widget.\n     *\n     * @returns A promise that resolves with whether the widget was closed.\n     */\n    async onClose(widget) {\n        var _a;\n        // Handle dirty state.\n        const [shouldClose, ignoreSave] = await this._maybeClose(widget, this.translator);\n        if (widget.isDisposed) {\n            return true;\n        }\n        if (shouldClose) {\n            const context = Private.contextProperty.get(widget);\n            if (!ignoreSave) {\n                if (!context) {\n                    return true;\n                }\n                if ((_a = context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable) {\n                    await context.save();\n                }\n                else {\n                    await context.saveAs();\n                }\n            }\n            if (context) {\n                const result = await Promise.race([\n                    context.ready,\n                    new Promise(resolve => setTimeout(resolve, 3000, 'timeout'))\n                ]);\n                if (result === 'timeout') {\n                    console.warn('Could not record the widget as recently closed because the context did not become ready in 3 seconds');\n                }\n                else {\n                    // Note: `contentsModel` is null until the the context is ready;\n                    // we have to handle it after `await` rather than in a `then`\n                    // to ensure we record it as recent before the widget gets disposed.\n                    this._recordAsRecentlyClosed(widget, context.contentsModel);\n                }\n            }\n            if (widget.isDisposed) {\n                return true;\n            }\n            widget.dispose();\n        }\n        return shouldClose;\n    }\n    /**\n     * Dispose of widget regardless of widget's dirty state.\n     *\n     * @param widget - The target widget.\n     */\n    onDelete(widget) {\n        widget.dispose();\n        return Promise.resolve(void 0);\n    }\n    /**\n     * Record the activated file, and its parent directory, as recently opened.\n     */\n    _recordAsRecentlyOpened(widget, model) {\n        var _a;\n        const recents = this._recentsManager;\n        if (!recents) {\n            // no-op\n            return;\n        }\n        const path = model.path;\n        const fileType = this._registry.getFileTypeForModel(model);\n        const contentType = fileType.contentType;\n        const factory = (_a = Private.factoryProperty.get(widget)) === null || _a === void 0 ? void 0 : _a.name;\n        recents.addRecent({ path, contentType, factory }, 'opened');\n        // Add the containing directory, too\n        if (contentType !== 'directory') {\n            const parent = path.lastIndexOf('/') > 0 ? path.slice(0, path.lastIndexOf('/')) : '';\n            recents.addRecent({ path: parent, contentType: 'directory' }, 'opened');\n        }\n    }\n    /**\n     * Record the activated file, and its parent directory, as recently opened.\n     */\n    _recordAsRecentlyClosed(widget, model) {\n        var _a;\n        const recents = this._recentsManager;\n        if (!recents) {\n            // no-op\n            return;\n        }\n        const path = model.path;\n        const fileType = this._registry.getFileTypeForModel(model);\n        const contentType = fileType.contentType;\n        const factory = (_a = Private.factoryProperty.get(widget)) === null || _a === void 0 ? void 0 : _a.name;\n        recents.addRecent({ path, contentType, factory }, 'closed');\n    }\n    /**\n     * Ask the user whether to close an unsaved file.\n     */\n    async _maybeClose(widget, translator) {\n        var _a, _b;\n        translator = translator || _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_2__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        // Bail if the model is not dirty or other widgets are using the model.)\n        const context = Private.contextProperty.get(widget);\n        if (!context) {\n            return Promise.resolve([true, true]);\n        }\n        let widgets = Private.widgetsProperty.get(context);\n        if (!widgets) {\n            return Promise.resolve([true, true]);\n        }\n        // Filter by whether the factories are read only.\n        widgets = widgets.filter(widget => {\n            const factory = Private.factoryProperty.get(widget);\n            if (!factory) {\n                return false;\n            }\n            return factory.readOnly === false;\n        });\n        const fileName = widget.title.label;\n        const factory = Private.factoryProperty.get(widget);\n        const isDirty = context.model.dirty &&\n            widgets.length <= 1 &&\n            !((_a = factory === null || factory === void 0 ? void 0 : factory.readOnly) !== null && _a !== void 0 ? _a : true);\n        // Ask confirmation\n        if (this.confirmClosingDocument) {\n            const buttons = [\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.cancelButton(),\n                _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({\n                    label: isDirty ? trans.__('Close and save') : trans.__('Close'),\n                    ariaLabel: isDirty\n                        ? trans.__('Close and save Document')\n                        : trans.__('Close Document')\n                })\n            ];\n            if (isDirty) {\n                buttons.splice(1, 0, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.warnButton({\n                    label: trans.__('Close without saving'),\n                    ariaLabel: trans.__('Close Document without saving')\n                }));\n            }\n            const confirm = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                title: trans.__('Confirmation'),\n                body: trans.__('Please confirm you want to close \"%1\".', fileName),\n                checkbox: isDirty\n                    ? null\n                    : {\n                        label: trans.__('Do not ask me again.'),\n                        caption: trans.__('If checked, no confirmation to close a document will be asked in the future.')\n                    },\n                buttons\n            });\n            if (confirm.isChecked) {\n                this.confirmClosingDocument = false;\n            }\n            return Promise.resolve([\n                confirm.button.accept,\n                isDirty ? confirm.button.displayType === 'warn' : true\n            ]);\n        }\n        else {\n            if (!isDirty) {\n                return Promise.resolve([true, true]);\n            }\n            const saveLabel = ((_b = context.contentsModel) === null || _b === void 0 ? void 0 : _b.writable)\n                ? trans.__('Save')\n                : trans.__('Save as');\n            const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showDialog)({\n                title: trans.__('Save your work'),\n                body: trans.__('Save changes in \"%1\" before closing?', fileName),\n                buttons: [\n                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.cancelButton(),\n                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.warnButton({\n                        label: trans.__('Discard'),\n                        ariaLabel: trans.__('Discard changes to file')\n                    }),\n                    _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Dialog.okButton({ label: saveLabel })\n                ]\n            });\n            return [result.button.accept, result.button.displayType === 'warn'];\n        }\n    }\n    /**\n     * Handle the disposal of a widget.\n     */\n    _widgetDisposed(widget) {\n        const context = Private.contextProperty.get(widget);\n        if (!context) {\n            return;\n        }\n        const widgets = Private.widgetsProperty.get(context);\n        if (!widgets) {\n            return;\n        }\n        // Remove the widget.\n        _lumino_algorithm__WEBPACK_IMPORTED_MODULE_3__.ArrayExt.removeFirstOf(widgets, widget);\n        // Dispose of the context if this is the last widget using it.\n        if (!widgets.length) {\n            context.dispose();\n        }\n    }\n    /**\n     * Handle the disposal of a widget.\n     */\n    _onWidgetDisposed(widget) {\n        const disposables = Private.disposablesProperty.get(widget);\n        disposables.dispose();\n    }\n    /**\n     * Handle a file changed signal for a context.\n     */\n    _onFileChanged(context) {\n        const widgets = Private.widgetsProperty.get(context);\n        for (const widget of widgets) {\n            void this.setCaption(widget);\n        }\n    }\n    /**\n     * Handle a path changed signal for a context.\n     */\n    _onPathChanged(context) {\n        const widgets = Private.widgetsProperty.get(context);\n        for (const widget of widgets) {\n            void this.setCaption(widget);\n        }\n    }\n}\n/**\n * A private namespace for DocumentManager data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * A private attached property for a widget context.\n     */\n    Private.contextProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'context',\n        create: () => undefined\n    });\n    /**\n     * A private attached property for a widget factory.\n     */\n    Private.factoryProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'factory',\n        create: () => undefined\n    });\n    /**\n     * A private attached property for the widgets associated with a context.\n     */\n    Private.widgetsProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'widgets',\n        create: () => []\n    });\n    /**\n     * A private attached property for a widget's disposables.\n     */\n    Private.disposablesProperty = new _lumino_properties__WEBPACK_IMPORTED_MODULE_6__.AttachedProperty({\n        name: 'disposables',\n        create: () => new _lumino_disposable__WEBPACK_IMPORTED_MODULE_4__.DisposableSet()\n    });\n})(Private || (Private = {}));\n//# sourceMappingURL=widgetmanager.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager/lib/widgetmanager.js?");

/***/ })

}]);