"use strict";
(self["webpackChunkmito_ai"] = self["webpackChunkmito_ai"] || []).push([["lib_index_js"],{

/***/ "./lib/Extensions/AiChat/AiChatPlugin.js":
/*!***********************************************!*\
  !*** ./lib/Extensions/AiChat/AiChatPlugin.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/application */ "webpack/sharing/consume/default/@jupyterlab/application");
/* harmony import */ var _jupyterlab_application__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _ChatWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ChatWidget */ "./lib/Extensions/AiChat/ChatWidget.js");
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/rendermime */ "webpack/sharing/consume/default/@jupyterlab/rendermime");
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
/* harmony import */ var _token__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./token */ "./lib/Extensions/AiChat/token.js");








/**
 * Initialization data for the mito-ai extension.
 */
const AiChatPlugin = {
    id: 'mito_ai:chat',
    description: 'AI chat for JupyterLab',
    autoStart: true,
    requires: [
        _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_2__.INotebookTracker,
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ICommandPalette,
        _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_3__.IRenderMimeRegistry,
        _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_4__.IContextManager,
    ],
    optional: [_jupyterlab_application__WEBPACK_IMPORTED_MODULE_0__.ILayoutRestorer],
    provides: _token__WEBPACK_IMPORTED_MODULE_5__.IChatTracker,
    activate: (app, notebookTracker, palette, rendermime, contextManager, restorer) => {
        // Define a widget creator function,
        // then call it to make a new widget
        const newWidget = () => {
            // Create a blank content widget inside of a MainAreaWidget
            const chatWidget = (0,_ChatWidget__WEBPACK_IMPORTED_MODULE_6__.buildChatWidget)(app, notebookTracker, rendermime, contextManager);
            return chatWidget;
        };
        let widget = newWidget();
        // Add an application command
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_7__.COMMAND_MITO_AI_OPEN_CHAT, {
            label: 'Your friendly Python Expert chat bot',
            execute: (args) => {
                // In order for the widget to be accessible, the widget must be:
                // 1. Created
                // 2. Added to the widget tracker
                // 3. Attatched to the frontend
                // Step 1: Create the widget if its not already created
                if (!widget || widget.isDisposed) {
                    widget = newWidget();
                }
                // Step 2: Add the widget to the widget tracker if
                // its not already there
                if (!tracker.has(widget)) {
                    void tracker.add(widget);
                }
                // Step 3: Attatch the widget to the app if its not
                // already there
                if (!widget.isAttached) {
                    void app.shell.add(widget, 'left', { rank: 2000 });
                }
                // Now that the widget is potentially accessible, activating the
                // widget opens the taskpane
                app.shell.activateById(widget.id);
                // If the command is called with focus on chat input set to false, 
                // don't focus. This is useful when we don't want to active cell 
                // preview to be displayed when using the smart debugger.
                if ((args === null || args === void 0 ? void 0 : args.focusChatInput) === false) {
                    return;
                }
                // Set focus on the chat input
                const chatInput = widget.node.querySelector('.chat-input');
                chatInput === null || chatInput === void 0 ? void 0 : chatInput.focus();
            }
        });
        app.commands.addKeyBinding({
            command: _commands__WEBPACK_IMPORTED_MODULE_7__.COMMAND_MITO_AI_OPEN_CHAT,
            keys: ['Accel E'],
            selector: 'body'
        });
        app.shell.add(widget, 'left', { rank: 2000 });
        // Add the command to the palette.
        palette.addItem({
            command: _commands__WEBPACK_IMPORTED_MODULE_7__.COMMAND_MITO_AI_OPEN_CHAT,
            category: 'AI Chat'
        });
        // Track and restore the widget state
        const tracker = new _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.WidgetTracker({
            namespace: widget.id
        });
        if (!tracker.has(widget)) {
            void tracker.add(widget);
        }
        if (restorer) {
            restorer.add(widget, 'mito_ai');
        }
        // This allows us to force plugin load order
        console.log("mito-ai: AiChatPlugin activated");
        return tracker;
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AiChatPlugin);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatHistoryManager.js":
/*!*****************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatHistoryManager.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ChatHistoryManager: () => (/* binding */ ChatHistoryManager)
/* harmony export */ });
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");


/*
    The ChatHistoryManager is responsible for managing the AI chat history.

    It keeps track of messages displayed in the chat interface that only display info the user wants to see, like their original input.

    TODO: In the future, we should make this its own extension that provides an interface for adding new messages to the chat history,
    creating new chats, etc. Doing so would allow us to easily append new messages from other extensions without having to do so
    by calling commands with untyped arguments.

    Whenever, the chatHistoryManager is updated, it should automatically send a message to the AI.
*/
class ChatHistoryManager {
    constructor(contextManager, notebookTracker, initialHistory) {
        this.getLastAIMessageIndex = () => {
            const displayOptimizedChatHistory = this.getDisplayOptimizedHistory();
            const aiMessageIndexes = displayOptimizedChatHistory.map((chatEntry, index) => {
                if (chatEntry.message.role === 'assistant') {
                    return index;
                }
                return undefined;
            }).filter(index => index !== undefined);
            return aiMessageIndexes[aiMessageIndexes.length - 1];
        };
        this.getLastAIDisplayOptimizedChatItem = () => {
            const lastAIMessagesIndex = this.getLastAIMessageIndex();
            if (!lastAIMessagesIndex) {
                return;
            }
            return this.displayOptimizedChatHistory[lastAIMessagesIndex];
        };
        // Initialize the history
        this.displayOptimizedChatHistory = initialHistory || [];
        // Save the context manager
        this.contextManager = contextManager;
        // Save the notebook tracker
        this.notebookTracker = notebookTracker;
    }
    createDuplicateChatHistoryManager() {
        return new ChatHistoryManager(this.contextManager, this.notebookTracker, this.displayOptimizedChatHistory);
    }
    getDisplayOptimizedHistory() {
        return this.displayOptimizedChatHistory;
    }
    addChatMessageFromHistory(message) {
        this.displayOptimizedChatHistory.push({
            message: message,
            type: 'openai message',
            codeCellID: undefined,
            promptType: 'chat'
        });
    }
    addChatInputMessage(input) {
        const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellCode)(this.notebookTracker);
        const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellID)(this.notebookTracker);
        const chatMessageMetadata = {
            promptType: 'chat',
            variables: this.contextManager.variables,
            files: this.contextManager.files,
            activeCellCode: activeCellCode,
            input: input
        };
        this.displayOptimizedChatHistory.push({
            message: getDisplayedOptimizedUserMessage(input, activeCellCode),
            type: 'openai message',
            codeCellID: activeCellID,
            promptType: 'chat'
        });
        return chatMessageMetadata;
    }
    addAgentExecutionMessage(input) {
        const aiOptimizedCells = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getAIOptimizedCells)(this.notebookTracker);
        const agentExecutionMetatada = {
            promptType: 'agent:execution',
            variables: this.contextManager.variables,
            files: this.contextManager.files,
            aiOptimizedCells: aiOptimizedCells,
            input: input || ''
        };
        // We use this function in two ways: 
        // 1. When the user sends the original agent:execution message to start the agent
        // 2. When the agent sends itself information about the updated variables, etc. In this case, 
        // we don't want to pass an input. 
        let userMessage;
        if (input) {
            userMessage = getDisplayedOptimizedUserMessage(input);
        }
        else {
            userMessage = {
                role: 'user',
                content: ''
            };
        }
        this.displayOptimizedChatHistory.push({
            message: userMessage,
            type: 'openai message',
            promptType: 'chat',
        });
        return agentExecutionMetatada;
    }
    dropMessagesStartingAtIndex(index) {
        this.displayOptimizedChatHistory.splice(index);
    }
    addSmartDebugMessage(errorMessage) {
        const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellID)(this.notebookTracker);
        const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getCellCodeByID)(this.notebookTracker, activeCellID);
        const smartDebugMetadata = {
            promptType: 'smartDebug',
            variables: this.contextManager.variables,
            files: this.contextManager.files,
            activeCellCode: activeCellCode,
            errorMessage: errorMessage
        };
        this.displayOptimizedChatHistory.push({
            message: getDisplayedOptimizedUserMessage(errorMessage, activeCellCode),
            type: 'openai message',
            codeCellID: activeCellID,
            promptType: 'smartDebug'
        });
        return smartDebugMetadata;
    }
    addAgentSmartDebugMessage(errorMessage) {
        const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellID)(this.notebookTracker);
        const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellCode)(this.notebookTracker);
        const agentSmartDebugMetadata = {
            promptType: 'agent:autoErrorFixup',
            aiOptimizedCells: (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getAIOptimizedCells)(this.notebookTracker),
            variables: this.contextManager.variables,
            files: this.contextManager.files,
            errorMessage: errorMessage,
            error_message_producing_code_cell_id: activeCellID || ''
        };
        this.displayOptimizedChatHistory.push({
            message: getDisplayedOptimizedUserMessage(errorMessage, activeCellCode),
            type: 'openai message',
            codeCellID: activeCellID,
            promptType: 'agent:autoErrorFixup'
        });
        return agentSmartDebugMetadata;
    }
    addExplainCodeMessage() {
        const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellID)(this.notebookTracker);
        const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getCellCodeByID)(this.notebookTracker, activeCellID);
        const codeExplainMetadata = {
            promptType: 'codeExplain',
            variables: this.contextManager.variables,
            activeCellCode
        };
        this.displayOptimizedChatHistory.push({
            message: getDisplayedOptimizedUserMessage('Explain this code', activeCellCode),
            type: 'openai message',
            codeCellID: activeCellID,
            promptType: 'codeExplain'
        });
        return codeExplainMetadata;
    }
    addAIMessageFromResponse(messageContent, promptType, mitoAIConnectionError = false, mitoAIConnectionErrorType = null) {
        if (messageContent === null) {
            return;
        }
        const aiMessage = {
            role: 'assistant',
            content: messageContent
        };
        let type;
        if (mitoAIConnectionError) {
            type = 'connection error';
        }
        else {
            type = 'openai message';
        }
        const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_0__.getActiveCellID)(this.notebookTracker);
        this.displayOptimizedChatHistory.push({
            message: aiMessage,
            type: type,
            mitoAIConnectionErrorType: mitoAIConnectionErrorType,
            codeCellID: activeCellID,
            promptType: promptType
        });
    }
    addAIMessageFromAgentResponse(agentResponse) {
        var _a;
        const code = (_a = agentResponse.cell_update) === null || _a === void 0 ? void 0 : _a.code;
        const codeWithMarkdownFormatting = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_1__.addMarkdownCodeFormatting)(code);
        let content = agentResponse.message;
        if (codeWithMarkdownFormatting !== undefined) {
            content = content + '\n\n' + codeWithMarkdownFormatting;
        }
        const aiMessage = {
            role: 'assistant',
            content: content
        };
        this.displayOptimizedChatHistory.push({
            message: aiMessage,
            type: 'openai message',
            promptType: 'agent:execution',
            agentResponse: agentResponse
        });
    }
}
const getDisplayedOptimizedUserMessage = (input, activeCellCode, messageToAgent = false) => {
    // Don't include the active cell code if it is an agent planning message
    // or if the there is no active cell code provided, which occurs when
    // sending an agent:execution message which uses the entire notebook as context
    // instead of just the active cell
    let activeCellCodeBlock = '';
    if (!messageToAgent && activeCellCode) {
        activeCellCodeBlock =
            `\`\`\`python
${activeCellCode}
\`\`\``;
    }
    return {
        role: 'user',
        content: `${activeCellCodeBlock}
${input}`
    };
};


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/AlertBlock.js":
/*!*********************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/AlertBlock.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_TextButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../components/TextButton */ "./lib/components/TextButton.js");
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/errors */ "./lib/utils/errors.js");
/* harmony import */ var _utils_stripe__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/stripe */ "./lib/utils/stripe.js");




const AlertBlock = ({ content, mitoAIConnectionErrorType }) => {
    if (mitoAIConnectionErrorType === _utils_errors__WEBPACK_IMPORTED_MODULE_1__.FREE_TIER_LIMIT_REACHED_ERROR_TITLE) {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chat-message-alert" },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null,
                "You've used up your free trial of Mito AI for this month. To continue using Mito AI now, upgrade to ",
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("a", { href: "https://www.trymito.io/plans", target: "_blank", rel: "noreferrer" }, "Mito Pro"),
                " and get access to:"),
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", null,
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, "Unlimited AI Chat and Agent"),
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, "Unlimited AI Autocompletes"),
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", null, "All Mito Spreadsheet Pro features")),
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "Or supply your own Open AI Key to continue using the basic version of Mito AI."),
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_2__["default"], { title: "Upgrade to Pro", text: "Upgrade to Pro", action: _utils_stripe__WEBPACK_IMPORTED_MODULE_3__.STRIPE_PAYMENT_LINK, variant: "purple", width: "block" })));
    }
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "chat-message-alert" }, content));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AlertBlock);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js":
/*!***********************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");


const ChatDropdown = ({ options, onSelect, filterText, maxDropdownItems = 10, }) => {
    const [selectedIndex, setSelectedIndex] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
    const filteredOptions = options.filter((variable) => variable.variable_name.toLowerCase().includes(filterText.toLowerCase()) &&
        variable.type !== "<class 'module'>" &&
        variable.variable_name !== "FUNCTIONS" // This is default exported from mitosheet when you run from mitosheet import * as FUNCTIONS
    ).slice(0, maxDropdownItems);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        setSelectedIndex(0);
    }, [options, filterText]);
    const handleKeyDown = (event) => {
        switch (event.key) {
            case 'ArrowDown':
            case 'Down':
                event.preventDefault();
                setSelectedIndex((prev) => prev < filteredOptions.length - 1 ? prev + 1 : 0);
                break;
            case 'ArrowUp':
            case 'Up':
                event.preventDefault();
                setSelectedIndex((prev) => prev > 0 ? prev - 1 : filteredOptions.length - 1);
                break;
            case 'Enter':
            case 'Return':
            case 'Tab': {
                event.preventDefault();
                const selectedOption = filteredOptions[selectedIndex];
                if (selectedOption !== undefined) {
                    onSelect(selectedOption.variable_name, selectedOption.parent_df);
                }
                break;
            }
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        document.addEventListener('keydown', handleKeyDown);
        return () => document.removeEventListener('keydown', handleKeyDown);
    }, [filteredOptions, selectedIndex]);
    const getShortType = (type) => {
        var _a;
        if (type.includes("DataFrame")) {
            return "df";
        }
        if (type.includes("Series")) {
            return "s";
        }
        if (type.includes("<class '")) {
            return (_a = type.split("'")[1]) !== null && _a !== void 0 ? _a : '';
        }
        return type;
    };
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `chat-dropdown`, "data-testid": "chat-dropdown" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("ul", { className: "chat-dropdown-list", "data-testid": "chat-dropdown-list" },
            filteredOptions.length === 0 && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { className: "chat-dropdown-item", "data-testid": "chat-dropdown-empty-item" }, "No variables found")),
            filteredOptions.map((option, index) => {
                const uniqueKey = option.parent_df
                    ? `${option.parent_df}.${option.variable_name}`
                    : option.variable_name;
                return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("li", { key: uniqueKey, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_1__.classNames)("chat-dropdown-item", { selected: index === selectedIndex }), onClick: () => onSelect(option.variable_name, option.parent_df), "data-testid": `chat-dropdown-item-${option.variable_name}` },
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-type", title: getShortType(option.type), "data-testid": `chat-dropdown-item-type-${option.variable_name}` }, getShortType(option.type)),
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-name", title: option.variable_name, "data-testid": `chat-dropdown-item-name-${option.variable_name}`, ref: (el) => {
                            // Show full text on hover if the text is too long
                            if (el) {
                                el.title = el.scrollWidth > el.clientWidth ? option.variable_name : '';
                            }
                        } }, option.variable_name),
                    option.parent_df && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "chat-dropdown-item-parent-df" }, option.parent_df))));
            }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatDropdown);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js":
/*!********************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/ChatInput.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
/* harmony import */ var _ChatDropdown__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ChatDropdown */ "./lib/Extensions/AiChat/ChatMessage/ChatDropdown.js");
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/notebook */ "./lib/utils/notebook.js");
/* harmony import */ var _PythonCode__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PythonCode */ "./lib/Extensions/AiChat/ChatMessage/PythonCode.js");
/* harmony import */ var _style_ChatInput_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ChatInput.css */ "./style/ChatInput.css");
/* harmony import */ var _style_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/ChatDropdown.css */ "./style/ChatDropdown.css");
/* harmony import */ var _hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../hooks/useDebouncedFunction */ "./lib/hooks/useDebouncedFunction.js");








const ChatInput = ({ initialContent, placeholder, onSave, onCancel, isEditing, contextManager, notebookTracker, renderMimeRegistry, displayActiveCellCode = true, agentModeEnabled = false, }) => {
    var _a;
    const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(initialContent);
    const [expandedVariables, setExpandedVariables] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
    const textAreaRef = react__WEBPACK_IMPORTED_MODULE_0___default().useRef(null);
    const [isFocused, setIsFocused] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
    const [activeCellID, setActiveCellID] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getActiveCellID)(notebookTracker));
    const [isDropdownVisible, setDropdownVisible] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
    const [dropdownFilter, setDropdownFilter] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)('');
    // Debounce the active cell ID change to avoid multiple rerenders. 
    // We use this to avoid a flickering screen when the active cell changes. 
    const debouncedSetActiveCellID = (0,_hooks_useDebouncedFunction__WEBPACK_IMPORTED_MODULE_4__.useDebouncedFunction)((newID) => {
        setActiveCellID(newID);
    }, 100);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const activeCellChangedListener = () => {
            const newActiveCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getActiveCellID)(notebookTracker);
            debouncedSetActiveCellID(newActiveCellID);
        };
        // Connect the listener once when the component mounts
        notebookTracker.activeCellChanged.connect(activeCellChangedListener);
        // Cleanup: disconnect the listener when the component unmounts
        return () => {
            notebookTracker.activeCellChanged.disconnect(activeCellChangedListener);
        };
    }, [notebookTracker, activeCellID, debouncedSetActiveCellID]);
    // TextAreas cannot automatically adjust their height based on the content that they contain, 
    // so instead we re-adjust the height as the content changes here. 
    const adjustHeight = (resetHeight = false) => {
        const textarea = textAreaRef === null || textAreaRef === void 0 ? void 0 : textAreaRef.current;
        if (!textarea)
            return;
        textarea.style.minHeight = 'auto';
        textarea.style.height = !textarea.value || resetHeight
            ? '80px'
            : `${Math.max(80, textarea.scrollHeight)}px`;
    };
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        adjustHeight();
    }, [(_a = textAreaRef === null || textAreaRef === void 0 ? void 0 : textAreaRef.current) === null || _a === void 0 ? void 0 : _a.value]);
    const handleInputChange = (event) => {
        const value = event.target.value;
        setInput(value);
        const cursorPosition = event.target.selectionStart;
        const textBeforeCursor = value.slice(0, cursorPosition);
        const words = textBeforeCursor.split(/\s+/);
        const currentWord = words[words.length - 1];
        if (currentWord && currentWord.startsWith("@")) {
            const query = currentWord.slice(1);
            setDropdownFilter(query);
            setDropdownVisible(true);
        }
        else {
            setDropdownVisible(false);
            setDropdownFilter('');
        }
    };
    const handleOptionSelect = (variableName, parentDf) => {
        const textarea = textAreaRef.current;
        if (!textarea)
            return;
        const cursorPosition = textarea.selectionStart;
        const textBeforeCursor = input.slice(0, cursorPosition);
        const atIndex = textBeforeCursor.lastIndexOf("@");
        const textAfterCursor = input.slice(cursorPosition);
        let variableNameWithBackticks;
        if (!parentDf) {
            variableNameWithBackticks = `\`${variableName}\``;
        }
        else {
            variableNameWithBackticks = `\`${parentDf}['${variableName}']\``;
        }
        const newValue = input.slice(0, atIndex) +
            variableNameWithBackticks +
            textAfterCursor;
        setInput(newValue);
        setDropdownVisible(false);
        // After updating the input value, set the cursor position after the inserted variable name
        // We use setTimeout to ensure this happens after React's state update
        setTimeout(() => {
            if (textarea) {
                const newCursorPosition = atIndex + variableNameWithBackticks.length;
                textarea.focus();
                textarea.setSelectionRange(newCursorPosition, newCursorPosition);
            }
        }, 0);
    };
    // Update the expandedVariables arr when the variable manager changes
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const expandedVariables = [
            // Add base variables (excluding DataFrames)
            ...((contextManager === null || contextManager === void 0 ? void 0 : contextManager.variables.filter(variable => variable.type !== "pd.DataFrame")) || []),
            // Add DataFrames
            ...((contextManager === null || contextManager === void 0 ? void 0 : contextManager.variables.filter((variable) => variable.type === "pd.DataFrame")) || []),
            // Add series with parent DataFrame references
            ...((contextManager === null || contextManager === void 0 ? void 0 : contextManager.variables.filter((variable) => variable.type === "pd.DataFrame").flatMap((df) => Object.entries(df.value).map(([seriesName, _]) => ({
                variable_name: seriesName,
                type: "col",
                value: "replace_me",
                parent_df: df.variable_name,
            })))) || [])
        ];
        setExpandedVariables(expandedVariables);
    }, [contextManager === null || contextManager === void 0 ? void 0 : contextManager.variables]);
    // If there are more than 8 lines, show the first 8 lines and add a "..."
    const activeCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_3__.getCellCodeByID)(notebookTracker, activeCellID) || '';
    const activeCellCodePreview = activeCellCode.split('\n').slice(0, 8).join('\n') + (activeCellCode.split('\n').length > 8 ? '\n\n# Rest of active cell code...' : '');
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("chat-input-container"), onFocus: () => setIsFocused(true), onBlur: () => {
            setIsFocused(false);
        } },
        displayActiveCellCode && activeCellCodePreview.length > 0
            && (isFocused || input.length > 0)
            && react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'active-cell-preview-container', "data-testid": 'active-cell-preview-container' },
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-container' },
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_PythonCode__WEBPACK_IMPORTED_MODULE_6__["default"], { code: activeCellCodePreview, renderMimeRegistry: renderMimeRegistry }))),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { style: { position: 'relative', height: 'min-content' } },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("textarea", { ref: textAreaRef, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message", "message-user", 'chat-input', { "agent-mode": agentModeEnabled }), placeholder: placeholder, value: input, onChange: handleInputChange, onKeyDown: (e) => {
                    // If dropdown is visible, only handle escape to close it
                    if (isDropdownVisible) {
                        if (e.key === 'Escape') {
                            e.preventDefault();
                            setDropdownVisible(false);
                        }
                        return;
                    }
                    // Enter key sends the message, but we still want to allow 
                    // shift + enter to add a new line.
                    if (e.key === 'Enter' && !e.shiftKey) {
                        e.preventDefault();
                        adjustHeight(true);
                        onSave(input);
                        setInput('');
                        setIsFocused(false);
                    }
                    // Escape key cancels editing
                    if (e.key === 'Escape') {
                        e.preventDefault();
                        if (onCancel) {
                            onCancel();
                        }
                    }
                } }),
            isDropdownVisible && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatDropdown__WEBPACK_IMPORTED_MODULE_7__["default"], { options: expandedVariables, onSelect: handleOptionSelect, filterText: dropdownFilter }))),
        isEditing &&
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "message-edit-buttons" },
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: () => onSave(input) }, "Save"),
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: onCancel }, "Cancel"))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatInput);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/ChatMessage.js":
/*!**********************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/ChatMessage.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../utils/classNames */ "./lib/utils/classNames.js");
/* harmony import */ var _CodeBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CodeBlock */ "./lib/Extensions/AiChat/ChatMessage/CodeBlock.js");
/* harmony import */ var _AlertBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AlertBlock */ "./lib/Extensions/AiChat/ChatMessage/AlertBlock.js");
/* harmony import */ var _MarkdownBlock__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./MarkdownBlock */ "./lib/Extensions/AiChat/ChatMessage/MarkdownBlock.js");
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/strings */ "./lib/utils/strings.js");
/* harmony import */ var _icons_Pencil__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../../icons/Pencil */ "./lib/icons/Pencil.js");
/* harmony import */ var _ChatInput__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
/* harmony import */ var _components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../components/TextAndIconButton */ "./lib/components/TextAndIconButton.js");
/* harmony import */ var _icons_PlayButtonIcon__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../icons/PlayButtonIcon */ "./lib/icons/PlayButtonIcon.js");
/* harmony import */ var _icons_CopyIcon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../icons/CopyIcon */ "./lib/icons/CopyIcon.js");
/* harmony import */ var _utils_copyToClipboard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../../utils/copyToClipboard */ "./lib/utils/copyToClipboard.js");
/* harmony import */ var _components_TextButton__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../components/TextButton */ "./lib/components/TextButton.js");
/* harmony import */ var _style_ChatMessage_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/ChatMessage.css */ "./style/ChatMessage.css");
/* harmony import */ var _style_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/MarkdownMessage.css */ "./style/MarkdownMessage.css");















const ChatMessage = ({ message, messageType, promptType, messageIndex, mitoAIConnectionError, mitoAIConnectionErrorType, notebookTracker, renderMimeRegistry, isLastAiMessage, operatingSystem, previewAICode, acceptAICode, rejectAICode, onUpdateMessage, contextManager, codeReviewStatus }) => {
    const [isEditing, setIsEditing] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
    if (message.role !== 'user' && message.role !== 'assistant') {
        return null;
    }
    const editable = message.role === 'user';
    const messageContentParts = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_3__.splitStringWithCodeBlocks)(message);
    const handleEditClick = () => {
        setIsEditing(true);
    };
    const handleSave = (content) => {
        onUpdateMessage(messageIndex, content, messageType);
        setIsEditing(false);
    };
    const handleCancel = () => {
        setIsEditing(false);
    };
    if (isEditing) {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatInput__WEBPACK_IMPORTED_MODULE_4__["default"], { initialContent: message.content.replace(/```[\s\S]*?```/g, '').trim(), placeholder: "Edit your message", onSave: handleSave, onCancel: handleCancel, isEditing: isEditing, contextManager: contextManager, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, displayActiveCellCode: true }));
    }
    if (mitoAIConnectionError) {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message") },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_AlertBlock__WEBPACK_IMPORTED_MODULE_6__["default"], { content: message.content, mitoAIConnectionErrorType: mitoAIConnectionErrorType })));
    }
    // If the message is empty, don't render anything
    const messageContent = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_3__.getContentStringFromMessage)(message);
    if (messageContent === undefined || messageContent === '') {
        return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);
    }
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)("message", { "message-user": message.role === 'user' }, { 'message-assistant-chat': message.role === 'assistant' }) },
        messageContentParts.map((messagePart, index) => {
            if (messagePart.startsWith(_utils_strings__WEBPACK_IMPORTED_MODULE_3__.PYTHON_CODE_BLOCK_START_WITHOUT_NEW_LINE)) {
                // Make sure that there is actually code in the message. 
                // An empty code will look like this '```python  ```'
                if (messagePart.length > 14) {
                    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
                        react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CodeBlock__WEBPACK_IMPORTED_MODULE_7__["default"], { key: index + messagePart, code: messagePart, role: message.role, renderMimeRegistry: renderMimeRegistry, previewAICode: previewAICode, acceptAICode: acceptAICode, rejectAICode: rejectAICode, isLastAiMessage: isLastAiMessage, codeReviewStatus: codeReviewStatus }),
                        isLastAiMessage && codeReviewStatus === 'chatPreview' &&
                            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'chat-message-buttons' },
                                react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_8__["default"], { onClick: () => { previewAICode(); }, text: 'Overwrite Active Cell', icon: _icons_PlayButtonIcon__WEBPACK_IMPORTED_MODULE_9__["default"], title: 'Write the Ai generated code to the active cell in the jupyter notebook, replacing the current code.', variant: 'gray', width: 'fit-contents' }),
                                react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextAndIconButton__WEBPACK_IMPORTED_MODULE_8__["default"], { onClick: () => { void (0,_utils_copyToClipboard__WEBPACK_IMPORTED_MODULE_10__["default"])(messagePart); }, text: 'Copy', icon: _icons_CopyIcon__WEBPACK_IMPORTED_MODULE_11__["default"], title: 'Copy the Ai generated code to your clipboard', variant: 'gray', width: 'fit-contents' })),
                        isLastAiMessage && codeReviewStatus === 'codeCellPreview' &&
                            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'chat-message-buttons' },
                                react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_12__["default"], { onClick: () => { acceptAICode(); }, text: `Accept code ${operatingSystem === 'mac' ? '⌘Y' : 'Ctrl+Y'}`, title: 'Accept the Ai generated code', variant: 'green', width: 'fit-contents' }),
                                react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_12__["default"], { onClick: () => { rejectAICode(); }, text: `Reject code ${operatingSystem === 'mac' ? '⌘U' : 'Ctrl+U'}`, title: 'Reject the Ai generated code and revert to the previous version of the code cell', variant: 'red', width: 'fit-contents' }))));
                }
                else {
                    // Return null for empty code blocks
                    return null;
                }
            }
            else {
                return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { key: index + messagePart, className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_5__.classNames)('markdown-message-part') },
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", { onDoubleClick: () => {
                            // Only allow users to edit their own messages, not the AI responses
                            if (message.role === 'user') {
                                setIsEditing(true);
                            }
                        } }, message.role === 'user' && promptType === 'smartDebug' ? (
                    /* Use a pre tag to preserve the newline and indentation of the error message */
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { className: "chat-taskpane-smart-debug-error-message" }, messagePart)) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MarkdownBlock__WEBPACK_IMPORTED_MODULE_13__["default"], { markdown: messagePart, renderMimeRegistry: renderMimeRegistry, notebookTracker: notebookTracker })))));
            }
        }),
        editable &&
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "message-action-buttons" },
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "message-start-editing-button", onClick: handleEditClick, title: "Edit message" },
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_Pencil__WEBPACK_IMPORTED_MODULE_14__["default"], null)))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatMessage);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/Citation.js":
/*!*******************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/Citation.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Citation: () => (/* binding */ Citation),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../utils/notebook */ "./lib/utils/notebook.js");
/* harmony import */ var _style_Citation_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/Citation.css */ "./style/Citation.css");



// Citation button component
const Citation = ({ citationIndex, cellId, line, notebookTracker }) => {
    const handleClick = () => {
        (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_2__.scrollToCell)(notebookTracker, cellId, line);
    };
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "citation-button", onClick: handleClick, title: `Line ${line}` }, citationIndex));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Citation);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/CodeBlock.js":
/*!********************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/CodeBlock.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _PythonCode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PythonCode */ "./lib/Extensions/AiChat/ChatMessage/PythonCode.js");
/* harmony import */ var _style_CodeBlock_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../style/CodeBlock.css */ "./style/CodeBlock.css");
/* harmony import */ var _utils_copyToClipboard__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../utils/copyToClipboard */ "./lib/utils/copyToClipboard.js");
/* harmony import */ var _components_IconButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../components/IconButton */ "./lib/components/IconButton.js");
/* harmony import */ var _icons_CopyIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../icons/CopyIcon */ "./lib/icons/CopyIcon.js");
/* harmony import */ var _icons_PlayButtonIcon__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../icons/PlayButtonIcon */ "./lib/icons/PlayButtonIcon.js");
/* harmony import */ var _icons_AcceptIcon__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../icons/AcceptIcon */ "./lib/icons/AcceptIcon.js");
/* harmony import */ var _icons_RejectIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../icons/RejectIcon */ "./lib/icons/RejectIcon.js");









const CodeBlock = ({ code, role, renderMimeRegistry, previewAICode, acceptAICode, rejectAICode, isLastAiMessage, codeReviewStatus, }) => {
    if (role === 'user') {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-container' },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_PythonCode__WEBPACK_IMPORTED_MODULE_2__["default"], { code: code, renderMimeRegistry: renderMimeRegistry })));
    }
    if (role === 'assistant') {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-container' },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
                isLastAiMessage &&
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-toolbar' },
                        codeReviewStatus === 'chatPreview' &&
                            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_3__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_PlayButtonIcon__WEBPACK_IMPORTED_MODULE_4__["default"], null), title: "Overwrite Active Cell", onClick: () => { previewAICode(); } }),
                        codeReviewStatus === 'codeCellPreview' &&
                            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_3__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_AcceptIcon__WEBPACK_IMPORTED_MODULE_5__["default"], null), title: "Accept AI Generated Code", onClick: () => { acceptAICode(); }, style: { color: 'var(--green-700)' } }),
                        codeReviewStatus === 'codeCellPreview' &&
                            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_3__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_RejectIcon__WEBPACK_IMPORTED_MODULE_6__["default"], null), title: "Reject AI Generated Code", onClick: () => { rejectAICode(); }, style: { color: 'var(--red-700)' } }),
                        codeReviewStatus !== 'codeCellPreview' &&
                            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_3__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_CopyIcon__WEBPACK_IMPORTED_MODULE_7__["default"], null), title: "Copy", onClick: () => { void (0,_utils_copyToClipboard__WEBPACK_IMPORTED_MODULE_8__["default"])(code); } })),
                !isLastAiMessage &&
                    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-toolbar' },
                        react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_3__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_CopyIcon__WEBPACK_IMPORTED_MODULE_7__["default"], null), title: "Copy", onClick: () => { void (0,_utils_copyToClipboard__WEBPACK_IMPORTED_MODULE_8__["default"])(code); } }))),
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_PythonCode__WEBPACK_IMPORTED_MODULE_2__["default"], { code: code, renderMimeRegistry: renderMimeRegistry })));
    }
    return react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CodeBlock);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/MarkdownBlock.js":
/*!************************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/MarkdownBlock.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/rendermime */ "webpack/sharing/consume/default/@jupyterlab/rendermime");
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-dom */ "webpack/sharing/consume/default/react-dom");
/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Citation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Citation */ "./lib/Extensions/AiChat/ChatMessage/Citation.js");




const CitationPortal = ({ container, ...props }) => {
    return (0,react_dom__WEBPACK_IMPORTED_MODULE_2__.createPortal)(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_Citation__WEBPACK_IMPORTED_MODULE_3__.Citation, { ...props }), container);
};
const MarkdownBlock = ({ markdown, renderMimeRegistry, notebookTracker }) => {
    const [citationPortals, setCitationPortals] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
    const containerRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
    // Extract citations from the markdown, returning the markdown with the JSON citations replaced with 
    // citation placeholders {{${id}}} and an array of citation objects.
    const extractCitations = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((text) => {
        // eslint-disable-next-line no-useless-escape
        const citationRegex = /(\{\"type\"\:\s*\"citation\".*?\})/g;
        const citations = [];
        let counter = 0;
        // Replace each citation with a placeholder
        const processedMarkdown = text.replace(citationRegex, (match) => {
            try {
                const citation = JSON.parse(match);
                const id = `citation-${counter++}`;
                citations.push({ id, data: { citation_index: counter, ...citation } });
                return `{{${id}}}`;
            }
            catch (e) {
                console.error("Failed to parse citation JSON:", e);
                return match;
            }
        });
        return { processedMarkdown, citations };
    }, []);
    // Uses the Jupyter markdowm MimeRenderer to render the markdown content as normal HTML
    const renderMarkdownContent = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async (processedMarkdown) => {
        if (!processedMarkdown || !containerRef.current)
            return;
        try {
            const model = new _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__.MimeModel({
                data: { ['text/markdown']: processedMarkdown },
            });
            const renderer = renderMimeRegistry.createRenderer('text/markdown');
            await renderer.renderModel(model);
            // Clear previous content
            containerRef.current.innerHTML = '';
            containerRef.current.appendChild(renderer.node.cloneNode(true));
        }
        catch (error) {
            console.error("Error rendering markdown:", error);
        }
    }, [renderMimeRegistry]);
    // Replace the citation placeholders with Citation Components in the DOM
    const createCitationPortals = (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((citations) => {
        if (!containerRef.current || citations.length === 0)
            return [];
        const newPortals = [];
        // Create a map of placeholder to citation for faster lookup
        const citationMap = new Map(citations.map(citation => [`{{${citation.id}}}`, citation]));
        // Find all text nodes that contain our placeholder like {{citation-id}}).
        // Since these placeholders exist within the text content (not as separate DOM elements):
        //  - Find all text nodes in the rendered markdown
        //  - Check each one to see if it contains any of your placeholders
        //  - Process those that do contain placeholders
        const textNodes = [];
        const walker = document.createTreeWalker(containerRef.current, NodeFilter.SHOW_TEXT);
        let textNode;
        while ((textNode = walker.nextNode())) {
            textNodes.push(textNode);
        }
        // Process all text nodes in a single pass
        textNodes.forEach(node => {
            if (!node.nodeValue)
                return;
            // Check if this node contains any placeholders
            let containsPlaceholder = false;
            for (const placeholder of citationMap.keys()) {
                if (node.nodeValue.includes(placeholder)) {
                    containsPlaceholder = true;
                    break;
                }
            }
            if (!containsPlaceholder)
                return;
            // Create a regex to match all placeholders
            const placeholderPattern = /\{\{citation-\d+\}\}/g;
            const matches = [...node.nodeValue.matchAll(placeholderPattern)];
            if (matches.length === 0)
                return;
            // Split the text by all placeholders and create a fragment
            const fragment = document.createDocumentFragment();
            let lastIndex = 0;
            matches.forEach(match => {
                const placeholder = match[0];
                const citation = citationMap.get(placeholder);
                if (!citation)
                    return;
                const startIndex = match.index;
                // Add text before the placeholder
                if (startIndex > lastIndex) {
                    fragment.appendChild(document.createTextNode(node.nodeValue.substring(lastIndex, startIndex)));
                }
                // Create span for the citation
                const span = document.createElement('span');
                span.classList.add('citation-container');
                span.dataset.citationId = citation.id;
                fragment.appendChild(span);
                // Create React portal for this span
                newPortals.push(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(CitationPortal, { key: citation.id + '-' + matches.indexOf(match), container: span, citationIndex: citation.data.citation_index, cellId: citation.data.cell_id, line: citation.data.line, notebookTracker: notebookTracker }));
                lastIndex = startIndex + placeholder.length;
            });
            // Add any remaining text after the last placeholder
            if (lastIndex < node.nodeValue.length) {
                fragment.appendChild(document.createTextNode(node.nodeValue.substring(lastIndex)));
            }
            // Replace the original text node with our fragment
            if (node.parentNode) {
                node.parentNode.replaceChild(fragment, node);
            }
        });
        return newPortals;
    }, []);
    // Process everything in one effect, but with clear separation via helper functions
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const processMarkdown = async () => {
            // Step 1: Extract citations and get processed markdown
            const { processedMarkdown, citations } = extractCitations(markdown);
            // Step 2: Render markdown with placeholders
            await renderMarkdownContent(processedMarkdown);
            // Step 3: Create and insert citation portals
            const portals = createCitationPortals(citations);
            setCitationPortals(portals);
        };
        void processMarkdown();
    }, [markdown, extractCitations, renderMarkdownContent, createCitationPortals]);
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { ref: containerRef, className: "markdown-block-with-citations" }, citationPortals));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MarkdownBlock);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatMessage/PythonCode.js":
/*!*********************************************************!*\
  !*** ./lib/Extensions/AiChat/ChatMessage/PythonCode.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/rendermime */ "webpack/sharing/consume/default/@jupyterlab/rendermime");
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _style_PythonCode_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../style/PythonCode.css */ "./style/PythonCode.css");
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../utils/strings */ "./lib/utils/strings.js");




const PythonCode = ({ code, renderMimeRegistry }) => {
    const [node, setNode] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const model = new _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_1__.MimeModel({
            data: { ['text/markdown']: (0,_utils_strings__WEBPACK_IMPORTED_MODULE_3__.addMarkdownCodeFormatting)(code, true) },
        });
        const renderer = renderMimeRegistry.createRenderer('text/markdown');
        const renderCode = async () => {
            await renderer.renderModel(model);
            const node = renderer.node;
            setNode(node);
        };
        void renderCode();
        // Clean up function to remove the node when component unmounts or code changes
        return () => {
            if (node && node.parentNode) {
                node.parentNode.removeChild(node);
            }
        };
    }, [code, renderMimeRegistry]); // Add dependencies to useEffect
    if (node) {
        return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-python-code', ref: (el) => el && el.appendChild(node) });
    }
    else {
        return react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: 'code-block-python-code' });
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PythonCode);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatTaskpane.js":
/*!***********************************************!*\
  !*** ./lib/Extensions/AiChat/ChatTaskpane.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/state */ "webpack/sharing/consume/default/@codemirror/state");
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_codemirror_state__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../style/button.css */ "./style/button.css");
/* harmony import */ var _style_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../style/ChatTaskpane.css */ "./style/ChatTaskpane.css");
/* harmony import */ var _style_TextButton_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../style/TextButton.css */ "./style/TextButton.css");
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @jupyterlab/ui-components */ "webpack/sharing/consume/default/@jupyterlab/ui-components");
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
/* harmony import */ var _icons_SupportIcon__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../icons/SupportIcon */ "./lib/icons/SupportIcon.js");
/* harmony import */ var _ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./ChatMessage/ChatInput */ "./lib/Extensions/AiChat/ChatMessage/ChatInput.js");
/* harmony import */ var _ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./ChatMessage/ChatMessage */ "./lib/Extensions/AiChat/ChatMessage/ChatMessage.js");
/* harmony import */ var _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ChatHistoryManager */ "./lib/Extensions/AiChat/ChatHistoryManager.js");
/* harmony import */ var _CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CodeDiffDisplay */ "./lib/Extensions/AiChat/CodeDiffDisplay.js");
/* harmony import */ var _components_ToggleButton__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../../components/ToggleButton */ "./lib/components/ToggleButton.js");
/* harmony import */ var _components_IconButton__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../../components/IconButton */ "./lib/components/IconButton.js");
/* harmony import */ var _components_LoadingDots__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../../components/LoadingDots */ "./lib/components/LoadingDots.js");
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
/* harmony import */ var _utils_codeDiff__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/codeDiff */ "./lib/utils/codeDiff.js");
/* harmony import */ var _utils_notebook__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/notebook */ "./lib/utils/notebook.js");
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");
/* harmony import */ var _utils_agentActions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/agentActions */ "./lib/utils/agentActions.js");
/* harmony import */ var _utils_scroll__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../utils/scroll */ "./lib/utils/scroll.js");
/* harmony import */ var _components_LoadingCircle__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../../components/LoadingCircle */ "./lib/components/LoadingCircle.js");
/* harmony import */ var _utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../utils/blacklistedWords */ "./lib/utils/blacklistedWords.js");
/* harmony import */ var _components_DropdownMenu__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../components/DropdownMenu */ "./lib/components/DropdownMenu.js");

























const AGENT_EXECUTION_DEPTH_LIMIT = 20;
const getDefaultChatHistoryManager = (notebookTracker, contextManager) => {
    const chatHistoryManager = new _ChatHistoryManager__WEBPACK_IMPORTED_MODULE_7__.ChatHistoryManager(contextManager, notebookTracker);
    return chatHistoryManager;
};
const ChatTaskpane = ({ notebookTracker, renderMimeRegistry, contextManager, app, operatingSystem, websocketClient }) => {
    const [chatHistoryManager, setChatHistoryManager] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(() => getDefaultChatHistoryManager(notebookTracker, contextManager));
    const chatHistoryManagerRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(chatHistoryManager);
    const [loadingAIResponse, setLoadingAIResponse] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    // Store the original cell before diff so that we can revert to it if the user rejects the AI's code
    const cellStateBeforeDiff = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(undefined);
    // Three possible states:
    // 1. chatPreview: state where the user has not yet pressed the apply button.
    // 2. codeCellPreview: state where the user is seeing the code diffs and deciding how they want to respond.
    // 3. applied: state where the user has applied the code to the code cell
    const [codeReviewStatus, setCodeReviewStatus] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)('chatPreview');
    // Add this ref for the chat messages container
    const chatMessagesRef = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(null);
    const [agentModeEnabled, setAgentModeEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
    const [chatThreads, setChatThreads] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)([]);
    const [activeThreadId, setActiveThreadId] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
    /*
        Three possible states:
        1. working: the agent is working on the task
        2. stopping: the agent is stopping after it has received ai response it is waiting on
        3. idle: the agent is idle
    */
    const [agentExecutionStatus, setAgentExecutionStatus] = (0,react__WEBPACK_IMPORTED_MODULE_2__.useState)('idle');
    // We use a ref to always access the most up-to-date value during a function's execution. Refs immediately reflect changes, 
    // unlike state variables, which are captured at the beginning of a function and may not reflect updates made during execution.
    const shouldContinueAgentExecution = (0,react__WEBPACK_IMPORTED_MODULE_2__.useRef)(true);
    const fetchChatThreads = async () => {
        const metadata = {
            promptType: "get_threads"
        };
        const chatThreadsResponse = await websocketClient.sendMessage({
            type: "get_threads",
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: metadata,
            stream: false
        });
        setChatThreads(chatThreadsResponse.threads);
    };
    const fetchChatHistoryForThread = async (threadId) => {
        const metadata = {
            promptType: "fetch_history",
            thread_id: threadId
        };
        const fetchHistoryCompletionRequest = {
            type: 'fetch_history',
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: metadata,
            stream: false
        };
        const chatHistoryResponse = await websocketClient.sendMessage(fetchHistoryCompletionRequest);
        // Create a fresh ChatHistoryManager and add the initial messages
        const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager);
        // Each thread only contains agent or chat messages. For now, we enforce this by clearing the chat 
        // when the user switches mode. When the user reloads a chat, we want to put them back into the same
        // chat mode so that we use the correct system message and preserve this one-type of message invariant.
        let isAgentChat = false;
        // Add messages to the ChatHistoryManager
        chatHistoryResponse.items.forEach(item => {
            try {
                // If the user sent a message in agent:execution mode, the ai response will be a JSON object which we need to parse. 
                // TODO: We need to save the full metadata in the message_history.json so we don't have to do these hacky workarounds!
                const chatHistoryItem = JSON.parse(item.content);
                if (Object.prototype.hasOwnProperty.call(chatHistoryItem, 'is_finished')) {
                    // If it has the is_finished keys then it is an AgentResponse and we should handle it as such
                    const agentResponse = chatHistoryItem;
                    newChatHistoryManager.addAIMessageFromAgentResponse(agentResponse);
                    isAgentChat = true;
                }
                else {
                    newChatHistoryManager.addChatMessageFromHistory(item);
                }
            }
            catch (_a) {
                newChatHistoryManager.addChatMessageFromHistory(item);
            }
        });
        // Update the state with the new ChatHistoryManager
        setAgentModeEnabled(isAgentChat);
        setChatHistoryManager(newChatHistoryManager);
        setActiveThreadId(threadId);
    };
    const deleteThread = async (threadId) => {
        const metadata = {
            promptType: "delete_thread",
            thread_id: threadId
        };
        const response = await websocketClient.sendMessage({
            type: "delete_thread",
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: metadata,
            stream: false
        });
        if (response.success) {
            const updatedThreads = chatThreads.filter(thread => thread.thread_id !== threadId);
            setChatThreads(updatedThreads);
            if (activeThreadId === threadId) {
                if (updatedThreads.length > 0) {
                    const latestThread = updatedThreads[0];
                    await fetchChatHistoryForThread(latestThread.thread_id);
                }
                else {
                    await startNewChat();
                }
            }
        }
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        const initializeChatHistory = async () => {
            try {
                // 1. Fetch available chat threads.
                const chatThreadsResponse = await websocketClient.sendMessage({
                    type: "get_threads",
                    message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
                    metadata: {
                        promptType: "get_threads"
                    },
                    stream: false
                });
                setChatThreads(chatThreadsResponse.threads);
                // 2. If threads exist, load the latest thread; otherwise, start a new chat.
                if (chatThreadsResponse.threads.length > 0) {
                    const latestThread = chatThreadsResponse.threads[0];
                    await fetchChatHistoryForThread(latestThread.thread_id);
                }
                else {
                    await startNewChat();
                }
            }
            catch (error) {
                const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager);
                addAIMessageFromResponseAndUpdateState(error.title ? error.title : `${error}`, 'chat', newChatHistoryManager, false);
                addAIMessageFromResponseAndUpdateState(error.hint ? error.hint : `${error}`, 'chat', newChatHistoryManager, true);
            }
        };
        void initializeChatHistory();
    }, [websocketClient]);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        /*
            Why we use a ref (chatHistoryManagerRef) instead of directly accessing the state (chatHistoryManager):

            The reason we use a ref here is because the function `applyLatestCode` is registered once
            when the component mounts via `app.commands.addCommand`. If we directly used `chatHistoryManager`
            in the command's execute function, it would "freeze" the state at the time of the registration
            and wouldn't update as the state changes over time.

            React's state (`useState`) is asynchronous, and the registered command won't automatically pick up the
            updated state unless the command is re-registered every time the state changes, which would require
            unregistering and re-registering the command, causing unnecessary complexity.

            By using a ref (`chatHistoryManagerRef`), we are able to keep a persistent reference to the
            latest version of `chatHistoryManager`, which is updated in this effect whenever the state
            changes. This allows us to always access the most recent state of `chatHistoryManager` in the
            `applyLatestCode` function, without needing to re-register the command or cause unnecessary re-renders.

            We still use `useState` for `chatHistoryManager` so that we can trigger a re-render of the chat
            when the state changes.
        */
        chatHistoryManagerRef.current = chatHistoryManager;
    }, [chatHistoryManager]);
    // Scroll to bottom whenever chat history updates
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        (0,_utils_scroll__WEBPACK_IMPORTED_MODULE_8__.scrollToDiv)(chatMessagesRef);
    }, [chatHistoryManager.getDisplayOptimizedHistory().length]);
    const getDuplicateChatHistoryManager = () => {
        /*
            We use getDuplicateChatHistoryManager() instead of directly accessing the state variable because
            the COMMAND_MITO_AI_SEND_MESSAGE is registered in a useEffect on initial render, which
            would otherwise always use the initial state values. By using a function, we ensure we always
            get the most recent chat history, even when the command is executed later.
        */
        return chatHistoryManagerRef.current.createDuplicateChatHistoryManager();
    };
    /*
        Send a message with a specific input, clearing what is currently in the chat input.
        This is useful when we want to send the error message from the MIME renderer directly
        to the AI chat.
    */
    const sendSmartDebugMessage = async (errorMessage) => {
        // Step 0: Reject the previous Ai generated code if they did not accept it
        rejectAICode();
        // Step 1. Clear the chat when there is a new error to debug
        const newChatHistoryManager = await startNewChat();
        const smartDebugMetadata = newChatHistoryManager.addSmartDebugMessage(errorMessage);
        setChatHistoryManager(newChatHistoryManager);
        // Step 2: Send the message to the AI
        const smartDebugCompletionRequest = {
            type: 'smartDebug',
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: smartDebugMetadata,
            stream: false
        };
        await _sendMessageAndSaveResponse(smartDebugCompletionRequest, newChatHistoryManager);
    };
    const sendAgentSmartDebugMessage = async (errorMessage) => {
        // Step 0: Reject the previous Ai generated code if they did not accept it
        rejectAICode();
        // Step 1: Create message metadata
        const newChatHistoryManager = getDuplicateChatHistoryManager();
        const agentSmartDebugMessage = newChatHistoryManager.addAgentSmartDebugMessage(errorMessage);
        setChatHistoryManager(newChatHistoryManager);
        // Step 2: Send the message to the AI
        const smartDebugCompletionRequest = {
            type: 'agent:autoErrorFixup',
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: agentSmartDebugMessage,
            stream: false
        };
        await _sendMessageAndSaveResponse(smartDebugCompletionRequest, newChatHistoryManager);
    };
    const sendExplainCodeMessage = async () => {
        // Step 0: Reject the previous Ai generated code if they did not accept it
        rejectAICode();
        // Step 1: Clear the chat history, and add the explain code message
        const newChatHistoryManager = await startNewChat();
        const explainCodeMetadata = newChatHistoryManager.addExplainCodeMessage();
        setChatHistoryManager(newChatHistoryManager);
        // Step 2: Send the message to the AI
        const explainCompletionRequest = {
            type: 'codeExplain',
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: explainCodeMetadata,
            stream: false
        };
        await _sendMessageAndSaveResponse(explainCompletionRequest, newChatHistoryManager);
        // Step 3: No post processing step needed for explaining code. 
    };
    const sendAgentExecutionMessage = async (input, messageIndex) => {
        // Step 0: Reject the previous Ai generated code if they did not accept it
        rejectAICode();
        // Step 1: Add the user's message to the chat history
        const newChatHistoryManager = getDuplicateChatHistoryManager();
        if (messageIndex !== undefined) {
            // Drop all of the messages starting at the message index
            newChatHistoryManager.dropMessagesStartingAtIndex(messageIndex);
        }
        const agentExecutionMetatada = newChatHistoryManager.addAgentExecutionMessage(input);
        setChatHistoryManager(newChatHistoryManager);
        // Step 2: Send the message to the AI
        const completionRequest = {
            type: 'agent:execution',
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: agentExecutionMetatada,
            stream: false
        };
        await _sendMessageAndSaveResponse(completionRequest, newChatHistoryManager);
    };
    /*
        Send whatever message is currently in the chat input
    */
    const sendChatInputMessage = async (input, messageIndex) => {
        // Step 0: Reject the previous Ai generated code if they did not accept it
        rejectAICode();
        // Step 1: Add the user's message to the chat history
        const newChatHistoryManager = getDuplicateChatHistoryManager();
        if (messageIndex !== undefined) {
            // Drop all of the messages starting at the message index
            newChatHistoryManager.dropMessagesStartingAtIndex(messageIndex);
        }
        const chatMessageMetadata = newChatHistoryManager.addChatInputMessage(input);
        setChatHistoryManager(newChatHistoryManager);
        const completionRequest = {
            type: 'chat',
            message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
            metadata: chatMessageMetadata,
            stream: false
        };
        // Step 2: Scroll to the bottom of the chat messages container
        // Add a small delay to ensure the new message is rendered
        setTimeout(() => {
            var _a;
            (_a = chatMessagesRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
                top: chatMessagesRef.current.scrollHeight,
                behavior: 'smooth'
            });
        }, 100);
        // Step 3: Send the message to the AI
        await _sendMessageAndSaveResponse(completionRequest, newChatHistoryManager);
        // Step 4: Scroll to the bottom of the chat smoothly
        setTimeout(() => {
            const chatContainer = chatMessagesRef.current;
            if (chatContainer) {
                chatContainer.scrollTo({
                    top: chatContainer.scrollHeight,
                    behavior: 'smooth'
                });
            }
        }, 100);
    };
    const handleUpdateMessage = async (messageIndex, newContent) => {
        // Then send the new message to replace it
        if (agentModeEnabled) {
            await startAgentExecution(newContent, messageIndex);
        }
        else {
            await sendChatInputMessage(newContent, messageIndex);
        }
    };
    const _sendMessageAndSaveResponse = async (completionRequest, newChatHistoryManager) => {
        var _a, _b;
        setLoadingAIResponse(true);
        try {
            const aiResponse = await websocketClient.sendMessage(completionRequest);
            if (aiResponse.error) {
                console.error('Error calling OpenAI API:', aiResponse.error);
                addAIMessageFromResponseAndUpdateState(aiResponse.error.hint
                    ? aiResponse.error.hint
                    : `${aiResponse.error.error_type}: ${aiResponse.error.title}`, completionRequest.metadata.promptType, // #TODO: Why are we storing the prompt type in the AI response?
                newChatHistoryManager, true, aiResponse.error.title);
            }
            else {
                const content = (_b = (_a = aiResponse.items[0]) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : '';
                if (completionRequest.metadata.promptType === 'agent:execution' || completionRequest.metadata.promptType === 'agent:autoErrorFixup') {
                    // Agent:Execution prompts return a CellUpdate object that we need to parse
                    const agentResponse = JSON.parse(content);
                    newChatHistoryManager.addAIMessageFromAgentResponse(agentResponse);
                }
                else {
                    // For all other prompt types, we can just add the content to the chat history
                    aiResponse.items.forEach((item) => {
                        newChatHistoryManager.addAIMessageFromResponse(item.content || '', completionRequest.metadata.promptType);
                    });
                    setChatHistoryManager(newChatHistoryManager);
                }
            }
        }
        catch (error) {
            addAIMessageFromResponseAndUpdateState(error.title ? error.title : `${error}`, 'chat', newChatHistoryManager, false);
            addAIMessageFromResponseAndUpdateState(error.hint ? error.hint : `${error}`, completionRequest.metadata.promptType, newChatHistoryManager, true);
        }
        finally {
            // Reset states to allow future messages to show the "Apply" button
            setCodeReviewStatus('chatPreview');
            setLoadingAIResponse(false);
        }
        return true;
    };
    const addAIMessageFromResponseAndUpdateState = (messageContent, promptType, chatHistoryManager, mitoAIConnectionError = false, mitoAIConnectionErrorType = null) => {
        /*
        Adds a new message to the chat history and updates the state. If we don't update the state
        then the chat history does not update in the UI.
        */
        chatHistoryManager.addAIMessageFromResponse(messageContent, promptType, mitoAIConnectionError, mitoAIConnectionErrorType);
        setChatHistoryManager(chatHistoryManager);
    };
    const markAgentForStopping = () => {
        // Signal that the agent should stop after current task
        shouldContinueAgentExecution.current = false;
        // Update UI to show stopping state
        setAgentExecutionStatus('stopping');
    };
    const finalizeAgentStop = () => {
        // Notify user that agent has been stopped
        shouldContinueAgentExecution.current = false;
        const newChatHistoryManager = getDuplicateChatHistoryManager();
        addAIMessageFromResponseAndUpdateState("Agent execution stopped. You can continue the conversation or start a new one.", 'chat', newChatHistoryManager);
        // Reset agent to idle state
        setAgentExecutionStatus('idle');
    };
    const startAgentExecution = async (input, messageIndex) => {
        setAgentExecutionStatus('working');
        // Reset the execution flag at the start of a new plan
        shouldContinueAgentExecution.current = true;
        let isAgentFinished = false;
        let agentExecutionDepth = 1;
        // Loop through each message in the plan and send it to the AI
        while (!isAgentFinished && agentExecutionDepth <= AGENT_EXECUTION_DEPTH_LIMIT) {
            // Check if we should continue execution
            if (!shouldContinueAgentExecution.current) {
                finalizeAgentStop();
                break;
            }
            // Only the first message sent to the Agent should contain the user's input.
            // All other messages only contain updated information about the state of the notebook.
            if (agentExecutionDepth === 1) {
                await sendAgentExecutionMessage(input, messageIndex);
            }
            else {
                await sendAgentExecutionMessage('');
            }
            // Iterate the agent execution depth
            agentExecutionDepth++;
            // Check the code generated by the AI for blacklisted words before running it
            const aiDisplayOptimizedChatItem = chatHistoryManagerRef.current.getLastAIDisplayOptimizedChatItem();
            // # TODO: Make this is a helper function so we can also use it in the auto error fixup! 
            if (aiDisplayOptimizedChatItem) {
                const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_9__.getCodeBlockFromMessage)(aiDisplayOptimizedChatItem.message);
                if (aiGeneratedCode) {
                    const securityCheck = (0,_utils_blacklistedWords__WEBPACK_IMPORTED_MODULE_10__.checkForBlacklistedWords)(aiGeneratedCode);
                    if (!securityCheck.safe) {
                        console.error('Security Warning:', securityCheck.reason);
                        addAIMessageFromResponseAndUpdateState(`I cannot execute this code without your approval because this code did not pass my security checks. ${securityCheck.reason}. For your safety, I am stopping execution of this plan.`, 'agent:execution', chatHistoryManager);
                        finalizeAgentStop();
                        break;
                    }
                }
            }
            const agentResponse = aiDisplayOptimizedChatItem === null || aiDisplayOptimizedChatItem === void 0 ? void 0 : aiDisplayOptimizedChatItem.agentResponse;
            if (agentResponse === undefined) {
                // If the agent response is undefined, we need to send a message to the agent
                isAgentFinished = true;
                break;
            }
            if (agentResponse.is_finished) {
                // If the agent told us that it is finished, we can stop
                isAgentFinished = true;
                break;
            }
            if (agentResponse.cell_update === undefined || agentResponse.cell_update === null) {
                // If the agent's response is not formatted correctly, stop. This is for typechecking mostly
                isAgentFinished = true;
                break;
            }
            // Run the code and handle any errors
            await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_11__.acceptAndRunCellUpdate)(agentResponse.cell_update, notebookTracker, app, previewAICodeToActiveCell, acceptAICode);
            const status = await (0,_utils_agentActions__WEBPACK_IMPORTED_MODULE_11__.retryIfExecutionError)(notebookTracker, app, getDuplicateChatHistoryManager, addAIMessageFromResponseAndUpdateState, sendAgentSmartDebugMessage, previewAICodeToActiveCell, acceptAICode, shouldContinueAgentExecution, finalizeAgentStop, chatHistoryManagerRef);
            if (status === 'interupted') {
                break;
            }
            // If we were not able to run the code, break out of the loop 
            // so we don't continue to execute the plan. Instead, we encourage
            // the user to update the plan and try again. 
            // TODO: Save this message in backend also even if there is not another message sent. 
            if (status === 'failure') {
                addAIMessageFromResponseAndUpdateState("I apologize, but I was unable to fix the error after 3 attempts. You may want to try rephrasing your request or providing more context.", 'agent:execution', chatHistoryManager);
                break;
            }
        }
        if (agentExecutionDepth > AGENT_EXECUTION_DEPTH_LIMIT) {
            addAIMessageFromResponseAndUpdateState("Since I've been working for a while now, give my work a review and then tell me how to continue.", 'agent:execution', chatHistoryManager);
        }
        setAgentExecutionStatus('idle');
    };
    const updateCodeDiffStripes = (aiMessage, updateCellID) => {
        if (!aiMessage) {
            return;
        }
        const updateCellCode = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getCellCodeByID)(notebookTracker, updateCellID);
        if (updateCellID === undefined || updateCellCode === undefined) {
            return;
        }
        // Extract the code from the AI's message and then calculate the code diffs
        const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_9__.getCodeBlockFromMessage)(aiMessage);
        const aiGeneratedCodeCleaned = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_9__.removeMarkdownCodeFormatting)(aiGeneratedCode || '');
        const { unifiedCodeString, unifiedDiffs } = (0,_utils_codeDiff__WEBPACK_IMPORTED_MODULE_13__.getCodeDiffsAndUnifiedCodeString)(updateCellCode, aiGeneratedCodeCleaned);
        // Store the code cell ID where we write the code diffs so that we can
        // accept or reject the code diffs to the correct cell
        cellStateBeforeDiff.current = { codeCellID: updateCellID, code: updateCellCode };
        // Temporarily write the unified code string to the active cell so we can display
        // the code diffs to the user
        (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.writeCodeToCellByID)(notebookTracker, unifiedCodeString, updateCellID);
        updateCodeCellsExtensions(unifiedDiffs);
        // Briefly highlight the code cell to draw the user's attention to it
        (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.highlightCodeCell)(notebookTracker, updateCellID);
    };
    const displayOptimizedChatHistory = chatHistoryManager.getDisplayOptimizedHistory();
    const previewAICodeToActiveCell = () => {
        setCodeReviewStatus('codeCellPreview');
        const activeCellID = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getActiveCellID)(notebookTracker);
        const lastAIDisplayMessage = chatHistoryManagerRef.current.getLastAIDisplayOptimizedChatItem();
        if (activeCellID === undefined || lastAIDisplayMessage === undefined) {
            return;
        }
        updateCodeDiffStripes(lastAIDisplayMessage.message, activeCellID);
        updateCellToolbarButtons();
    };
    const acceptAICode = () => {
        const latestChatHistoryManager = chatHistoryManagerRef.current;
        const lastAIMessage = latestChatHistoryManager.getLastAIDisplayOptimizedChatItem();
        if (!lastAIMessage || !cellStateBeforeDiff.current) {
            return;
        }
        const aiGeneratedCode = (0,_utils_strings__WEBPACK_IMPORTED_MODULE_9__.getCodeBlockFromMessage)(lastAIMessage.message);
        if (!aiGeneratedCode) {
            return;
        }
        setCodeReviewStatus('applied');
        const targetCellID = cellStateBeforeDiff.current.codeCellID;
        // Write to the cell that has the code diffs
        writeCodeToCellAndTurnOffDiffs(aiGeneratedCode, targetCellID);
        // Focus on the active cell after the code is written
        const targetCell = (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.getCellByID)(notebookTracker, targetCellID);
        if (targetCell) {
            // Make the target cell the active cell
            (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.setActiveCellByID)(notebookTracker, targetCellID);
            // Focus on the active cell
            targetCell.activate();
        }
    };
    const rejectAICode = () => {
        if (cellStateBeforeDiff.current === undefined) {
            return;
        }
        setCodeReviewStatus('chatPreview');
        writeCodeToCellAndTurnOffDiffs(cellStateBeforeDiff.current.code, cellStateBeforeDiff.current.codeCellID);
    };
    const writeCodeToCellAndTurnOffDiffs = (code, codeCellID) => {
        updateCodeCellsExtensions(undefined);
        cellStateBeforeDiff.current = undefined;
        if (codeCellID !== undefined) {
            (0,_utils_notebook__WEBPACK_IMPORTED_MODULE_12__.writeCodeToCellByID)(notebookTracker, code, codeCellID);
            updateCellToolbarButtons();
        }
    };
    const startNewChat = async () => {
        // If current thread is empty, do not create a new thread.
        if (chatHistoryManagerRef.current.getDisplayOptimizedHistory().length === 0) {
            return chatHistoryManager;
        }
        // Reset frontend chat history
        const newChatHistoryManager = getDefaultChatHistoryManager(notebookTracker, contextManager);
        setChatHistoryManager(newChatHistoryManager);
        // Notify the backend to request a new chat thread and get its ID
        try {
            const response = await websocketClient.sendMessage({
                type: 'start_new_chat',
                message_id: _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.UUID.uuid4(),
                metadata: {
                    promptType: 'start_new_chat'
                },
                stream: false,
            });
            // Set the new thread ID as active
            const newThreadId = response.thread_id;
            setActiveThreadId(newThreadId);
        }
        catch (error) {
            console.error('Error starting new chat:', error);
        }
        return newChatHistoryManager;
    };
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        /*
            Add a new command to the JupyterLab command registry that applies the latest AI generated code
            to the active code cell. Do this inside of the useEffect so that we only register the command
            the first time we create the chat. Registering the command when it is already created causes
            errors.
        */
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE, {
            execute: () => {
                previewAICodeToActiveCell();
            }
        });
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_APPLY_LATEST_CODE, {
            execute: () => {
                acceptAICode();
            }
        });
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_REJECT_LATEST_CODE, {
            execute: () => {
                rejectAICode();
            }
        });
        /*
            Add a new command to the JupyterLab command registry that sends the current chat message.
            We use this to automatically send the message when the user adds an error to the chat.
        */
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE, {
            execute: async (args) => {
                if (args === null || args === void 0 ? void 0 : args.input) {
                    await sendSmartDebugMessage(args.input.toString());
                }
            }
        });
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE, {
            execute: async () => {
                await sendExplainCodeMessage();
            }
        });
        /*
            Register the code cell toolbar buttons for accepting and rejecting code.
        */
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE, {
            label: `Accept ${operatingSystem === 'mac' ? '⌘Y' : 'Ctrl+Y'}`,
            className: 'text-button-mito-ai button-base button-green',
            caption: 'Accept Code',
            execute: () => { acceptAICode(); },
            // We use the cellStateBeforeDiff because it contains the code cell ID that we want to write to
            // and it will only be set when the codeReviewStatus is 'codeCellPreview'
            isVisible: () => {
                var _a, _b;
                try {
                    return ((_a = notebookTracker.activeCell) === null || _a === void 0 ? void 0 : _a.model.id) === ((_b = cellStateBeforeDiff.current) === null || _b === void 0 ? void 0 : _b.codeCellID);
                }
                catch (error) {
                    console.error('Error checking if code cell toolbar accept code is visible', error);
                    return false;
                }
            }
        });
        app.commands.addCommand(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE, {
            label: `Reject ${operatingSystem === 'mac' ? '⌘U' : 'Ctrl+U'}`,
            className: 'text-button-mito-ai button-base button-red',
            caption: 'Reject Code',
            execute: () => { rejectAICode(); },
            isVisible: () => {
                var _a, _b;
                try {
                    return ((_a = notebookTracker.activeCell) === null || _a === void 0 ? void 0 : _a.model.id) === ((_b = cellStateBeforeDiff.current) === null || _b === void 0 ? void 0 : _b.codeCellID);
                }
                catch (error) {
                    console.error('Error checking if code cell toolbar reject code is visible', error);
                    return false;
                }
            }
        });
    }, []);
    (0,react__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
        // Register keyboard shortcuts 
        const accelYDisposable = app.commands.addKeyBinding({
            command: codeReviewStatus === 'chatPreview' ?
                _commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_PREVIEW_LATEST_CODE :
                _commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_APPLY_LATEST_CODE,
            keys: ['Accel Y'],
            selector: 'body',
        });
        const accelDDisposable = app.commands.addKeyBinding({
            command: _commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_REJECT_LATEST_CODE,
            keys: ['Accel U'],
            selector: 'body',
            preventDefault: true,
        });
        // Clean up the key bindings when the component unmounts or when codeReviewStatus changes
        // This prevents keyboard shortcuts from persisting when they shouldn't.
        return () => {
            accelYDisposable.dispose();
            accelDDisposable.dispose();
        };
    }, [codeReviewStatus]);
    const updateCellToolbarButtons = () => {
        // Tell Jupyter to re-evaluate if the toolbar buttons should be visible.
        // Without this, the user needs to take some action, like switching to a different cell 
        // and then switching back in order for the Jupyter to re-evaluate if it should
        // show the toolbar buttons.
        app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE);
        app.commands.notifyCommandChanged(_commands__WEBPACK_IMPORTED_MODULE_14__.COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE);
    };
    // Create a WeakMap to store compartments per code cell
    const codeDiffStripesCompartments = react__WEBPACK_IMPORTED_MODULE_2___default().useRef(new WeakMap());
    // Function to update the extensions of code cells
    const updateCodeCellsExtensions = (unifiedDiffLines) => {
        var _a;
        const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
        if (!notebook) {
            return;
        }
        const activeCellIndex = notebook.activeCellIndex;
        notebook.widgets.forEach((cell, index) => {
            if (cell.model.type === 'code') {
                const isActiveCodeCell = activeCellIndex === index;
                const codeCell = cell;
                const cmEditor = codeCell.editor;
                const editorView = cmEditor === null || cmEditor === void 0 ? void 0 : cmEditor.editor;
                if (editorView) {
                    let compartment = codeDiffStripesCompartments.current.get(codeCell);
                    if (!compartment) {
                        // Create a new compartment and store it
                        compartment = new _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.Compartment();
                        codeDiffStripesCompartments.current.set(codeCell, compartment);
                        // Apply the initial configuration
                        editorView.dispatch({
                            effects: _codemirror_state__WEBPACK_IMPORTED_MODULE_1__.StateEffect.appendConfig.of(compartment.of(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_15__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : [])),
                        });
                    }
                    else {
                        // Reconfigure the compartment
                        editorView.dispatch({
                            effects: compartment.reconfigure(unifiedDiffLines !== undefined && isActiveCodeCell ? (0,_CodeDiffDisplay__WEBPACK_IMPORTED_MODULE_15__.codeDiffStripesExtension)({ unifiedDiffLines: unifiedDiffLines }) : []),
                        });
                    }
                }
                else {
                    console.log('Mito AI: editor view not found when applying code diff stripes');
                }
            }
        });
    };
    const lastAIMessagesIndex = chatHistoryManager.getLastAIMessageIndex();
    return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-taskpane" },
        react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-taskpane-header" },
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-taskpane-header-buttons" },
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_16__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_icons_SupportIcon__WEBPACK_IMPORTED_MODULE_17__["default"], null), title: "Get Help", onClick: () => {
                        window.open('mailto:founders@sagacollab.com?subject=Mito AI Chat Support', '_blank');
                    } }),
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_IconButton__WEBPACK_IMPORTED_MODULE_16__["default"], { icon: react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.addIcon.react, null), title: "Start New Chat", onClick: async () => { await startNewChat(); } }),
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_DropdownMenu__WEBPACK_IMPORTED_MODULE_18__["default"], { trigger: react__WEBPACK_IMPORTED_MODULE_2___default().createElement("button", { className: "icon-button", title: "Chat Threads", onClick: fetchChatThreads },
                        react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.historyIcon.react, null)), items: chatThreads.length > 0
                        ? chatThreads.map(thread => ({
                            label: thread.name,
                            primaryIcon: activeThreadId === thread.thread_id ? _icons__WEBPACK_IMPORTED_MODULE_19__.OpenIndicatorLabIcon.react : undefined,
                            onClick: () => fetchChatHistoryForThread(thread.thread_id),
                            secondaryActions: [
                                {
                                    icon: _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_6__.deleteIcon.react,
                                    onClick: () => deleteThread(thread.thread_id),
                                    tooltip: 'Delete this chat',
                                }
                            ]
                        }))
                        : [{
                                label: "No chat history available",
                                disabled: true,
                                onClick: () => { }
                            }], alignment: "right" }))),
        react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-messages", ref: chatMessagesRef },
            displayOptimizedChatHistory.length === 0 &&
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-empty-message" },
                    react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", { className: "long-message" },
                        "Ask your personal Python expert anything!",
                        react__WEBPACK_IMPORTED_MODULE_2___default().createElement("br", null),
                        "Hint:",
                        [
                            " Use @ to reference variables.",
                            ` Use ${operatingSystem === 'mac' ? '⌘' : 'CTRL'} + E to chat with Mito AI.`,
                            ` Use ${operatingSystem === 'mac' ? '⌘' : 'CTRL'} + Y to preview code suggestions.`
                        ][Math.floor(Math.random() * 3)]),
                    react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", { className: "short-message" }, "Ask me anything!")),
            displayOptimizedChatHistory.map((displayOptimizedChat, index) => {
                return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_ChatMessage_ChatMessage__WEBPACK_IMPORTED_MODULE_20__["default"], { key: index, message: displayOptimizedChat.message, promptType: displayOptimizedChat.promptType, messageType: displayOptimizedChat.type, codeCellID: displayOptimizedChat.codeCellID, mitoAIConnectionError: displayOptimizedChat.type === 'connection error', mitoAIConnectionErrorType: displayOptimizedChat.mitoAIConnectionErrorType || null, messageIndex: index, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, app: app, isLastAiMessage: index === lastAIMessagesIndex, operatingSystem: operatingSystem, previewAICode: previewAICodeToActiveCell, acceptAICode: acceptAICode, rejectAICode: rejectAICode, onUpdateMessage: handleUpdateMessage, contextManager: contextManager, codeReviewStatus: codeReviewStatus }));
            }).filter(message => message !== null),
            loadingAIResponse &&
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-loading-message" },
                    "Thinking ",
                    react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_LoadingDots__WEBPACK_IMPORTED_MODULE_21__["default"], null))),
        react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_ChatMessage_ChatInput__WEBPACK_IMPORTED_MODULE_22__["default"], { initialContent: '', placeholder: agentExecutionStatus === 'working' ? 'Agent is working...' :
                agentExecutionStatus === 'stopping' ? 'Agent is stopping...' :
                    agentModeEnabled ? 'Ask agent to do anything' :
                        displayOptimizedChatHistory.length < 2 ? `Ask question (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`
                            : `Ask followup (${operatingSystem === 'mac' ? '⌘' : 'Ctrl'}E), @ to mention`, onSave: agentModeEnabled ? startAgentExecution : sendChatInputMessage, onCancel: undefined, isEditing: false, contextManager: contextManager, notebookTracker: notebookTracker, renderMimeRegistry: renderMimeRegistry, agentModeEnabled: agentModeEnabled }),
        agentExecutionStatus !== 'working' && agentExecutionStatus !== 'stopping' && (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "chat-controls" },
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_ToggleButton__WEBPACK_IMPORTED_MODULE_23__["default"], { leftText: "Chat", rightText: "Agent", isLeftSelected: !agentModeEnabled, onChange: async (isLeftSelected) => {
                    await startNewChat(); // TODO: delete thread instead of starting new chat
                    setAgentModeEnabled(!isLeftSelected);
                    // Focus the chat input directly
                    const chatInput = document.querySelector('.chat-input');
                    if (chatInput) {
                        chatInput.focus();
                    }
                }, title: "Agent can create plans and run code." }),
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement("button", { className: "button-base submit-button", onClick: () => {
                    const chatInput = document.querySelector('.chat-input');
                    if (chatInput && chatInput.value) {
                        // Simulate an Enter keypress
                        // This triggers the existing submission logic in ChatInput.tsx
                        const enterEvent = new KeyboardEvent('keydown', {
                            key: 'Enter',
                            code: 'Enter',
                            keyCode: 13,
                            which: 13,
                            bubbles: true,
                            cancelable: true
                        });
                        chatInput.dispatchEvent(enterEvent);
                    }
                } }, "Submit \u23CE"))),
        (agentExecutionStatus === 'working' || agentExecutionStatus === 'stopping') && (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("button", { className: "button-base button-red stop-agent-button", onClick: markAgentForStopping, disabled: agentExecutionStatus === 'stopping', "data-testid": "stop-agent-button" }, agentExecutionStatus === 'stopping' ? (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "stop-agent-button-content" },
            "Stopping",
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_LoadingCircle__WEBPACK_IMPORTED_MODULE_24__["default"], null),
            " ")) : ('Stop Agent')))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChatTaskpane);


/***/ }),

/***/ "./lib/Extensions/AiChat/ChatWidget.js":
/*!*********************************************!*\
  !*** ./lib/Extensions/AiChat/ChatWidget.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ChatWidget: () => (/* binding */ ChatWidget),
/* harmony export */   buildChatWidget: () => (/* binding */ buildChatWidget),
/* harmony export */   chatIcon: () => (/* binding */ chatIcon)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _ChatTaskpane__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ChatTaskpane */ "./lib/Extensions/AiChat/ChatTaskpane.js");
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/ui-components */ "webpack/sharing/consume/default/@jupyterlab/ui-components");
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _src_icons_ChatIcon_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../src/icons/ChatIcon.svg */ "./src/icons/ChatIcon.svg");
/* harmony import */ var _utils_user__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../utils/user */ "./lib/utils/user.js");
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/signaling */ "webpack/sharing/consume/default/@lumino/signaling");
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_websocket_websocketClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/websocket/websocketClient */ "./lib/utils/websocket/websocketClient.js");








const chatIcon = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_2__.LabIcon({
    name: 'mito_ai',
    svgstr: _src_icons_ChatIcon_svg__WEBPACK_IMPORTED_MODULE_4__
});
class ChatWidget extends _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_1__.ReactWidget {
    constructor(options) {
        super();
        this.options = options;
        this._capabilitiesChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal(this);
        this._lastErrorChanged = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal(this);
        // Create the websocket client
        this.websocketClient = new _utils_websocket_websocketClient__WEBPACK_IMPORTED_MODULE_5__.CompletionWebsocketClient({
            serverSettings: options.app.serviceManager.serverSettings
        });
        this.websocketClient.messages.connect(this.onMessage, this);
        // Initialize the websocket client
        this.websocketClient.initialize().catch((error) => {
            console.error('Failed to initialized the websocketClient for the Mito AI Chat panel', error);
        });
        this.title.icon = chatIcon;
        this.title.caption = 'AI Chat for your JupyterLab';
    }
    /**
     * Signal emitted when the capabilities of the AI provider changes.
     */
    get capabilitiesChanged() {
        return this._capabilitiesChanged;
    }
    /**
     * Signal emitted when the last error of the AI provider changes.
     */
    get lastErrorChanged() {
        return this._lastErrorChanged;
    }
    /**
     * Dispose the widget.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this.websocketClient.dispose();
        super.dispose();
    }
    render() {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_ChatTaskpane__WEBPACK_IMPORTED_MODULE_6__["default"], { app: this.options.app, notebookTracker: this.options.notebookTracker, renderMimeRegistry: this.options.renderMimeRegistry, contextManager: this.options.contextManager, operatingSystem: this.options.operatingSystem, websocketClient: this.websocketClient }));
    }
    onMessage(client, message) {
        switch (message.type) {
            case 'ai_capabilities':
                this._capabilitiesChanged.emit(message);
                break;
            case 'error':
                this._lastErrorChanged.emit(message);
                break;
        }
    }
}
function buildChatWidget(app, notebookTracker, renderMimeRegistry, contextManager) {
    // Get the operating system here so we don't have to do it each time the chat changes.
    // The operating system won't change, duh.
    const operatingSystem = (0,_utils_user__WEBPACK_IMPORTED_MODULE_7__.getOperatingSystem)();
    const chatWidget = new ChatWidget({
        app,
        notebookTracker,
        renderMimeRegistry,
        contextManager,
        operatingSystem
    });
    chatWidget.id = 'mito_ai';
    return chatWidget;
}


/***/ }),

/***/ "./lib/Extensions/AiChat/CodeDiffDisplay.js":
/*!**************************************************!*\
  !*** ./lib/Extensions/AiChat/CodeDiffDisplay.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   codeDiffStripesExtension: () => (/* binding */ codeDiffStripesExtension)
/* harmony export */ });
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @codemirror/state */ "webpack/sharing/consume/default/@codemirror/state");
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_codemirror_state__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/view */ "webpack/sharing/consume/default/@codemirror/view");
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_codemirror_view__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _utils_arrays__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/arrays */ "./lib/utils/arrays.js");



// Defines new styles for this extension
const baseTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.baseTheme({
    // We need to set some transparency because the stripes are above the selection layer
    '.cm-codeDiffRemovedStripe': { backgroundColor: 'color-mix(in srgb, var(--error-color) 30%, transparent)' },
    '.cm-codeDiffInsertedStripe': { backgroundColor: 'color-mix(in srgb, var(--jp-accent-color2) 35%, transparent)' },
});
// Resolve step to use in the editor
const unifiedDiffLines = _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.Facet.define({
    combine: (unifiedDiffLines) => {
        return unifiedDiffLines;
    }
});
// Add decoration to editor lines
const removedStripe = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.Decoration.line({
    attributes: { class: 'cm-codeDiffRemovedStripe' }
});
const insertedStripe = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.Decoration.line({
    attributes: { class: 'cm-codeDiffInsertedStripe' }
});
// Create the range of lines requiring decorations
const getCodeDiffStripesDecoration = (view) => {
    var _a, _b, _c;
    const unifiedDiffLinesFacet = view.state.facet(unifiedDiffLines)[0];
    const builder = new _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.RangeSetBuilder();
    for (const { from, to } of view.visibleRanges) {
        for (let pos = from; pos <= to;) {
            const line = view.state.doc.lineAt(pos);
            // The code mirror line numbers are 1-indexed, but our diff lines are 0-indexed
            if (line.number - 1 >= ((_a = unifiedDiffLinesFacet === null || unifiedDiffLinesFacet === void 0 ? void 0 : unifiedDiffLinesFacet.length) !== null && _a !== void 0 ? _a : 0)) {
                /*
                  Because we need to rerender the decorations each time the doc changes or viewport updates
                  (maybe we don't need to, but the code mirror examples does this so we will to for now) there
                  is a race condition where sometimes the content of the code cell updates before the unified diff lines
                  are updated. As a result, we need to break out of the loop before we get a null pointer error.
        
                  This isn't a problem because right afterwards, the code mirror updates again due to the unified diff lines
                  being updated. In that render, we get the correct results.
                */
                break;
            }
            if (((_b = unifiedDiffLinesFacet === null || unifiedDiffLinesFacet === void 0 ? void 0 : unifiedDiffLinesFacet[line.number - 1]) === null || _b === void 0 ? void 0 : _b.type) === 'removed') {
                builder.add(line.from, line.from, removedStripe);
            }
            if (((_c = unifiedDiffLinesFacet === null || unifiedDiffLinesFacet === void 0 ? void 0 : unifiedDiffLinesFacet[line.number - 1]) === null || _c === void 0 ? void 0 : _c.type) === 'inserted') {
                builder.add(line.from, line.from, insertedStripe);
            }
            pos = line.to + 1;
        }
    }
    return builder.finish();
};
// Update the decoration status of the editor view
const showStripes = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.ViewPlugin.fromClass(class {
    constructor(view) {
        this.decorations = getCodeDiffStripesDecoration(view);
    }
    update(update) {
        var _a, _b;
        const oldUnifiedDiffLines = update.startState.facet(unifiedDiffLines);
        const newUnifiedDiffLines = update.view.state.facet(unifiedDiffLines);
        if (update.docChanged ||
            update.viewportChanged ||
            !(0,_utils_arrays__WEBPACK_IMPORTED_MODULE_2__.deepEqualArrays)((_a = oldUnifiedDiffLines[0]) !== null && _a !== void 0 ? _a : [], (_b = newUnifiedDiffLines[0]) !== null && _b !== void 0 ? _b : [])) {
            this.decorations = getCodeDiffStripesDecoration(update.view);
        }
    }
}, {
    decorations: v => v.decorations
});
// Create the Code Mirror Extension to apply the code diff stripes to the code mirror editor
function codeDiffStripesExtension(options = {}) {
    return [
        baseTheme,
        options.unifiedDiffLines ? unifiedDiffLines.of(options.unifiedDiffLines) : [],
        showStripes
    ];
}


/***/ }),

/***/ "./lib/Extensions/AiChat/token.js":
/*!****************************************!*\
  !*** ./lib/Extensions/AiChat/token.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   IChatTracker: () => (/* binding */ IChatTracker)
/* harmony export */ });
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__);

/*
Because other extensions rely on the Chat plugin, we need to make sure that the
Chat plugin is loaded before these other extensions.

For example, the emptyCell extension relies on the Chat plugin in order to
find the keybindings associated with the COMMAND_MITO_AI_OPEN_CHAT command.

By providing a chat plugin token, we can require it from the other extensions.
This makes sure that the chat plugin is loaded before these other extensions.
*/
const IChatTracker = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_0__.Token('mito-ai/IChatTracker', 'Widget tracker for the chat sidebar.');


/***/ }),

/***/ "./lib/Extensions/CellToolbarButtons/CellToolbarButtonsPlugin.js":
/*!***********************************************************************!*\
  !*** ./lib/Extensions/CellToolbarButtons/CellToolbarButtonsPlugin.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");



const CellToolbarButtonsPlugin = {
    // Important: The Cell Toolbar Buttons are added to the toolbar registry via the schema/cell-toolbar-buttons.json file.
    // The id here must be mito-ai:cell-toolbar-buttons otherwise the buttons are not successfull added. My understanding is that
    // the id must match the name of the package and `cell-toolbar-buttons` must match the name of the .json file.
    id: 'mito-ai:cell-toolbar-buttons',
    description: 'Adds an "explain code cell with AI" button to the cell toolbar',
    autoStart: true,
    requires: [_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.INotebookTracker],
    activate: (app, notebookTracker) => {
        const { commands } = app;
        // Important: To add a button to the cell toolbar, the command must start with "toolbar-button:"
        // and the command must match the command in the schema/plugin.json file.
        commands.addCommand('toolbar-button:explain-code', {
            icon: _icons__WEBPACK_IMPORTED_MODULE_1__.lightBulbLabIcon,
            caption: 'Explain code in AI Chat',
            execute: async () => {
                /*
                    In order to click on the cell toolbar button, that cell must be the active cell,
                    so the ChatHistoryManager will take care of providing the cell context.
                */
                await app.commands.execute(_commands__WEBPACK_IMPORTED_MODULE_2__.COMMAND_MITO_AI_OPEN_CHAT);
                await app.commands.execute(_commands__WEBPACK_IMPORTED_MODULE_2__.COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE);
            },
            isVisible: () => { var _a; return ((_a = notebookTracker.activeCell) === null || _a === void 0 ? void 0 : _a.model.type) === 'code' && app.commands.hasCommand(_commands__WEBPACK_IMPORTED_MODULE_2__.COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE); }
        });
        console.log("mito-ai: CellToolbarButtonsPlugin activated");
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CellToolbarButtonsPlugin);


/***/ }),

/***/ "./lib/Extensions/ContextManager/ContextManagerPlugin.js":
/*!***************************************************************!*\
  !*** ./lib/Extensions/ContextManager/ContextManagerPlugin.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ContextManager: () => (/* binding */ ContextManager),
/* harmony export */   ContextManagerPlugin: () => (/* binding */ ContextManagerPlugin),
/* harmony export */   IContextManager: () => (/* binding */ IContextManager),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _VariableInspector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VariableInspector */ "./lib/Extensions/ContextManager/VariableInspector.js");
/* harmony import */ var _FileInspector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./FileInspector */ "./lib/Extensions/ContextManager/FileInspector.js");




// The provides field in JupyterLab's JupyterFrontEndPlugin expects a token 
// that can be used to look up the service in the dependency injection system,
// so we define a new token for the ContextManager
const IContextManager = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_1__.Token('mito-ai:IContextManager');
class ContextManager {
    constructor(app, notebookTracker) {
        this._variables = [];
        this._files = [];
        // Setup the kernel listener to update context as kernel messages are received
        this.setupKernelListener(app, notebookTracker);
    }
    get variables() {
        return this._variables;
    }
    setVariables(newVars) {
        this._variables = newVars;
    }
    get files() {
        return this._files;
    }
    setFiles(newFiles) {
        this._files = newFiles;
    }
    // Setup kernel execution listener
    setupKernelListener(app, notebookTracker) {
        notebookTracker.currentChanged.connect(async (tracker, notebookPanel) => {
            if (!notebookPanel) {
                return;
            }
            // As soon as the notebook is opened, fetch the files so we don't have to wait for the first message.
            await (0,_FileInspector__WEBPACK_IMPORTED_MODULE_2__.fetchFilesAndUpdateState)(app, notebookTracker, this.setFiles.bind(this));
            // Listen to kernel messages
            notebookPanel.context.sessionContext.iopubMessage.connect(async (sender, msg) => {
                // Watch for execute_input messages, which indicate is a request to execute code. 
                // Previosuly, we watched for 'execute_result' messages, but these are only returned
                // from the kernel when a code cell prints a value to the output cell, which is not what we want.
                // TODO: Check if there is a race condition where we might end up fetching variables before the 
                // code is executed. I don't think this is the case because the kernel runs in one thread I believe.
                if (msg.header.msg_type === 'execute_input') {
                    await (0,_VariableInspector__WEBPACK_IMPORTED_MODULE_3__.fetchVariablesAndUpdateState)(notebookPanel, this.setVariables.bind(this));
                    await (0,_FileInspector__WEBPACK_IMPORTED_MODULE_2__.fetchFilesAndUpdateState)(app, notebookTracker, this.setFiles.bind(this));
                }
            });
        });
    }
}
const ContextManagerPlugin = {
    id: 'mito-ai:context-manager',
    autoStart: true,
    requires: [_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.INotebookTracker],
    provides: IContextManager,
    activate: (app, notebookTracker) => {
        console.log("mito-ai: ContextManagerPlugin activated");
        return new ContextManager(app, notebookTracker);
    }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ContextManagerPlugin);


/***/ }),

/***/ "./lib/Extensions/ContextManager/FileInspector.js":
/*!********************************************************!*\
  !*** ./lib/Extensions/ContextManager/FileInspector.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fetchFilesAndUpdateState: () => (/* binding */ fetchFilesAndUpdateState)
/* harmony export */ });
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ "webpack/sharing/consume/default/@jupyterlab/coreutils");
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);

/*
    Fetches all files in the current directory and updates the state of the files.
*/
const fetchFilesAndUpdateState = async (app, notebookTracker, setFiles) => {
    const fileManager = app.serviceManager.contents;
    // Get the current notebook
    const currentNotebook = notebookTracker.currentWidget;
    if (!currentNotebook) {
        return;
    }
    // Get the directory path using PathExt.dirname from @jupyterlab/coreutils
    const relativeNotebookPath = currentNotebook.context.path;
    const relativeDirectoryPath = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.PathExt.dirname(relativeNotebookPath);
    try {
        const contents = await fileManager.get(relativeDirectoryPath);
        if (contents.type === 'directory') {
            // Filter for only csv and Excel files
            const data_files = contents.content.filter((file) => {
                var _a;
                const extension = (_a = file.name.split('.').pop()) === null || _a === void 0 ? void 0 : _a.toLowerCase();
                return extension === 'csv' ||
                    extension === 'xlsx' ||
                    extension === 'xls' ||
                    extension === 'xlsm';
            });
            // Map the files to the File type
            const files = data_files.map((file) => ({
                file_name: file.name
            }));
            // Update the state of the files
            setFiles(files);
        }
        else {
            // If the contents are not a directory, set the files to an empty array
            setFiles([]);
        }
    }
    catch (error) {
        console.error('Error listing directory contents:', error);
        return;
    }
};


/***/ }),

/***/ "./lib/Extensions/ContextManager/VariableInspector.js":
/*!************************************************************!*\
  !*** ./lib/Extensions/ContextManager/VariableInspector.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   fetchVariablesAndUpdateState: () => (/* binding */ fetchVariablesAndUpdateState)
/* harmony export */ });
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/services */ "webpack/sharing/consume/default/@jupyterlab/services");
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__);

// TODO: Use something like raw-loader to load an actual python file 
// to make it easier to modify the script without creating syntax errors.
const pythonVariableInspectionScript = `import json


# We need to check if pandas is imported so we know if its safe
# to check for pandas dataframes 
_is_pandas_imported = False
try:
    import pandas as pd
    _is_pandas_imported = True
except:
    pass

# Function to convert dataframe to structured format
def get_dataframe_structure(df, sample_size=5):
    def convert_value(value):
        if pd.isna(value):
            # Handle None and NaN (convert to None, which maps to null in JSON)
            return None
        elif not isinstance(value, (str, int, float, bool, type(None))):
            return str(value)            
        return value 
        
    structure = {}
    for column in df.columns:
        structure[column] = {
            "dtype": str(df[column].dtype),
            "samples": [convert_value(x) for x in df[column].head(sample_size)]
        }
    return structure

def structured_globals():
    output = []
    for k, v in globals().items():
            if not k.startswith("_") and k not in ("In", "Out", "json") and not callable(v):
                if _is_pandas_imported and isinstance(v, pd.DataFrame):

                    new_variable = {
                        "variable_name": k,
                        "type": "pd.DataFrame",
                        "value": get_dataframe_structure(v)
                    }

                    try:
                        # Check if the variable can be converted to JSON.
                        # If it can, add it to the outputs. If it can't, we just skip it.
                        # We check each variable individually so that we don't crash
                        # the entire variable inspection if just one variable cannot be serialized.
                        json.dumps(new_variable["value"])
                        output.append(new_variable)
                    except:
                        pass

                else:

                    new_variable = {
                        "variable_name": k,
                        "type": str(type(v)),
                        "value": repr(v)
                    }

                    try:
                        # Check if the variable can be converted to JSON.
                        # If it can, add it to the outputs. If it can't, we just skip it.
                        # We check each variable individually so that we don't crash
                        # the entire variable inspection if just one variable cannot be serialized.
                        json.dumps(new_variable["value"])
                        output.append(new_variable)
                    except:
                        pass

    return json.dumps(output)

print(structured_globals())
`;
// Function to fetch variables and sync with the frontend
function fetchVariablesAndUpdateState(notebookPanel, setVariables) {
    var _a;
    const kernel = (_a = notebookPanel.context.sessionContext.session) === null || _a === void 0 ? void 0 : _a.kernel;
    if (kernel) {
        // Request the kernel to execute a command to fetch global variables
        const future = kernel.requestExecute({
            code: pythonVariableInspectionScript,
            // Adding silent: true prevents a execute_input message from being sent. This is important 
            // because it prevents an infinite loop where we fetch variables and in the process trigger 
            // a new execute_input which leads to fetching variables again.
            silent: true
        });
        // Listen for the output from the kernel
        future.onIOPub = (msg) => {
            // A 'stream' message represents standard output (stdout) or standard error (stderr) produced 
            // during the execution of code in the kernel.
            if (_jupyterlab_services__WEBPACK_IMPORTED_MODULE_0__.KernelMessage.isStreamMsg(msg)) {
                if (msg.content.name === 'stdout') {
                    try {
                        setVariables(JSON.parse(msg.content.text));
                    }
                    catch (e) {
                        console.log("Error parsing variables", e);
                    }
                }
            }
        };
    }
}


/***/ }),

/***/ "./lib/Extensions/ErrorMimeRenderer/CollapsibleWarningBlock.js":
/*!*********************************************************************!*\
  !*** ./lib/Extensions/ErrorMimeRenderer/CollapsibleWarningBlock.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CollapsibleWarningBlock: () => (/* binding */ CollapsibleWarningBlock)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const CollapsibleWarningBlock = ({ message }) => {
    const [isExpanded, setIsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
    const lines = message.split('\n');
    const warningCount = lines.filter(line => line.includes("Warning: ")).length;
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "output-block" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { style: { display: 'flex', alignItems: 'center', gap: '8px', cursor: 'pointer' }, onClick: () => setIsExpanded(!isExpanded) },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "collapse-button" }, isExpanded ? '▼' : '▶'),
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { style: { margin: 0, display: 'inline' } },
                "Warning (",
                warningCount,
                ")")),
        isExpanded &&
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "output-block-expanded" },
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("pre", { style: { marginTop: '10px' } }, message))));
};


/***/ }),

/***/ "./lib/Extensions/ErrorMimeRenderer/ErrorMimeRendererPlugin.js":
/*!*********************************************************************!*\
  !*** ./lib/Extensions/ErrorMimeRenderer/ErrorMimeRendererPlugin.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_dom_client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom/client */ "./node_modules/react-dom/client.js");
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/rendermime */ "webpack/sharing/consume/default/@jupyterlab/rendermime");
/* harmony import */ var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/widgets */ "webpack/sharing/consume/default/@lumino/widgets");
/* harmony import */ var _lumino_widgets__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_widgets__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
/* harmony import */ var _icons_MagicWand__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../icons/MagicWand */ "./lib/icons/MagicWand.js");
/* harmony import */ var _style_ErrorMimeRendererPlugin_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../style/ErrorMimeRendererPlugin.css */ "./style/ErrorMimeRendererPlugin.css");
/* harmony import */ var _CollapsibleWarningBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CollapsibleWarningBlock */ "./lib/Extensions/ErrorMimeRenderer/CollapsibleWarningBlock.js");
/* harmony import */ var _errorUtils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./errorUtils */ "./lib/Extensions/ErrorMimeRenderer/errorUtils.js");









const ErrorMessage = ({ onDebugClick }) => {
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: "error-mime-renderer-container" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { onClick: onDebugClick, className: 'error-mime-renderer-button' },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_icons_MagicWand__WEBPACK_IMPORTED_MODULE_5__["default"], null),
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("p", null, "Fix Error in AI Chat"))));
};
/**
 * A mime renderer plugin for the mimetype application/vnd.jupyter.stderr
 *
 * This plugin augments the standard error output with a prompt to debug the error in the chat interface.
*/
const ErrorMimeRendererPlugin = {
    id: 'mito-ai:debug-error-with-ai',
    autoStart: true,
    requires: [_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_2__.IRenderMimeRegistry],
    activate: (app, rendermime) => {
        const factory = rendermime.getFactory('application/vnd.jupyter.stderr');
        if (factory) {
            rendermime.addFactory({
                safe: true,
                mimeTypes: ['application/vnd.jupyter.stderr'],
                createRenderer: (options) => {
                    const originalRenderer = factory.createRenderer(options);
                    return new AugmentedStderrRenderer(app, originalRenderer);
                }
            }, -1); // Giving this renderer a lower rank than the default renderer gives this default priority
        }
        console.log("mito-ai: ErrorMimeRendererPlugin activated");
    }
};
/**
 * A widget that extends the default StderrRenderer.
*/
class AugmentedStderrRenderer extends _lumino_widgets__WEBPACK_IMPORTED_MODULE_3__.Widget {
    constructor(app, originalRenderer) {
        super();
        this.app = app;
        this.originalRenderer = originalRenderer;
    }
    /**
     * Render the original error message and append the custom prompt.
     */
    async renderModel(model) {
        // Determine if it's an error or a warning. 
        // An error has:     'application/vnd.jupyter.error' 
        // A warning has:    'application/vnd.jupyter.stderr'
        const isErrorMessage = 'application/vnd.jupyter.error' in model.data;
        // Create the container for the custom UI elements
        const resolveInChatDiv = document.createElement('div');
        const originalNode = this.originalRenderer.node;
        // Only show the Fix Error in AI Chat button if it is an error, not a warning
        if (isErrorMessage) {
            (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(resolveInChatDiv).render(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ErrorMessage, { onDebugClick: () => this.openChatInterfaceWithError(model) }));
            // Append the chat container before rendering the original output
            this.node.appendChild(resolveInChatDiv);
            // Render the original content
            await this.originalRenderer.renderModel(model);
        }
        else {
            // Apply styling for warnings
            // Strip styling, use ErrorMimeRendererPlugin.css
            originalNode.style.background = 'transparent';
            originalNode.style.padding = '0px';
            // Render the OutputBlock component
            (0,react_dom_client__WEBPACK_IMPORTED_MODULE_1__.createRoot)(originalNode).render(react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CollapsibleWarningBlock__WEBPACK_IMPORTED_MODULE_6__.CollapsibleWarningBlock, { message: String(model.data['application/vnd.jupyter.stderr'] || '') }));
        }
        // Append the original error/warning rendered node
        this.node.appendChild(originalNode);
    }
    /*
        Open the chat interface and preload the error message into
        the user input.
    */
    async openChatInterfaceWithError(model) {
        const structuredError = (0,_errorUtils__WEBPACK_IMPORTED_MODULE_7__.getFullErrorMessageFromModel)(model);
        await this.app.commands.execute(_commands__WEBPACK_IMPORTED_MODULE_8__.COMMAND_MITO_AI_OPEN_CHAT, { focusChatInput: false });
        await this.app.commands.execute(_commands__WEBPACK_IMPORTED_MODULE_8__.COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE, { input: structuredError });
    }
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorMimeRendererPlugin);


/***/ }),

/***/ "./lib/Extensions/ErrorMimeRenderer/errorUtils.js":
/*!********************************************************!*\
  !*** ./lib/Extensions/ErrorMimeRenderer/errorUtils.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getConciseErrorMessage: () => (/* binding */ getConciseErrorMessage),
/* harmony export */   getFullErrorMessageFromModel: () => (/* binding */ getFullErrorMessageFromModel),
/* harmony export */   getFullErrorMessageFromTraceback: () => (/* binding */ getFullErrorMessageFromTraceback)
/* harmony export */ });
/* harmony import */ var _utils_strings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/strings */ "./lib/utils/strings.js");

/*
Get the error string from the model.
    
For example, if this is the error message:

    Cell In[3], line 3
      1 import pandas as pd
      2 df = pd.DataFrame({'A': ['1/2/24', '2/2/24', '3/2/24'], 'B': [4, 5, 6]})
----> 3 df['Year'] = df['A'].dt.year

    AttributeError: Can only use .dt accessor with datetimelike values

This function will return:

    AttributeError: Can only use .dt accessor with datetimelike values
*/
const getConciseErrorMessage = (model) => {
    const error = model.data['application/vnd.jupyter.error'];
    if (error && typeof error === 'object' && 'ename' in error && 'evalue' in error) {
        return `${error.ename}: ${error.evalue}`;
    }
    return '';
};
/*
Gets all of the error message parts that contain code in the Jupyter Notebook.

For example, if this is the error message:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[3], line 3
      1 import pandas as pd
      2 df = pd.DataFrame({'A': ['1/2/24', '2/2/24', '3/2/24'], 'B': [4, 5, 6]})
----> 3 df['Year'] = df['A'].dt.year

File ~/Mito/mito/mito-ai/venv/lib/python3.11/site-packages/pandas/core/generic.py:6299, in NDFrame.__getattr__(self, name)
   6292 if (
   6293     name not in self._internal_names_set
   6294     and name not in self._metadata
   6295     and name not in self._accessors
   6296     and self._info_axis._can_hold_identifiers_and_holds_name(name)
   6297 ):
   6298     return self[name]
-> 6299 return object.__getattribute__(self, name)

File ~/Mito/mito/mito-ai/venv/lib/python3.11/site-packages/pandas/core/accessor.py:224, in CachedAccessor.__get__(self, obj, cls)
    221 if obj is None:
    222     # we're accessing the attribute of the class, i.e., Dataset.geo
    223     return self._accessor
--> 224 accessor_obj = self._accessor(obj)
    225 # Replace the property with the accessor object. Inspired by:
    226 # https://www.pydanny.com/cached-property.html
    227 # We need to use object.__setattr__ because we overwrite __setattr__ on
    228 # NDFrame
    229 object.__setattr__(obj, self._name, accessor_obj)

File ~/Mito/mito/mito-ai/venv/lib/python3.11/site-packages/pandas/core/indexes/accessors.py:643, in CombinedDatetimelikeProperties.__new__(cls, data)
    640 elif isinstance(data.dtype, PeriodDtype):
    641     return PeriodProperties(data, orig)
--> 643 raise AttributeError("Can only use .dt accessor with datetimelike values")

AttributeError: Can only use .dt accessor with datetimelike values


This function will only return:

Cell In[3], line 3
      1 import pandas as pd
      2 df = pd.DataFrame({'A': ['1/2/24', '2/2/24', '3/2/24'], 'B': [4, 5, 6]})
----> 3 df['Year'] = df['A'].dt.year

AttributeError: Can only use .dt accessor with datetimelike values

*/
const getFullErrorMessageFromModel = (model) => {
    const error = model.data['application/vnd.jupyter.error'];
    return getFullErrorMessageFromTraceback(error['traceback']);
};
const getFullErrorMessageFromTraceback = (tracebackArray) => {
    var _a;
    try {
        // Strip ANSI codes from each line
        const cleanedArray = tracebackArray.map(line => (0,_utils_strings__WEBPACK_IMPORTED_MODULE_0__.stripAnsiCodes)(line));
        const filteredLines = [];
        for (const line of cleanedArray) {
            // Start capturing when we see a Cell block or its the last line
            if (line.trim().startsWith('Cell In[') || line === cleanedArray[cleanedArray.length - 1]) {
                // Split on any type of line ending (\r\n, \r, \n, ↵)
                const newLines = line.split(/\r\n|\r|\n|↵/);
                filteredLines.push(...newLines);
                // Add a new line to separate the sections
                filteredLines.push('\n');
                continue;
            }
        }
        const fullErrorMessage = filteredLines.join('\n');
        return fullErrorMessage;
    }
    catch (error) {
        // If something goes wrong parsing the error, just return the concise error message
        console.error('Error processing traceback:', error);
        return (_a = tracebackArray[tracebackArray.length - 1]) !== null && _a !== void 0 ? _a : '';
    }
};


/***/ }),

/***/ "./lib/Extensions/InlineCompleter/index.js":
/*!*************************************************!*\
  !*** ./lib/Extensions/InlineCompleter/index.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   completionPlugin: () => (/* binding */ completionPlugin)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/completer */ "webpack/sharing/consume/default/@jupyterlab/completer");
/* harmony import */ var _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @jupyterlab/services */ "webpack/sharing/consume/default/@jupyterlab/services");
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @jupyterlab/settingregistry */ "webpack/sharing/consume/default/@jupyterlab/settingregistry");
/* harmony import */ var _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _provider__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./provider */ "./lib/Extensions/InlineCompleter/provider.js");
/* harmony import */ var _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");






const JUPYTERLAB_INLINE_COMPLETER_ID = '@jupyterlab/completer-extension:inline-completer';
const JUPYTERLAB_SHORTCUTS_ID = '@jupyterlab/shortcuts-extension:shortcuts';
const completionPlugin = {
    id: 'mito-ai:inline-completion',
    autoStart: true,
    requires: [
        _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1__.ICompletionProviderManager,
        _jupyterlab_settingregistry__WEBPACK_IMPORTED_MODULE_3__.ISettingRegistry,
        _ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_4__.IContextManager,
    ],
    activate: (app, completionManager, settingRegistry, contextManager) => {
        if (typeof completionManager.registerInlineProvider === 'undefined') {
            // Gracefully short-circuit on JupyterLab 4.0 and Notebook 7.0
            console.warn('Inline completions are only supported in JupyterLab 4.1+ and Jupyter Notebook 7.1+');
            return;
        }
        // Only alphanumeric characters are authorized for configuration section
        const CONFIG_SECTION = 'mitoaiconfig';
        // Use Jupyter Server configuration to check if this is the first time the extension is installed.
        // Jupyter Server configuration are stored in the $HOME/.jupyter/serverconfig folder as JSON files.
        // If the user click on "Enable" or "Not now" button in the notification, the configuration will
        // be changed to contain `{settingsChecked: true}` to prevent notifying the user at later launches.
        _jupyterlab_services__WEBPACK_IMPORTED_MODULE_2__.ConfigSection.create({
            name: CONFIG_SECTION,
            serverSettings: app.serviceManager.serverSettings
        })
            .then(async (config) => {
            var _a;
            const state = (_a = config === null || config === void 0 ? void 0 : config.data) === null || _a === void 0 ? void 0 : _a['state'];
            // Check if the user has acknowledge the notification before;
            // aka if the settingsChecked flag is set to true.
            if (!(state === null || state === void 0 ? void 0 : state.settingsChecked)) {
                const checkSettings = async () => {
                    var _a;
                    const providers = (await settingRegistry.get(JUPYTERLAB_INLINE_COMPLETER_ID, 'providers')).composite;
                    let shortcuts = (await settingRegistry.get(JUPYTERLAB_SHORTCUTS_ID, 'shortcuts')).composite;
                    const updateConfig = () => {
                        // Set the settingsChecked flag to true to store
                        // that the user has acknowledge the notification.
                        config
                            .update({ state: { settingsChecked: true } })
                            .catch(reason => {
                            console.error(`Failed to update configuration section ${CONFIG_SECTION}.`, reason);
                        });
                    };
                    if (!providers['mito-ai']['enabled']) {
                        /* The first time the user installs Mito AI, we take a few actions*/
                        // 1. Dispaly welcome notification
                        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.info('Mito AI is now enabled!', {
                            autoClose: 10000
                        });
                        // 2. Disable the default inline completer
                        if (((_a = providers['@jupyterlab/inline-completer:history']) === null || _a === void 0 ? void 0 : _a['enabled']) !== false) {
                            providers['@jupyterlab/inline-completer:history']['enabled'] = false;
                        }
                        // 3. Enable the Mito AI inline completer
                        providers['mito-ai']['enabled'] = true;
                        await settingRegistry.set(JUPYTERLAB_INLINE_COMPLETER_ID, 'providers', providers);
                        // 4. Set Tab as the accept button for autocomplete.
                        // For some reason, it seems that unless the Tab shortcut is registered first, 
                        // Jupyter does not accept it. So we try removing the existing shortcut.
                        shortcuts = shortcuts.filter((shortcut) => shortcut.command !== 'inline-completer:accept');
                        shortcuts.push({
                            command: 'inline-completer:accept',
                            keys: ['Tab'],
                            selector: '.jp-mod-inline-completer-active'
                        });
                        await settingRegistry.set(JUPYTERLAB_SHORTCUTS_ID, 'shortcuts', shortcuts);
                        updateConfig();
                    }
                };
                // Jupyter inline completer settings may not be available yet
                // If they are, we check the settings immediately. Otherwise,
                // we wait for the settings to be available by listening to the
                // settingsRegistry.pluginChanged signal.
                if (JUPYTERLAB_INLINE_COMPLETER_ID in settingRegistry.plugins) {
                    await checkSettings();
                }
                else {
                    const watchSettings = async (registry, id) => {
                        if (id === JUPYTERLAB_INLINE_COMPLETER_ID) {
                            registry.pluginChanged.disconnect(watchSettings);
                            await checkSettings();
                        }
                    };
                    settingRegistry.pluginChanged.connect(watchSettings);
                }
            }
        })
            .catch(reason => {
            console.error(`Failed to fetch configuration section '${CONFIG_SECTION}'`, reason);
        });
        // Register the Mito AI inline completer
        const provider = new _provider__WEBPACK_IMPORTED_MODULE_5__.MitoAIInlineCompleter({
            serverSettings: app.serviceManager.serverSettings,
            contextManager: contextManager
        });
        completionManager.registerInlineProvider(provider);
    }
};


/***/ }),

/***/ "./lib/Extensions/InlineCompleter/provider.js":
/*!****************************************************!*\
  !*** ./lib/Extensions/InlineCompleter/provider.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MitoAIInlineCompleter: () => (/* binding */ MitoAIInlineCompleter)
/* harmony export */ });
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/apputils */ "webpack/sharing/consume/default/@jupyterlab/apputils");
/* harmony import */ var _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/completer */ "webpack/sharing/consume/default/@jupyterlab/completer");
/* harmony import */ var _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/signaling */ "webpack/sharing/consume/default/@lumino/signaling");
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils_websocket_websocketClient__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/websocket/websocketClient */ "./lib/utils/websocket/websocketClient.js");
/* harmony import */ var _utils_stripe__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/stripe */ "./lib/utils/stripe.js");
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/errors */ "./lib/utils/errors.js");







/**
 * Mito AI inline completer
 *
 * It uses a WebSocket connection to request an AI model.
 */
class MitoAIInlineCompleter {
    constructor({ 
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
    serverSettings, contextManager, ...clientOptions }) {
        this._counter = 0;
        this._isDisposed = false;
        this._settings = MitoAIInlineCompleter.DEFAULT_SETTINGS;
        // Store only one inline completion stream
        // Each new request should invalidate any other suggestions.
        this._currentToken = '';
        this._currentStream = null;
        /**
         * Block processing chunks while waiting for the acknowledge request
         * that will provide the unique completion token.
         */
        this._completionLock = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
        this._fullCompletionMap = new WeakMap();
        // We only want to display the free tier limit reached notification once 
        // per session to avoid spamming the user. 
        this._displayed_free_tier_limit_reached_notification = false;
        // Similarly, we only want to show the general completion failure notification once
        this._displayed_completion_failure_notification = false;
        /**
         * Completer unique identifier
         */
        this.identifier = 'mito-ai';
        /**
         * Completer name
         */
        this.name = 'Mito AI';
        this._contextManager = contextManager;
        this._client = new _utils_websocket_websocketClient__WEBPACK_IMPORTED_MODULE_4__.CompletionWebsocketClient(clientOptions);
        this._client
            .initialize()
            .then(() => {
            this._client.stream.connect(this._receiveStreamChunk, this);
            this._completionLock.resolve();
        })
            .catch(reason => {
            this._completionLock.reject(reason);
            console.error('Failed to initialize the websocket connection for ai completions.', reason);
        });
    }
    /**
     * Whether the completer is disposed or not.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Settings schema contributed by provider for user customization.
     */
    get schema() {
        return {
            properties: {
                triggerKind: {
                    title: 'Inline completions trigger',
                    type: 'string',
                    oneOf: [
                        { const: 'any', title: 'Automatic (on typing or invocation)' },
                        { const: 'manual', title: 'Only when invoked manually' }
                    ],
                    description: 'When to trigger inline completions when using mito-ai.'
                }
            },
            default: MitoAIInlineCompleter.DEFAULT_SETTINGS
        };
    }
    /**
     * Callback on user settings changes.
     */
    async configure(settings) {
        this._settings = settings;
    }
    /**
     * Dispose of the resources used by the completer.
     */
    dispose() {
        if (this._isDisposed) {
            return;
        }
        this._isDisposed = true;
        this._client.stream.disconnect(this._receiveStreamChunk, this);
        this._client.dispose();
        this._resetCurrentStream();
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal.clearData(this);
    }
    /**
     * The method called when user requests inline completions.
     *
     * The implicit request (on typing) vs explicit invocation are distinguished
     * by the value of `triggerKind` in the provided `context`.
     */
    async fetch(request, context) {
        var _a;
        if (!this.isEnabled()) {
            return Promise.reject('Mito AI completion is disabled.');
        }
        if (this.isDisposed) {
            return Promise.reject('Mito AI provider is disposed.');
        }
        // Block processing chunks while waiting for the acknowledge request
        // that will provide the unique completion token.
        await this._completionLock.promise;
        this._completionLock = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
        try {
            // Stop current stream if any
            this._resetCurrentStream();
            const allowedTriggerKind = this._settings.triggerKind;
            const triggerKind = context.triggerKind;
            if (allowedTriggerKind === 'manual' &&
                triggerKind !== _jupyterlab_completer__WEBPACK_IMPORTED_MODULE_1__.InlineCompletionTriggerKind.Invoke) {
                // Short-circuit if user requested to only invoke inline completions
                // on manual trigger. Users may still get completions
                // from other (e.g. less expensive or faster) providers.
                return {
                    items: []
                };
            }
            const messageId = ++this._counter;
            const prefix = this._getPrefix(request);
            const suffix = this._getSuffix(request);
            const metadata = {
                promptType: 'inline_completion',
                variables: this._contextManager.variables,
                files: this._contextManager.files,
                prefix: prefix,
                suffix: suffix
            };
            const inlineCompleterCompletionRequest = {
                type: 'inline_completion',
                message_id: messageId.toString(),
                metadata: metadata,
                stream: false,
            };
            const result = await this._client.sendMessage(inlineCompleterCompletionRequest);
            if ((_a = result.items[0]) === null || _a === void 0 ? void 0 : _a.token) {
                this._currentToken = result.items[0].token;
                this._currentStream = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Stream(this);
            }
            const error = result.error;
            if ((error === null || error === void 0 ? void 0 : error.title) === _utils_errors__WEBPACK_IMPORTED_MODULE_5__.FREE_TIER_LIMIT_REACHED_ERROR_TITLE) {
                if (!this._displayed_free_tier_limit_reached_notification) {
                    this._notifyFreeTierLimitReached();
                    this._displayed_free_tier_limit_reached_notification = true;
                }
            }
            else if (error) {
                this._notifyCompletionFailure(error);
                throw new Error(`Inline completion failed: ${error.error_type}\n${error.traceback}`);
            }
            return {
                items: result.items.map(item => ({
                    ...item,
                    insertText: this._cleanCompletion(item.content, prefix, suffix)
                }))
            };
        }
        finally {
            this._completionLock.resolve();
        }
    }
    /**
     * Whether the completer is enabled or not.
     */
    isEnabled() {
        return this._settings.enabled;
    }
    /**
     * Stream a reply for completion identified by given `token`.
     */
    async *stream(token) {
        var _a;
        if (!this.isEnabled()) {
            throw new Error('Mito AI completion is disabled.');
        }
        // Wait for the acknowledge request to be fulfilled before starting the stream
        await this._completionLock.promise;
        if (this._currentToken !== token) {
            // New completion may be triggered before the code have started streaming
            // the previous one. So not raising an error here.
            console.debug(`No stream found for token '${token}'.`);
            return;
        }
        for await (const chunk of this._currentStream) {
            // If a new completion is triggered, stop the current stream
            // before the backend has finished streaming the full suggestion.
            if (this._currentToken !== token) {
                break;
            }
            yield chunk;
            if (chunk.done || chunk.error) {
                // Break this for loop
                (_a = this._currentStream) === null || _a === void 0 ? void 0 : _a.stop();
            }
        }
    }
    /**
     * Extract prefix from request, accounting for context window limit.
     *
     * For the case of a cell, this extract all the code of the current cell
     * before the cursor.
     */
    _getPrefix(request) {
        return request.text.slice(0, request.offset);
    }
    /**
     * Extract suffix from request, accounting for context window limit.
     *
     * For the case of a cell, this extract all the code of the current cell
     * after the cursor.
     */
    _getSuffix(request) {
        return request.text.slice(request.offset);
    }
    _notifyFreeTierLimitReached() {
        _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(`You've used up your free Mito AI completions for this month. Upgrade to Mito Pro or supply your own key.`, 'error', {
            autoClose: false,
            actions: [
                {
                    label: 'Upgrade to Mito Pro',
                    callback: () => {
                        // We create and submit a form programmatically instead of using window.open()
                        // because the Stripe endpoint requires a POST request, which window.open() 
                        // cannot do (it only makes GET requests). This approach allows us to make
                        // a proper POST request that will create a Stripe checkout session.
                        const form = document.createElement('form');
                        form.method = 'POST';
                        form.action = _utils_stripe__WEBPACK_IMPORTED_MODULE_6__.STRIPE_PAYMENT_LINK;
                        form.target = '_blank';
                        document.body.appendChild(form);
                        form.submit();
                        document.body.removeChild(form);
                    }
                },
                {
                    label: "Learn more",
                    callback: () => {
                        window.open("https://www.trymito.io/plans", '_blank');
                    }
                }
            ]
        });
    }
    _notifyCompletionFailure(error) {
        // Only show the notification if we haven't shown one already
        if (!this._displayed_completion_failure_notification) {
            _jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.Notification.emit(`AI code completion failed. We're experiencing some technical difficulties.`, 'error', {
                autoClose: false,
                actions: [
                    {
                        label: 'Show Technical Details',
                        callback: async (event) => {
                            var _a;
                            // Prevent the default action which might close the notification
                            event.preventDefault();
                            event.stopPropagation();
                            // Show the error details in a separate dialog
                            await (0,_jupyterlab_apputils__WEBPACK_IMPORTED_MODULE_0__.showErrorMessage)('Completion Service Error Details', {
                                message: (_a = error.traceback) !== null && _a !== void 0 ? _a : 'No additional error information is available.'
                            });
                        }
                    },
                    {
                        label: 'Get Help',
                        callback: () => {
                            // Create the body text with error details
                            const bodyText = `Hello Mito team,

I encountered an error while using the AI code completion feature:

Error type: ${error.error_type || 'Unknown'}
${error.traceback ? `\nTraceback:\n${error.traceback}` : ''}

Additional details about what I was doing:
[User can add details here]

Thanks for your help!
`;
                            // URL encode the body text
                            const encodedBody = encodeURIComponent(bodyText);
                            // Open email client with pre-filled recipients, subject, and body
                            window.open(`mailto:founders@sagacollab.com?subject=AI%20Completion%20Error%20Support&body=${encodedBody}`, '_blank');
                        }
                    }
                ]
            });
            // Set the flag to true so we don't show this notification again
            this._displayed_completion_failure_notification = true;
        }
    }
    /**
     * Process the stream chunk to make it available in the awaiting generator.
     */
    _receiveStreamChunk(_emitter, chunk) {
        var _a, _b;
        if (((_a = chunk.error) === null || _a === void 0 ? void 0 : _a.title) === _utils_errors__WEBPACK_IMPORTED_MODULE_5__.FREE_TIER_LIMIT_REACHED_ERROR_TITLE) {
            this._notifyFreeTierLimitReached();
            this._displayed_free_tier_limit_reached_notification = true;
        }
        else if (chunk.error) {
            this._notifyCompletionFailure(chunk.error);
        }
        const token = chunk.chunk.token;
        if (!token) {
            throw Error('Stream chunks must define `token` in `chunk`.');
        }
        if (this._currentToken !== token) {
            // This may happen if the backend is still streaming for a previous token
            console.debug(`Received completion chunk for an unknown token '${token}'`);
            return;
        }
        if (!this._currentStream) {
            throw Error(`Stream not found for token ${token}`);
        }
        let fullCompletion = (_b = this._fullCompletionMap.get(this._currentStream)) !== null && _b !== void 0 ? _b : '';
        fullCompletion += chunk.chunk.content;
        this._fullCompletionMap.set(this._currentStream, fullCompletion);
        const cleanedCompletion = this._cleanCompletion(fullCompletion);
        this._currentStream.emit({
            done: chunk.done,
            error: chunk.error,
            parent_id: chunk.parent_id,
            response: {
                insertText: cleanedCompletion,
                isIncomplete: !chunk.done,
                error: chunk.chunk.error,
                token: chunk.chunk.token
            },
            type: chunk.type
        });
    }
    _cleanCompletion(rawCompletion, prefix, suffix) {
        let cleanedCompletion = rawCompletion
            .replace(/^```python\n?/, '') // Remove opening code fence with optional python language
            .replace(/```$/, '') // Remove closing code fence
            .replace(/\n$/, '');
        // Remove duplicate prefix content
        if (prefix) {
            const lastPrefixLine = prefix.split('\n').slice(-1)[0];
            if (lastPrefixLine && cleanedCompletion.startsWith(lastPrefixLine) && lastPrefixLine !== '') {
                cleanedCompletion = cleanedCompletion.slice(lastPrefixLine.length);
            }
        }
        // Remove duplicate suffix content
        if (suffix) {
            const firstSuffixLine = suffix.split('\n')[0];
            if (firstSuffixLine && cleanedCompletion.endsWith(firstSuffixLine) && firstSuffixLine !== '') {
                cleanedCompletion = cleanedCompletion.slice(0, -firstSuffixLine.length);
            }
        }
        return cleanedCompletion;
    }
    _resetCurrentStream() {
        this._currentToken = '';
        if (this._currentStream) {
            this._currentStream.stop();
            this._fullCompletionMap.delete(this._currentStream);
            this._currentStream = null;
        }
    }
}
// eslint-disable-next-line @typescript-eslint/no-namespace
(function (MitoAIInlineCompleter) {
    MitoAIInlineCompleter.DEFAULT_SETTINGS = {
        triggerKind: 'any',
        debouncerDelay: 250,
        enabled: false
    };
})(MitoAIInlineCompleter || (MitoAIInlineCompleter = {}));


/***/ }),

/***/ "./lib/Extensions/emptyCell/EmptyCellPlugin.js":
/*!*****************************************************!*\
  !*** ./lib/Extensions/emptyCell/EmptyCellPlugin.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   emptyCellPlaceholder: () => (/* binding */ emptyCellPlaceholder)
/* harmony export */ });
/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/codeeditor */ "webpack/sharing/consume/default/@jupyterlab/codeeditor");
/* harmony import */ var _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/codemirror */ "webpack/sharing/consume/default/@jupyterlab/codemirror");
/* harmony import */ var _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/commands */ "webpack/sharing/consume/default/@lumino/commands");
/* harmony import */ var _lumino_commands__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_commands__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _commands__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../commands */ "./lib/commands.js");
/* harmony import */ var _AiChat_token__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../AiChat/token */ "./lib/Extensions/AiChat/token.js");
/* harmony import */ var _emptyCell__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./emptyCell */ "./lib/Extensions/emptyCell/emptyCell.js");






const emptyCellPlaceholder = {
    id: 'mito-ai:empty-cell-placeholder',
    description: 'Display a default message in an empty code cell.',
    autoStart: true,
    requires: [_AiChat_token__WEBPACK_IMPORTED_MODULE_3__.IChatTracker, _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1__.IEditorExtensionRegistry],
    activate: (app, 
    // Trick to ensure the chat plugin is available and loaded before this one
    // so that the keybinding can be properly resolved.
    tracker, extensions) => {
        var _a;
        const keyBindings = app.commands.keyBindings.find(b => b.command === _commands__WEBPACK_IMPORTED_MODULE_4__.COMMAND_MITO_AI_OPEN_CHAT);
        const pythonAdvice = `Start writing python or Press ${_lumino_commands__WEBPACK_IMPORTED_MODULE_2__.CommandRegistry.formatKeystroke((_a = keyBindings === null || keyBindings === void 0 ? void 0 : keyBindings.keys[0]) !== null && _a !== void 0 ? _a : 'Accel E')
            .split(/[+\s]/)
            .map(s => `<kbd>${s}</kbd>`)
            .join(' + ')} to ask Mito AI to write code for you.`;
        extensions.addExtension({
            name: 'mito-ai:empty-editor-advice',
            factory: options => {
                let advice = ''; // Default advice
                // Add the advice only for cells (not for file editor)
                if (options.inline) {
                    let guessedMimeType = options.model.mimeType;
                    if (guessedMimeType === _jupyterlab_codeeditor__WEBPACK_IMPORTED_MODULE_0__.IEditorMimeTypeService.defaultMimeType &&
                        options.model.type === 'code') {
                        // Assume the kernel is not yet ready and will be a Python one.
                        // FIXME it will be better to deal with model.mimeTypeChanged signal
                        // but this is gonna be hard.
                        guessedMimeType = 'text/x-ipython';
                    }
                    // Tune the advice with the mimetype
                    switch (guessedMimeType) {
                        case 'text/x-ipython': // Python code cell
                            advice = pythonAdvice;
                            break;
                        case 'text/x-ipythongfm': // Jupyter Markdown cell
                            advice = 'Start writing markdown.';
                            break;
                    }
                }
                return _jupyterlab_codemirror__WEBPACK_IMPORTED_MODULE_1__.EditorExtensionRegistry.createImmutableExtension((0,_emptyCell__WEBPACK_IMPORTED_MODULE_5__.advicePlugin)({
                    advice
                }));
            }
        });
        console.log("mito-ai: EmptyCellPlugin activated");
    }
};


/***/ }),

/***/ "./lib/Extensions/emptyCell/emptyCell.js":
/*!***********************************************!*\
  !*** ./lib/Extensions/emptyCell/emptyCell.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   advicePlugin: () => (/* binding */ advicePlugin),
/* harmony export */   showAdvice: () => (/* binding */ showAdvice)
/* harmony export */ });
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @codemirror/state */ "webpack/sharing/consume/default/@codemirror/state");
/* harmony import */ var _codemirror_state__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_codemirror_state__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @codemirror/view */ "webpack/sharing/consume/default/@codemirror/view");
/* harmony import */ var _codemirror_view__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_codemirror_view__WEBPACK_IMPORTED_MODULE_1__);


/**
 * Theme for the advice widget.
 */
const adviceTheme = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.EditorView.baseTheme({
    '& .cm-mito-advice': {
        color: 'var(--jp-ui-font-color3)',
        fontStyle: 'italic'
    },
    '& .cm-mito-advice > kbd': {
        borderRadius: '3px',
        borderStyle: 'solid',
        borderWidth: '1px',
        fontSize: 'calc(var(--jp-code-font-size) - 2px)',
        padding: '3px 5px',
        verticalAlign: 'middle'
    }
});
/**
 * A facet that stores the chat shortcut.
 */
const adviceText = _codemirror_state__WEBPACK_IMPORTED_MODULE_0__.Facet.define({
    // @ts-expect-error - Ignoring this error because I don't want to mess with codemirror for now
    combine: values => (values.length ? values[values.length - 1] : '')
});
class AdviceWidget extends _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.WidgetType {
    constructor(advice) {
        super();
        this.advice = advice;
    }
    eq(_) {
        return false;
    }
    toDOM() {
        const wrap = document.createElement('span');
        wrap.className = 'cm-mito-advice';
        wrap.innerHTML = this.advice;
        return wrap;
    }
}
function shouldDisplayAdvice(view) {
    const shortcut = view.state.facet(adviceText);
    const widgets = [];
    if (view.hasFocus && view.state.doc.length == 0) {
        const deco = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.Decoration.widget({
            widget: new AdviceWidget(shortcut),
            side: 1
        });
        widgets.push(deco.range(0));
    }
    return _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.Decoration.set(widgets);
}
const showAdvice = _codemirror_view__WEBPACK_IMPORTED_MODULE_1__.ViewPlugin.fromClass(class {
    constructor(view) {
        this.decorations = shouldDisplayAdvice(view);
    }
    update(update) {
        const advice = update.view.state.facet(adviceText);
        if (update.docChanged ||
            update.focusChanged ||
            advice !== update.startState.facet(adviceText)) {
            this.decorations = shouldDisplayAdvice(update.view);
        }
    }
}, {
    decorations: v => v.decorations,
    provide: () => [adviceTheme]
});
function advicePlugin(options = {}) {
    var _a;
    return [adviceText.of((_a = options.advice) !== null && _a !== void 0 ? _a : ''), showAdvice];
}


/***/ }),

/***/ "./lib/Extensions/status/index.js":
/*!****************************************!*\
  !*** ./lib/Extensions/status/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   statusItem: () => (/* binding */ statusItem)
/* harmony export */ });
/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/statusbar */ "webpack/sharing/consume/default/@jupyterlab/statusbar");
/* harmony import */ var _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/ui-components */ "webpack/sharing/consume/default/@jupyterlab/ui-components");
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../icons */ "./lib/icons/index.js");
/* harmony import */ var _AiChat_token__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../AiChat/token */ "./lib/Extensions/AiChat/token.js");
/* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/errors */ "./lib/utils/errors.js");
/* harmony import */ var _components_TextButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../components/TextButton */ "./lib/components/TextButton.js");
/* harmony import */ var _utils_stripe__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/stripe */ "./lib/utils/stripe.js");








/**
 * Mito AI status model
 */
class StatusModel extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__.VDomModel {
    constructor(chatPanel) {
        super();
        this.chatPanel = chatPanel;
        chatPanel.capabilitiesChanged.connect(this._onCapabilitiesChanged, this);
        chatPanel.lastErrorChanged.connect(this._onLastErrorChanged, this);
    }
    /**
     * AI capabilities.
     */
    get capabilities() {
        return this._capabilities;
    }
    /**
     * Latest seen error.
     */
    get lastError() {
        return this._lastError;
    }
    _onCapabilitiesChanged(_, capabilities) {
        this._capabilities = capabilities;
        this.stateChanged.emit(void 0);
    }
    _onLastErrorChanged(_, error) {
        this._lastError = error.error_type ? error : undefined;
        this.stateChanged.emit(void 0);
    }
}
/**
 * Mito AI status popup.
 */
class StatusPopUp extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__.VDomRenderer {
    render() {
        var _a, _b, _c, _d;
        let status_paragraph = react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", { className: 'mito-ai-status-ready' }, "Ready");
        if (((_a = this.model.lastError) === null || _a === void 0 ? void 0 : _a.title) == _utils_errors__WEBPACK_IMPORTED_MODULE_3__.FREE_TIER_LIMIT_REACHED_ERROR_TITLE) {
            status_paragraph = react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", { className: 'mito-ai-status-error' }, "Free Trial Expired");
        }
        return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: "mito-ai-status-popup" },
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement("h3", null, "Mito AI Status"),
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: 'mito-ai-status-popup-table-row' },
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", null, "Status:"),
                status_paragraph),
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement("div", { className: 'mito-ai-status-popup-table-row' },
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", null, "Provider:"),
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", null, (_c = (_b = this.model.capabilities) === null || _b === void 0 ? void 0 : _b.provider) !== null && _c !== void 0 ? _c : 'None')),
            ((_d = this.model.lastError) === null || _d === void 0 ? void 0 : _d.title) == _utils_errors__WEBPACK_IMPORTED_MODULE_3__.FREE_TIER_LIMIT_REACHED_ERROR_TITLE && (react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null,
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", null,
                    "\u26A0\uFE0F You've used up your free Mito AI completions for this month. Upgrade to ",
                    react__WEBPACK_IMPORTED_MODULE_2___default().createElement("a", { href: "https://www.trymito.io/plans", target: "_blank", rel: "noreferrer" }, "Mito Pro"),
                    " or supply your own Open AI Key to continue using Mito AI."),
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_components_TextButton__WEBPACK_IMPORTED_MODULE_4__["default"], { title: "Upgrade to Pro", text: "Upgrade to Pro", action: _utils_stripe__WEBPACK_IMPORTED_MODULE_5__.STRIPE_PAYMENT_LINK, variant: 'gray', width: 'block' }))),
            this.model.lastError && this.model.lastError.title !== _utils_errors__WEBPACK_IMPORTED_MODULE_3__.FREE_TIER_LIMIT_REACHED_ERROR_TITLE && (react__WEBPACK_IMPORTED_MODULE_2___default().createElement((react__WEBPACK_IMPORTED_MODULE_2___default().Fragment), null,
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("p", null, "Last error:"),
                react__WEBPACK_IMPORTED_MODULE_2___default().createElement("ul", null,
                    react__WEBPACK_IMPORTED_MODULE_2___default().createElement("li", null,
                        "Type: ",
                        this.model.lastError.error_type),
                    react__WEBPACK_IMPORTED_MODULE_2___default().createElement("li", null,
                        "Title: ",
                        this.model.lastError.title),
                    this.model.lastError.hint && (react__WEBPACK_IMPORTED_MODULE_2___default().createElement("li", null,
                        "Hint: ",
                        this.model.lastError.hint)))))));
    }
}
const MITO_AI_ERROR_CLASS = 'mito-ai-error';
/**
 * Mito widget to display in the status bar.
 */
class StatusItem extends _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__.ReactWidget {
    constructor(model) {
        super();
        this.model = model;
        this._hasError = false;
        this._popup = null;
        model.stateChanged.connect(this._onLastErrorChanged, this);
    }
    render() {
        return (react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_1__.Button, { className: "mito-ai-status-button", onClick: () => {
                this._onClick();
            }, minimal: true, small: true, title: "Mito AI Status" },
            "Mito AI \u00A0 ",
            react__WEBPACK_IMPORTED_MODULE_2___default().createElement(_icons__WEBPACK_IMPORTED_MODULE_6__.NucleusLabIcon.react, { tag: 'span', stylesheet: 'statusBar' })));
    }
    _onLastErrorChanged() {
        var _a, _b;
        if (this.model.lastError) {
            this._hasError = true;
            (_a = this.node.querySelector('button')) === null || _a === void 0 ? void 0 : _a.classList.add(MITO_AI_ERROR_CLASS);
        }
        else {
            if (this._hasError) {
                this._hasError = false;
                (_b = this.node
                    .querySelector('button')) === null || _b === void 0 ? void 0 : _b.classList.remove(MITO_AI_ERROR_CLASS);
            }
        }
    }
    _onClick() {
        if (this._popup && !this._popup.isDisposed) {
            this._popup.dispose();
        }
        else {
            this._popup = (0,_jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0__.showPopup)({
                body: new StatusPopUp(this.model),
                anchor: this,
                align: 'right',
                hasDynamicSize: true
            });
        }
    }
}
const statusItem = {
    id: 'mito_ai:status-item',
    autoStart: true,
    requires: [_AiChat_token__WEBPACK_IMPORTED_MODULE_7__.IChatTracker, _jupyterlab_statusbar__WEBPACK_IMPORTED_MODULE_0__.IStatusBar],
    activate: (app, chatTracker, statusBar) => {
        let registered = false;
        const registerMitoStatus = (chatPanel) => {
            if (registered) {
                return;
            }
            registered = true;
            const model = new StatusModel(chatPanel);
            const renderer = new StatusItem(model);
            statusBar.registerStatusItem('mito-ai:status-item', {
                item: renderer,
                align: 'right',
                rank: 0
            });
        };
        if (chatTracker.currentWidget) {
            registerMitoStatus(chatTracker.currentWidget);
        }
        else {
            chatTracker.widgetAdded.connect((_, chatPanel) => {
                registerMitoStatus(chatPanel);
            });
        }
    }
};


/***/ }),

/***/ "./lib/commands.js":
/*!*************************!*\
  !*** ./lib/commands.js ***!
  \*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   COMMAND_MITO_AI_APPLY_LATEST_CODE: () => (/* binding */ COMMAND_MITO_AI_APPLY_LATEST_CODE),
/* harmony export */   COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE: () => (/* binding */ COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE),
/* harmony export */   COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE: () => (/* binding */ COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE),
/* harmony export */   COMMAND_MITO_AI_OPEN_CHAT: () => (/* binding */ COMMAND_MITO_AI_OPEN_CHAT),
/* harmony export */   COMMAND_MITO_AI_PREVIEW_LATEST_CODE: () => (/* binding */ COMMAND_MITO_AI_PREVIEW_LATEST_CODE),
/* harmony export */   COMMAND_MITO_AI_REJECT_LATEST_CODE: () => (/* binding */ COMMAND_MITO_AI_REJECT_LATEST_CODE),
/* harmony export */   COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE: () => (/* binding */ COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE),
/* harmony export */   COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE: () => (/* binding */ COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE),
/* harmony export */   COMMAND_MITO_AI_SEND_MESSAGE: () => (/* binding */ COMMAND_MITO_AI_SEND_MESSAGE)
/* harmony export */ });
const MITO_AI = 'mito_ai';
const COMMAND_MITO_AI_OPEN_CHAT = `${MITO_AI}:open-chat`;
const COMMAND_MITO_AI_PREVIEW_LATEST_CODE = `${MITO_AI}:preview-latest-code`;
const COMMAND_MITO_AI_APPLY_LATEST_CODE = `${MITO_AI}:apply-latest-code`;
const COMMAND_MITO_AI_REJECT_LATEST_CODE = `${MITO_AI}:reject-latest-code`;
const COMMAND_MITO_AI_SEND_MESSAGE = `${MITO_AI}:send-message`;
const COMMAND_MITO_AI_SEND_EXPLAIN_CODE_MESSAGE = `${MITO_AI}:send-explain-code-message`;
const COMMAND_MITO_AI_SEND_DEBUG_ERROR_MESSAGE = `${MITO_AI}:send-debug-error-message`;
const COMMAND_MITO_AI_CELL_TOOLBAR_ACCEPT_CODE = `toolbar-button:accept-code`;
const COMMAND_MITO_AI_CELL_TOOLBAR_REJECT_CODE = `toolbar-button:reject-code`;


/***/ }),

/***/ "./lib/components/DropdownMenu.js":
/*!****************************************!*\
  !*** ./lib/components/DropdownMenu.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_DropdownMenu_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/DropdownMenu.css */ "./style/DropdownMenu.css");


const DropdownMenu = ({ trigger, items, className = '', alignment = 'left', }) => {
    const [isOpen, setIsOpen] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
    const dropdownRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
    // Close dropdown when clicking outside
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const handleClickOutside = (event) => {
            if (dropdownRef.current &&
                !dropdownRef.current.contains(event.target)) {
                setIsOpen(false);
            }
        };
        document.addEventListener('mousedown', handleClickOutside);
        return () => document.removeEventListener('mousedown', handleClickOutside);
    }, []);
    // Handle the main click (primary action)
    const handlePrimaryClick = (onClick, disabled) => {
        if (disabled)
            return;
        onClick();
        setIsOpen(false);
    };
    // Choose the alignment class
    const alignmentClass = alignment === 'right' ? 'dropdown-menu-right' : 'dropdown-menu-left';
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `dropdown-container ${className}`, ref: dropdownRef },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { onClick: () => setIsOpen(!isOpen) }, trigger),
        isOpen && (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: `dropdown-menu ${alignmentClass}` }, items.map((item, index) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { key: index, className: `dropdown-item-row ${item.disabled ? 'dropdown-item-disabled' : ''}` },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: "dropdown-item-main", onClick: () => handlePrimaryClick(item.onClick, item.disabled), disabled: item.disabled, title: item.disabled ? item.disabledTooltip : item.label },
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "dropdown-item-icon" }, item.primaryIcon && react__WEBPACK_IMPORTED_MODULE_0___default().createElement(item.primaryIcon)),
                react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "dropdown-item-label" }, item.label)),
            item.secondaryActions && item.secondaryActions.map((action, actionIndex) => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { key: actionIndex, className: "dropdown-item-secondary", onClick: (e) => {
                    e.stopPropagation(); // prevent triggering the main onClick
                    if (!action.disabled) {
                        action.onClick();
                        setIsOpen(false); // optional: close the dropdown after secondary action
                    }
                }, disabled: action.disabled, title: action.tooltip, style: {
                    background: 'none',
                    border: 'none',
                    cursor: action.disabled ? 'default' : 'pointer',
                    padding: 0,
                } }, react__WEBPACK_IMPORTED_MODULE_0___default().createElement(action.icon, { fill: 'currentColor' })))))))))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DropdownMenu);


/***/ }),

/***/ "./lib/components/IconButton.js":
/*!**************************************!*\
  !*** ./lib/components/IconButton.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_IconButton_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/IconButton.css */ "./style/IconButton.css");
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/button.css */ "./style/button.css");
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/classNames */ "./lib/utils/classNames.js");




const IconButton = ({ icon, onClick, title, style }) => {
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("icon-button"), onClick: onClick, title: title, style: style }, icon));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IconButton);


/***/ }),

/***/ "./lib/components/LoadingCircle.js":
/*!*****************************************!*\
  !*** ./lib/components/LoadingCircle.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
// Copyright (c) Mito

/*
    A spinning circle loading indicator that inherits its color from the parent component.
*/
const LoadingCircle = () => {
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("circle", { cx: "8", cy: "8", r: "7", stroke: "currentColor", strokeWidth: "2", opacity: "0.25" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M8 1C11.866 1 15 4.13401 15 8", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("animateTransform", { attributeName: "transform", attributeType: "XML", type: "rotate", from: "0 8 8", to: "360 8 8", dur: "1s", repeatCount: "indefinite" }))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadingCircle);


/***/ }),

/***/ "./lib/components/LoadingDots.js":
/*!***************************************!*\
  !*** ./lib/components/LoadingDots.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
// Copyright (c) Mito

/*
    Dot, dot, dots. They count, so that you can display something as loading.
*/
const LoadingDots = () => {
    // We use a count to track the number of ...s to display.
    // 0 -> '', 1 -> '.', 2 -> '..', 3 -> '...'. Wraps % 4.
    const [indicatorState, setIndicatorState] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(1);
    // Schedule a change to update the loading indicator, every .5 seconds
    (0,react__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        const interval = setInterval(() => {
            setIndicatorState(indicatorState => indicatorState + 1);
        }, 500);
        return () => clearInterval(interval);
    }, []);
    const someNumberOfDots = '.'.repeat(indicatorState % 4);
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null, someNumberOfDots));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadingDots);


/***/ }),

/***/ "./lib/components/TextAndIconButton.js":
/*!*********************************************!*\
  !*** ./lib/components/TextAndIconButton.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_TextAndIconButton_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/TextAndIconButton.css */ "./style/TextAndIconButton.css");
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/button.css */ "./style/button.css");
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/classNames */ "./lib/utils/classNames.js");




const TextAndIconButton = ({ text, icon: Icon, onClick, title, variant, iconPosition = 'right' // default to right
 }) => {
    const content = iconPosition === 'right' ? (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
        text,
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "text-and-icon-button__icon" },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Icon, null)))) : (react__WEBPACK_IMPORTED_MODULE_0___default().createElement((react__WEBPACK_IMPORTED_MODULE_0___default().Fragment), null,
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("span", { className: "text-and-icon-button__icon" },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Icon, null)),
        text));
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)('text-and-icon-button', 'button-base', `button-${variant}`, `button-width-fit-contents`), onClick: onClick, title: title }, content));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TextAndIconButton);


/***/ }),

/***/ "./lib/components/TextButton.js":
/*!**************************************!*\
  !*** ./lib/components/TextButton.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_TextButton_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/TextButton.css */ "./style/TextButton.css");
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/button.css */ "./style/button.css");
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/classNames */ "./lib/utils/classNames.js");




const TextButton = ({ text, onClick, title, variant, width, action }) => {
    if (action) {
        return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("form", { action: action, method: "POST", target: "_blank" },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("text-button-mito-ai", "button-base", `button-${variant}`, `button-width-${width}`), onClick: onClick, title: title }, text)));
    }
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("text-button-mito-ai", "button-base", `button-${variant}`, `button-width-${width}`), onClick: onClick, title: title }, text));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TextButton);


/***/ }),

/***/ "./lib/components/ToggleButton.js":
/*!****************************************!*\
  !*** ./lib/components/ToggleButton.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _style_button_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../style/button.css */ "./style/button.css");
/* harmony import */ var _style_ToggleButton_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../style/ToggleButton.css */ "./style/ToggleButton.css");
/* harmony import */ var _utils_classNames__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../utils/classNames */ "./lib/utils/classNames.js");




const ToggleButton = ({ leftText, rightText, leftIcon: LeftIcon, rightIcon: RightIcon, isLeftSelected, onChange, title, }) => {
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("toggle-button-container") },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("toggle-button-half", "button-base", isLeftSelected ? 'selected' : 'unselected'), onClick: () => onChange(true), title: title },
            LeftIcon && react__WEBPACK_IMPORTED_MODULE_0___default().createElement(LeftIcon, { width: "16px", height: "16px" }),
            leftText),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("button", { className: (0,_utils_classNames__WEBPACK_IMPORTED_MODULE_3__.classNames)("toggle-button-half", "button-base", !isLeftSelected ? 'selected' : 'unselected'), onClick: () => onChange(false), title: title },
            RightIcon && react__WEBPACK_IMPORTED_MODULE_0___default().createElement(RightIcon, { width: "16px", height: "16px" }),
            rightText)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ToggleButton);


/***/ }),

/***/ "./lib/hooks/useDebouncedFunction.js":
/*!*******************************************!*\
  !*** ./lib/hooks/useDebouncedFunction.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useDebouncedFunction: () => (/* binding */ useDebouncedFunction)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

/**
 * Creates a debounced version of a function that only executes after waiting for a specified delay
 * with no additional calls. If the function is called multiple times within the delay period,
 * only the last call will be executed.
 *
 * @param callback The function to debounce
 * @param delay The delay in milliseconds
 * @returns A debounced version of the callback
 */
const useDebouncedFunction = (callback, delay) => {
    const timeoutRef = (0,react__WEBPACK_IMPORTED_MODULE_0__.useRef)(null);
    return (0,react__WEBPACK_IMPORTED_MODULE_0__.useCallback)((...args) => {
        // Clear any existing timeout
        if (timeoutRef.current) {
            clearTimeout(timeoutRef.current);
        }
        // Set new timeout
        timeoutRef.current = setTimeout(() => {
            callback(...args);
        }, delay);
    }, [callback, delay]);
};


/***/ }),

/***/ "./lib/icons/AcceptIcon.js":
/*!*********************************!*\
  !*** ./lib/icons/AcceptIcon.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const AcceptIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M10.2236 0C4.70642 0 0.224487 4.48351 0.224487 10.0009C0.224487 15.5182 4.70642 20 10.2236 20C15.7408 20 20.2245 15.5181 20.2245 10.0009C20.2245 4.48368 15.741 0 10.2236 0ZM14.6192 5.46298C14.986 5.46298 15.3511 5.60114 15.6283 5.87746C16.1817 6.43091 16.1817 7.34456 15.6283 7.89886L9.56828 13.9589C9.01482 14.5123 8.10035 14.5123 7.54687 13.9589L4.85354 11.2648C4.30008 10.7114 4.30008 9.79937 4.85354 9.24518C5.407 8.69172 6.319 8.69172 6.87319 9.24518L8.55657 10.9294L13.6083 5.87851C13.8855 5.60054 14.2525 5.46298 14.6192 5.46298Z" }))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AcceptIcon);


/***/ }),

/***/ "./lib/icons/CopyIcon.js":
/*!*******************************!*\
  !*** ./lib/icons/CopyIcon.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const CopyIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M3.12502 4.03283H4.27968C4.35507 4.02072 4.4082 3.95276 4.40156 3.87658V2.59542C4.25976 2.64425 4.13359 2.72979 4.03593 2.84385L3.32343 3.65323C3.22929 3.76299 3.16172 3.89307 3.125 4.03291L3.12502 4.03283Z" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M7.75784 2.55308H4.70626V3.87342C4.71524 4.12263 4.5211 4.33201 4.27188 4.34217H3.0813V9.2C3.08208 9.56993 3.38012 9.8707 3.75005 9.875H7.75788C7.93757 9.87578 8.11022 9.80508 8.23757 9.67852C8.3653 9.55195 8.43717 9.37969 8.43757 9.2V3.22808C8.43718 3.0484 8.3653 2.87613 8.23757 2.74957C8.11022 2.623 7.93757 2.5523 7.75788 2.55308H7.75784Z" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M3.80163 2.62967C4.01452 2.38553 4.32155 2.24373 4.64538 2.2406H6.91879V1.79998C6.91801 1.43005 6.61997 1.12928 6.25004 1.12498H3.19221V2.44531C3.20119 2.69453 3.00705 2.9039 2.75783 2.91406H1.5625V7.77189C1.56328 8.14416 1.86523 8.44611 2.2375 8.44689H2.76407V4.30631C2.76172 3.98795 2.87578 3.67974 3.08438 3.43914L3.80163 2.62967Z" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M2.75783 2.60467C2.83322 2.59256 2.88635 2.52459 2.87971 2.44842V1.16725C2.74182 1.21569 2.61916 1.29928 2.52346 1.40943L1.80783 2.21881C1.71096 2.33013 1.64065 2.46217 1.60315 2.60474L2.75783 2.60467Z" }))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CopyIcon);


/***/ }),

/***/ "./lib/icons/MagicWand.js":
/*!********************************!*\
  !*** ./lib/icons/MagicWand.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const MagicWandIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "17", height: "16", viewBox: "0 0 17 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { clipPath: "url(#clip0_52_2)" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M11.7423 4.48214C11.4704 4.21083 11.0307 4.21083 10.7587 4.48214L7.80698 7.43387L8.79062 8.41751L11.7415 5.46578C12.0129 5.1952 12.0136 4.75411 11.7423 4.48214H11.7423Z", fill: "currentColor" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M0.428284 15.796C0.700257 16.068 1.13995 16.068 1.41192 15.796L8.29886 8.90973L7.31522 7.92609L0.428284 14.8124C0.156311 15.0843 0.156311 15.524 0.428284 15.796Z", fill: "currentColor" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M11.3549 1.39133L11.0071 0L10.6592 1.39133L9.26791 1.73915L10.6592 2.08701L11.0071 3.47835L11.3549 2.08701L12.7462 1.73915L11.3549 1.39133Z", fill: "currentColor" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M14.4858 3.47826L14.1379 4.8696L12.7466 5.21741L14.1379 5.56522L14.4858 6.95656L14.8336 5.56522L16.225 5.21741L14.8336 4.8696L14.4858 3.47826Z", fill: "currentColor" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M12.7462 7.65213L12.0506 10.4348L9.26791 11.1304L12.0506 11.8261L12.7462 14.6088L13.4419 11.8261L16.2246 11.1304L13.4419 10.4348L12.7462 7.65213Z", fill: "currentColor" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M6.48544 4.17387L9.2681 3.47824L6.48544 2.78256L5.78976 -0.000106812L5.09413 2.78256L2.31146 3.47824L5.09413 4.17387L5.78976 6.95653L6.48544 4.17387Z", fill: "currentColor" })),
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("defs", null,
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("clipPath", { id: "clip0_52_2" },
            react__WEBPACK_IMPORTED_MODULE_0___default().createElement("rect", { width: "16", height: "16", fill: "white", transform: "translate(0.224487)" })))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MagicWandIcon);


/***/ }),

/***/ "./lib/icons/Pencil.js":
/*!*****************************!*\
  !*** ./lib/icons/Pencil.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const PencilIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "14", height: "14", viewBox: "0 0 10 10", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: 'currentColor' },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M9.88308 1.82456C9.68326 1.49798 9.43085 1.18192 9.1259 0.876387C8.8209 0.570854 8.5054 0.317998 8.18991 0.117862C7.88492 -0.0717913 7.48531 -0.0296413 7.22238 0.223215L1.15425 6.29155C1.12269 6.32317 1.10167 6.35476 1.08065 6.39691L0.0289843 9.38893C-0.0341088 9.55749 0.00796491 9.73662 0.134151 9.86302C0.218298 9.94732 0.333977 10 0.449651 10C0.502235 10 0.554818 9.98947 0.596894 9.97894L3.58363 8.92541C3.6257 8.91488 3.65723 8.88326 3.6888 8.85168L9.76744 2.78325C10.0304 2.51987 10.0724 2.13008 9.88311 1.82454L9.88308 1.82456ZM1.56439 6.80777C1.86938 6.98685 2.18488 7.2397 2.47934 7.53471C2.77382 7.82972 3.01568 8.14578 3.19449 8.45128L1.46976 9.06235C1.41717 8.957 1.34357 8.85164 1.25942 8.76734C1.16476 8.67252 1.0701 8.60931 0.964937 8.55664L1.56439 6.80777Z" }))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PencilIcon);


/***/ }),

/***/ "./lib/icons/PlayButtonIcon.js":
/*!*************************************!*\
  !*** ./lib/icons/PlayButtonIcon.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const PlayButtonIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 10 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5 0.5C6.38068 0.5 7.63072 1.05968 8.53558 1.9646C9.44034 2.86935 10 4.11938 10 5.50005C10 6.88071 9.44031 8.13075 8.53558 9.03559C7.63071 9.94034 6.38058 10.5 5 10.5C3.61942 10.5 2.36928 9.94032 1.46442 9.03559C0.559662 8.13073 0 6.88062 0 5.50005C0 4.11948 0.55969 2.86935 1.46461 1.9645C2.36937 1.05975 3.61942 0.500096 5.0001 0.500096L5 0.5ZM7.31017 5.70697C7.34646 5.68679 7.37783 5.65673 7.40006 5.61816C7.46534 5.50465 7.42621 5.35975 7.31271 5.29447L3.89591 3.32169C3.85701 3.29401 3.80938 3.27775 3.75805 3.27775C3.62653 3.27775 3.51992 3.38435 3.51992 3.51588L3.51988 5.50003V7.48417H3.52085C3.52085 7.52427 3.53099 7.56497 3.55237 7.60234C3.61764 7.71585 3.76256 7.75501 3.87606 7.6897L5.59438 6.69758L7.31017 5.70697Z" }))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PlayButtonIcon);


/***/ }),

/***/ "./lib/icons/RejectIcon.js":
/*!*********************************!*\
  !*** ./lib/icons/RejectIcon.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const RejectIcon = () => (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "1em", height: "1em", viewBox: "0 0 21 20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
    react__WEBPACK_IMPORTED_MODULE_0___default().createElement("g", { fill: "currentColor" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M10.2245 0C7.57229 0 5.02869 1.0536 3.15349 2.929C1.27817 4.8044 0.224487 7.348 0.224487 10C0.224487 12.652 1.27809 15.1958 3.15349 17.071C5.02889 18.9463 7.57249 20 10.2245 20C12.8765 20 15.4203 18.9464 17.2955 17.071C19.1708 15.1956 20.2245 12.652 20.2245 10C20.2245 8.2446 19.7624 6.5202 18.8847 5C18.0071 3.47984 16.7447 2.2174 15.2245 1.3398C13.7044 0.46206 11.9799 3.9978e-05 10.2245 3.9978e-05L10.2245 0ZM13.9315 12.293C14.1244 12.4794 14.2344 12.7354 14.2367 13.0036C14.2391 13.2718 14.1335 13.5298 13.9438 13.7194C13.7542 13.9091 13.4962 14.0146 13.228 14.0123C12.9598 14.01 12.7038 13.9 12.5174 13.7071L10.2244 11.4141L7.93143 13.7071C7.67737 13.9524 7.31283 14.0455 6.97229 13.9521C6.63175 13.8588 6.36565 13.5927 6.27229 13.2521C6.17893 12.9116 6.27205 12.5471 6.51737 12.293L8.81037 10L6.51737 7.707C6.27205 7.45294 6.17893 7.0884 6.27229 6.74786C6.36565 6.40732 6.63175 6.14122 6.97229 6.04786C7.31283 5.9545 7.67737 6.04763 7.93143 6.29294L10.2244 8.58594L12.5174 6.29294V6.29286C12.7715 6.04754 13.136 5.95442 13.4766 6.04778C13.8171 6.14114 14.0832 6.40724 14.1766 6.74778C14.2699 7.08832 14.1768 7.45286 13.9315 7.70692L11.6385 9.99992L13.9315 12.293Z" }))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RejectIcon);


/***/ }),

/***/ "./lib/icons/SupportIcon.js":
/*!**********************************!*\
  !*** ./lib/icons/SupportIcon.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "webpack/sharing/consume/default/react");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);

const SupportIcon = () => {
    return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement("svg", { width: "15", height: "14", viewBox: "0 0 15 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M7.92926 10.2004C7.92926 10.642 7.57122 11 7.12958 11C6.68793 11 6.3299 10.642 6.3299 10.2004C6.3299 9.75875 6.68793 9.40074 7.12958 9.40074C7.57125 9.40077 7.92926 9.75881 7.92926 10.2004Z", fill: "black", className: "jp-icon3 jp-icon-selectable" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("path", { d: "M7.12451 3.00306C6.56492 2.97458 6.01874 3.17955 5.61602 3.56909C5.21343 3.95871 4.99047 4.49789 5.00031 5.05801V5.10118L5.00171 5.10365H5.00182C5.01703 5.33497 5.15197 5.54159 5.35761 5.64855C5.56336 5.75553 5.81001 5.74739 6.00813 5.62703C6.20626 5.50664 6.3272 5.2916 6.32709 5.05973V5.03468L6.32698 5.03446L6.32709 5.03435C6.31585 4.81821 6.39572 4.60726 6.54728 4.45268C6.69884 4.29803 6.9082 4.21407 7.12456 4.22093C7.34357 4.2161 7.55478 4.30231 7.70781 4.4591C7.86085 4.61578 7.94204 4.82901 7.93187 5.04794C7.91655 5.29042 7.82006 5.52078 7.65792 5.70178L6.84168 6.86601C6.5946 7.16641 6.46502 7.54629 6.47722 7.93508V7.96101C6.47722 8.19406 6.60145 8.40935 6.80325 8.52587C7.00502 8.64229 7.25372 8.64229 7.45546 8.52587C7.65724 8.40935 7.78149 8.19406 7.78149 7.96101V7.98426H7.7816C7.79832 7.82585 7.85657 7.67462 7.95059 7.54611L8.75729 6.35122C9.06218 5.98323 9.23827 5.5255 9.25839 5.04791C9.26557 4.48777 9.04001 3.94972 8.6355 3.56215C8.23091 3.17459 7.68389 2.97208 7.12448 3.00311L7.12451 3.00306Z", fill: "black", className: "jp-icon3 jp-icon-selectable" }),
        react__WEBPACK_IMPORTED_MODULE_0___default().createElement("circle", { cx: "7.22449", cy: "7", r: "6.375", stroke: "black", strokeWidth: "1.25", className: "jp-icon3 jp-icon-selectable" })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SupportIcon);


/***/ }),

/***/ "./lib/icons/index.js":
/*!****************************!*\
  !*** ./lib/icons/index.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   NucleusLabIcon: () => (/* binding */ NucleusLabIcon),
/* harmony export */   OpenIndicatorLabIcon: () => (/* binding */ OpenIndicatorLabIcon),
/* harmony export */   lightBulbLabIcon: () => (/* binding */ lightBulbLabIcon)
/* harmony export */ });
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/ui-components */ "webpack/sharing/consume/default/@jupyterlab/ui-components");
/* harmony import */ var _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _src_icons_LightbulbIcon_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../src/icons/LightbulbIcon.svg */ "./src/icons/LightbulbIcon.svg");
/* harmony import */ var _src_icons_NucleusIcon_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../src/icons/NucleusIcon.svg */ "./src/icons/NucleusIcon.svg");
/* harmony import */ var _src_icons_OpenIndicatorIcon_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../src/icons/OpenIndicatorIcon.svg */ "./src/icons/OpenIndicatorIcon.svg");




const lightBulbLabIcon = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabIcon({
    name: 'lightbulb-icon',
    svgstr: _src_icons_LightbulbIcon_svg__WEBPACK_IMPORTED_MODULE_1__
});
const NucleusLabIcon = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabIcon({
    name: 'nucleus-icon',
    svgstr: _src_icons_NucleusIcon_svg__WEBPACK_IMPORTED_MODULE_2__
});
const OpenIndicatorLabIcon = new _jupyterlab_ui_components__WEBPACK_IMPORTED_MODULE_0__.LabIcon({
    name: 'open-indicator-icon',
    svgstr: _src_icons_OpenIndicatorIcon_svg__WEBPACK_IMPORTED_MODULE_3__
});


/***/ }),

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

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _Extensions_AiChat_AiChatPlugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Extensions/AiChat/AiChatPlugin */ "./lib/Extensions/AiChat/AiChatPlugin.js");
/* harmony import */ var _Extensions_ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Extensions/ContextManager/ContextManagerPlugin */ "./lib/Extensions/ContextManager/ContextManagerPlugin.js");
/* harmony import */ var _Extensions_ErrorMimeRenderer_ErrorMimeRendererPlugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Extensions/ErrorMimeRenderer/ErrorMimeRendererPlugin */ "./lib/Extensions/ErrorMimeRenderer/ErrorMimeRendererPlugin.js");
/* harmony import */ var _Extensions_CellToolbarButtons_CellToolbarButtonsPlugin__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Extensions/CellToolbarButtons/CellToolbarButtonsPlugin */ "./lib/Extensions/CellToolbarButtons/CellToolbarButtonsPlugin.js");
/* harmony import */ var _Extensions_emptyCell_EmptyCellPlugin__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Extensions/emptyCell/EmptyCellPlugin */ "./lib/Extensions/emptyCell/EmptyCellPlugin.js");
/* harmony import */ var _Extensions_InlineCompleter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Extensions/InlineCompleter */ "./lib/Extensions/InlineCompleter/index.js");
/* harmony import */ var _Extensions_status__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Extensions/status */ "./lib/Extensions/status/index.js");







// This is the main entry point to the mito-ai extension. It must export all of the top level
// extensions that we want to load.
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([
    _Extensions_AiChat_AiChatPlugin__WEBPACK_IMPORTED_MODULE_0__["default"],
    _Extensions_ErrorMimeRenderer_ErrorMimeRendererPlugin__WEBPACK_IMPORTED_MODULE_1__["default"],
    _Extensions_ContextManager_ContextManagerPlugin__WEBPACK_IMPORTED_MODULE_2__["default"],
    _Extensions_CellToolbarButtons_CellToolbarButtonsPlugin__WEBPACK_IMPORTED_MODULE_3__["default"],
    _Extensions_emptyCell_EmptyCellPlugin__WEBPACK_IMPORTED_MODULE_4__.emptyCellPlaceholder,
    _Extensions_InlineCompleter__WEBPACK_IMPORTED_MODULE_5__.completionPlugin,
    _Extensions_status__WEBPACK_IMPORTED_MODULE_6__.statusItem
]);


/***/ }),

/***/ "./lib/utils/agentActions.js":
/*!***********************************!*\
  !*** ./lib/utils/agentActions.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   acceptAndRunCellUpdate: () => (/* binding */ acceptAndRunCellUpdate),
/* harmony export */   acceptAndRunCode: () => (/* binding */ acceptAndRunCode),
/* harmony export */   retryIfExecutionError: () => (/* binding */ retryIfExecutionError)
/* harmony export */ });
/* harmony import */ var _Extensions_ErrorMimeRenderer_errorUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Extensions/ErrorMimeRenderer/errorUtils */ "./lib/Extensions/ErrorMimeRenderer/errorUtils.js");
/* harmony import */ var _sleep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sleep */ "./lib/utils/sleep.js");
/* harmony import */ var _notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./notebook */ "./lib/utils/notebook.js");



const acceptAndRunCellUpdate = async (cellUpdate, notebookTracker, app, previewAICodeToActiveCell, acceptAICode) => {
    // If the cellUpdate is creating a new code cell, insert it 
    // before previewing and accepting the code. 
    if (cellUpdate.type === 'new') {
        // makes the cell the active cell
        (0,_notebook__WEBPACK_IMPORTED_MODULE_0__.createCodeCellAtIndexAndActivate)(notebookTracker, cellUpdate.index);
    }
    else {
        (0,_notebook__WEBPACK_IMPORTED_MODULE_0__.setActiveCellByID)(notebookTracker, cellUpdate.id);
    }
    // The target cell should now be the active cell
    await acceptAndRunCode(app, previewAICodeToActiveCell, acceptAICode);
};
const acceptAndRunCode = async (app, previewAICodeToActiveCell, acceptAICode) => {
    /*
        PreviewAICode applies the code to the current active code cell,
        so make sure that correct cell is active before calling
        this function
    */
    previewAICodeToActiveCell();
    acceptAICode();
    await app.commands.execute("notebook:run-cell");
};
const retryIfExecutionError = async (notebookTracker, app, getDuplicateChatHistoryManager, addAIMessageFromResponseAndUpdateState, sendAgentSmartDebugMessage, previewAICodeToActiveCell, acceptAICode, shouldContinueAgentExecution, finalizeAgentStop, chatHistoryManagerRef) => {
    var _a, _b, _c, _d;
    const cell = (_b = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.activeCell;
    // Note: If you update the max retries, update the message we display on each failure
    // attempt to ensure we don't say "third attempt" over and over again.
    const MAX_RETRIES = 3;
    let attempts = 0;
    while ((0,_notebook__WEBPACK_IMPORTED_MODULE_0__.didCellExecutionError)(cell) && attempts < MAX_RETRIES) {
        if (!shouldContinueAgentExecution.current) {
            finalizeAgentStop();
            return 'interupted';
        }
        // If the code cell has an error, we need to send the error to the AI
        // and get it to fix the error.
        const errorOutput = (_c = cell === null || cell === void 0 ? void 0 : cell.model.outputs) === null || _c === void 0 ? void 0 : _c.toJSON().find(output => output.output_type === "error");
        if (!errorOutput) {
            return 'success'; // If no error output, we're done
        }
        const errorMessage = (0,_Extensions_ErrorMimeRenderer_errorUtils__WEBPACK_IMPORTED_MODULE_1__.getFullErrorMessageFromTraceback)(errorOutput.traceback);
        const newChatHistoryManager = getDuplicateChatHistoryManager();
        addAIMessageFromResponseAndUpdateState(attempts === 0
            ? "Hmm, looks like my first attempt didn't work. Let me try again."
            : `Looks like my ${attempts === 1 ? 'second' : 'third'} attempt didn't work. ${attempts === 1 ? 'Let me try again.' : "Let me try one more time. If I cannot figure it out this time, I'll ask you for more information"}`, 'agent:execution', newChatHistoryManager);
        // Wait two seconds so the use can more easily see what is going on 
        await (0,_sleep__WEBPACK_IMPORTED_MODULE_2__.sleep)(2000);
        await sendAgentSmartDebugMessage(errorMessage);
        const aiDisplayOptimizedChatItem = chatHistoryManagerRef.current.getLastAIDisplayOptimizedChatItem();
        const cellUpdate = (_d = aiDisplayOptimizedChatItem === null || aiDisplayOptimizedChatItem === void 0 ? void 0 : aiDisplayOptimizedChatItem.agentResponse) === null || _d === void 0 ? void 0 : _d.cell_update;
        if (cellUpdate !== undefined && cellUpdate !== null) {
            await acceptAndRunCellUpdate(cellUpdate, notebookTracker, app, previewAICodeToActiveCell, acceptAICode);
        }
        attempts++;
        // If this was the last attempt and it still failed
        if (attempts === MAX_RETRIES && (0,_notebook__WEBPACK_IMPORTED_MODULE_0__.didCellExecutionError)(cell)) {
            return 'failure';
        }
    }
    return 'success';
};


/***/ }),

/***/ "./lib/utils/arrays.js":
/*!*****************************!*\
  !*** ./lib/utils/arrays.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   deepEqualArrays: () => (/* binding */ deepEqualArrays)
/* harmony export */ });
const deepEqualArrays = (arr1, arr2) => {
    if (arr1.length !== arr2.length)
        return false;
    for (let i = 0; i < arr1.length; i++) {
        if (typeof arr1[i] === 'object' && typeof arr2[i] === 'object') {
            if (!deepEqualArrays(arr1[i], arr2[i]))
                return false;
        }
        else if (arr1[i] !== arr2[i]) {
            return false;
        }
    }
    return true;
};


/***/ }),

/***/ "./lib/utils/blacklistedWords.js":
/*!***************************************!*\
  !*** ./lib/utils/blacklistedWords.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   checkForBlacklistedWords: () => (/* binding */ checkForBlacklistedWords)
/* harmony export */ });
// Function to check for blacklisted words that could be dangerous for the agent to execute
const checkForBlacklistedWords = (code) => {
    // List of dangerous operations/commands that could delete files or cause harm
    const blacklistedPatterns = [
        {
            pattern: /\brm\s+-rf\b/,
            message: "This code contains a command (rm -rf) that could recursively delete files and directories from your system"
        },
        {
            pattern: /\bfs\.rmdir\b/,
            message: "This code contains a Node.js command (fs.rmdir) that could delete directories from your system"
        },
        {
            pattern: /\bfs\.unlink\b/,
            message: "This code contains a Node.js command (fs.unlink) that could delete files from your system"
        },
        {
            pattern: /\bshutil\.rmtree\b/,
            message: "This code contains a Python command (shutil.rmtree) that could recursively delete directories and their contents"
        },
        {
            pattern: /\bos\.remove\b/,
            message: "This code contains a Python command (os.remove) that could delete files from your system"
        },
        {
            pattern: /\bos\.rmdir\b/,
            message: "This code contains a Python command (os.rmdir) that could delete directories from your system"
        },
        {
            pattern: /\bos\.unlink\b/,
            message: "This code contains a Python command (os.unlink) that could delete files from your system"
        },
        {
            pattern: /\brmdir\b/,
            message: "This code contains a command (rmdir) that could delete directories from your system"
        },
        {
            pattern: /\bunlink\b/,
            message: "This code contains a function (unlink) that could delete files from your system"
        },
        {
            pattern: /\bdelete\s+from\b/i,
            message: "This code contains an SQL DELETE command that could remove data from your database"
        },
        {
            pattern: /\bdrop\s+table\b/i,
            message: "This code contains an SQL DROP TABLE command that could delete entire tables from your database"
        },
        {
            pattern: /\bdrop\s+database\b/i,
            message: "This code contains an SQL DROP DATABASE command that could delete your entire database"
        },
        {
            pattern: /\bformat\s*\(/,
            message: "This code contains a format command that could potentially format your drives or storage devices"
        },
        {
            pattern: /\bsystem\s*\(/,
            message: "This code contains a system() call that could execute arbitrary system commands, which is a security risk"
        },
        {
            pattern: /\beval\s*\(/,
            message: "This code contains an eval() function that could execute arbitrary code, which is a security risk"
        },
        {
            pattern: /\bexec\s*\(/,
            message: "This code contains an exec() function that could execute arbitrary code, which is a security risk"
        },
    ];
    for (const { pattern, message } of blacklistedPatterns) {
        if (pattern.test(code)) {
            return {
                safe: false,
                reason: message
            };
        }
    }
    return { safe: true };
};


/***/ }),

/***/ "./lib/utils/classNames.js":
/*!*********************************!*\
  !*** ./lib/utils/classNames.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   classNames: () => (/* binding */ classNames)
/* harmony export */ });
/*
    A utility for constructing a valid classnames string, you can either pass
    a string, or an object that maps a string to a boolean value, indicating if
    it should be included in the final object.

    For example:
        classNames('abc', '123') = 'abc 123'
        classNames('abc', {'123': true}) = 'abc 123'
        classNames('abc', {'123': false}) = 'abc'
*/
const classNames = (...args) => {
    let finalString = '';
    for (let i = 0; i < args.length; i++) {
        const arg = args[i];
        // Skip undefined arguments
        if (arg === undefined) {
            continue;
        }
        if (typeof arg === 'string') {
            finalString += arg + ' ';
        }
        else {
            Object.entries(arg).map(([className, include]) => {
                if (include) {
                    finalString += className + ' ';
                }
            });
        }
    }
    return finalString;
};


/***/ }),

/***/ "./lib/utils/codeDiff.js":
/*!*******************************!*\
  !*** ./lib/utils/codeDiff.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createUnifiedDiff: () => (/* binding */ createUnifiedDiff),
/* harmony export */   getCodeDiffLineRanges: () => (/* binding */ getCodeDiffLineRanges),
/* harmony export */   getCodeDiffsAndUnifiedCodeString: () => (/* binding */ getCodeDiffsAndUnifiedCodeString)
/* harmony export */ });
/* harmony import */ var vscode_diff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vscode-diff */ "webpack/sharing/consume/default/vscode-diff/vscode-diff");
/* harmony import */ var vscode_diff__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vscode_diff__WEBPACK_IMPORTED_MODULE_0__);

const getCodeDiffLineRanges = (originalLines, modifiedLines) => {
    if (originalLines === undefined || originalLines === null) {
        originalLines = '';
    }
    if (modifiedLines === undefined || modifiedLines === null) {
        modifiedLines = '';
    }
    const originalLinesArray = originalLines.split('\n');
    const modifiedLinesArray = modifiedLines.split('\n');
    const options = {
        shouldPostProcessCharChanges: true,
        shouldIgnoreTrimWhitespace: true,
        shouldMakePrettyDiff: true,
        shouldComputeCharChanges: true,
        maxComputationTime: 0 // time in milliseconds, 0 => no computation limit.
    };
    const diffComputer = new vscode_diff__WEBPACK_IMPORTED_MODULE_0__.DiffComputer(originalLinesArray, modifiedLinesArray, options);
    const lineChanges = diffComputer.computeDiff().changes;
    return lineChanges || [];
};
const createUnifiedDiff = (originalCode, modifiedCode, lineChanges) => {
    var _a, _b, _c, _d, _e, _f, _g, _h;
    if (originalCode === undefined || originalCode === null) {
        originalCode = '';
    }
    if (modifiedCode === undefined || modifiedCode === null) {
        modifiedCode = '';
    }
    const originalLines = originalCode.split('\n');
    const modifiedLines = modifiedCode.split('\n');
    /*
    Algorithm explanation:
    
    This function creates a unified diff by comparing the original and modified code.
    It iterates through both versions of the code simultaneously, creating a new representation
    of the code called result that is UnifiedDiffLine[]. Each time the algorithm sees a new line
    of code, it adds it to the result, marking it as unchanged, removed, or inserted.

    The algorithm works as follows:
    1. Process unchanged lines until a change is encountered.
    2. When a change is found, handle it based on its type:
        a. Modification: Mark original lines as removed, mark modified lines as inserted.
        b. Inserted: Add new lines from the modified code and mark as Inserted.
        c. Removed: Add removed lines from the original code to the result and mark as Removed.
    3. After processing all changes, handle any remaining lines.
    The result is a unified diff that shows all changes in context.
    */
    const result = [];
    let originalLineNum = 1;
    let modifiedLineNum = 1;
    let changeIndex = 0;
    while (originalLineNum <= originalLines.length ||
        modifiedLineNum <= modifiedLines.length) {
        if (changeIndex < lineChanges.length) {
            const change = lineChanges[changeIndex];
            if (change === undefined) {
                break;
            }
            // Process unchanged lines before the next change
            while ((originalLineNum < change.originalStartLineNumber ||
                modifiedLineNum < change.modifiedStartLineNumber) &&
                originalLineNum <= originalLines.length &&
                modifiedLineNum <= modifiedLines.length) {
                result.push({
                    content: (_a = originalLines[originalLineNum - 1]) !== null && _a !== void 0 ? _a : '',
                    type: 'unchanged',
                    originalLineNumber: originalLineNum,
                    modifiedLineNumber: modifiedLineNum,
                });
                originalLineNum++;
                modifiedLineNum++;
            }
            // Process the change
            if (change.originalEndLineNumber > 0 &&
                change.modifiedEndLineNumber > 0) {
                // Modification
                // First add removed lines
                for (; originalLineNum <= change.originalEndLineNumber; originalLineNum++) {
                    result.push({
                        content: (_b = originalLines[originalLineNum - 1]) !== null && _b !== void 0 ? _b : '',
                        type: 'removed',
                        originalLineNumber: originalLineNum,
                        modifiedLineNumber: null,
                    });
                }
                // Then add inserted lines
                for (; modifiedLineNum <= change.modifiedEndLineNumber; modifiedLineNum++) {
                    result.push({
                        content: (_c = modifiedLines[modifiedLineNum - 1]) !== null && _c !== void 0 ? _c : '',
                        type: 'inserted',
                        originalLineNumber: null,
                        modifiedLineNumber: modifiedLineNum,
                    });
                }
            }
            else if (change.originalEndLineNumber === 0) {
                // Inserted Lines
                for (; modifiedLineNum <= change.modifiedEndLineNumber; modifiedLineNum++) {
                    result.push({
                        content: (_d = modifiedLines[modifiedLineNum - 1]) !== null && _d !== void 0 ? _d : '',
                        type: 'inserted',
                        originalLineNumber: null,
                        modifiedLineNumber: modifiedLineNum,
                    });
                }
            }
            else if (change.modifiedEndLineNumber === 0) {
                // Removed lines
                for (; originalLineNum <= change.originalEndLineNumber; originalLineNum++) {
                    result.push({
                        content: (_e = originalLines[originalLineNum - 1]) !== null && _e !== void 0 ? _e : '',
                        type: 'removed',
                        originalLineNumber: originalLineNum,
                        modifiedLineNumber: null,
                    });
                }
            }
            changeIndex++;
        }
        else {
            // Process any remaining unchanged lines
            if (originalLineNum <= originalLines.length &&
                modifiedLineNum <= modifiedLines.length) {
                result.push({
                    content: (_f = originalLines[originalLineNum - 1]) !== null && _f !== void 0 ? _f : '',
                    type: 'unchanged',
                    originalLineNumber: originalLineNum,
                    modifiedLineNumber: modifiedLineNum,
                });
                originalLineNum++;
                modifiedLineNum++;
            }
            else if (originalLineNum <= originalLines.length) {
                // Remaining lines were removed
                result.push({
                    content: (_g = originalLines[originalLineNum - 1]) !== null && _g !== void 0 ? _g : '',
                    type: 'removed',
                    originalLineNumber: originalLineNum,
                    modifiedLineNumber: null,
                });
                originalLineNum++;
            }
            else if (modifiedLineNum <= modifiedLines.length) {
                // Remaining lines were added
                result.push({
                    content: (_h = modifiedLines[modifiedLineNum - 1]) !== null && _h !== void 0 ? _h : '',
                    type: 'inserted',
                    originalLineNumber: null,
                    modifiedLineNumber: modifiedLineNum,
                });
                modifiedLineNum++;
            }
            else {
                break;
            }
        }
    }
    return result;
};
const getCodeDiffsAndUnifiedCodeString = (originalCode, modifiedCode) => {
    const lineChanges = getCodeDiffLineRanges(originalCode, modifiedCode);
    const unifiedDiffs = createUnifiedDiff(originalCode, modifiedCode, lineChanges);
    const unifiedCodeString = (unifiedDiffs.map(line => {
        return line.content !== undefined ? line.content : '';
    }).join('\n'));
    return {
        unifiedCodeString,
        unifiedDiffs
    };
};


/***/ }),

/***/ "./lib/utils/copyToClipboard.js":
/*!**************************************!*\
  !*** ./lib/utils/copyToClipboard.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./strings */ "./lib/utils/strings.js");

const copyToClipboard = async (text) => {
    const codeWithoutMarkdown = (0,_strings__WEBPACK_IMPORTED_MODULE_0__.removeMarkdownCodeFormatting)(text);
    await navigator.clipboard.writeText(codeWithoutMarkdown !== null && codeWithoutMarkdown !== void 0 ? codeWithoutMarkdown : '');
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (copyToClipboard);


/***/ }),

/***/ "./lib/utils/errors.js":
/*!*****************************!*\
  !*** ./lib/utils/errors.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   FREE_TIER_LIMIT_REACHED_ERROR_TITLE: () => (/* binding */ FREE_TIER_LIMIT_REACHED_ERROR_TITLE)
/* harmony export */ });
const FREE_TIER_LIMIT_REACHED_ERROR_TITLE = 'mito_server_free_tier_limit_reached';


/***/ }),

/***/ "./lib/utils/notebook.js":
/*!*******************************!*\
  !*** ./lib/utils/notebook.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createCodeCellAtIndexAndActivate: () => (/* binding */ createCodeCellAtIndexAndActivate),
/* harmony export */   didCellExecutionError: () => (/* binding */ didCellExecutionError),
/* harmony export */   getAIOptimizedCells: () => (/* binding */ getAIOptimizedCells),
/* harmony export */   getActiveCell: () => (/* binding */ getActiveCell),
/* harmony export */   getActiveCellCode: () => (/* binding */ getActiveCellCode),
/* harmony export */   getActiveCellID: () => (/* binding */ getActiveCellID),
/* harmony export */   getCellByID: () => (/* binding */ getCellByID),
/* harmony export */   getCellCodeByID: () => (/* binding */ getCellCodeByID),
/* harmony export */   getCellIndexByID: () => (/* binding */ getCellIndexByID),
/* harmony export */   getNotebookName: () => (/* binding */ getNotebookName),
/* harmony export */   highlightCodeCell: () => (/* binding */ highlightCodeCell),
/* harmony export */   highlightLineOfCodeInCodeCell: () => (/* binding */ highlightLineOfCodeInCodeCell),
/* harmony export */   scrollToCell: () => (/* binding */ scrollToCell),
/* harmony export */   setActiveCellByID: () => (/* binding */ setActiveCellByID),
/* harmony export */   writeCodeToCellByID: () => (/* binding */ writeCodeToCellByID)
/* harmony export */ });
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/notebook */ "webpack/sharing/consume/default/@jupyterlab/notebook");
/* harmony import */ var _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _strings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./strings */ "./lib/utils/strings.js");


const getActiveCell = (notebookTracker) => {
    var _a;
    const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
    const activeCell = notebook === null || notebook === void 0 ? void 0 : notebook.activeCell;
    return activeCell || undefined;
};
const getCellByID = (notebookTracker, cellID) => {
    var _a;
    if (cellID === undefined) {
        return undefined;
    }
    const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
    return notebook === null || notebook === void 0 ? void 0 : notebook.widgets.find(cell => cell.model.id === cellID);
};
const getActiveCellID = (notebookTracker) => {
    var _a;
    return (_a = getActiveCell(notebookTracker)) === null || _a === void 0 ? void 0 : _a.model.id;
};
const getActiveCellCode = (notebookTracker) => {
    const activeCell = getActiveCell(notebookTracker);
    return activeCell === null || activeCell === void 0 ? void 0 : activeCell.model.sharedModel.source;
};
const getCellCodeByID = (notebookTracker, codeCellID) => {
    const cell = getCellByID(notebookTracker, codeCellID);
    return cell === null || cell === void 0 ? void 0 : cell.model.sharedModel.source;
};
const getCellIndexByID = (notebookTracker, cellID) => {
    var _a, _b;
    const cellList = (_b = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.cells;
    if (cellList === undefined) {
        return undefined;
    }
    // In order to get the cell index, we need to iterate over the cells and call the `get` method
    // to see the cells in order. Otherwise, the cells are returned in a random order.
    for (let i = 0; i < cellList.length; i++) {
        const cellModel = cellList.get(i);
        if (cellModel.id == cellID) {
            return i;
        }
    }
    return undefined;
};
const setActiveCellByID = (notebookTracker, cellID) => {
    const cellIndex = getCellIndexByID(notebookTracker, cellID);
    const notebookPanel = notebookTracker.currentWidget;
    if (notebookPanel !== undefined && notebookPanel !== null && cellIndex !== undefined) {
        notebookPanel.content.activeCellIndex = cellIndex;
    }
};
const writeCodeToCellByID = (notebookTracker, code, codeCellID) => {
    var _a;
    if (code === undefined) {
        return;
    }
    const codeMirrorValidCode = (0,_strings__WEBPACK_IMPORTED_MODULE_1__.removeMarkdownCodeFormatting)(code);
    const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
    const cell = notebook === null || notebook === void 0 ? void 0 : notebook.widgets.find(cell => cell.model.id === codeCellID);
    console.log("codeMirrorValidCode", codeMirrorValidCode);
    console.log("cell", cell);
    if (cell) {
        cell.model.sharedModel.source = codeMirrorValidCode;
    }
};
const getAIOptimizedCells = (notebookTracker) => {
    var _a, _b;
    const cellList = (_b = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.model) === null || _b === void 0 ? void 0 : _b.cells;
    if (cellList == undefined) {
        return [];
    }
    // In order to get the cell index, we need to iterate over the cells and call the `get` method
    // to see the cells in order. Otherwise, the cells are returned in a random order.
    const cells = [];
    for (let i = 0; i < cellList.length; i++) {
        const cellModel = cellList.get(i);
        const cell = {
            id: cellModel.id,
            cell_type: cellModel.type,
            code: cellModel.sharedModel.source
        };
        cells.push(cell);
    }
    return cells;
};
function createCodeCellAtIndexAndActivate(notebookTracker, index) {
    /*
        Create a new code cell at index and make it the active cell.
    */
    var _a;
    const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
    if (notebook === undefined) {
        return;
    }
    if (index > 0) {
        notebook.activeCellIndex = index - 1;
        // insertBelow makes the new cell the active cell
        _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.NotebookActions.insertBelow(notebook);
    }
    else {
        notebook.activeCellIndex = 0;
        // insertAbove makes the new cell the active cell
        _jupyterlab_notebook__WEBPACK_IMPORTED_MODULE_0__.NotebookActions.insertAbove(notebook);
    }
}
const didCellExecutionError = (cell) => {
    var _a;
    /*
        Check the cell's output for an error.
    */
    const outputs = ((_a = cell === null || cell === void 0 ? void 0 : cell.model.outputs) === null || _a === void 0 ? void 0 : _a.toJSON()) || [];
    return outputs.some(output => output.output_type === "error");
};
const getNotebookName = (notebookTracker) => {
    var _a;
    const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
    return (notebook === null || notebook === void 0 ? void 0 : notebook.title.label) || 'Untitled';
};
const highlightCodeCell = (notebookTracker, codeCellID) => {
    var _a;
    /*
        Briefly highlights a code cell, to draw the user's attention to it.
    */
    const notebook = (_a = notebookTracker.currentWidget) === null || _a === void 0 ? void 0 : _a.content;
    const cell = notebook === null || notebook === void 0 ? void 0 : notebook.widgets.find(cell => cell.model.id === codeCellID);
    if (cell) {
        const cellElement = cell.node;
        const originalBackground = cellElement.style.background;
        // Add a yellow highlight
        cellElement.style.background = 'var(--purple-400)';
        // Remove highlight after 500ms
        cellElement.style.transition = 'background 0.5s ease';
        setTimeout(() => {
            cellElement.style.background = originalBackground;
        }, 500);
    }
};
const highlightLineOfCodeInCodeCell = (notebookTracker, codeCellID, lineNumber) => {
    /*
        Briefly highlights a specific line in a code cell, to draw the user's attention to it.
        
        Args:
            notebookTracker: The notebook tracker.
            codeCellID: The ID of the code cell.
            lineNumber: The 0-indexed line number to highlight.
    */
    // Get the cell with the given ID
    const cell = getCellByID(notebookTracker, codeCellID);
    if (!cell) {
        return;
    }
    // Get the cell's editor
    const editor = cell.editor;
    if (!editor) {
        return;
    }
    // We expect the line number to be 0-indexed. To be safe, if the line number is out of bounds, we clamp it.
    const lines = editor.model.sharedModel.source.split('\n');
    const targetLine = Math.min(Math.max(lineNumber, 0), lines.length - 1);
    // Find the line element in the DOM
    const cmEditor = cell.node.querySelector('.jp-Editor');
    if (!cmEditor) {
        return;
    }
    // Find all line elements and get the one at the target index
    const lineElements = cmEditor.querySelectorAll('.cm-line');
    if (targetLine >= lineElements.length) {
        return;
    }
    const lineElement = lineElements[targetLine];
    if (!lineElement) {
        return;
    }
    // Store the original background color
    const originalBackground = lineElement.style.background;
    // Change the background color to highlight the line
    lineElement.style.background = 'var(--purple-400)';
    lineElement.style.transition = 'background 0.5s ease';
    // Reset the background color after a delay
    setTimeout(() => {
        lineElement.style.background = originalBackground;
    }, 2000);
};
const scrollToCell = (notebookTracker, cellID, lineNumber) => {
    // First activate the cell
    setActiveCellByID(notebookTracker, cellID);
    // Get the cell
    const cell = getCellByID(notebookTracker, cellID);
    if (!cell) {
        return;
    }
    // Get the cell's editor
    const editor = cell.editor;
    if (!editor) {
        return;
    }
    // Make the cell node visible by scrolling to it
    const cellNode = cell.node;
    if (cellNode) {
        cellNode.scrollIntoView({ behavior: 'smooth', block: 'center' });
        // Wait for the scroll animation to complete before highlighting the line
        // The default smooth scroll takes about 300-500ms to complete
        setTimeout(() => {
            if (lineNumber !== undefined) {
                highlightLineOfCodeInCodeCell(notebookTracker, cellID, lineNumber);
            }
        }, 500);
    }
};


/***/ }),

/***/ "./lib/utils/scroll.js":
/*!*****************************!*\
  !*** ./lib/utils/scroll.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   scrollToDiv: () => (/* binding */ scrollToDiv)
/* harmony export */ });
// Helper function to scroll to div
const scrollToDiv = (div) => {
    setTimeout(() => {
        const divContainer = div.current;
        if (divContainer) {
            divContainer.scrollTo({
                top: divContainer.scrollHeight,
                behavior: 'smooth'
            });
        }
    }, 100);
};


/***/ }),

/***/ "./lib/utils/sleep.js":
/*!****************************!*\
  !*** ./lib/utils/sleep.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   sleep: () => (/* binding */ sleep)
/* harmony export */ });
/**
 * Pauses the execution of the program for a specified number of milliseconds.
 *
 * @param ms - The number of milliseconds to pause.
 */
function sleep(ms) {
    return new Promise((resolve) => setTimeout(resolve, ms));
}


/***/ }),

/***/ "./lib/utils/strings.js":
/*!******************************!*\
  !*** ./lib/utils/strings.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PYTHON_CODE_BLOCK_END_WITHOUT_NEW_LINE: () => (/* binding */ PYTHON_CODE_BLOCK_END_WITHOUT_NEW_LINE),
/* harmony export */   PYTHON_CODE_BLOCK_END_WITH_NEW_LINE: () => (/* binding */ PYTHON_CODE_BLOCK_END_WITH_NEW_LINE),
/* harmony export */   PYTHON_CODE_BLOCK_START_WITHOUT_NEW_LINE: () => (/* binding */ PYTHON_CODE_BLOCK_START_WITHOUT_NEW_LINE),
/* harmony export */   PYTHON_CODE_BLOCK_START_WITH_NEW_LINE: () => (/* binding */ PYTHON_CODE_BLOCK_START_WITH_NEW_LINE),
/* harmony export */   addMarkdownCodeFormatting: () => (/* binding */ addMarkdownCodeFormatting),
/* harmony export */   getCodeBlockFromMessage: () => (/* binding */ getCodeBlockFromMessage),
/* harmony export */   getContentStringFromMessage: () => (/* binding */ getContentStringFromMessage),
/* harmony export */   removeMarkdownCodeFormatting: () => (/* binding */ removeMarkdownCodeFormatting),
/* harmony export */   splitStringWithCodeBlocks: () => (/* binding */ splitStringWithCodeBlocks),
/* harmony export */   stripAnsiCodes: () => (/* binding */ stripAnsiCodes)
/* harmony export */ });
const PYTHON_CODE_BLOCK_START_WITH_NEW_LINE = '```python\n';
const PYTHON_CODE_BLOCK_START_WITHOUT_NEW_LINE = '```python';
const PYTHON_CODE_BLOCK_END_WITH_NEW_LINE = '\n```';
const PYTHON_CODE_BLOCK_END_WITHOUT_NEW_LINE = '```';
/*
    Given a message from the OpenAI API, returns the content as a string.
    If the content is not a string, returns undefined.
*/
const getContentStringFromMessage = (message) => {
    // TODO: We can't assume this is a string. We need to handle the other
    // return options
    if (message.role === 'user' || message.role === 'assistant') {
        // Don't convert the message to a string if the content is undefined or null
        // so we can continue to use type checking
        if (message.content === undefined || message.content === null) {
            return undefined;
        }
        return message.content;
    }
    return undefined;
};
/*
    Given a string like "Hello ```python print('Hello, world!')```",
    returns ["Hello", "```python print('Hello, world!')```"]

    This is useful for taking an AI generated message and displaying the code in
    code blocks and the rest of the message in plain text.
*/
const splitStringWithCodeBlocks = (message) => {
    const messageContent = getContentStringFromMessage(message);
    if (!messageContent) {
        return [];
    }
    const parts = messageContent.split(/(```[\s\S]*?```)/);
    // Remove empty strings caused by consecutive delimiters, if any
    return parts.filter(part => part.trim() !== "");
};
/*
    Given a string like "Hello ```python print('Hello, world!')```",
    returns "```python print('Hello, world!')```"
*/
const getCodeBlockFromMessage = (message) => {
    const parts = splitStringWithCodeBlocks(message);
    return parts.find(part => part.startsWith('```'));
};
/*
    To display code in markdown, we need to take input values like this:

    ```python x + 1```

    And turn them into this:

    ```python
    x + 1
    ```

    Sometimes, we also want to trim the code to remove any leading or trailing whitespace. For example,
    when we're displaying the code in the chat history this is useful. Othertimes we don't want to trim.
    For example, when we're displaying the code in the active cell, we want to keep the users's whitespace.
    This is important for showing diffs. If the code cell contains no code, the first line will be marked as
    removed in the code diff. To ensure the diff lines up with the code, we need to leave this whitespace line.
*/
const addMarkdownCodeFormatting = (code, trim) => {
    var _a;
    if (code === undefined) {
        return undefined;
    }
    let codeWithoutBackticks = code;
    // If the code already has the code formatting backticks, remove them 
    // so we can add them back in the correct format
    if (code.split(PYTHON_CODE_BLOCK_START_WITHOUT_NEW_LINE).length > 1) {
        const parts = code.split(PYTHON_CODE_BLOCK_START_WITHOUT_NEW_LINE);
        if (parts.length > 1 && parts[1] != null) {
            const endParts = parts[1].split(PYTHON_CODE_BLOCK_END_WITHOUT_NEW_LINE);
            codeWithoutBackticks = (_a = endParts[0]) !== null && _a !== void 0 ? _a : '';
        }
    }
    else {
        codeWithoutBackticks = code;
    }
    if (trim) {
        codeWithoutBackticks = codeWithoutBackticks.trim();
    }
    // Note: We add a space after the code because for some unknown reason, the markdown 
    // renderer is cutting off the last character in the code block.
    return `${PYTHON_CODE_BLOCK_START_WITH_NEW_LINE}${codeWithoutBackticks} ${PYTHON_CODE_BLOCK_END_WITH_NEW_LINE}`;
};
/*
    To write code in a Jupyter Code Cell, we need to take inputs like this:

    ```python
    x + 1
    ```

    And turn them into this:

    x + 1

    Jupyter does not need the backticks.
*/
const removeMarkdownCodeFormatting = (code) => {
    if (code.split(PYTHON_CODE_BLOCK_START_WITH_NEW_LINE).length > 1) {
        const parts = code.split(PYTHON_CODE_BLOCK_START_WITH_NEW_LINE)[1].split(PYTHON_CODE_BLOCK_END_WITH_NEW_LINE)[0];
        return parts;
    }
    return code;
};
/*
    Remove ANSI escape sequences from text.
    For example, this is useful for removing the escape
    codes from the error traceback.
*/
const stripAnsiCodes = (text) => {
    // eslint-disable-next-line no-control-regex
    const ansiEscape = /\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])/g;
    return text.replace(ansiEscape, '');
};


/***/ }),

/***/ "./lib/utils/stripe.js":
/*!*****************************!*\
  !*** ./lib/utils/stripe.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   STRIPE_PAYMENT_LINK: () => (/* binding */ STRIPE_PAYMENT_LINK)
/* harmony export */ });
const STRIPE_PAYMENT_LINK = "https://jl76z192i0.execute-api.us-east-1.amazonaws.com/Prod/create_checkout_session/";


/***/ }),

/***/ "./lib/utils/user.js":
/*!***************************!*\
  !*** ./lib/utils/user.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getOperatingSystem: () => (/* binding */ getOperatingSystem)
/* harmony export */ });
const getOperatingSystem = () => {
    if (navigator.userAgent.includes('Macintosh')) {
        return 'mac';
    }
    else {
        return 'windows';
    }
};


/***/ }),

/***/ "./lib/utils/websocket/websocketClient.js":
/*!************************************************!*\
  !*** ./lib/utils/websocket/websocketClient.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CompletionWebsocketClient: () => (/* binding */ CompletionWebsocketClient),
/* harmony export */   MitoAIError: () => (/* binding */ MitoAIError)
/* harmony export */ });
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @jupyterlab/coreutils */ "webpack/sharing/consume/default/@jupyterlab/coreutils");
/* harmony import */ var _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @jupyterlab/services */ "webpack/sharing/consume/default/@jupyterlab/services");
/* harmony import */ var _jupyterlab_services__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_jupyterlab_services__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @lumino/coreutils */ "webpack/sharing/consume/default/@lumino/coreutils");
/* harmony import */ var _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @lumino/signaling */ "webpack/sharing/consume/default/@lumino/signaling");
/* harmony import */ var _lumino_signaling__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_lumino_signaling__WEBPACK_IMPORTED_MODULE_3__);




const SERVICE_URL = 'mito-ai/completions';
/**
 * Error thrown by Mito AI completion
 */
class MitoAIError extends Error {
    constructor(message, options = {}) {
        super(message, { cause: options.cause });
        this.name = 'MitoAIError';
        this.hint = options.hint;
        if (options.cause && typeof options.cause === 'object' && 'stack' in options.cause) {
            this.stack = `${this.stack}\nCaused by: ${options.cause.stack}`;
        }
    }
}
/**
 * Mito AI completion client
 *
 * It communicates with the backend over a WebSocket to allow streaming answer.
 */
class CompletionWebsocketClient {
    /**
     * Create a new completion client.
     */
    constructor(options = {}) {
        var _a;
        /**
         * Maximum number of reconnection attempts
         */
        this._maxReconnectAttempts = 5;
        /**
         * Current reconnection attempt
         */
        this._reconnectAttempt = 0;
        this._isDisposed = false;
        this._messages = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Stream(this);
        this._socket = null;
        this._stream = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Stream(this);
        this._ready = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
        /**
         * Dictionary mapping message IDs to Promise resolvers.
         */
        this._pendingRepliesMap = new Map();
        this._connectionStatus = new _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Stream(this);
        this.serverSettings =
            (_a = options.serverSettings) !== null && _a !== void 0 ? _a : _jupyterlab_services__WEBPACK_IMPORTED_MODULE_1__.ServerConnection.makeSettings();
        this._ready = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
    }
    /**
     * Whether the websocket client is disposed.
     */
    get isDisposed() {
        return this._isDisposed;
    }
    /**
     * Completion chunk stream.
     */
    get messages() {
        return this._messages;
    }
    /**
     * Completion chunk stream.
     */
    get stream() {
        return this._stream;
    }
    /**
     * Promise that resolves when the websocket connection is ready.
     */
    get ready() {
        return this._ready.promise;
    }
    /**
     * Stream of connection status events
     */
    get connectionStatus() {
        return this._connectionStatus;
    }
    /**
     * Check if websocket is currently connected
     */
    get isConnected() {
        return this._socket !== null && this._socket.readyState === WebSocket.OPEN;
    }
    /**
     * Dispose the websocket client.
     */
    dispose() {
        if (this.isDisposed) {
            return;
        }
        this._isDisposed = true;
        // Clean up socket.
        const socket = this._socket;
        if (socket) {
            this._socket = null;
            socket.onopen = () => undefined;
            socket.onerror = () => undefined;
            socket.onmessage = () => undefined;
            socket.onclose = () => undefined;
            socket.close();
        }
        this._stream.stop();
        for (const resolver of this._pendingRepliesMap.values()) {
            resolver.reject(new Error('Completion websocket client disposed'));
        }
        this._pendingRepliesMap.clear();
        _lumino_signaling__WEBPACK_IMPORTED_MODULE_3__.Signal.clearData(this);
    }
    /**
     * Initializes the WebSocket connection to the completion backend. This
     * must be awaited before calling any other method.
     */
    async initialize() {
        await this._initialize();
    }
    /**
     * Sends a message across the WebSocket. Promise resolves to the message ID
     * when the server sends the same message back, acknowledging receipt.
     * Automatically ensures the websocket is initialized before sending.
     */
    sendMessage(message) {
        // Create a Promise for the eventual result
        return new Promise((resolve, reject) => {
            // First check if we need to reconnect
            void Promise.resolve().then(async () => {
                try {
                    // If the socket is not connected, try to reconnect first
                    if (this._socket === null || this._socket.readyState !== WebSocket.OPEN) {
                        try {
                            console.log('Connection is closed, attempting to reconnect before sending message...');
                            // Reset the ready promise since we're going to reconnect
                            this._ready = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
                            await this.reconnect();
                            console.log('Successfully reconnected, now sending message');
                        }
                        catch (reconnectError) {
                            console.error('Failed to reconnect websocket:', reconnectError);
                            // If the error is a MitoAIError, propagate it directly to preserve the helpful message
                            if (reconnectError instanceof MitoAIError) {
                                reject(reconnectError);
                            }
                            else {
                                reject(new Error('Failed to reconnect websocket before sending message'));
                            }
                            return;
                        }
                    }
                    if (this._socket && this._socket.readyState === WebSocket.OPEN) {
                        const pendingReply = new _lumino_coreutils__WEBPACK_IMPORTED_MODULE_2__.PromiseDelegate();
                        this._pendingRepliesMap.set(message.message_id, pendingReply);
                        pendingReply.promise.then(resolve).catch(reject);
                        // Send the message
                        this._socket.send(JSON.stringify(message));
                    }
                    else {
                        reject(new Error('Inline completion websocket not initialized'));
                    }
                }
                catch (error) {
                    reject(error);
                }
            });
        });
    }
    _onMessage(message) {
        /**
         * Emit unconditionally the message to interested parties.
         */
        this._messages.emit(message);
        /**
         * Dispatch completion messages
         */
        switch (message.type) {
            case 'chunk': {
                this._stream.emit(message);
                break;
            }
            case 'reply': {
                const resolver = this._pendingRepliesMap.get(message.parent_id);
                if (resolver) {
                    resolver.resolve(message);
                    this._pendingRepliesMap.delete(message.parent_id);
                }
                else {
                    console.warn('Unhandled mito ai completion message', message);
                }
                break;
            }
            // default: /* no-op */
        }
    }
    _onOpen(_) {
        console.log('Mito AI completion websocket connected');
        this._ready.resolve();
        this._connectionStatus.emit('connected');
    }
    _onClose(_e) {
        this._ready.reject(new Error('Completion websocket disconnected'));
        console.error('Completion websocket disconnected');
        this._connectionStatus.emit('disconnected');
    }
    async _initialize() {
        if (this.isDisposed || this._socket) {
            return;
        }
        console.log('Creating a new websocket connection for mito-ai completions...');
        const { appendToken, token, WebSocket, wsUrl } = this.serverSettings;
        let url = _jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.join(wsUrl, SERVICE_URL);
        if (appendToken && token !== '') {
            url += `?token=${encodeURIComponent(token)}`;
        }
        // Check if the service is available before attempting to connect
        const answer = await fetch(_jupyterlab_coreutils__WEBPACK_IMPORTED_MODULE_0__.URLExt.join(this.serverSettings.baseUrl, SERVICE_URL), {
            method: 'HEAD',
        });
        if (!answer.ok) {
            const message = answer.status == 404
                ? 'Mito AI extension not enabled.'
                : `Mito AI completion not available; error ${answer.status} ${answer.statusText}`;
            const hint = answer.status == 404
                ? 'You can enable it by running in a cell `!jupyter server extension enable mito_ai`. Then restart the application.'
                : undefined;
            this._messages.emit({
                type: 'error',
                error_type: 'HTTPError',
                title: message,
                hint
            });
            this._ready.reject(new MitoAIError(message, {
                cause: answer,
                hint
            }));
            return this._ready.promise;
        }
        const socket = (this._socket = new WebSocket(url));
        socket.onopen = e => {
            this._onOpen(e);
        };
        socket.onclose = e => {
            this._onClose(e);
        };
        socket.onerror = e => {
            this._ready.reject(e);
        };
        socket.onmessage = msg => {
            if (msg.data) {
                this._onMessage(JSON.parse(msg.data));
            }
        };
        await this._ready.promise;
    }
    /**
     * Attempt to reconnect the websocket with exponential backoff.
     * @param forceReset - If true (default), resets the reconnection attempt counter to 0,
     * effectively starting a fresh sequence of reconnection attempts. When false, maintains
     * the current attempt count, which is used during recursive reconnection attempts within the method.
     * @returns Promise that resolves when reconnection is successful or rejects after max attempts
     * @throws Error if the client is disposed or max reconnection attempts are exceeded
     */
    async reconnect(forceReset = true) {
        if (this._isDisposed) {
            throw new Error('Client is disposed');
        }
        // Reset _reconnectAttempt if this is a manual reconnect
        if (forceReset) {
            this._reconnectAttempt = 0;
        }
        if (this._reconnectAttempt >= this._maxReconnectAttempts) {
            throw new Error(`Failed to reconnect after ${this._maxReconnectAttempts} attempts`);
        }
        // Clean up any existing socket
        if (this._socket) {
            this._socket.close();
            this._socket = null;
        }
        // Calculate delay using exponential backoff
        // First attempt is immediate, then 1s, 2s, 4s, 8s
        const delay = this._reconnectAttempt === 0 ? 0 : Math.pow(2, this._reconnectAttempt - 1) * 1000;
        if (delay > 0) {
            console.log(`Attempting to reconnect in ${delay / 1000}s (attempt ${this._reconnectAttempt + 1}/${this._maxReconnectAttempts})...`);
            await new Promise(resolve => setTimeout(resolve, delay));
        }
        this._reconnectAttempt++;
        try {
            // Reinitialize connection
            await this._initialize();
            // Reset reconnect attempt counter on success
            this._reconnectAttempt = 0;
        }
        catch (error) {
            console.error(`Reconnection attempt ${this._reconnectAttempt} failed:`, error);
            // If the error is a MitoAIError (like the extension not being enabled),
            // propagate it immediately instead of retrying
            if (error instanceof MitoAIError) {
                throw error;
            }
            // Try again recursively with exponential backoff
            return this.reconnect(false);
        }
    }
}


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/ChatDropdown.css":
/*!**********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/ChatDropdown.css ***!
  \**********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.chat-dropdown {
  /* Position the dropdown in the right place*/
  position: absolute;
  z-index: 9999;
  bottom: 100%;
  margin-bottom: 5px;

  /* Style the dropdown */
  display: flex;
  justify-content: space-evenly;
  align-items: baseline;
  width: 100%;
}

.chat-dropdown-list {
  position: relative;
  border: 0px;
  border-radius: 5px;
  background-color: var(--jp-layout-color1);
  list-style-type: none;
  padding: 0;
  margin: 0;
  width: 100%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chat-dropdown-item {
  padding: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--jp-content-font-color1);
}

.chat-dropdown-item:hover,
.chat-dropdown-item.selected {
  background-color: var(--jp-layout-color3);
}

.chat-dropdown-item:first-child {
  /* Add rounded corners to the top of the first selected dropdown item */
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

.chat-dropdown-item:last-child {
  /* Add rounded corners to the bottom of the last selected dropdown item */
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

.chat-dropdown-item-type {
  color: var(--jp-brand-color1);
  font-family: var(--jp-code-font-family);
  min-width: 35px;
  width: 35px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dropdown-item-name {
  font-size: 15px;
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-dropdown-item-parent-df {
  color: var(--muted-text-color);
  font-size: 12px;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdown-item-disabled:hover {
  background-color: inherit;
}
`, "",{"version":3,"sources":["webpack://./style/ChatDropdown.css"],"names":[],"mappings":"AAAA;EACE,4CAA4C;EAC5C,kBAAkB;EAClB,aAAa;EACb,YAAY;EACZ,kBAAkB;;EAElB,uBAAuB;EACvB,aAAa;EACb,6BAA6B;EAC7B,qBAAqB;EACrB,WAAW;AACb;;AAEA;EACE,kBAAkB;EAClB,WAAW;EACX,kBAAkB;EAClB,yCAAyC;EACzC,qBAAqB;EACrB,UAAU;EACV,SAAS;EACT,WAAW;EACX,wCAAwC;AAC1C;;AAEA;EACE,YAAY;EACZ,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,oCAAoC;AACtC;;AAEA;;EAEE,yCAAyC;AAC3C;;AAEA;EACE,uEAAuE;EACvE,2BAA2B;EAC3B,4BAA4B;AAC9B;;AAEA;EACE,yEAAyE;EACzE,8BAA8B;EAC9B,+BAA+B;AACjC;;AAEA;EACE,6BAA6B;EAC7B,uCAAuC;EACvC,eAAe;EACf,WAAW;EACX,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,eAAe;EACf,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,8BAA8B;EAC9B,eAAe;EACf,gBAAgB;EAChB,mBAAmB;EACnB,gBAAgB;EAChB,uBAAuB;AACzB;;AAEA;EACE,YAAY;EACZ,mBAAmB;AACrB;;AAEA;EACE,yBAAyB;AAC3B","sourcesContent":[".chat-dropdown {\n  /* Position the dropdown in the right place*/\n  position: absolute;\n  z-index: 9999;\n  bottom: 100%;\n  margin-bottom: 5px;\n\n  /* Style the dropdown */\n  display: flex;\n  justify-content: space-evenly;\n  align-items: baseline;\n  width: 100%;\n}\n\n.chat-dropdown-list {\n  position: relative;\n  border: 0px;\n  border-radius: 5px;\n  background-color: var(--jp-layout-color1);\n  list-style-type: none;\n  padding: 0;\n  margin: 0;\n  width: 100%;\n  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n}\n\n.chat-dropdown-item {\n  padding: 8px;\n  cursor: pointer;\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  color: var(--jp-content-font-color1);\n}\n\n.chat-dropdown-item:hover,\n.chat-dropdown-item.selected {\n  background-color: var(--jp-layout-color3);\n}\n\n.chat-dropdown-item:first-child {\n  /* Add rounded corners to the top of the first selected dropdown item */\n  border-top-left-radius: 5px;\n  border-top-right-radius: 5px;\n}\n\n.chat-dropdown-item:last-child {\n  /* Add rounded corners to the bottom of the last selected dropdown item */\n  border-bottom-left-radius: 5px;\n  border-bottom-right-radius: 5px;\n}\n\n.chat-dropdown-item-type {\n  color: var(--jp-brand-color1);\n  font-family: var(--jp-code-font-family);\n  min-width: 35px;\n  width: 35px;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.chat-dropdown-item-name {\n  font-size: 15px;\n  display: flex;\n  align-items: center;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.chat-dropdown-item-parent-df {\n  color: var(--muted-text-color);\n  font-size: 12px;\n  margin-left: 4px;\n  white-space: nowrap;\n  overflow: hidden;\n  text-overflow: ellipsis;\n}\n\n.dropdown-item-disabled {\n  opacity: 0.5;\n  cursor: not-allowed;\n}\n\n.dropdown-item-disabled:hover {\n  background-color: inherit;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/ChatInput.css":
/*!*******************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/ChatInput.css ***!
  \*******************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.chat-input-container {
  position: sticky;
  bottom: 0;
  margin: 10px 0;
  margin-top: auto;
  border-radius: 3px;
  border: 1px solid var(--grey-300);
  background-color: var(--chat-user-message-background-color);
}

.chat-input {
  outline: none;
  border: none;
  resize: none;
  width: 100%;
  padding: 10px;
  overflow-y: hidden;
  box-sizing: border-box;
  flex-shrink: 0 !important;
  background-color: white;
}

@keyframes glow {
  0% {
    box-shadow: 0 0 0 0 var(--glow-color);
  }
  50% {
    box-shadow: 0 0 10px 3px var(--glow-color);
  }
  100% {
    box-shadow: 0 0 0 0 var(--glow-color);
  }
}

.chat-input-container:has(.chat-input.agent-mode) {
  border: 1px solid var(--purple-500);
  animation: glow 1s ease-in-out;
  --glow-color: var(--purple-500);
}

.active-cell-preview-container {
  padding: 10px;
  background-color: var(--chat-user-message-background-color);
}
`, "",{"version":3,"sources":["webpack://./style/ChatInput.css"],"names":[],"mappings":"AAAA;EACE,gBAAgB;EAChB,SAAS;EACT,cAAc;EACd,gBAAgB;EAChB,kBAAkB;EAClB,iCAAiC;EACjC,2DAA2D;AAC7D;;AAEA;EACE,aAAa;EACb,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,aAAa;EACb,kBAAkB;EAClB,sBAAsB;EACtB,yBAAyB;EACzB,uBAAuB;AACzB;;AAEA;EACE;IACE,qCAAqC;EACvC;EACA;IACE,0CAA0C;EAC5C;EACA;IACE,qCAAqC;EACvC;AACF;;AAEA;EACE,mCAAmC;EACnC,8BAA8B;EAC9B,+BAA+B;AACjC;;AAEA;EACE,aAAa;EACb,2DAA2D;AAC7D","sourcesContent":[".chat-input-container {\n  position: sticky;\n  bottom: 0;\n  margin: 10px 0;\n  margin-top: auto;\n  border-radius: 3px;\n  border: 1px solid var(--grey-300);\n  background-color: var(--chat-user-message-background-color);\n}\n\n.chat-input {\n  outline: none;\n  border: none;\n  resize: none;\n  width: 100%;\n  padding: 10px;\n  overflow-y: hidden;\n  box-sizing: border-box;\n  flex-shrink: 0 !important;\n  background-color: white;\n}\n\n@keyframes glow {\n  0% {\n    box-shadow: 0 0 0 0 var(--glow-color);\n  }\n  50% {\n    box-shadow: 0 0 10px 3px var(--glow-color);\n  }\n  100% {\n    box-shadow: 0 0 0 0 var(--glow-color);\n  }\n}\n\n.chat-input-container:has(.chat-input.agent-mode) {\n  border: 1px solid var(--purple-500);\n  animation: glow 1s ease-in-out;\n  --glow-color: var(--purple-500);\n}\n\n.active-cell-preview-container {\n  padding: 10px;\n  background-color: var(--chat-user-message-background-color);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/ChatMessage.css":
/*!*********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/ChatMessage.css ***!
  \*********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.message {
  position: relative;
  height: min-content;
  box-sizing: border-box;
  width: 100%;
  font-size: 14px;
  border-radius: 5px;
  padding-left: 10px;
  padding-right: 10px;
}

.message:not(.chat-input) {
  margin-bottom: 20px;
}

.message:hover .message-start-editing-button {
  opacity: 1 !important;
}

.message-user {
  background-color: var(--chat-user-message-background-color);
  color: var(--chat-user-message-font-color);
  padding: 10px;
}

.message-assistant-chat {
  color: var(--chat-assistant-message-font-color);
}

.chat-message-buttons {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.chat-taskpane-smart-debug-error-message {
  white-space: pre;
  font-family: monospace;
  margin: 0;
  overflow-x: auto;
}

.message-text {
  align-items: center;
}

/* Message Action Buttons Container */
.message-action-buttons {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  border-radius: 4px;
  overflow: hidden; /* Ensures inner buttons don't break the rounded corners */
}

/* Common styles for action buttons */
.message-action-buttons button,
.message-start-editing-button {
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.2s ease-in-out,
    background-color 0.2s ease-in-out;
  background-color: var(--jp-layout-color3);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--jp-content-font-color1);
}

/* Action buttons in the group */
.message-action-buttons button {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 0; /* Remove individual button radius */
}

/* Add subtle separator between buttons */
.message-action-buttons button:not(:last-child) {
  border-right: 1px solid var(--jp-border-color1);
}

/* Remove the individual button radius styles since we're handling it at the container level */
.message-action-buttons button:first-child,
.message-action-buttons button:last-child {
  border-radius: 0;
}

/* Standalone edit button */
.message-start-editing-button {
  position: relative;
  padding: 4px;
  border-radius: 4px;
}

/* SVG icon color */
.message-action-buttons button svg {
  color: var(--jp-content-font-color1);
}

/* Hover states */
.message-action-buttons button:hover,
.message-start-editing-button:hover {
  background-color: var(--jp-layout-color4);
}

/* Show buttons on message hover */
.message:hover .message-action-buttons button,
.message:hover .message-start-editing-button {
  opacity: 1;
}

.message-edit-buttons {
  display: flex;
  gap: 8px;
  padding: 5px;
}

.message-edit-buttons button {
  padding: 4px 12px;
  border-radius: 4px;
  background-color: var(--jp-layout-color1);
  color: var(--jp-content-font-color1);
  border: 1px solid var(--jp-border-color1);
  cursor: pointer;
}

.message-edit-buttons button:hover {
  background-color: var(--jp-layout-color2);
}

.chat-message-alert {
  background-color: var(--purple-300);
  border-radius: 5px;
  padding: 10px;
  border: 1px solid var(--purple-500);
  color: var(--grey-900);
}

.chat-message-alert a {
  color: var(--purple-700);
  text-decoration: underline;
}
`, "",{"version":3,"sources":["webpack://./style/ChatMessage.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,mBAAmB;EACnB,sBAAsB;EACtB,WAAW;EACX,eAAe;EACf,kBAAkB;EAClB,kBAAkB;EAClB,mBAAmB;AACrB;;AAEA;EACE,mBAAmB;AACrB;;AAEA;EACE,qBAAqB;AACvB;;AAEA;EACE,2DAA2D;EAC3D,0CAA0C;EAC1C,aAAa;AACf;;AAEA;EACE,+CAA+C;AACjD;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,QAAQ;EACR,gBAAgB;EAChB,mBAAmB;EACnB,eAAe;AACjB;;AAEA;EACE,gBAAgB;EAChB,sBAAsB;EACtB,SAAS;EACT,gBAAgB;AAClB;;AAEA;EACE,mBAAmB;AACrB;;AAEA,qCAAqC;AACrC;EACE,kBAAkB;EAClB,WAAW;EACX,UAAU;EACV,aAAa;EACb,kBAAkB;EAClB,gBAAgB,EAAE,0DAA0D;AAC9E;;AAEA,qCAAqC;AACrC;;EAEE,eAAe;EACf,UAAU;EACV;;qCAEmC;EACnC,yCAAyC;EACzC,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,oCAAoC;AACtC;;AAEA,gCAAgC;AAChC;EACE,WAAW;EACX,YAAY;EACZ,UAAU;EACV,gBAAgB,EAAE,oCAAoC;AACxD;;AAEA,yCAAyC;AACzC;EACE,+CAA+C;AACjD;;AAEA,8FAA8F;AAC9F;;EAEE,gBAAgB;AAClB;;AAEA,2BAA2B;AAC3B;EACE,kBAAkB;EAClB,YAAY;EACZ,kBAAkB;AACpB;;AAEA,mBAAmB;AACnB;EACE,oCAAoC;AACtC;;AAEA,iBAAiB;AACjB;;EAEE,yCAAyC;AAC3C;;AAEA,kCAAkC;AAClC;;EAEE,UAAU;AACZ;;AAEA;EACE,aAAa;EACb,QAAQ;EACR,YAAY;AACd;;AAEA;EACE,iBAAiB;EACjB,kBAAkB;EAClB,yCAAyC;EACzC,oCAAoC;EACpC,yCAAyC;EACzC,eAAe;AACjB;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mCAAmC;EACnC,kBAAkB;EAClB,aAAa;EACb,mCAAmC;EACnC,sBAAsB;AACxB;;AAEA;EACE,wBAAwB;EACxB,0BAA0B;AAC5B","sourcesContent":[".message {\n  position: relative;\n  height: min-content;\n  box-sizing: border-box;\n  width: 100%;\n  font-size: 14px;\n  border-radius: 5px;\n  padding-left: 10px;\n  padding-right: 10px;\n}\n\n.message:not(.chat-input) {\n  margin-bottom: 20px;\n}\n\n.message:hover .message-start-editing-button {\n  opacity: 1 !important;\n}\n\n.message-user {\n  background-color: var(--chat-user-message-background-color);\n  color: var(--chat-user-message-font-color);\n  padding: 10px;\n}\n\n.message-assistant-chat {\n  color: var(--chat-assistant-message-font-color);\n}\n\n.chat-message-buttons {\n  display: flex;\n  flex-direction: row;\n  gap: 8px;\n  margin-top: 10px;\n  margin-bottom: 10px;\n  flex-wrap: wrap;\n}\n\n.chat-taskpane-smart-debug-error-message {\n  white-space: pre;\n  font-family: monospace;\n  margin: 0;\n  overflow-x: auto;\n}\n\n.message-text {\n  align-items: center;\n}\n\n/* Message Action Buttons Container */\n.message-action-buttons {\n  position: absolute;\n  bottom: 8px;\n  right: 8px;\n  display: flex;\n  border-radius: 4px;\n  overflow: hidden; /* Ensures inner buttons don't break the rounded corners */\n}\n\n/* Common styles for action buttons */\n.message-action-buttons button,\n.message-start-editing-button {\n  cursor: pointer;\n  opacity: 0;\n  transition:\n    opacity 0.2s ease-in-out,\n    background-color 0.2s ease-in-out;\n  background-color: var(--jp-layout-color3);\n  border: none;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  color: var(--jp-content-font-color1);\n}\n\n/* Action buttons in the group */\n.message-action-buttons button {\n  width: 28px;\n  height: 28px;\n  padding: 0;\n  border-radius: 0; /* Remove individual button radius */\n}\n\n/* Add subtle separator between buttons */\n.message-action-buttons button:not(:last-child) {\n  border-right: 1px solid var(--jp-border-color1);\n}\n\n/* Remove the individual button radius styles since we're handling it at the container level */\n.message-action-buttons button:first-child,\n.message-action-buttons button:last-child {\n  border-radius: 0;\n}\n\n/* Standalone edit button */\n.message-start-editing-button {\n  position: relative;\n  padding: 4px;\n  border-radius: 4px;\n}\n\n/* SVG icon color */\n.message-action-buttons button svg {\n  color: var(--jp-content-font-color1);\n}\n\n/* Hover states */\n.message-action-buttons button:hover,\n.message-start-editing-button:hover {\n  background-color: var(--jp-layout-color4);\n}\n\n/* Show buttons on message hover */\n.message:hover .message-action-buttons button,\n.message:hover .message-start-editing-button {\n  opacity: 1;\n}\n\n.message-edit-buttons {\n  display: flex;\n  gap: 8px;\n  padding: 5px;\n}\n\n.message-edit-buttons button {\n  padding: 4px 12px;\n  border-radius: 4px;\n  background-color: var(--jp-layout-color1);\n  color: var(--jp-content-font-color1);\n  border: 1px solid var(--jp-border-color1);\n  cursor: pointer;\n}\n\n.message-edit-buttons button:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.chat-message-alert {\n  background-color: var(--purple-300);\n  border-radius: 5px;\n  padding: 10px;\n  border: 1px solid var(--purple-500);\n  color: var(--grey-900);\n}\n\n.chat-message-alert a {\n  color: var(--purple-700);\n  text-decoration: underline;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/ChatTaskpane.css":
/*!**********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/ChatTaskpane.css ***!
  \**********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.chat-taskpane {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--chat-background-color) !important;
  --jp-sidebar-min-width: 350px;
  width: 100%;
  box-sizing: border-box;
  overflow-y: scroll;

  /* 
        Don't set padding on top from the taskpane so we can instead
        set the padding on the chat-taskpane-header instead to make 
        sure the sticky header covers all of the content behind it. 
    */
  padding-top: 0px;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 10px;
}

.chat-taskpane-header {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
  padding-top: 10px;
  padding-bottom: 5px;
  position: sticky;
  /* Make the header sticky */
  top: 0;
  /* Stick to the top of the container */
  background-color: var(--chat-background-color);
  /* Ensure background color covers content behind */
  z-index: 1;
  /* Ensure it stays above other content */
}

.chat-taskpane-header-title {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
}

.chat-taskpane-header-buttons {
  display: flex;
  gap: 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 10px;
}

.chat-empty-message {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  color: var(--muted-text-color);
  padding: 20px;
  /* Add container query support */
  container-type: inline-size;
}

.chat-empty-message .short-message {
  display: none;
}

/* Use container query instead of media query */
@container (max-width: 300px) {
  .chat-empty-message .long-message {
    display: none;
  }

  .chat-empty-message .short-message {
    display: block;
  }
}

.chat-loading-message {
  margin-top: 20px;
  margin-bottom: 20px;
}

.chat-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.submit-button {
  background-color: var(--purple-400);
  color: var(--purple-700);
  padding: 2px 10px;
}

.submit-button:hover {
  background-color: var(--purple-500);
  transition: background-color 0.2s ease-in-out;
}

.stop-agent-button {
  margin-top: 8px;
}

.stop-agent-button-content {
  display: flex;
  text-align: center;
  align-items: center;
  gap: 8px;
  justify-content: center;
}

.agent-controls {
  display: flex;
  gap: 8px;
  width: 100%;
}

.agent-start-button {
  flex: 1;
}

.agent-cancel-button {
  width: 32px;
  padding: 0;
}
`, "",{"version":3,"sources":["webpack://./style/ChatTaskpane.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;EACtB,YAAY;EACZ,yDAAyD;EACzD,6BAA6B;EAC7B,WAAW;EACX,sBAAsB;EACtB,kBAAkB;;EAElB;;;;KAIG;EACH,gBAAgB;EAChB,kBAAkB;EAClB,mBAAmB;EACnB,oBAAoB;AACtB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,yBAAyB;EACzB,mBAAmB;EACnB,iBAAiB;EACjB,mBAAmB;EACnB,gBAAgB;EAChB,2BAA2B;EAC3B,MAAM;EACN,sCAAsC;EACtC,8CAA8C;EAC9C,kDAAkD;EAClD,UAAU;EACV,wCAAwC;AAC1C;;AAEA;EACE,eAAe;EACf,iBAAiB;EACjB,SAAS;AACX;;AAEA;EACE,aAAa;EACb,QAAQ;AACV;;AAEA;EACE,OAAO;EACP,gBAAgB;EAChB,oBAAoB;AACtB;;AAEA;EACE,aAAa;EACb,uBAAuB;EACvB,mBAAmB;EACnB,YAAY;EACZ,kBAAkB;EAClB,8BAA8B;EAC9B,aAAa;EACb,gCAAgC;EAChC,2BAA2B;AAC7B;;AAEA;EACE,aAAa;AACf;;AAEA,+CAA+C;AAC/C;EACE;IACE,aAAa;EACf;;EAEA;IACE,cAAc;EAChB;AACF;;AAEA;EACE,gBAAgB;EAChB,mBAAmB;AACrB;;AAEA;EACE,aAAa;EACb,8BAA8B;EAC9B,mBAAmB;AACrB;;AAEA;EACE,mCAAmC;EACnC,wBAAwB;EACxB,iBAAiB;AACnB;;AAEA;EACE,mCAAmC;EACnC,6CAA6C;AAC/C;;AAEA;EACE,eAAe;AACjB;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,mBAAmB;EACnB,QAAQ;EACR,uBAAuB;AACzB;;AAEA;EACE,aAAa;EACb,QAAQ;EACR,WAAW;AACb;;AAEA;EACE,OAAO;AACT;;AAEA;EACE,WAAW;EACX,UAAU;AACZ","sourcesContent":[".chat-taskpane {\n  display: flex;\n  flex-direction: column;\n  height: 100%;\n  background-color: var(--chat-background-color) !important;\n  --jp-sidebar-min-width: 350px;\n  width: 100%;\n  box-sizing: border-box;\n  overflow-y: scroll;\n\n  /* \n        Don't set padding on top from the taskpane so we can instead\n        set the padding on the chat-taskpane-header instead to make \n        sure the sticky header covers all of the content behind it. \n    */\n  padding-top: 0px;\n  padding-left: 10px;\n  padding-right: 10px;\n  padding-bottom: 10px;\n}\n\n.chat-taskpane-header {\n  display: flex;\n  flex-direction: row;\n  justify-content: flex-end;\n  align-items: center;\n  padding-top: 10px;\n  padding-bottom: 5px;\n  position: sticky;\n  /* Make the header sticky */\n  top: 0;\n  /* Stick to the top of the container */\n  background-color: var(--chat-background-color);\n  /* Ensure background color covers content behind */\n  z-index: 1;\n  /* Ensure it stays above other content */\n}\n\n.chat-taskpane-header-title {\n  font-size: 14px;\n  font-weight: bold;\n  margin: 0;\n}\n\n.chat-taskpane-header-buttons {\n  display: flex;\n  gap: 8px;\n}\n\n.chat-messages {\n  flex: 1;\n  overflow-y: auto;\n  padding-bottom: 10px;\n}\n\n.chat-empty-message {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  height: 100%;\n  text-align: center;\n  color: var(--muted-text-color);\n  padding: 20px;\n  /* Add container query support */\n  container-type: inline-size;\n}\n\n.chat-empty-message .short-message {\n  display: none;\n}\n\n/* Use container query instead of media query */\n@container (max-width: 300px) {\n  .chat-empty-message .long-message {\n    display: none;\n  }\n\n  .chat-empty-message .short-message {\n    display: block;\n  }\n}\n\n.chat-loading-message {\n  margin-top: 20px;\n  margin-bottom: 20px;\n}\n\n.chat-controls {\n  display: flex;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.submit-button {\n  background-color: var(--purple-400);\n  color: var(--purple-700);\n  padding: 2px 10px;\n}\n\n.submit-button:hover {\n  background-color: var(--purple-500);\n  transition: background-color 0.2s ease-in-out;\n}\n\n.stop-agent-button {\n  margin-top: 8px;\n}\n\n.stop-agent-button-content {\n  display: flex;\n  text-align: center;\n  align-items: center;\n  gap: 8px;\n  justify-content: center;\n}\n\n.agent-controls {\n  display: flex;\n  gap: 8px;\n  width: 100%;\n}\n\n.agent-start-button {\n  flex: 1;\n}\n\n.agent-cancel-button {\n  width: 32px;\n  padding: 0;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/Citation.css":
/*!******************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/Citation.css ***!
  \******************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.citation-button {
    background-color: var(--purple-400);
    color: var(--purple-700);
    height: 14px;
    width: 14px;
    border-radius: 2px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    top: -0.5em; /* Makes it appear as superscript */
    vertical-align: baseline;
    margin-right: 2px;
}

.citation-button:hover {
    background-color: var(--purple-500);
}`, "",{"version":3,"sources":["webpack://./style/Citation.css"],"names":[],"mappings":"AAAA;IACI,mCAAmC;IACnC,wBAAwB;IACxB,YAAY;IACZ,WAAW;IACX,kBAAkB;IAClB,eAAe;IACf,eAAe;IACf,oBAAoB;IACpB,mBAAmB;IACnB,uBAAuB;IACvB,kBAAkB;IAClB,WAAW,EAAE,mCAAmC;IAChD,wBAAwB;IACxB,iBAAiB;AACrB;;AAEA;IACI,mCAAmC;AACvC","sourcesContent":[".citation-button {\n    background-color: var(--purple-400);\n    color: var(--purple-700);\n    height: 14px;\n    width: 14px;\n    border-radius: 2px;\n    font-size: 12px;\n    cursor: pointer;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    position: relative;\n    top: -0.5em; /* Makes it appear as superscript */\n    vertical-align: baseline;\n    margin-right: 2px;\n}\n\n.citation-button:hover {\n    background-color: var(--purple-500);\n}"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/CodeBlock.css":
/*!*******************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/CodeBlock.css ***!
  \*******************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.code-block-container {
  display: flex;
  flex-direction: column;

  background-color: var(--chat-background-color);
  border-radius: 3px;
  border: 1px solid var(--grey-300);
  overflow: hidden;
}

.code-block-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: end;

  width: 100%;
  background-color: var(--chat-user-message-background-color);
  border-bottom: 1px solid var(--grey-300);
  font-size: 0.8em;
}

.code-location {
  flex-grow: 1;
  margin-left: 5px;
  color: var(--chat-user-message-font-color);
}

.code-block-toolbar button {
  background-color: var(--chat-user-message-background-color);
  border: none;
  border-left: 1px solid var(--grey-300);
  border-radius: 0px;

  font-size: 0.8em;
  color: var(--chat-user-message-font-color);
}

.code-block-toolbar button:hover {
  background-color: var(--chat-background-color);
  color: var(--chat-assistant-message-font-color);
}
`, "",{"version":3,"sources":["webpack://./style/CodeBlock.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,sBAAsB;;EAEtB,8CAA8C;EAC9C,kBAAkB;EAClB,iCAAiC;EACjC,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,oBAAoB;;EAEpB,WAAW;EACX,2DAA2D;EAC3D,wCAAwC;EACxC,gBAAgB;AAClB;;AAEA;EACE,YAAY;EACZ,gBAAgB;EAChB,0CAA0C;AAC5C;;AAEA;EACE,2DAA2D;EAC3D,YAAY;EACZ,sCAAsC;EACtC,kBAAkB;;EAElB,gBAAgB;EAChB,0CAA0C;AAC5C;;AAEA;EACE,8CAA8C;EAC9C,+CAA+C;AACjD","sourcesContent":[".code-block-container {\n  display: flex;\n  flex-direction: column;\n\n  background-color: var(--chat-background-color);\n  border-radius: 3px;\n  border: 1px solid var(--grey-300);\n  overflow: hidden;\n}\n\n.code-block-toolbar {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  justify-content: end;\n\n  width: 100%;\n  background-color: var(--chat-user-message-background-color);\n  border-bottom: 1px solid var(--grey-300);\n  font-size: 0.8em;\n}\n\n.code-location {\n  flex-grow: 1;\n  margin-left: 5px;\n  color: var(--chat-user-message-font-color);\n}\n\n.code-block-toolbar button {\n  background-color: var(--chat-user-message-background-color);\n  border: none;\n  border-left: 1px solid var(--grey-300);\n  border-radius: 0px;\n\n  font-size: 0.8em;\n  color: var(--chat-user-message-font-color);\n}\n\n.code-block-toolbar button:hover {\n  background-color: var(--chat-background-color);\n  color: var(--chat-assistant-message-font-color);\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/DropdownMenu.css":
/*!**********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/DropdownMenu.css ***!
  \**********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.dropdown-container {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  z-index: 1000;
  background-color: var(--jp-layout-color1);
  border: 1px solid var(--jp-layout-color2);
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  white-space: nowrap;
  height: 400px;
  min-width: 225px;
  max-width: 350px;
  overflow-y: auto;
}

/* Left-aligned dropdown */
.dropdown-menu-left {
  left: 0;
  right: auto;
}

/* Right-aligned dropdown */
.dropdown-menu-right {
  right: 0;
  left: auto;
}

.dropdown-item-row {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 2px;
  padding-right: 20px; /* Add padding to leave space for the scrollbar */
}

.dropdown-item-row:hover {
  background-color: var(--jp-layout-color2);
}

.dropdown-item-main {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  border: none;
  background: none;
  color: var(--jp-ui-font-color1);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.dropdown-item-icon {
  width: 20px;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropdown-item-label {
  padding-left: 3px; /* Add consistent padding */
}

.dropdown-item-disabled {
  opacity: 0.5;
  cursor: default;
}

/* 
  When using Lab Icons, we seem to get an extra div around the svg icon
  This makes sure the svg is aligned properly in that div
*/
.dropdown-item-icon > div, 
.dropdown-item-secondary > div{
  display: flex;
  align-items: center;
}
`, "",{"version":3,"sources":["webpack://./style/DropdownMenu.css"],"names":[],"mappings":"AAAA;EACE,kBAAkB;EAClB,qBAAqB;AACvB;;AAEA;EACE,kBAAkB;EAClB,qBAAqB;EACrB,aAAa;EACb,yCAAyC;EACzC,yCAAyC;EACzC,kBAAkB;EAClB,wCAAwC;EACxC,aAAa;EACb,sBAAsB;EACtB,gBAAgB;EAChB,mBAAmB;EACnB,aAAa;EACb,gBAAgB;EAChB,gBAAgB;EAChB,gBAAgB;AAClB;;AAEA,0BAA0B;AAC1B;EACE,OAAO;EACP,WAAW;AACb;;AAEA,2BAA2B;AAC3B;EACE,QAAQ;EACR,UAAU;AACZ;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,mBAAmB;EACnB,QAAQ;EACR,gBAAgB;EAChB,mBAAmB,EAAE,iDAAiD;AACxE;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,mBAAmB;EACnB,gBAAgB;EAChB,YAAY;EACZ,gBAAgB;EAChB,+BAA+B;EAC/B,OAAO;EACP,gBAAgB;EAChB,uBAAuB;EACvB,eAAe;AACjB;;AAEA;EACE,WAAW;EACX,eAAe;EACf,YAAY;EACZ,aAAa;EACb,mBAAmB;EACnB,uBAAuB;AACzB;;AAEA;EACE,iBAAiB,EAAE,2BAA2B;AAChD;;AAEA;EACE,YAAY;EACZ,eAAe;AACjB;;AAEA;;;CAGC;AACD;;EAEE,aAAa;EACb,mBAAmB;AACrB","sourcesContent":[".dropdown-container {\n  position: relative;\n  display: inline-block;\n}\n\n.dropdown-menu {\n  position: absolute;\n  top: calc(100% + 4px);\n  z-index: 1000;\n  background-color: var(--jp-layout-color1);\n  border: 1px solid var(--jp-layout-color2);\n  border-radius: 3px;\n  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n  display: flex;\n  flex-direction: column;\n  min-width: 200px;\n  white-space: nowrap;\n  height: 400px;\n  min-width: 225px;\n  max-width: 350px;\n  overflow-y: auto;\n}\n\n/* Left-aligned dropdown */\n.dropdown-menu-left {\n  left: 0;\n  right: auto;\n}\n\n/* Right-aligned dropdown */\n.dropdown-menu-right {\n  right: 0;\n  left: auto;\n}\n\n.dropdown-item-row {\n  display: flex;\n  flex-direction: row;\n  justify-content: space-between;\n  align-items: center;\n  gap: 8px;\n  padding: 4px 2px;\n  padding-right: 20px; /* Add padding to leave space for the scrollbar */\n}\n\n.dropdown-item-row:hover {\n  background-color: var(--jp-layout-color2);\n}\n\n.dropdown-item-main {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n  text-align: left;\n  border: none;\n  background: none;\n  color: var(--jp-ui-font-color1);\n  flex: 1;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  cursor: pointer;\n}\n\n.dropdown-item-icon {\n  width: 20px;\n  min-width: 20px;\n  height: 20px;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n}\n\n.dropdown-item-label {\n  padding-left: 3px; /* Add consistent padding */\n}\n\n.dropdown-item-disabled {\n  opacity: 0.5;\n  cursor: default;\n}\n\n/* \n  When using Lab Icons, we seem to get an extra div around the svg icon\n  This makes sure the svg is aligned properly in that div\n*/\n.dropdown-item-icon > div, \n.dropdown-item-secondary > div{\n  display: flex;\n  align-items: center;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/ErrorMimeRendererPlugin.css":
/*!*********************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/ErrorMimeRendererPlugin.css ***!
  \*********************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.error-mime-renderer-container {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: start;
  background-color: var(--jp-rendermime-error-background);
  width: 100%;
}

.error-mime-renderer-button {
  display: flex;
  flex-direction: row;
  justify-content: start;
  align-items: center;

  background-color: var(--jp-error-color3);
  border: var(--jp-error-color0) 1px solid;
  color: var(--jp-error-color0);

  margin: 10px;
  box-sizing: border-box;

  border-radius: 3px;
  font-size: 14px;
}

.error-mime-renderer-button:hover {
  background-color: var(--jp-error-color4);
  cursor: pointer;
}

.error-mime-renderer-button svg {
  margin-right: 5px;
}

.error-mime-renderer-button p {
  margin: 0;
}

.output-block {
  padding: 10px;
  background-color: var(--yellow-500);
  border-radius: 3px;
}

.output-block pre {
  color: var(--yellow-900) !important;
}

.collapse-button {
  background-color: transparent;
  border: none;
  color: var(--yellow-900);
  padding: 0;
  cursor: pointer;
}
`, "",{"version":3,"sources":["webpack://./style/ErrorMimeRendererPlugin.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,kBAAkB;EAClB,uDAAuD;EACvD,WAAW;AACb;;AAEA;EACE,aAAa;EACb,mBAAmB;EACnB,sBAAsB;EACtB,mBAAmB;;EAEnB,wCAAwC;EACxC,wCAAwC;EACxC,6BAA6B;;EAE7B,YAAY;EACZ,sBAAsB;;EAEtB,kBAAkB;EAClB,eAAe;AACjB;;AAEA;EACE,wCAAwC;EACxC,eAAe;AACjB;;AAEA;EACE,iBAAiB;AACnB;;AAEA;EACE,SAAS;AACX;;AAEA;EACE,aAAa;EACb,mCAAmC;EACnC,kBAAkB;AACpB;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,6BAA6B;EAC7B,YAAY;EACZ,wBAAwB;EACxB,UAAU;EACV,eAAe;AACjB","sourcesContent":[".error-mime-renderer-container {\n  display: flex;\n  flex-direction: row;\n  justify-content: start;\n  align-items: start;\n  background-color: var(--jp-rendermime-error-background);\n  width: 100%;\n}\n\n.error-mime-renderer-button {\n  display: flex;\n  flex-direction: row;\n  justify-content: start;\n  align-items: center;\n\n  background-color: var(--jp-error-color3);\n  border: var(--jp-error-color0) 1px solid;\n  color: var(--jp-error-color0);\n\n  margin: 10px;\n  box-sizing: border-box;\n\n  border-radius: 3px;\n  font-size: 14px;\n}\n\n.error-mime-renderer-button:hover {\n  background-color: var(--jp-error-color4);\n  cursor: pointer;\n}\n\n.error-mime-renderer-button svg {\n  margin-right: 5px;\n}\n\n.error-mime-renderer-button p {\n  margin: 0;\n}\n\n.output-block {\n  padding: 10px;\n  background-color: var(--yellow-500);\n  border-radius: 3px;\n}\n\n.output-block pre {\n  color: var(--yellow-900) !important;\n}\n\n.collapse-button {\n  background-color: transparent;\n  border: none;\n  color: var(--yellow-900);\n  padding: 0;\n  cursor: pointer;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/IconButton.css":
/*!********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/IconButton.css ***!
  \********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  cursor: pointer;
}
`, "",{"version":3,"sources":["webpack://./style/IconButton.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,6BAA6B;EAC7B,YAAY;EACZ,eAAe;AACjB","sourcesContent":[".icon-button {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  background-color: transparent;\n  border: none;\n  cursor: pointer;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/MarkdownMessage.css":
/*!*************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/MarkdownMessage.css ***!
  \*************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.markdown-message-part * .jp-RenderedHTMLCommon :not(pre) > code {
    background-color: var(--purple-300);
    color: var(--purple-700);
    border-radius: 3px;
    display: inline-flex;
    align-items: center;
}`, "",{"version":3,"sources":["webpack://./style/MarkdownMessage.css"],"names":[],"mappings":"AAAA;IACI,mCAAmC;IACnC,wBAAwB;IACxB,kBAAkB;IAClB,oBAAoB;IACpB,mBAAmB;AACvB","sourcesContent":[".markdown-message-part * .jp-RenderedHTMLCommon :not(pre) > code {\n    background-color: var(--purple-300);\n    color: var(--purple-700);\n    border-radius: 3px;\n    display: inline-flex;\n    align-items: center;\n}"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/PythonCode.css":
/*!********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/PythonCode.css ***!
  \********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.code-block-python-code pre {
  flex-grow: 1;
  height: 100%;
  width: 100%;
  margin: 0 !important;
  padding: 10px !important;
  font-size: 12px !important;
  overflow-x: auto;
}

.code-block-python-code code {
  white-space: pre !important;
}

.code-block-python-code .jp-RenderedHTMLCommon > *:last-child {
  /* 
        Remove the default Jupyter ending margin 
        so that the rendered code is flush with the bottom
        of the CodeMessagePart
    */
  margin-bottom: 0px;
}
`, "",{"version":3,"sources":["webpack://./style/PythonCode.css"],"names":[],"mappings":"AAAA;EACE,YAAY;EACZ,YAAY;EACZ,WAAW;EACX,oBAAoB;EACpB,wBAAwB;EACxB,0BAA0B;EAC1B,gBAAgB;AAClB;;AAEA;EACE,2BAA2B;AAC7B;;AAEA;EACE;;;;KAIG;EACH,kBAAkB;AACpB","sourcesContent":[".code-block-python-code pre {\n  flex-grow: 1;\n  height: 100%;\n  width: 100%;\n  margin: 0 !important;\n  padding: 10px !important;\n  font-size: 12px !important;\n  overflow-x: auto;\n}\n\n.code-block-python-code code {\n  white-space: pre !important;\n}\n\n.code-block-python-code .jp-RenderedHTMLCommon > *:last-child {\n  /* \n        Remove the default Jupyter ending margin \n        so that the rendered code is flush with the bottom\n        of the CodeMessagePart\n    */\n  margin-bottom: 0px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/TextAndIconButton.css":
/*!***************************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/TextAndIconButton.css ***!
  \***************************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.text-and-icon-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.text-and-icon-button__icon {
  height: 100%;
  display: flex;
  align-items: center;
}

.text-and-icon-button__icon > svg {
  height: 100%;
  width: auto;
}
`, "",{"version":3,"sources":["webpack://./style/TextAndIconButton.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,mBAAmB;EACnB,8BAA8B;EAC9B,QAAQ;AACV;;AAEA;EACE,YAAY;EACZ,aAAa;EACb,mBAAmB;AACrB;;AAEA;EACE,YAAY;EACZ,WAAW;AACb","sourcesContent":[".text-and-icon-button {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  gap: 5px;\n}\n\n.text-and-icon-button__icon {\n  height: 100%;\n  display: flex;\n  align-items: center;\n}\n\n.text-and-icon-button__icon > svg {\n  height: 100%;\n  width: auto;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/TextButton.css":
/*!********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/TextButton.css ***!
  \********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.text-button-mito-ai {
  display: flex;
  align-items: center;
  justify-content: space-around;
}
`, "",{"version":3,"sources":["webpack://./style/TextButton.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,mBAAmB;EACnB,6BAA6B;AAC/B","sourcesContent":[".text-button-mito-ai {\n  display: flex;\n  align-items: center;\n  justify-content: space-around;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/ToggleButton.css":
/*!**********************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/ToggleButton.css ***!
  \**********************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `.toggle-button-container {
  display: flex;
  gap: 1px;
  background-color: var(--jp-layout-color2);
  border: 1px solid var(--jp-ui-font-color3);
  border-radius: 2px;
  width: 120px;
  overflow: hidden;
}

.toggle-button-half {
  flex: 0 0 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 20px;
  font-size: 12px;
  padding: 2px 10px;
}

.toggle-button-half:first-child {
  border-radius: 0px;
}

.toggle-button-half:last-child {
  border-radius: 0px;
}

.toggle-button-half.selected {
  opacity: 1;
  background-color: var(--purple-400);
  color: var(--purple-700) !important;
}

.toggle-button-half.unselected {
  opacity: 0.6;
  background-color: transparent !important;
  color: var(--jp-ui-font-color2) !important;
}

.toggle-button-icon {
  width: 16px;
  height: 16px;
}
`, "",{"version":3,"sources":["webpack://./style/ToggleButton.css"],"names":[],"mappings":"AAAA;EACE,aAAa;EACb,QAAQ;EACR,yCAAyC;EACzC,0CAA0C;EAC1C,kBAAkB;EAClB,YAAY;EACZ,gBAAgB;AAClB;;AAEA;EACE,aAAa;EACb,aAAa;EACb,mBAAmB;EACnB,uBAAuB;EACvB,QAAQ;EACR,eAAe;EACf,eAAe;EACf,iBAAiB;AACnB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,kBAAkB;AACpB;;AAEA;EACE,UAAU;EACV,mCAAmC;EACnC,mCAAmC;AACrC;;AAEA;EACE,YAAY;EACZ,wCAAwC;EACxC,0CAA0C;AAC5C;;AAEA;EACE,WAAW;EACX,YAAY;AACd","sourcesContent":[".toggle-button-container {\n  display: flex;\n  gap: 1px;\n  background-color: var(--jp-layout-color2);\n  border: 1px solid var(--jp-ui-font-color3);\n  border-radius: 2px;\n  width: 120px;\n  overflow: hidden;\n}\n\n.toggle-button-half {\n  flex: 0 0 50%;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  min-width: 20px;\n  font-size: 12px;\n  padding: 2px 10px;\n}\n\n.toggle-button-half:first-child {\n  border-radius: 0px;\n}\n\n.toggle-button-half:last-child {\n  border-radius: 0px;\n}\n\n.toggle-button-half.selected {\n  opacity: 1;\n  background-color: var(--purple-400);\n  color: var(--purple-700) !important;\n}\n\n.toggle-button-half.unselected {\n  opacity: 0.6;\n  background-color: transparent !important;\n  color: var(--jp-ui-font-color2) !important;\n}\n\n.toggle-button-icon {\n  width: 16px;\n  height: 16px;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/cjs.js!./style/button.css":
/*!****************************************************************!*\
  !*** ./node_modules/css-loader/dist/cjs.js!./style/button.css ***!
  \****************************************************************/
/***/ ((module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/sourceMaps.js */ "./node_modules/css-loader/dist/runtime/sourceMaps.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
// Imports


var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_sourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
// Module
___CSS_LOADER_EXPORT___.push([module.id, `/* 
    Classes that can be used for any button, making it easier to keep 
    the theme consistent. For example, use them to make a textButton or
    textAndIconButton green.
*/

.button-base {
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  /* Make sure the button grows large enough so that the text does not wrap */
  white-space: nowrap;
  padding: 5px 10px;
}

.button-green {
  background-color: var(--green-400);
  color: var(--green-900) !important;
}

.button-green:hover {
  background-color: var(--green-500);
}

.button-red {
  background-color: var(--red-400);
  color: var(--red-900) !important;
}

.button-red:hover {
  background-color: var(--red-500);
}

.button-gray {
  background-color: var(--jp-layout-color2);
  color: var(--jp-content-font-color1) !important;
}

.button-gray:hover {
  background-color: var(--jp-layout-color3);
}

.button-purple {
  background-color: var(--purple-700);
  color: white !important;
}

.button-purple:hover {
  background-color: var(--purple-600);
}

.button-width-block {
  width: 100%;
}

.button-width-fit-contents {
  width: fit-content;
}
`, "",{"version":3,"sources":["webpack://./style/button.css"],"names":[],"mappings":"AAAA;;;;CAIC;;AAED;EACE,YAAY;EACZ,kBAAkB;EAClB,eAAe;EACf,eAAe;EACf,2EAA2E;EAC3E,mBAAmB;EACnB,iBAAiB;AACnB;;AAEA;EACE,kCAAkC;EAClC,kCAAkC;AACpC;;AAEA;EACE,kCAAkC;AACpC;;AAEA;EACE,gCAAgC;EAChC,gCAAgC;AAClC;;AAEA;EACE,gCAAgC;AAClC;;AAEA;EACE,yCAAyC;EACzC,+CAA+C;AACjD;;AAEA;EACE,yCAAyC;AAC3C;;AAEA;EACE,mCAAmC;EACnC,uBAAuB;AACzB;;AAEA;EACE,mCAAmC;AACrC;;AAEA;EACE,WAAW;AACb;;AAEA;EACE,kBAAkB;AACpB","sourcesContent":["/* \n    Classes that can be used for any button, making it easier to keep \n    the theme consistent. For example, use them to make a textButton or\n    textAndIconButton green.\n*/\n\n.button-base {\n  border: none;\n  border-radius: 3px;\n  cursor: pointer;\n  font-size: 14px;\n  /* Make sure the button grows large enough so that the text does not wrap */\n  white-space: nowrap;\n  padding: 5px 10px;\n}\n\n.button-green {\n  background-color: var(--green-400);\n  color: var(--green-900) !important;\n}\n\n.button-green:hover {\n  background-color: var(--green-500);\n}\n\n.button-red {\n  background-color: var(--red-400);\n  color: var(--red-900) !important;\n}\n\n.button-red:hover {\n  background-color: var(--red-500);\n}\n\n.button-gray {\n  background-color: var(--jp-layout-color2);\n  color: var(--jp-content-font-color1) !important;\n}\n\n.button-gray:hover {\n  background-color: var(--jp-layout-color3);\n}\n\n.button-purple {\n  background-color: var(--purple-700);\n  color: white !important;\n}\n\n.button-purple:hover {\n  background-color: var(--purple-600);\n}\n\n.button-width-block {\n  width: 100%;\n}\n\n.button-width-fit-contents {\n  width: fit-content;\n}\n"],"sourceRoot":""}]);
// Exports
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);


/***/ }),

/***/ "./node_modules/css-loader/dist/runtime/api.js":
/*!*****************************************************!*\
  !*** ./node_modules/css-loader/dist/runtime/api.js ***!
  \*****************************************************/
/***/ ((module) => {



/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/
module.exports = function (cssWithMappingToString) {
  var list = [];

  // return the list of modules as css string
  list.toString = function toString() {
    return this.map(function (item) {
      var content = "";
      var needLayer = typeof item[5] !== "undefined";
      if (item[4]) {
        content += "@supports (".concat(item[4], ") {");
      }
      if (item[2]) {
        content += "@media ".concat(item[2], " {");
      }
      if (needLayer) {
        content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
      }
      content += cssWithMappingToString(item);
      if (needLayer) {
        content += "}";
      }
      if (item[2]) {
        content += "}";
      }
      if (item[4]) {
        content += "}";
      }
      return content;
    }).join("");
  };

  // import a list of modules into the list
  list.i = function i(modules, media, dedupe, supports, layer) {
    if (typeof modules === "string") {
      modules = [[null, modules, undefined]];
    }
    var alreadyImportedModules = {};
    if (dedupe) {
      for (var k = 0; k < this.length; k++) {
        var id = this[k][0];
        if (id != null) {
          alreadyImportedModules[id] = true;
        }
      }
    }
    for (var _k = 0; _k < modules.length; _k++) {
      var item = [].concat(modules[_k]);
      if (dedupe && alreadyImportedModules[item[0]]) {
        continue;
      }
      if (typeof layer !== "undefined") {
        if (typeof item[5] === "undefined") {
          item[5] = layer;
        } else {
          item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
          item[5] = layer;
        }
      }
      if (media) {
        if (!item[2]) {
          item[2] = media;
        } else {
          item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
          item[2] = media;
        }
      }
      if (supports) {
        if (!item[4]) {
          item[4] = "".concat(supports);
        } else {
          item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
          item[4] = supports;
        }
      }
      list.push(item);
    }
  };
  return list;
};

/***/ }),

/***/ "./node_modules/css-loader/dist/runtime/sourceMaps.js":
/*!************************************************************!*\
  !*** ./node_modules/css-loader/dist/runtime/sourceMaps.js ***!
  \************************************************************/
/***/ ((module) => {



module.exports = function (item) {
  var content = item[1];
  var cssMapping = item[3];
  if (!cssMapping) {
    return content;
  }
  if (typeof btoa === "function") {
    var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));
    var data = "sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(base64);
    var sourceMapping = "/*# ".concat(data, " */");
    return [content].concat([sourceMapping]).join("\n");
  }
  return [content].join("\n");
};

/***/ }),

/***/ "./node_modules/react-dom/client.js":
/*!******************************************!*\
  !*** ./node_modules/react-dom/client.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {



var m = __webpack_require__(/*! react-dom */ "webpack/sharing/consume/default/react-dom");
if (false) {} else {
  var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
  exports.createRoot = function(c, o) {
    i.usingClientEntryPoint = true;
    try {
      return m.createRoot(c, o);
    } finally {
      i.usingClientEntryPoint = false;
    }
  };
  exports.hydrateRoot = function(c, h, o) {
    i.usingClientEntryPoint = true;
    try {
      return m.hydrateRoot(c, h, o);
    } finally {
      i.usingClientEntryPoint = false;
    }
  };
}


/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js":
/*!****************************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***!
  \****************************************************************************/
/***/ ((module) => {



var stylesInDOM = [];
function getIndexByIdentifier(identifier) {
  var result = -1;
  for (var i = 0; i < stylesInDOM.length; i++) {
    if (stylesInDOM[i].identifier === identifier) {
      result = i;
      break;
    }
  }
  return result;
}
function modulesToDom(list, options) {
  var idCountMap = {};
  var identifiers = [];
  for (var i = 0; i < list.length; i++) {
    var item = list[i];
    var id = options.base ? item[0] + options.base : item[0];
    var count = idCountMap[id] || 0;
    var identifier = "".concat(id, " ").concat(count);
    idCountMap[id] = count + 1;
    var indexByIdentifier = getIndexByIdentifier(identifier);
    var obj = {
      css: item[1],
      media: item[2],
      sourceMap: item[3],
      supports: item[4],
      layer: item[5]
    };
    if (indexByIdentifier !== -1) {
      stylesInDOM[indexByIdentifier].references++;
      stylesInDOM[indexByIdentifier].updater(obj);
    } else {
      var updater = addElementStyle(obj, options);
      options.byIndex = i;
      stylesInDOM.splice(i, 0, {
        identifier: identifier,
        updater: updater,
        references: 1
      });
    }
    identifiers.push(identifier);
  }
  return identifiers;
}
function addElementStyle(obj, options) {
  var api = options.domAPI(options);
  api.update(obj);
  var updater = function updater(newObj) {
    if (newObj) {
      if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {
        return;
      }
      api.update(obj = newObj);
    } else {
      api.remove();
    }
  };
  return updater;
}
module.exports = function (list, options) {
  options = options || {};
  list = list || [];
  var lastIdentifiers = modulesToDom(list, options);
  return function update(newList) {
    newList = newList || [];
    for (var i = 0; i < lastIdentifiers.length; i++) {
      var identifier = lastIdentifiers[i];
      var index = getIndexByIdentifier(identifier);
      stylesInDOM[index].references--;
    }
    var newLastIdentifiers = modulesToDom(newList, options);
    for (var _i = 0; _i < lastIdentifiers.length; _i++) {
      var _identifier = lastIdentifiers[_i];
      var _index = getIndexByIdentifier(_identifier);
      if (stylesInDOM[_index].references === 0) {
        stylesInDOM[_index].updater();
        stylesInDOM.splice(_index, 1);
      }
    }
    lastIdentifiers = newLastIdentifiers;
  };
};

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js":
/*!********************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***!
  \********************************************************************/
/***/ ((module) => {



var memo = {};

/* istanbul ignore next  */
function getTarget(target) {
  if (typeof memo[target] === "undefined") {
    var styleTarget = document.querySelector(target);

    // Special case to return head of iframe instead of iframe itself
    if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
      try {
        // This will throw an exception if access to iframe is blocked
        // due to cross-origin restrictions
        styleTarget = styleTarget.contentDocument.head;
      } catch (e) {
        // istanbul ignore next
        styleTarget = null;
      }
    }
    memo[target] = styleTarget;
  }
  return memo[target];
}

/* istanbul ignore next  */
function insertBySelector(insert, style) {
  var target = getTarget(insert);
  if (!target) {
    throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");
  }
  target.appendChild(style);
}
module.exports = insertBySelector;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js":
/*!**********************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***!
  \**********************************************************************/
/***/ ((module) => {



/* istanbul ignore next  */
function insertStyleElement(options) {
  var element = document.createElement("style");
  options.setAttributes(element, options.attributes);
  options.insert(element, options.options);
  return element;
}
module.exports = insertStyleElement;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js":
/*!**********************************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***!
  \**********************************************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {



/* istanbul ignore next  */
function setAttributesWithoutAttributes(styleElement) {
  var nonce =  true ? __webpack_require__.nc : 0;
  if (nonce) {
    styleElement.setAttribute("nonce", nonce);
  }
}
module.exports = setAttributesWithoutAttributes;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js":
/*!***************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***!
  \***************************************************************/
/***/ ((module) => {



/* istanbul ignore next  */
function apply(styleElement, options, obj) {
  var css = "";
  if (obj.supports) {
    css += "@supports (".concat(obj.supports, ") {");
  }
  if (obj.media) {
    css += "@media ".concat(obj.media, " {");
  }
  var needLayer = typeof obj.layer !== "undefined";
  if (needLayer) {
    css += "@layer".concat(obj.layer.length > 0 ? " ".concat(obj.layer) : "", " {");
  }
  css += obj.css;
  if (needLayer) {
    css += "}";
  }
  if (obj.media) {
    css += "}";
  }
  if (obj.supports) {
    css += "}";
  }
  var sourceMap = obj.sourceMap;
  if (sourceMap && typeof btoa !== "undefined") {
    css += "\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), " */");
  }

  // For old IE
  /* istanbul ignore if  */
  options.styleTagTransform(css, styleElement, options.options);
}
function removeStyleElement(styleElement) {
  // istanbul ignore if
  if (styleElement.parentNode === null) {
    return false;
  }
  styleElement.parentNode.removeChild(styleElement);
}

/* istanbul ignore next  */
function domAPI(options) {
  if (typeof document === "undefined") {
    return {
      update: function update() {},
      remove: function remove() {}
    };
  }
  var styleElement = options.insertStyleElement(options);
  return {
    update: function update(obj) {
      apply(styleElement, options, obj);
    },
    remove: function remove() {
      removeStyleElement(styleElement);
    }
  };
}
module.exports = domAPI;

/***/ }),

/***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js":
/*!*********************************************************************!*\
  !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***!
  \*********************************************************************/
/***/ ((module) => {



/* istanbul ignore next  */
function styleTagTransform(css, styleElement) {
  if (styleElement.styleSheet) {
    styleElement.styleSheet.cssText = css;
  } else {
    while (styleElement.firstChild) {
      styleElement.removeChild(styleElement.firstChild);
    }
    styleElement.appendChild(document.createTextNode(css));
  }
}
module.exports = styleTagTransform;

/***/ }),

/***/ "./src/icons/ChatIcon.svg":
/*!********************************!*\
  !*** ./src/icons/ChatIcon.svg ***!
  \********************************/
/***/ ((module) => {

module.exports = "<svg width=\"19\" height=\"20\" viewBox=\"0 0 19 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <path d=\"M15.0626 4.8125C15.5466 4.8125 15.9376 5.20352 15.9376 5.6875C15.9376 6.17148 15.5466 6.5625 15.0626 6.5625C14.5787 6.5625 14.1876 6.17148 14.1876 5.6875C14.1876 5.20352 14.5787 4.8125 15.0626 4.8125ZM12.0001 4.8125C12.4841 4.8125 12.8751 5.20352 12.8751 5.6875C12.8751 6.17148 12.4841 6.5625 12.0001 6.5625C11.5162 6.5625 11.1251 6.17148 11.1251 5.6875C11.1251 5.20352 11.5162 4.8125 12.0001 4.8125ZM8.93764 4.8125C9.42162 4.8125 9.81264 5.20352 9.81264 5.6875C9.81264 6.17148 9.42162 6.5625 8.93764 6.5625C8.45365 6.5625 8.06264 6.17148 8.06264 5.6875C8.06264 5.20352 8.45365 4.8125 8.93764 4.8125ZM12.0001 0C15.8665 0 19.0001 2.5457 19.0001 5.6875C19.0001 6.98906 18.456 8.18125 17.5537 9.14102C17.9611 10.2184 18.8087 11.1316 18.8224 11.1426C19.0029 11.334 19.0521 11.6129 18.9482 11.8535C18.8443 12.0941 18.6064 12.25 18.3439 12.25C16.6622 12.25 15.3361 11.5473 14.5404 10.984C13.7501 11.2328 12.897 11.375 12.0001 11.375C8.13373 11.375 5.00014 8.8293 5.00014 5.6875C5.00014 2.5457 8.13373 0 12.0001 0ZM12.0001 10.0625C12.7302 10.0625 13.4521 9.95039 14.1439 9.73164L14.7646 9.53477L15.2978 9.91211C15.6888 10.1883 16.2247 10.4973 16.8701 10.7051C16.6705 10.3742 16.4763 10.0023 16.3259 9.60586L16.0361 8.8375L16.5994 8.24141C17.0943 7.71367 17.6876 6.84141 17.6876 5.6875C17.6876 3.27578 15.1365 1.3125 12.0001 1.3125C8.86381 1.3125 6.31264 3.27578 6.31264 5.6875C6.31264 8.09922 8.86381 10.0625 12.0001 10.0625Z\" fill=\"var(--purple-600)\" class=\"jp-icon-selectable\"/>\n    <path d=\"M7 7C3.13359 7 0 9.5457 0 12.6875C0 14.0437 0.585156 15.2852 1.55859 16.2613C1.2168 17.6395 0.0738281 18.8672 0.0601563 18.8809C0 18.9438 -0.0164062 19.0367 0.0191406 19.1188C0.0546875 19.2008 0.13125 19.25 0.21875 19.25C2.03164 19.25 3.39063 18.3805 4.06328 17.8445C4.95742 18.1809 5.95 18.375 7 18.375C10.8664 18.375 14 15.8293 14 12.6875C14 9.5457 10.8664 7 7 7ZM3.5 13.5625C3.01602 13.5625 2.625 13.1715 2.625 12.6875C2.625 12.2035 3.01602 11.8125 3.5 11.8125C3.98398 11.8125 4.375 12.2035 4.375 12.6875C4.375 13.1715 3.98398 13.5625 3.5 13.5625ZM7 13.5625C6.51602 13.5625 6.125 13.1715 6.125 12.6875C6.125 12.2035 6.51602 11.8125 7 11.8125C7.48398 11.8125 7.875 12.2035 7.875 12.6875C7.875 13.1715 7.48398 13.5625 7 13.5625ZM10.5 13.5625C10.016 13.5625 9.625 13.1715 9.625 12.6875C9.625 12.2035 10.016 11.8125 10.5 11.8125C10.984 11.8125 11.375 12.2035 11.375 12.6875C11.375 13.1715 10.984 13.5625 10.5 13.5625Z\" fill=\"var(--purple-700)\" class=\"jp-icon-selectable\"/>\n</svg>\n";

/***/ }),

/***/ "./src/icons/LightbulbIcon.svg":
/*!*************************************!*\
  !*** ./src/icons/LightbulbIcon.svg ***!
  \*************************************/
/***/ ((module) => {

module.exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg width=\"1200pt\" height=\"1200pt\" version=\"1.1\" viewBox=\"0 0 1200 1200\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"currentColor\" class=\"jp-icon3 jp-icon-selectable\">\n  <path d=\"m735.61 979.22h-271.22c-19.781 0-33.844 14.391-33.844 34.688s14.156 34.688 33.844 34.688h271.22c19.781 0 33.844-14.391 33.844-34.688s-14.156-34.688-33.844-34.688z\"/>\n  <path d=\"m735.61 891.84h-271.22c-19.781 0-33.844 13.922-33.844 33.375 0 16.688 14.156 33.375 33.844 33.375h271.22c19.781 0 33.844-16.688 33.844-33.375 0-19.453-14.156-33.375-33.844-33.375z\"/>\n  <path d=\"m701.86 1070.6h-203.86c-5.625 0-8.5312 2.8594-2.8594 8.625l51 51.938c5.625 2.8594 14.156 8.625 19.781 8.625h67.922c5.625 0 14.156-5.7656 19.781-8.625l51-51.938c5.625-5.7656 2.8594-8.625-2.8594-8.625z\"/>\n  <path d=\"m600 60c-187.78 0-341.53 153.84-341.53 341.76 0 74.062 22.781 145.22 62.625 199.31 48.375 79.781 108.14 162.37 108.14 250.69v5.625c0 5.625 5.625 11.391 11.391 11.391h318.71c5.625 0 11.391-5.625 11.391-11.391v-5.625c0-91.078 65.391-176.53 113.86-256.31 36.938-54.141 56.859-122.53 56.859-193.69 0-187.92-153.71-341.76-341.53-341.76zm-23.531 138.14c-98.391 0-178.45 80.062-178.45 178.45 0 10.453-8.5312 18.938-18.938 18.938-10.453 0-18.938-8.5312-18.938-18.938 0-119.3 97.078-216.37 216.37-216.37 10.453 0 18.938 8.5312 18.938 18.938 0 10.453-8.5312 18.938-18.938 18.938z\"/>\n </g>\n</svg>\n";

/***/ }),

/***/ "./src/icons/NucleusIcon.svg":
/*!***********************************!*\
  !*** ./src/icons/NucleusIcon.svg ***!
  \***********************************/
/***/ ((module) => {

module.exports = "<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n    <g fill=\"currentColor\">\n        <path d=\"M18.5775 2.50569L17.3933 1.85818C17.3684 1.84329 17.3461 1.82344 17.3337 1.79616L16.6832 0.61281C16.5715 0.404416 16.353 0 16.1171 0C15.8788 0 15.6628 0.404416 15.5485 0.61281L14.9005 1.79616C14.8856 1.82344 14.8658 1.84329 14.8385 1.85818L13.6542 2.50569C13.4456 2.61981 13.0087 2.83564 13.0087 3.07381C13.0087 3.30949 13.4456 3.52781 13.6542 3.64193L14.8385 4.28944C14.8658 4.30184 14.8856 4.32417 14.9005 4.34898L15.5485 5.53232C15.6628 5.74072 15.8788 6.16746 16.1171 6.16746C16.353 6.16746 16.5715 5.74072 16.6832 5.53232L17.3337 4.34898C17.3461 4.32417 17.3684 4.30184 17.3933 4.28944L18.5775 3.64193C18.7861 3.52781 19.2306 3.30949 19.2306 3.07381C19.2306 2.83564 18.7861 2.61981 18.5775 2.50569Z\"/>\n        <path d=\"M15.4932 9.95234L12.2462 8.17563C12.1781 8.13478 12.1168 8.08032 12.0828 8.00544L10.2993 4.75843C9.99295 4.18661 9.3939 3.07692 8.7472 3.07692C8.0937 3.07692 7.50145 4.18661 7.18832 4.75843L5.4116 8.00544C5.37075 8.08032 5.3163 8.13478 5.24141 8.17563L1.9944 9.95234C1.42258 10.2655 0.224487 10.8577 0.224487 11.5112C0.224487 12.1579 1.42258 12.757 1.9944 13.0701L5.24141 14.8468C5.3163 14.8809 5.37075 14.9421 5.4116 15.0102L7.18832 18.2572C7.50145 18.829 8.0937 20 8.7472 20C9.3939 20 9.99295 18.829 10.2993 18.2572L12.0828 15.0102C12.1168 14.9421 12.1781 14.8809 12.2462 14.8468L15.4932 13.0701C16.065 12.757 17.2837 12.1579 17.2837 11.5112C17.2837 10.8577 16.065 10.2655 15.4932 9.95234Z\"/>\n    </g>\n</svg>";

/***/ }),

/***/ "./src/icons/OpenIndicatorIcon.svg":
/*!*****************************************!*\
  !*** ./src/icons/OpenIndicatorIcon.svg ***!
  \*****************************************/
/***/ ((module) => {

module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"5\" viewBox=\"0 0 24 24\">\n    <circle cx=\"12\" cy=\"12\" r=\"12\" fill=\"green\" className=\"jp-icon3 jp-icon-selectable\"/>\n</svg>";

/***/ }),

/***/ "./style/ChatDropdown.css":
/*!********************************!*\
  !*** ./style/ChatDropdown.css ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ChatDropdown.css */ "./node_modules/css-loader/dist/cjs.js!./style/ChatDropdown.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ChatDropdown_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/ChatInput.css":
/*!*****************************!*\
  !*** ./style/ChatInput.css ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ChatInput_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ChatInput.css */ "./node_modules/css-loader/dist/cjs.js!./style/ChatInput.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ChatInput_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ChatInput_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ChatInput_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ChatInput_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/ChatMessage.css":
/*!*******************************!*\
  !*** ./style/ChatMessage.css ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ChatMessage_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ChatMessage.css */ "./node_modules/css-loader/dist/cjs.js!./style/ChatMessage.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ChatMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ChatMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ChatMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ChatMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/ChatTaskpane.css":
/*!********************************!*\
  !*** ./style/ChatTaskpane.css ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ChatTaskpane.css */ "./node_modules/css-loader/dist/cjs.js!./style/ChatTaskpane.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ChatTaskpane_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/Citation.css":
/*!****************************!*\
  !*** ./style/Citation.css ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_Citation_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./Citation.css */ "./node_modules/css-loader/dist/cjs.js!./style/Citation.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_Citation_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_Citation_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_Citation_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_Citation_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/CodeBlock.css":
/*!*****************************!*\
  !*** ./style/CodeBlock.css ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_CodeBlock_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./CodeBlock.css */ "./node_modules/css-loader/dist/cjs.js!./style/CodeBlock.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_CodeBlock_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_CodeBlock_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_CodeBlock_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_CodeBlock_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/DropdownMenu.css":
/*!********************************!*\
  !*** ./style/DropdownMenu.css ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_DropdownMenu_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./DropdownMenu.css */ "./node_modules/css-loader/dist/cjs.js!./style/DropdownMenu.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_DropdownMenu_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_DropdownMenu_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_DropdownMenu_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_DropdownMenu_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/ErrorMimeRendererPlugin.css":
/*!*******************************************!*\
  !*** ./style/ErrorMimeRendererPlugin.css ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ErrorMimeRendererPlugin_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ErrorMimeRendererPlugin.css */ "./node_modules/css-loader/dist/cjs.js!./style/ErrorMimeRendererPlugin.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ErrorMimeRendererPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ErrorMimeRendererPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ErrorMimeRendererPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ErrorMimeRendererPlugin_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/IconButton.css":
/*!******************************!*\
  !*** ./style/IconButton.css ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_IconButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./IconButton.css */ "./node_modules/css-loader/dist/cjs.js!./style/IconButton.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_IconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_IconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_IconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_IconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/MarkdownMessage.css":
/*!***********************************!*\
  !*** ./style/MarkdownMessage.css ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./MarkdownMessage.css */ "./node_modules/css-loader/dist/cjs.js!./style/MarkdownMessage.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_MarkdownMessage_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/PythonCode.css":
/*!******************************!*\
  !*** ./style/PythonCode.css ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_PythonCode_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./PythonCode.css */ "./node_modules/css-loader/dist/cjs.js!./style/PythonCode.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_PythonCode_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_PythonCode_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_PythonCode_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_PythonCode_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/TextAndIconButton.css":
/*!*************************************!*\
  !*** ./style/TextAndIconButton.css ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_TextAndIconButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./TextAndIconButton.css */ "./node_modules/css-loader/dist/cjs.js!./style/TextAndIconButton.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_TextAndIconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_TextAndIconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_TextAndIconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_TextAndIconButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/TextButton.css":
/*!******************************!*\
  !*** ./style/TextButton.css ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_TextButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./TextButton.css */ "./node_modules/css-loader/dist/cjs.js!./style/TextButton.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_TextButton_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_TextButton_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_TextButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_TextButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/ToggleButton.css":
/*!********************************!*\
  !*** ./style/ToggleButton.css ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./ToggleButton.css */ "./node_modules/css-loader/dist/cjs.js!./style/ToggleButton.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_ToggleButton_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ }),

/***/ "./style/button.css":
/*!**************************!*\
  !*** ./style/button.css ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ "./node_modules/style-loader/dist/runtime/styleDomAPI.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ "./node_modules/style-loader/dist/runtime/insertBySelector.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ "./node_modules/style-loader/dist/runtime/insertStyleElement.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ "./node_modules/style-loader/dist/runtime/styleTagTransform.js");
/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./button.css */ "./node_modules/css-loader/dist/cjs.js!./style/button.css");

      
      
      
      
      
      
      
      
      

var options = {};

options.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());
options.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());

      options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, "head");
    
options.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());
options.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());

var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_6__["default"], options);




       /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_6__["default"] && _node_modules_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals ? _node_modules_css_loader_dist_cjs_js_button_css__WEBPACK_IMPORTED_MODULE_6__["default"].locals : undefined);


/***/ })

}]);
//# sourceMappingURL=lib_index_js.b16bca9632fcbbee58ab.js.map