"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-extension_lib_index_js"],{

/***/ "../node_modules/@jupyterlab/docmanager-extension/lib/index.js":
/*!*********************************************************************!*\
  !*** ../node_modules/@jupyterlab/docmanager-extension/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 */   ToolbarItems: () => (/* binding */ ToolbarItems),\n/* harmony export */   \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */   downloadPlugin: () => (/* binding */ downloadPlugin),\n/* harmony export */   openBrowserTabPlugin: () => (/* binding */ openBrowserTabPlugin),\n/* harmony export */   pathStatusPlugin: () => (/* binding */ pathStatusPlugin),\n/* harmony export */   savingStatusPlugin: () => (/* binding */ savingStatusPlugin)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ \"webpack/sharing/consume/default/@jupyterlab/application/@jupyterlab/application\");\n/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ \"webpack/sharing/consume/default/@jupyterlab/apputils/@jupyterlab/apputils\");\n/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/coreutils */ \"webpack/sharing/consume/default/@jupyterlab/coreutils/@jupyterlab/coreutils\");\n/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/docmanager */ \"webpack/sharing/consume/default/@jupyterlab/docmanager/@jupyterlab/docmanager\");\n/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @jupyterlab/statusbar */ \"webpack/sharing/consume/default/@jupyterlab/statusbar/@jupyterlab/statusbar\");\n/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/translation */ \"webpack/sharing/consume/default/@jupyterlab/translation/@jupyterlab/translation\");\n/* harmony import */ var _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__ = __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_7___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @lumino/algorithm */ \"webpack/sharing/consume/default/@lumino/algorithm/@lumino/algorithm\");\n/* harmony import */ var _lumino_algorithm__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @lumino/coreutils */ \"webpack/sharing/consume/default/@lumino/coreutils/@lumino/coreutils\");\n/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @lumino/signaling */ \"webpack/sharing/consume/default/@lumino/signaling/@lumino/signaling\");\n/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @lumino/widgets */ \"webpack/sharing/consume/default/@lumino/widgets/@lumino/widgets\");\n/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react */ \"webpack/sharing/consume/default/react/react\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _recents__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./recents */ \"../node_modules/@jupyterlab/docmanager-extension/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-extension\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * The command IDs used by the document manager plugin.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.clone = 'docmanager:clone';\n    CommandIDs.deleteFile = 'docmanager:delete-file';\n    CommandIDs.newUntitled = 'docmanager:new-untitled';\n    CommandIDs.open = 'docmanager:open';\n    CommandIDs.openBrowserTab = 'docmanager:open-browser-tab';\n    CommandIDs.reload = 'docmanager:reload';\n    CommandIDs.rename = 'docmanager:rename';\n    CommandIDs.del = 'docmanager:delete';\n    CommandIDs.duplicate = 'docmanager:duplicate';\n    CommandIDs.restoreCheckpoint = 'docmanager:restore-checkpoint';\n    CommandIDs.save = 'docmanager:save';\n    CommandIDs.saveAll = 'docmanager:save-all';\n    CommandIDs.saveAs = 'docmanager:save-as';\n    CommandIDs.download = 'docmanager:download';\n    CommandIDs.toggleAutosave = 'docmanager:toggle-autosave';\n    CommandIDs.showInFileBrowser = 'docmanager:show-in-file-browser';\n})(CommandIDs || (CommandIDs = {}));\n/**\n * The id of the document manager plugin.\n */\nconst docManagerPluginId = '@jupyterlab/docmanager-extension:plugin';\n/**\n * A plugin to open documents in the main area.\n *\n */\nconst openerPlugin = {\n    id: '@jupyterlab/docmanager-extension:opener',\n    description: 'Provides the widget opener.',\n    autoStart: true,\n    provides: _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentWidgetOpener,\n    activate: (app) => {\n        const { shell } = app;\n        return new (class {\n            constructor() {\n                this._opened = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_10__.Signal(this);\n            }\n            open(widget, options) {\n                if (!widget.id) {\n                    widget.id = `document-manager-${++Private.id}`;\n                }\n                widget.title.dataset = {\n                    type: 'document-title',\n                    ...widget.title.dataset\n                };\n                if (!widget.isAttached) {\n                    shell.add(widget, 'main', options || {});\n                }\n                shell.activateById(widget.id);\n                this._opened.emit(widget);\n            }\n            get opened() {\n                return this._opened;\n            }\n        })();\n    }\n};\n/**\n * A plugin to handle dirty states for open documents.\n */\nconst contextsPlugin = {\n    id: '@jupyterlab/docmanager-extension:contexts',\n    description: 'Adds the handling of opened documents dirty state.',\n    autoStart: true,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager, _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentWidgetOpener],\n    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabStatus],\n    activate: (app, docManager, widgetOpener, status) => {\n        const contexts = new WeakSet();\n        widgetOpener.opened.connect((_, widget) => {\n            // Handle dirty state for open documents.\n            const context = docManager.contextForWidget(widget);\n            if (context && !contexts.has(context)) {\n                if (status) {\n                    handleContext(status, context);\n                }\n                contexts.add(context);\n            }\n        });\n    }\n};\n/**\n * A plugin providing the default document manager.\n */\nconst manager = {\n    id: '@jupyterlab/docmanager-extension:manager',\n    description: 'Provides the document manager.',\n    provides: _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentWidgetOpener],\n    optional: [\n        _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator,\n        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabStatus,\n        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ISessionContextDialogs,\n        _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.JupyterLab.IInfo,\n        _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IRecentsManager\n    ],\n    activate: (app, widgetOpener, translator_, status, sessionDialogs_, info, recentsManager) => {\n        var _a;\n        const { serviceManager: manager, docRegistry: registry } = app;\n        const translator = translator_ !== null && translator_ !== void 0 ? translator_ : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator;\n        const sessionDialogs = sessionDialogs_ !== null && sessionDialogs_ !== void 0 ? sessionDialogs_ : new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.SessionContextDialogs({ translator });\n        const when = app.restored.then(() => void 0);\n        const docManager = new _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.DocumentManager({\n            registry,\n            manager,\n            opener: widgetOpener,\n            when,\n            setBusy: (_a = (status && (() => status.setBusy()))) !== null && _a !== void 0 ? _a : undefined,\n            sessionDialogs,\n            translator: translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator,\n            isConnectedCallback: () => {\n                if (info) {\n                    return info.isConnected;\n                }\n                return true;\n            },\n            recentsManager: recentsManager !== null && recentsManager !== void 0 ? recentsManager : undefined\n        });\n        return docManager;\n    }\n};\n/**\n * The default document manager provider commands and settings.\n */\nconst docManagerPlugin = {\n    id: docManagerPluginId,\n    description: 'Adds commands and settings to the document manager.',\n    autoStart: true,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager, _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentWidgetOpener, _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_4__.ISettingRegistry],\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell],\n    activate: (app, docManager, widgetOpener, settingRegistry, translator, palette, labShell) => {\n        translator = translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator;\n        const trans = translator.load('jupyterlab');\n        const registry = app.docRegistry;\n        // Register the file operations commands.\n        addCommands(app, docManager, widgetOpener, settingRegistry, translator, labShell, palette);\n        // Keep up to date with the settings registry.\n        const onSettingsUpdated = (settings) => {\n            // Handle whether to autosave\n            const autosave = settings.get('autosave').composite;\n            docManager.autosave =\n                autosave === true || autosave === false ? autosave : true;\n            app.commands.notifyCommandChanged(CommandIDs.toggleAutosave);\n            const confirmClosingDocument = settings.get('confirmClosingDocument')\n                .composite;\n            docManager.confirmClosingDocument = confirmClosingDocument !== null && confirmClosingDocument !== void 0 ? confirmClosingDocument : true;\n            // Handle autosave interval\n            const autosaveInterval = settings.get('autosaveInterval').composite;\n            docManager.autosaveInterval = autosaveInterval || 120;\n            // Handle last modified timestamp check margin\n            const lastModifiedCheckMargin = settings.get('lastModifiedCheckMargin')\n                .composite;\n            docManager.lastModifiedCheckMargin = lastModifiedCheckMargin || 500;\n            const renameUntitledFile = settings.get('renameUntitledFileOnSave')\n                .composite;\n            docManager.renameUntitledFileOnSave = renameUntitledFile !== null && renameUntitledFile !== void 0 ? renameUntitledFile : true;\n            // Handle default widget factory overrides.\n            const defaultViewers = settings.get('defaultViewers').composite;\n            const overrides = {};\n            // Filter the defaultViewers and file types for existing ones.\n            Object.keys(defaultViewers).forEach(ft => {\n                if (!registry.getFileType(ft)) {\n                    console.warn(`File Type ${ft} not found`);\n                    return;\n                }\n                if (!registry.getWidgetFactory(defaultViewers[ft])) {\n                    console.warn(`Document viewer ${defaultViewers[ft]} not found`);\n                }\n                overrides[ft] = defaultViewers[ft];\n            });\n            // Set the default factory overrides. If not provided, this has the\n            // effect of unsetting any previous overrides.\n            for (const ft of registry.fileTypes()) {\n                try {\n                    registry.setDefaultWidgetFactory(ft.name, overrides[ft.name]);\n                }\n                catch (_a) {\n                    console.warn(`Failed to set default viewer ${overrides[ft.name]} for file type ${ft.name}`);\n                }\n            }\n        };\n        // Fetch the initial state of the settings.\n        Promise.all([settingRegistry.load(docManagerPluginId), app.restored])\n            .then(([settings]) => {\n            settings.changed.connect(onSettingsUpdated);\n            onSettingsUpdated(settings);\n            const onStateChanged = (sender, change) => {\n                if ([\n                    'autosave',\n                    'autosaveInterval',\n                    'confirmClosingDocument',\n                    'lastModifiedCheckMargin',\n                    'renameUntitledFileOnSave'\n                ].includes(change.name) &&\n                    settings.get(change.name).composite !== change.newValue) {\n                    settings.set(change.name, change.newValue).catch(reason => {\n                        console.error(`Failed to set the setting '${change.name}':\\n${reason}`);\n                    });\n                }\n            };\n            docManager.stateChanged.connect(onStateChanged);\n        })\n            .catch((reason) => {\n            console.error(reason.message);\n        });\n        // Register a fetch transformer for the settings registry,\n        // allowing us to dynamically populate a help string with the\n        // available document viewers and file types for the default\n        // viewer overrides.\n        settingRegistry.transform(docManagerPluginId, {\n            fetch: plugin => {\n                // Get the available file types.\n                const fileTypes = Array.from(registry.fileTypes())\n                    .map(ft => ft.name)\n                    .join('    \\n');\n                // Get the available widget factories.\n                const factories = Array.from(registry.widgetFactories())\n                    .map(f => f.name)\n                    .join('    \\n');\n                // Generate the help string.\n                const description = trans.__(`Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n  markdown: \"Markdown Preview\"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2`, factories, fileTypes);\n                const schema = _lumino_coreutils__WEBPACK_IMPORTED_MODULE_9__.JSONExt.deepCopy(plugin.schema);\n                schema.properties.defaultViewers.description = description;\n                return { ...plugin, schema };\n            }\n        });\n        // If the document registry gains or loses a factory or file type,\n        // regenerate the settings description with the available options.\n        registry.changed.connect(() => settingRegistry.load(docManagerPluginId, true));\n    }\n};\n/**\n * A plugin for adding a saving status item to the status bar.\n */\nconst savingStatusPlugin = {\n    id: '@jupyterlab/docmanager-extension:saving-status',\n    description: 'Adds a saving status indicator.',\n    autoStart: true,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell],\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator, _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_5__.IStatusBar],\n    activate: (_, docManager, labShell, translator, statusBar) => {\n        if (!statusBar) {\n            // Automatically disable if statusbar missing\n            return;\n        }\n        const saving = new _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.SavingStatus({\n            docManager,\n            translator: translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator\n        });\n        // Keep the currently active widget synchronized.\n        saving.model.widget = labShell.currentWidget;\n        labShell.currentChanged.connect(() => {\n            saving.model.widget = labShell.currentWidget;\n        });\n        statusBar.registerStatusItem(savingStatusPlugin.id, {\n            item: saving,\n            align: 'middle',\n            isActive: () => saving.model !== null && saving.model.status !== null,\n            activeStateChanged: saving.model.stateChanged\n        });\n    }\n};\n/**\n * A plugin providing a file path widget to the status bar.\n */\nconst pathStatusPlugin = {\n    id: '@jupyterlab/docmanager-extension:path-status',\n    description: 'Adds a file path indicator in the status bar.',\n    autoStart: true,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager, _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILabShell],\n    optional: [_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_5__.IStatusBar],\n    activate: (_, docManager, labShell, statusBar) => {\n        if (!statusBar) {\n            // Automatically disable if statusbar missing\n            return;\n        }\n        const path = new _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.PathStatus({ docManager });\n        // Keep the file path widget up-to-date with the application active widget.\n        path.model.widget = labShell.currentWidget;\n        labShell.currentChanged.connect(() => {\n            path.model.widget = labShell.currentWidget;\n        });\n        statusBar.registerStatusItem(pathStatusPlugin.id, {\n            item: path,\n            align: 'right',\n            rank: 0\n        });\n    }\n};\n/**\n * A plugin providing download commands in the file menu and command palette.\n */\nconst downloadPlugin = {\n    id: '@jupyterlab/docmanager-extension:download',\n    description: 'Adds command to download files.',\n    autoStart: true,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager],\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator, _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette],\n    activate: (app, docManager, translator, palette) => {\n        var _a;\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');\n        const { commands, shell } = app;\n        const isEnabled = () => {\n            const { currentWidget } = shell;\n            return !!(currentWidget && docManager.contextForWidget(currentWidget));\n        };\n        commands.addCommand(CommandIDs.download, {\n            label: trans.__('Download'),\n            caption: trans.__('Download the file to your computer'),\n            isEnabled,\n            execute: () => {\n                // Checks that shell.currentWidget is valid:\n                if (isEnabled()) {\n                    const context = docManager.contextForWidget(shell.currentWidget);\n                    if (!context) {\n                        return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                            title: trans.__('Cannot Download'),\n                            body: trans.__('No context found for current widget!'),\n                            buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton()]\n                        });\n                    }\n                    return context.download();\n                }\n            }\n        });\n        (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {\n            app.commands.notifyCommandChanged(CommandIDs.download);\n        });\n        const category = trans.__('File Operations');\n        if (palette) {\n            palette.addItem({ command: CommandIDs.download, category });\n        }\n    }\n};\n/**\n * A plugin providing open-browser-tab commands.\n *\n * This is its own plugin in case you would like to disable this feature.\n * e.g. jupyter labextension disable @jupyterlab/docmanager-extension:open-browser-tab\n *\n * Note: If disabling this, you may also want to disable:\n * @jupyterlab/filebrowser-extension:open-browser-tab\n */\nconst openBrowserTabPlugin = {\n    id: '@jupyterlab/docmanager-extension:open-browser-tab',\n    description: 'Adds command to open a browser tab.',\n    autoStart: true,\n    requires: [_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.IDocumentManager],\n    optional: [_jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.ITranslator],\n    activate: (app, docManager, translator) => {\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_6__.nullTranslator).load('jupyterlab');\n        const { commands } = app;\n        commands.addCommand(CommandIDs.openBrowserTab, {\n            execute: args => {\n                const path = typeof args['path'] === 'undefined' ? '' : args['path'];\n                if (!path) {\n                    return;\n                }\n                return docManager.services.contents.getDownloadUrl(path).then(url => {\n                    const opened = window.open();\n                    if (opened) {\n                        opened.opener = null;\n                        opened.location.href = url;\n                    }\n                    else {\n                        throw new Error('Failed to open new browser tab.');\n                    }\n                });\n            },\n            iconClass: args => args['icon'] || '',\n            label: () => trans.__('Open in New Browser Tab')\n        });\n    }\n};\n/**\n * Export the plugins as default.\n */\nconst plugins = [\n    manager,\n    docManagerPlugin,\n    contextsPlugin,\n    pathStatusPlugin,\n    savingStatusPlugin,\n    downloadPlugin,\n    openBrowserTabPlugin,\n    openerPlugin,\n    _recents__WEBPACK_IMPORTED_MODULE_13__.recentsManagerPlugin\n];\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (plugins);\n/**\n * Toolbar item factory\n */\nvar ToolbarItems;\n(function (ToolbarItems) {\n    /**\n     * Create save button toolbar item.\n     *\n     */\n    function createSaveButton(commands, fileChanged) {\n        return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.addCommandToolbarButtonClass)(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ReactWidget.create(react__WEBPACK_IMPORTED_MODULE_12__.createElement(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.UseSignal, { signal: fileChanged }, () => (react__WEBPACK_IMPORTED_MODULE_12__.createElement(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.CommandToolbarButtonComponent, { commands: commands, id: CommandIDs.save, label: '', args: { toolbar: true } })))));\n    }\n    ToolbarItems.createSaveButton = createSaveButton;\n})(ToolbarItems || (ToolbarItems = {}));\n/* Widget to display the revert to checkpoint confirmation. */\nclass RevertConfirmWidget extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_11__.Widget {\n    /**\n     * Construct a new revert confirmation widget.\n     */\n    constructor(checkpoint, trans, fileType = 'notebook') {\n        super({\n            node: Private.createRevertConfirmNode(checkpoint, fileType, trans)\n        });\n    }\n}\n// Returns the file type for a widget.\nfunction fileType(widget, docManager) {\n    if (!widget) {\n        return 'File';\n    }\n    const context = docManager.contextForWidget(widget);\n    if (!context) {\n        return '';\n    }\n    const fts = docManager.registry.getFileTypesForPath(context.path);\n    return fts.length && fts[0].displayName ? fts[0].displayName : 'File';\n}\n/**\n * Add the file operations commands to the application's command registry.\n */\nfunction addCommands(app, docManager, widgetOpener, settingRegistry, translator, labShell, palette) {\n    var _a;\n    const trans = translator.load('jupyterlab');\n    const { commands, shell } = app;\n    const category = trans.__('File Operations');\n    const isEnabled = () => {\n        const { currentWidget } = shell;\n        return !!(currentWidget && docManager.contextForWidget(currentWidget));\n    };\n    const isWritable = () => {\n        var _a;\n        const { currentWidget } = shell;\n        if (!currentWidget) {\n            return false;\n        }\n        const context = docManager.contextForWidget(currentWidget);\n        return !!((_a = context === null || context === void 0 ? void 0 : context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable);\n    };\n    const readonlyNotification = (contextPath) => {\n        return _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Notification.warning(trans.__(`%1 is read-only. Use \"Save as…\" instead.`, contextPath), { autoClose: 5000 });\n    };\n    // If inside a rich application like JupyterLab, add additional functionality.\n    if (labShell) {\n        addLabCommands(app, docManager, labShell, widgetOpener, translator);\n    }\n    commands.addCommand(CommandIDs.deleteFile, {\n        label: () => `Delete ${fileType(shell.currentWidget, docManager)}`,\n        execute: args => {\n            const path = typeof args['path'] === 'undefined' ? '' : args['path'];\n            if (!path) {\n                const command = CommandIDs.deleteFile;\n                throw new Error(`A non-empty path is required for ${command}.`);\n            }\n            return docManager.deleteFile(path);\n        }\n    });\n    commands.addCommand(CommandIDs.newUntitled, {\n        execute: async (args) => {\n            const errorTitle = args['error'] || trans.__('Error');\n            const path = typeof args['path'] === 'undefined' ? '' : args['path'];\n            const options = {\n                type: args['type'],\n                path\n            };\n            if (args['type'] === 'file') {\n                options.ext = args['ext'] || '.txt';\n            }\n            return docManager.services.contents\n                .newUntitled(options)\n                .catch(error => (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showErrorMessage)(errorTitle, error));\n        },\n        label: args => args['label'] || `New ${args['type']}`\n    });\n    commands.addCommand(CommandIDs.open, {\n        execute: async (args) => {\n            const path = typeof args['path'] === 'undefined' ? '' : args['path'];\n            const factory = args['factory'] || void 0;\n            const kernel = args === null || args === void 0 ? void 0 : args.kernel;\n            const options = args['options'] || void 0;\n            return docManager.services.contents\n                .get(path, { content: false })\n                .then(() => docManager.openOrReveal(path, factory, kernel, options));\n        },\n        iconClass: args => args['icon'] || '',\n        label: args => {\n            var _a;\n            return ((_a = (args['label'] || args['factory'])) !== null && _a !== void 0 ? _a : trans.__('Open the provided `path`.'));\n        },\n        mnemonic: args => args['mnemonic'] || -1\n    });\n    commands.addCommand(CommandIDs.reload, {\n        label: () => trans.__('Reload %1 from Disk', fileType(shell.currentWidget, docManager)),\n        caption: trans.__('Reload contents from disk'),\n        isEnabled,\n        execute: () => {\n            // Checks that shell.currentWidget is valid:\n            if (!isEnabled()) {\n                return;\n            }\n            const context = docManager.contextForWidget(shell.currentWidget);\n            const type = fileType(shell.currentWidget, docManager);\n            if (!context) {\n                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Cannot Reload'),\n                    body: trans.__('No context found for current widget!'),\n                    buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton()]\n                });\n            }\n            if (context.model.dirty) {\n                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Reload %1 from Disk', type),\n                    body: trans.__('Are you sure you want to reload the %1 from the disk?', type),\n                    buttons: [\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.warnButton({ label: trans.__('Reload') })\n                    ]\n                }).then(result => {\n                    if (result.button.accept && !context.isDisposed) {\n                        return context.revert();\n                    }\n                });\n            }\n            else {\n                if (!context.isDisposed) {\n                    return context.revert();\n                }\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.restoreCheckpoint, {\n        label: () => trans.__('Revert %1 to Checkpoint…', fileType(shell.currentWidget, docManager)),\n        caption: trans.__('Revert contents to previous checkpoint'),\n        isEnabled,\n        execute: () => {\n            // Checks that shell.currentWidget is valid:\n            if (!isEnabled()) {\n                return;\n            }\n            const context = docManager.contextForWidget(shell.currentWidget);\n            if (!context) {\n                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Cannot Revert'),\n                    body: trans.__('No context found for current widget!'),\n                    buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton()]\n                });\n            }\n            return context.listCheckpoints().then(async (checkpoints) => {\n                const type = fileType(shell.currentWidget, docManager);\n                if (checkpoints.length < 1) {\n                    await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showErrorMessage)(trans.__('No checkpoints'), trans.__('No checkpoints are available for this %1.', type));\n                    return;\n                }\n                const targetCheckpoint = checkpoints.length === 1\n                    ? checkpoints[0]\n                    : await Private.getTargetCheckpoint(checkpoints.reverse(), trans);\n                if (!targetCheckpoint) {\n                    return;\n                }\n                return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Revert %1 to checkpoint', type),\n                    body: new RevertConfirmWidget(targetCheckpoint, trans, type),\n                    buttons: [\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.warnButton({\n                            label: trans.__('Revert'),\n                            ariaLabel: trans.__('Revert to Checkpoint')\n                        })\n                    ]\n                }).then(result => {\n                    if (context.isDisposed) {\n                        return;\n                    }\n                    if (result.button.accept) {\n                        if (context.model.readOnly) {\n                            return context.revert();\n                        }\n                        return context\n                            .restoreCheckpoint(targetCheckpoint.id)\n                            .then(() => context.revert());\n                    }\n                });\n            });\n        }\n    });\n    const caption = () => {\n        if (shell.currentWidget) {\n            if (!isWritable()) {\n                return trans.__(`Document is read-only. \"Save\" is disabled; use \"Save as…\" instead`);\n            }\n        }\n        return trans.__('Save and create checkpoint');\n    };\n    const saveInProgress = new WeakSet();\n    commands.addCommand(CommandIDs.save, {\n        label: () => trans.__('Save %1', fileType(shell.currentWidget, docManager)),\n        caption,\n        icon: args => (args.toolbar ? _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_7__.saveIcon : undefined),\n        isEnabled: args => {\n            if (args._luminoEvent) {\n                return args._luminoEvent.type ===\n                    'keybinding'\n                    ? true\n                    : isWritable();\n            }\n            else {\n                return isWritable();\n            }\n        },\n        execute: async (args) => {\n            var _a, _b, _c, _d, _e;\n            // Checks that shell.currentWidget is valid:\n            const widget = shell.currentWidget;\n            const context = docManager.contextForWidget(widget);\n            if (isEnabled()) {\n                if (!context) {\n                    return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                        title: trans.__('Cannot Save'),\n                        body: trans.__('No context found for current widget!'),\n                        buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton()]\n                    });\n                }\n                else {\n                    if (saveInProgress.has(context)) {\n                        return;\n                    }\n                    if (!((_a = context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable)) {\n                        let type = (_b = args._luminoEvent) === null || _b === void 0 ? void 0 : _b.type;\n                        if (args._luminoEvent && type === 'keybinding') {\n                            readonlyNotification(context.path);\n                            return;\n                        }\n                        else {\n                            return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                                title: trans.__('Cannot Save'),\n                                body: trans.__('Document is read-only'),\n                                buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton()]\n                            });\n                        }\n                    }\n                    saveInProgress.add(context);\n                    const oldName = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PathExt.basename((_d = (_c = context.contentsModel) === null || _c === void 0 ? void 0 : _c.path) !== null && _d !== void 0 ? _d : '');\n                    let newName = oldName;\n                    if (docManager.renameUntitledFileOnSave &&\n                        widget.isUntitled === true) {\n                        const result = await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.InputDialog.getText({\n                            title: trans.__('Rename file'),\n                            okLabel: trans.__('Rename and Save'),\n                            placeholder: trans.__('File name'),\n                            text: oldName,\n                            selectionRange: oldName.length - _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.PathExt.extname(oldName).length,\n                            checkbox: {\n                                label: trans.__('Do not ask for rename on first save.'),\n                                caption: trans.__('If checked, you will not be asked to rename future untitled files when saving them.')\n                            }\n                        });\n                        if (result.button.accept) {\n                            newName = (_e = result.value) !== null && _e !== void 0 ? _e : oldName;\n                            widget.isUntitled = false;\n                            if (typeof result.isChecked === 'boolean') {\n                                const currentSetting = (await settingRegistry.get(docManagerPluginId, 'renameUntitledFileOnSave')).composite;\n                                if (result.isChecked === currentSetting) {\n                                    settingRegistry\n                                        .set(docManagerPluginId, 'renameUntitledFileOnSave', !result.isChecked)\n                                        .catch(reason => {\n                                        console.error(`Fail to set 'renameUntitledFileOnSave:\\n${reason}`);\n                                    });\n                                }\n                            }\n                        }\n                    }\n                    try {\n                        await context.save();\n                        if (!(widget === null || widget === void 0 ? void 0 : widget.isDisposed)) {\n                            return context.createCheckpoint();\n                        }\n                    }\n                    catch (err) {\n                        // If the save was canceled by user-action, do nothing.\n                        if (err.name === 'ModalCancelError') {\n                            return;\n                        }\n                        throw err;\n                    }\n                    finally {\n                        saveInProgress.delete(context);\n                        if (newName !== oldName) {\n                            await context.rename(newName);\n                        }\n                    }\n                }\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.saveAll, {\n        label: () => trans.__('Save All'),\n        caption: trans.__('Save all open documents'),\n        isEnabled: () => {\n            return (0,_lumino_algorithm__WEBPACK_IMPORTED_MODULE_8__.some)(shell.widgets('main'), w => { var _a, _b, _c; return (_c = (_b = (_a = docManager.contextForWidget(w)) === null || _a === void 0 ? void 0 : _a.contentsModel) === null || _b === void 0 ? void 0 : _b.writable) !== null && _c !== void 0 ? _c : false; });\n        },\n        execute: () => {\n            var _a;\n            const promises = [];\n            const paths = new Set(); // Cache so we don't double save files.\n            for (const widget of shell.widgets('main')) {\n                const context = docManager.contextForWidget(widget);\n                if (context && !paths.has(context.path)) {\n                    if ((_a = context.contentsModel) === null || _a === void 0 ? void 0 : _a.writable) {\n                        paths.add(context.path);\n                        promises.push(context.save());\n                    }\n                    else {\n                        readonlyNotification(context.path);\n                    }\n                }\n            }\n            return Promise.all(promises);\n        }\n    });\n    commands.addCommand(CommandIDs.saveAs, {\n        label: () => trans.__('Save %1 As…', fileType(shell.currentWidget, docManager)),\n        caption: trans.__('Save with new path'),\n        isEnabled,\n        execute: () => {\n            // Checks that shell.currentWidget is valid:\n            if (isEnabled()) {\n                const context = docManager.contextForWidget(shell.currentWidget);\n                if (!context) {\n                    return (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                        title: trans.__('Cannot Save'),\n                        body: trans.__('No context found for current widget!'),\n                        buttons: [_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.okButton()]\n                    });\n                }\n                const onChange = (sender, args) => {\n                    if (args.type === 'save' &&\n                        args.newValue &&\n                        args.newValue.path !== context.path) {\n                        void docManager.closeFile(context.path);\n                        void commands.execute(CommandIDs.open, {\n                            path: args.newValue.path\n                        });\n                    }\n                };\n                docManager.services.contents.fileChanged.connect(onChange);\n                void context\n                    .saveAs()\n                    .finally(() => docManager.services.contents.fileChanged.disconnect(onChange));\n            }\n        }\n    });\n    (_a = app.shell.currentChanged) === null || _a === void 0 ? void 0 : _a.connect(() => {\n        [\n            CommandIDs.reload,\n            CommandIDs.restoreCheckpoint,\n            CommandIDs.save,\n            CommandIDs.saveAll,\n            CommandIDs.saveAs\n        ].forEach(cmd => {\n            app.commands.notifyCommandChanged(cmd);\n        });\n    });\n    commands.addCommand(CommandIDs.toggleAutosave, {\n        label: trans.__('Autosave Documents'),\n        isToggled: () => docManager.autosave,\n        execute: () => {\n            const value = !docManager.autosave;\n            const key = 'autosave';\n            return settingRegistry\n                .set(docManagerPluginId, key, value)\n                .catch((reason) => {\n                console.error(`Failed to set ${docManagerPluginId}:${key} - ${reason.message}`);\n            });\n        }\n    });\n    if (palette) {\n        [\n            CommandIDs.reload,\n            CommandIDs.restoreCheckpoint,\n            CommandIDs.save,\n            CommandIDs.saveAs,\n            CommandIDs.toggleAutosave,\n            CommandIDs.duplicate\n        ].forEach(command => {\n            palette.addItem({ command, category });\n        });\n    }\n}\nfunction addLabCommands(app, docManager, labShell, widgetOpener, translator) {\n    const trans = translator.load('jupyterlab');\n    const { commands } = app;\n    // Returns the doc widget associated with the most recent contextmenu event.\n    const contextMenuWidget = () => {\n        var _a;\n        const pathRe = /[Pp]ath:\\s?(.*)\\n?/;\n        const test = (node) => { var _a; return !!((_a = node['title']) === null || _a === void 0 ? void 0 : _a.match(pathRe)); };\n        const node = app.contextMenuHitTest(test);\n        const pathMatch = node === null || node === void 0 ? void 0 : node['title'].match(pathRe);\n        return ((_a = (pathMatch && docManager.findWidget(pathMatch[1], null))) !== null && _a !== void 0 ? _a : \n        // Fall back to active doc widget if path cannot be obtained from event.\n        labShell.currentWidget);\n    };\n    // Returns `true` if the current widget has a document context.\n    const isEnabled = () => {\n        const { currentWidget } = labShell;\n        return !!(currentWidget && docManager.contextForWidget(currentWidget));\n    };\n    commands.addCommand(CommandIDs.clone, {\n        label: () => trans.__('New View for %1', fileType(contextMenuWidget(), docManager)),\n        isEnabled,\n        execute: args => {\n            const widget = contextMenuWidget();\n            const options = args['options'] || {\n                mode: 'split-right'\n            };\n            if (!widget) {\n                return;\n            }\n            // Clone the widget.\n            const child = docManager.cloneWidget(widget);\n            if (child) {\n                widgetOpener.open(child, options);\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.rename, {\n        label: () => {\n            let t = fileType(contextMenuWidget(), docManager);\n            if (t) {\n                t = ' ' + t;\n            }\n            return trans.__('Rename%1…', t);\n        },\n        isEnabled,\n        execute: () => {\n            // Implies contextMenuWidget() !== null\n            if (isEnabled()) {\n                const context = docManager.contextForWidget(contextMenuWidget());\n                return (0,_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_3__.renameDialog)(docManager, context);\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.duplicate, {\n        label: () => trans.__('Duplicate %1', fileType(contextMenuWidget(), docManager)),\n        isEnabled,\n        execute: () => {\n            if (isEnabled()) {\n                const context = docManager.contextForWidget(contextMenuWidget());\n                if (!context) {\n                    return;\n                }\n                return docManager.duplicate(context.path);\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.del, {\n        label: () => trans.__('Delete %1', fileType(contextMenuWidget(), docManager)),\n        isEnabled,\n        execute: async () => {\n            // Implies contextMenuWidget() !== null\n            if (isEnabled()) {\n                const context = docManager.contextForWidget(contextMenuWidget());\n                if (!context) {\n                    return;\n                }\n                const result = await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.showDialog)({\n                    title: trans.__('Delete'),\n                    body: trans.__('Are you sure you want to delete %1', context.path),\n                    buttons: [\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.cancelButton(),\n                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.Dialog.warnButton({ label: trans.__('Delete') })\n                    ]\n                });\n                if (result.button.accept) {\n                    await app.commands.execute('docmanager:delete-file', {\n                        path: context.path\n                    });\n                }\n            }\n        }\n    });\n    commands.addCommand(CommandIDs.showInFileBrowser, {\n        label: () => trans.__('Show in File Browser'),\n        isEnabled,\n        execute: async () => {\n            const widget = contextMenuWidget();\n            const context = widget && docManager.contextForWidget(widget);\n            if (!context) {\n                return;\n            }\n            // 'activate' is needed if this command is selected in the \"open tabs\" sidebar\n            await commands.execute('filebrowser:activate', { path: context.path });\n            await commands.execute('filebrowser:go-to-path', { path: context.path });\n        }\n    });\n    labShell.currentChanged.connect(() => {\n        [\n            CommandIDs.clone,\n            CommandIDs.rename,\n            CommandIDs.duplicate,\n            CommandIDs.del,\n            CommandIDs.showInFileBrowser\n        ].forEach(cmd => {\n            app.commands.notifyCommandChanged(cmd);\n        });\n    });\n}\n/**\n * Handle dirty state for a context.\n */\nfunction handleContext(status, context) {\n    let disposable = null;\n    const onStateChanged = (sender, args) => {\n        if (args.name === 'dirty') {\n            if (args.newValue === true) {\n                if (!disposable) {\n                    disposable = status.setDirty();\n                }\n            }\n            else if (disposable) {\n                disposable.dispose();\n                disposable = null;\n            }\n        }\n    };\n    void context.ready.then(() => {\n        context.model.stateChanged.connect(onStateChanged);\n        if (context.model.dirty) {\n            disposable = status.setDirty();\n        }\n    });\n    context.disposed.connect(() => {\n        if (disposable) {\n            disposable.dispose();\n        }\n    });\n}\n/**\n * A namespace for private module data.\n */\nvar Private;\n(function (Private) {\n    /**\n     * A counter for unique IDs.\n     */\n    Private.id = 0;\n    function createRevertConfirmNode(checkpoint, fileType, trans) {\n        const body = document.createElement('div');\n        const confirmMessage = document.createElement('p');\n        const confirmText = document.createTextNode(trans.__('Are you sure you want to revert the %1 to checkpoint? ', fileType));\n        const cannotUndoText = document.createElement('strong');\n        cannotUndoText.textContent = trans.__('This cannot be undone.');\n        confirmMessage.appendChild(confirmText);\n        confirmMessage.appendChild(cannotUndoText);\n        const lastCheckpointMessage = document.createElement('p');\n        const lastCheckpointText = document.createTextNode(trans.__('The checkpoint was last updated at: '));\n        const lastCheckpointDate = document.createElement('p');\n        const date = new Date(checkpoint.last_modified);\n        lastCheckpointDate.style.textAlign = 'center';\n        lastCheckpointDate.textContent =\n            _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.Time.format(date) + ' (' + _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.Time.formatHuman(date) + ')';\n        lastCheckpointMessage.appendChild(lastCheckpointText);\n        lastCheckpointMessage.appendChild(lastCheckpointDate);\n        body.appendChild(confirmMessage);\n        body.appendChild(lastCheckpointMessage);\n        return body;\n    }\n    Private.createRevertConfirmNode = createRevertConfirmNode;\n    /**\n     * Ask user for a checkpoint to revert to.\n     */\n    async function getTargetCheckpoint(checkpoints, trans) {\n        // the id could be too long to show so use the index instead\n        const indexSeparator = '.';\n        const items = checkpoints.map((checkpoint, index) => {\n            const isoDate = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.Time.format(checkpoint.last_modified);\n            const humanDate = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_2__.Time.formatHuman(checkpoint.last_modified);\n            return `${index}${indexSeparator} ${isoDate} (${humanDate})`;\n        });\n        const selectedItem = (await _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.InputDialog.getItem({\n            items: items,\n            title: trans.__('Choose a checkpoint')\n        })).value;\n        if (!selectedItem) {\n            return;\n        }\n        const selectedIndex = selectedItem.split(indexSeparator, 1)[0];\n        return checkpoints[parseInt(selectedIndex, 10)];\n    }\n    Private.getTargetCheckpoint = getTargetCheckpoint;\n})(Private || (Private = {}));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager-extension/lib/index.js?");

/***/ }),

/***/ "../node_modules/@jupyterlab/docmanager-extension/lib/recents.js":
/*!***********************************************************************!*\
  !*** ../node_modules/@jupyterlab/docmanager-extension/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 */   recentsManagerPlugin: () => (/* binding */ recentsManagerPlugin)\n/* harmony export */ });\n/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/docmanager */ \"webpack/sharing/consume/default/@jupyterlab/docmanager/@jupyterlab/docmanager\");\n/* harmony import */ var _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/settingregistry */ \"webpack/sharing/consume/default/@jupyterlab/settingregistry/@jupyterlab/settingregistry\");\n/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/statedb */ \"webpack/sharing/consume/default/@jupyterlab/statedb/@jupyterlab/statedb\");\n/* harmony import */ var _jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statedb__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/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n\n\n\n/**\n * A namespace for command IDs.\n */\nvar CommandIDs;\n(function (CommandIDs) {\n    CommandIDs.clearRecents = 'docmanager:clear-recents';\n})(CommandIDs || (CommandIDs = {}));\nvar PluginIDs;\n(function (PluginIDs) {\n    PluginIDs.recentsManager = '@jupyterlab/docmanager-extension:recents';\n    PluginIDs.reopenClosed = '@jupyterlab/docmanager-extension:reopen-recently-closed';\n    PluginIDs.mainPlugin = '@jupyterlab/docmanager-extension:plugin';\n})(PluginIDs || (PluginIDs = {}));\nconst recentsManagerPlugin = {\n    id: PluginIDs.recentsManager,\n    description: 'Provides a manager of recently opened and closed documents.',\n    autoStart: true,\n    requires: [_jupyterlab_statedb__WEBPACK_IMPORTED_MODULE_2__.IStateDB],\n    optional: [_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_1__.ISettingRegistry, _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.ITranslator],\n    provides: _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_0__.IRecentsManager,\n    activate: (app, stateDB, settingRegistry, translator) => {\n        const { serviceManager } = app;\n        const trans = (translator !== null && translator !== void 0 ? translator : _jupyterlab_translation__WEBPACK_IMPORTED_MODULE_3__.nullTranslator).load('jupyterlab');\n        // Create the manager\n        const recentsManager = new _jupyterlab_docmanager__WEBPACK_IMPORTED_MODULE_0__.RecentsManager({\n            stateDB: stateDB,\n            contents: serviceManager.contents\n        });\n        const updateSettings = (settings) => {\n            recentsManager.maximalRecentsLength = settings.get('maxNumberRecents')\n                .composite;\n        };\n        if (settingRegistry) {\n            void Promise.all([\n                app.restored,\n                settingRegistry.load(PluginIDs.mainPlugin)\n            ]).then(([_, settings]) => {\n                settings.changed.connect(updateSettings);\n                updateSettings(settings);\n            });\n        }\n        app.commands.addCommand(CommandIDs.clearRecents, {\n            execute: () => {\n                recentsManager.clearRecents();\n            },\n            isEnabled: () => recentsManager.recentlyOpened.length != 0 ||\n                recentsManager.recentlyClosed.length != 0,\n            label: trans.__('Clear Recent Documents'),\n            caption: trans.__('Clear the list of recently opened items.')\n        });\n        return recentsManager;\n    }\n};\n//# sourceMappingURL=recents.js.map\n\n//# sourceURL=webpack://_JUPYTERLAB.CORE_OUTPUT/../node_modules/@jupyterlab/docmanager-extension/lib/recents.js?");

/***/ })

}]);